Entering edit mode
4.5 years ago
am3
▴
80
Hello! If I have a SAM file produced by aligning using BWA-MEM, is there a way to tell how many secondary alignments each read produced, or how many reads produced how many secondary alignments? Let's say I do samtools flagstat and see that I have 100 secondary alignments. I want to know whether that's because one of my reads mapped to 100 different places, or because 100 reads each mapped to one secondary location, or anything in between. How can I extract that information from the SAM file? Thank you!
if you combine the read ID with the match ID (+position) you should be able to deduct this. Your first situation would look it one to many, the other many to many .