Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • aarvey
    Junior Member
    • Feb 2011
    • 1

    Bowtie XA, X0, X1 tags in SAM output

    Hi Everyone,

    Background: I've been using bowtie and samtools for a couple years. In the past 6 months have I converted to outputing SAM directly from bowtie (using -S) instead of piping it through bowtie2sam.pl. I just realized recently that bowtie doesn't output number of possible mappings (e.g. using tag X0 or X1) in the output.

    Goal: I would like bowtie's ouput to SAM option -S to have the total number of loci to which a read can map. Specifically, tags X0 and/or X1 would be nice to see.

    Question: Is the below proposal a reasonable path to accomplishing the goal? Is there some reason that Bowtie didn't do this by default? Is h.oms appropriate?

    Proposed Fix: When I examined bowtie 0.12.8 source code, I found that an object of class Hit (variable is typically named 'h') has a field 'oms' that is used to track the number of mappable loci. In the bowtie output, there is output of h.oms, but not in SAM output.


    Bowtie's default output in hit.cpp:
    Code:
                    if(!suppress.test(field++)) {
                            if(firstfield) firstfield = false;
                            else ss << '\t';
                            ss << h.oms;
                    }

    Bowtie's -S SAM output in sam.cpp:
    Code:
            // SEQ
            ss << '\t' << h.patSeq;
            // QUAL
            ss << '\t' << h.quals;
            //
            // Optional fields
            //
            // Always output stratum
            ss << "\tXA:i:" << (int)h.stratum;
            // Output MD field
            size_t len = length(h.patSeq);
            int nm = 0;
            int run = 0;
            ss << "\tMD:Z:";

    The modified bowtie -S SAM output in sam.cpp to output the X0 tag for total number of loci that read can map to:
    Code:
            // Always output stratum
            ss << "\tXA:i:" << (int)h.stratum;
            ss << "\tX0:i:" << (int)h.oms;

    Thank you very much for any suggestions or comments you may have on this fix/hack.

    Best, Aaron

Latest Articles

Collapse

  • seqadmin
    New Genomics Tools and Methods Shared at AGBT 2025
    by seqadmin


    This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

    The Headliner
    The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
    03-03-2025, 01:39 PM
  • seqadmin
    Investigating the Gut Microbiome Through Diet and Spatial Biology
    by seqadmin




    The human gut contains trillions of microorganisms that impact digestion, immune functions, and overall health1. Despite major breakthroughs, we’re only beginning to understand the full extent of the microbiome’s influence on health and disease. Advances in next-generation sequencing and spatial biology have opened new windows into this complex environment, yet many questions remain. This article highlights two recent studies exploring how diet influences microbial...
    02-24-2025, 06:31 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, 03-20-2025, 05:03 AM
0 responses
18 views
0 reactions
Last Post seqadmin  
Started by seqadmin, 03-19-2025, 07:27 AM
0 responses
24 views
0 reactions
Last Post seqadmin  
Started by seqadmin, 03-18-2025, 12:50 PM
0 responses
19 views
0 reactions
Last Post seqadmin  
Started by seqadmin, 03-03-2025, 01:15 PM
0 responses
187 views
0 reactions
Last Post seqadmin  
Working...