Tuesday, March 31, 2015

Multiple fastq files mapping in a loop

If you have multiple fastq files e.g. from 4 sequencing lanes that belong to the same sample.

C11_S11_L001_R1_001.fastq
C11_S11_L001_R2_001.fastq

C11_S11_L002_R1_001.fastq
C11_S11_L002_R2_001.fastq

C11_S11_L003_R1_001.fastq
C11_S11_L003_R2_001.fastq

C11_S11_L004_R1_001.fastq
C11_S11_L004_R2_001.fastq

And you want to run mapping algorithm in a loop to map them separately (then connect outputs with samtools) use a loop that will call left and right reads from one lane and put mapping code in a loop.

for j in {1..4}
do


                Reads1=C11_S11_L00"$j"_R1_001.fastq
                Reads2=C11_S11_L00"$j"_R2_001.fastq
                echo MAPPING $Reads1
                echo MAPPING  $Reads2

#mapping code $Reads1 $Reads2
done



No comments:

Post a Comment