Quick question: samtool idxstats and multiple mapping
1
0
Entering edit mode
6.5 years ago
Aurelie MLB ▴ 360

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

sequencing alignment • 2.9k views
ADD COMMENT
2
Entering edit mode

samtools idxstats outputs total mapped. If you would like to see secondary alignments, try flagstat from samtools. It would print secondary alignment.

ADD REPLY
1
Entering edit mode
6.5 years ago

As cpad0112 mentioned, every alignment is counted, whether secondary or supplementary. So if a read has multiple recorded alignments then each is counted.

BTW, this is only true of BAM files. For CRAM files on 0 will be returned.

ADD COMMENT
0
Entering edit mode

Thank you so much to both!! Really helpful!!

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2640 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6