This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract R1 Alignment Informations From Bam

Hi,

Simple question : How to extract only aignment from R1 read from a bam file ?

Thanks

bam

1 answer

samtools view -f 0x40 alignments.bam

This gives first in pair reads. But what about the reads which are not in pair i.e., R1 has aligned but not R2. I see R1's with flag 0 and 16 also.

Then the aligner is setting the flags incorrectly. If a read came from a pair, then it should never have a flag of 0 or 16.

Log in to answer this question.