Question: Quick question: samtool idxstats and multiple mapping
0
gravatar for Aurelie MLB
8 months ago by
Aurelie MLB290
United Kingdom
Aurelie MLB290 wrote:

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 • 386 views
ADD COMMENTlink modified 8 months ago by Devon Ryan81k • written 8 months ago by Aurelie MLB290
2

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

ADD REPLYlink written 8 months ago by cpad01127.7k
1
gravatar for Devon Ryan
8 months ago by
Devon Ryan81k
Freiburg, Germany
Devon Ryan81k wrote:

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 COMMENTlink modified 8 months ago • written 8 months ago by Devon Ryan81k

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

ADD REPLYlink written 8 months ago by Aurelie MLB290

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 REPLYlink written 11 weeks ago by cc34230

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 REPLYlink written 11 weeks ago by Devon Ryan81k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 508 users visited in the last hour