Hello,
I have around 100 fastq files, of forward and reverse reads I want to join in flash. I would like to create an automated script that would just go through a folder and join the reads for me.
Does anyone know if this is possible?
Best
Hello,
I have around 100 fastq files, of forward and reverse reads I want to join in flash. I would like to create an automated script that would just go through a folder and join the reads for me.
Does anyone know if this is possible?
Best
A for loop would do the trick, assuming the paired reads are named like; reads1_1.fq reads1_2.fq
for i in $(ls *fq | grep "_1" | cut -f 1 -d "_"); do flash ${i}_1.fq ${i}_2.fq; done
Give following a try. If you are running this on a single machine it may not be advisable to run the jobs like this since all 50 jobs would be submitted at the same time.
for i in $(ls *_1.fastq | cut -f 1-5 -d "_"); do flash ${i}_1.fastq ${i}_2.fastq; done
This will work only if all files names follow the nomenclature you posted above.
I can only speculate and say that you are not running the command right. Can you post the exact command you are running?
We assumed you know how to run FLASH from before. You may need to send the output to new file something like (use the correct syntax I am only generalizing using an output redirect).
for i in $(ls *_1.fastq | cut -f 1-5 -d "_"); do flash ${i}_1.fastq ${i}_2.fastq > $i\_merged.fastq ; done
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
You mean like
cat *.fastq > onebig.fastq
?Is this not just creating a big file? I want to use the program flash. Do you think putting them all in one file and then applying flash is the way to go?
Not necessarily. You could write a for loop and go through the file set (I guess 50 pairs). If you have access to a cluster you could submit all 50 jobs at the same time.
What is flash, could you link it?
FLASH is a read joiner (like BBMerge from BBMap).