This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Running Multiple Flash Sequence Joins in Terminal

I have input files that appear as such:

03631101_1.fastq
03631101_2.fastq

I would like to join the 100+ files I have by running a command in the terminal. From looking at another post, I tried the suggested line:

for i in $(ls *fastq | grep  "_1" | cut -f 1 -d "_"); do flash ${i}_1.fastq ${i}_2.fastq; done

But this created an error:

ERROR: zlib error opening

What can I do to create a loop for these fastq files so that I do not have to do each individually?

Thank you!

fastq shell

Do you want to merge all the *.fastq files into one? If yes, you can use cat. cat *.fastq >> new_file.fastq

I would like to create a loop to go through all the fastq files and join them

What OS are you using? Looks like you may be missing the zlib library.

It is OS X Yosemite. I checked and it is already installed.. and updated

Not sure why you are getting a zlib error for a straight for loop. Are there any other files that have a "_1" in name but are not ending in .fastq?

There aren't... but I actually have it working now. The only issue is that the output files come out like out.extendedFrags.fastq and this is being overwritten for each sample number. Do you know what I can add to the end so that the output in a folder called joined takes the sample number from each pair of fastq files? I have tried this for i in $(ls *fastq | grep "_1" | cut -f 1 -d "_"); do flash ${i}_1.fastq ${i}_2.fastq -d joined/-o; done but it just creates the output folder..

Try

for i in $(ls *fastq | grep "_1" | cut -f 1 -d "_"); do flash ${i}_1.fastq ${i}_2.fastq -d joined -o ${i}_joined.fastq; done

0 answers

No answers yet.

Log in to answer this question.