Hello,
I am am trying to use Samtools flagstat
to analyze my BAM file after aligning nanopore dRNAseq reads to a reference transcriptome using minimap2. The output file indicates I have the following flagstats below (excluded zero values from output).
729779 + 0 in total (QC-passed reads + QC-failed reads)
617632 + 0 primary
111418 + 0 secondary
729 + 0 supplementary
199740 + 0 mapped (27.37% : N/A)
87593 + 0 primary mapped (14.18% : N/A)
I am trying to figure out the difference between "617632 + 0 primary" and "87593 + 0 primary mapped (14.18% : N/A)". Although, I realize my mapping percentage is ~14% from other QC tools.
From the samtools flagstat documentation it defines the following
primary - neither 0x100 nor 0x800 bit set
primary mapped - 0x4, 0x100 and 0x800 bits not set
Can someone please clarify what a bit set is and also the difference between primary and primary mapped? I guess I don't understand how all reads with a primary tag are not mapped.
Not an answer, but I use this tranalator almost every time I play around with these flags. It should help you to gain an understanding of your bam, and I'd recommend going through your bam/sam and not just a summary.
https://broadinstitute.github.io/picard/explain-flags.html
Primary is only defined by the absence of those flags, so if a read is unmapped, then it can't be defined as secondary or supplementary. Then, by default, it is primary.