This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Find Reads With Secondary Alignment In Bwa Mem Sam File ?

In BWA MEM sam is there any tag that represents reads having secondary alignment? How to find reads with secondary alignment?

As XA tag represents Secondary alignment for aln command. But how to find in BWA MEM?

bwa-mem bwa

2 answers

use

samtools view -f (flag) file.bam

with flag=not primary alignment http://picard.sourceforge.net/explain-flags.html

Thanks for response. When i am using flag 2048 (supplementry alignment) , MEM output is showing results reads with SA tags ie chimeric alignment.

But in case in case i am interested in secondary alignment then what i need to do? shall i use flag 256 (not primary alignment)??

Log in to answer this question.