I have several fastq.gz files that look like this:
Sample1_R1.fastq.gz Sample1_R2.fastq.gz
Sample2_R1.fastq.gz Sample2_R2.fastq.gz
etc...
The output needs to be: Sample1_interleaved.fastq.gz, Sample2_interleaved.fastq.gz
I am still learning how to loop commands so bare with me. This is what I tried to run:
for i in `ls -1 *_R#.fastq.gz | sed 's/_R#.fastq.gz//‘`
do
reformat.sh in=$i\_R#.fastq.gz out=$i\_interleaved.fastq.gz
done
However this did not work. Can someone help me? Many Thanks!
In addition to using these instructions to fix problems with the loop infenit101 you should explicitly provide two inputs to thereformat.sh
command to get the interleaving.Edit: As @ross points out below using
#
shortcut should indeed work.@genomax - Based on the Reformat User Guide, I think the <name>_R#.fastq.gz syntax would work, although the escape before the underscore (<name>_R#) will cause problems that I didn't mention.