Hello,
I know there have been many questions regarding merging fastq files. But I am not getting relevant answers in my situation.
I have 4 paired-ended fastq files.
s_6_1.fastq s_6_2.fastq
s_7_1.fastq s_7_2.fastq
Can I just cat the first two files and the last two files to make s_6.fastq and s_7.fastq? I would like to use these fastq files for mapping with BWA or Bowtie.
Hope to get some suggestions regarding this. Thanks, AShwin
2 answers
Try this. Mostly default settings. Where I say "-t 4" I am assuming you have 4 processors. You can drop this number if that's not the case for you.
bwa index -p mygenome -a bwtsw mygenome.fa
bwa aln -t 4 bwtsw mygenome s_6_1.fastq > s_6_1.sai
bwa aln -t 4 bwtsw mygenome s_6_2.fastq > s_6_2.sai
bwa sampe mygenome s_6_1.sai s_6_2.sai s_6_1.fastq s_6_2.fastq > s_6.sam
Merging seems unnecessarily complicated in this case. I don't know if bwa can handle that.
If you would like to merge the files, in your case...the merging should be..
Sample1_r1 + Sample2_r1 = Sample_r1.fastq && Sample1_r2 + Sample2_r2 = Sample_r2.fastq
Then align using bowtie2.
bowtie2 -x Genome_Index -1 Sample_r1.fastq -2 Sample_r2.fastq -S out.sam
Log in to answer this question.
Why do you want to do that? bwa and bowtie both supports pair-end input and there doesn't really seems like the fastq are required to be merged before alignment
yes, you can merge the _1.fastq files into one files and the _2.fastq files into another. just maintain the order (pairing) between them.