Script Description: SPAdes Assembly Wrapper Script
This Python script automates the execution of SPAdes, a genome assembler, for paired-end reads. It identifies files ending with 'R1.fastq.gz' and 'R2.fastq.gz' in the current directory, pairs them, and runs SPAdes for each pair. The resulting assemblies are saved in output directories with names derived from the corresponding R1 files.
Usage:
Place the script in the directory containing your paired-end fastq.gz files. Open a terminal in the directory containing the script. Run the script. Example:
bash Copy code python loop_spades.py
Script Functionality:
Lists all files ending with 'R1.fastq.gz' and 'R2.fastq.gz' in the current directory. Iterates over pairs of corresponding R1 and R2 files. Generates an output name by removing '_R1.fastq.gz' from the R1 file name. Constructs the SPAdes command using the identified R1 and R2 files. Executes the SPAdes command for each pair of R1 and R2 files using os.system. This script streamlines the process of running SPAdes for multiple pairs of paired-end reads, providing a convenient way to assemble genomes using SPAdes.