Thank you so much to both!! Really helpful!!
Hello,
A quick naive question please: Samtools idxstats outputs the number of reads mapped to a given reference sequence. Right? What does it do in case of multiple mapping please? Does it count the best alignment for a read or does it adds 1 to all reference sequences where it mapped? I could not find any detail in the documentation.
Many thanks
1 answer
Hi Devon, Thanks for the reply. Is there any documentation about the multi-mapped you could share? I am wondering whether every method in samtools/sambamba take the XA flag into account; or it is specific for idxstats in samtools.
Whether a read is multimapping or not is determined by the aligner (it sets a bit in the FLAG field in the SAM/BAM/CRAM output). Samtools is just reporting whatever the aligner wrote. The XA tag is a custom tag produced by a couple aligners, almost all tools (including samtools) will ignore it completely.
Log in to answer this question.
samtools idxstats outputs total mapped. If you would like to see secondary alignments, try flagstat from samtools. It would print secondary alignment.