This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge two .fastq files from two different lane

Hi Every One,

How to Merge two .fastq files from two different lane using cat command with bash for loop. My file name looks like this

> RFNB-2939_S193_L001_R1_001.fastq,  RFNB-2939_S193_L002_R1_001.fastq, 
> RFNB-2951_S194_L001_R1_001.fastq,  RFNB-2951_S194_L002_R1_001.fastq.

Thanks in advance

loop ngs merge fastq cat

yes, and the issue/problem being ?

2 answers

from two different lane using cat command with bash for loop

Answers here: Concatenating fastq.gz files across lanes

that is what cat does, concatenates

Concatenate a,b into c

cat a b > c

in your case:

cat RFNB-2939_S193_L001_R1_001.fastq RFNB-2939_S193_L002_R1_001.fastq > RFNB-2939_S193.fq 

cat RFNB-2951_S194_L001_R1_001.fastq RFNB-2951_S194_L002_R1_001.fastq > RFNB-2951_S194.fq

Log in to answer this question.