This is a test version of Biostars. For the public version, visit https://www.biostars.org.
beginner question BWA program

hi

i want to map my own reads (illumina hiseq) to reference using "bwa mem". i have 2 lane of paired end data (read1.fastq, read2.fastq, read11.fastq and read22.fastq). in bwa tutorial, command for map to reference of paired end reads is "bwa mem ref.fa read1.fq read2.fq > aln-pe.sam". now i have 4 read files for mapping to reference, what is command for my reads?

"bwa mem ref.fa read1.fq read2.fq read11.fq read22.fq> aln-pe.sam" is true?

genome alignment

2 answers

your choice is:

1) merge the forward and the reverse fastq files

cat read1.fq read11.fq > R1.fq
cat read2.fq read22.fq > R2.fq
bwa mem ref.fa R1.fq R2.fq> aln-pe.sam

or

bwa mem ref.fa <(cat read1.fq read11.fq ) <( cat read2.fq read22.fq ) > aln-pe.sam

2) align both pairs

bwa mem ref.fa R1.fq R2.fq | samtools sort -T tmp -O bam -o f1.bam -
bwa mem ref.fa R11.fq R22.fq | samtools sort -T tmp -O bam -o f2.bam -

and then merge the sorted pairs.

samtools merge merged.bam f1.bam f2.bam

-O is unnecessary when -o is specified because the extension will be used to determine the out-type.

thanks a lot Pierre, your answer is complete

If he answered your question, then accept his answer as the solution.

hi again dear Pierre

After mapping to reference using "bwa mem", downstream analysis in my project are variant calling using samtools and CNV detection using CNV-seq. In your opinion, default setting in bwa is proper for my goal? i must use -M in "bwa mem" (after mapping i want to mark duplicates via Picard) ?

thanks in advance for your kindly helps

Log in to answer this question.