Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting map qualities with samtools mpileup?

    I've been using the -s option of samtools "pileup" to output the mapping qualities for each read at each position as a last column in the pileup file.

    I know that the "pileup" command is deprecated, and I need to switch to the "mpileup" command, but "mpileup" doesn't seem to have an option for including the map qualities. Does anyone have any advice? I know that the map quality is still reported once at the beginning of each read, but it seems like it will be tricky to map that quality to the correct base in each subsequent position. I'm hoping there's an easier alternative...

    Thanks for any help!

    Kris Weber
    Research Assistant
    Noble Lab, Department of Genome Sciences
    University of Washington

  • #2
    I have the same question

    I have the same question.

    bump

    Comment


    • #3
      And I still have the same question too, if anyone has any answers...

      Comment


      • #4
        Bumpity bump bump bump bump

        Bumpity bump bump bump bump

        Comment


        • #5
          mpileup, pileup, Bio:B::Sam

          mpileup is *supposed* to handle all the problems with mapping quality internally with the BAQ algorithm. I think the resulting entries in the pileup have been quality-adjusted so that the phred scores should reflect the BAQ-adjusted values, right? Thus mpileup's output should be "usable without needing the mapping quality".

          Am I reading the mpileup help page incorrectly? It skips bases with BAQ quality < 13, etc. The final pileup does not reflect the original reads exactly, but rather a BAQ-corrected version.



          I've generally found good results, better than trying to handle mapping-quality issues on my own ... but it seems odd to handle all that, and then *remove* the option that would make verification easier.

          Bio:B::Sam's pileup() call is a great tool for walking a pileup, while having access to ALL possible information, and it's way faster than running and then parsing the results of samtools pileup.
          Last edited by earonesty; 06-29-2011, 08:26 AM. Reason: add a title

          Comment


          • #6
            Originally posted by earonesty View Post
            mpileup is *supposed* to handle all the problems with mapping quality internally with the BAQ algorithm.
            BAQ adjusts the base qualities not the mapping qualities. The mapping qualities are set by the aligner/mapper.

            Comment


            • #7
              I thought the algorithm adjusted base qualitieis... based on mapping qualities. IE... it does it so you don't have to.

              Comment


              • #8
                Check out the paper: http://bioinformatics.oxfordjournals...s.btr076.short

                Anyhow, it uses the base qualities, not the mapping qualities. It resolves and weights the local ambiguities. Smith Waterman can be modeled as an HMM, with the BAQ running the forward/backward algorithms to compute the posterior probability of a query base and target base aligning based on all possible local alignments. This posterior is then converted to a base quality.

                Comment


                • #9
                  Solution

                  If you look at the MQ part of the info section in the VCF format that does equal mapping quality. The way that I extract that to work with the bed file is in perl

                  all you do is

                  call the line
                  my @snp_array = $snp =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+\S+\s+(\S+)\s+/;
                  my $mpileup_check = $snp_array[2];
                  my ($chr, $pos, $id, $ref, $var, $cns_qual, $rd_depth, $map_qual, $snp_qual, @extra);
                  if ($mpileup_check eq '.') {
                  ($chr, $pos, $id, $ref, $var, $cns_qual, @extra) =split("\t", $snp);
                  $extra[1] =~ /DP(\d+)/;
                  $rd_depth = $1;
                  $extra[1] =~ /MQ(\d+)/;
                  $map_qual = $1;
                  } else
                  that should work, that's just in perl though.

                  Hope this helps.

                  Comment


                  • #10
                    Originally posted by nilshomer View Post
                    Check out the paper: http://bioinformatics.oxfordjournals...s.btr076.short

                    Anyhow, it uses the base qualities, not the mapping qualities. It resolves and weights the local ambiguities. Smith Waterman can be modeled as an HMM, with the BAQ running the forward/backward algorithms to compute the posterior probability of a query base and target base aligning based on all possible local alignments. This posterior is then converted to a base quality.
                    Alignment quality is, effectively, summarized in the "mapping quality" MAQ statistic. BAQ is a "per base alignment quality",rather than a single statistic. The HMM model in BAQ is used to adjust base qualities , but the reason for adjustment is the alignment quality of each base.

                    The resulting pileup has lowered qualities on those bases whose alignment was ambiguous.

                    Using both MAQ and BAQ is, thus, a bit overlapped.

                    That's all I was trying to point out.

                    Comment


                    • #11
                      -s option for mpileup does exist in samtools 0.1.17

                      In samtools 0.1.17 the mpileup command does indeed have the -s option, even though it is not mentioned in the manpage. It is listed under output options when typing 'samtools mpileup'. In version 0.1.16, the -s option is not available for mpileup, but only for pileup.

                      I hope this answers the original question.

                      However, I do not understand the encoding of the mapping qualities in the -s output. It does not seem to be in the usual Sanger/Phred encoding. Can anyone point me to where this is documented?

                      Comment

                      Latest Articles

                      Collapse

                      • seqadmin
                        Strategies for Sequencing Challenging Samples
                        by seqadmin


                        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                        03-22-2024, 06:39 AM
                      • seqadmin
                        Techniques and Challenges in Conservation Genomics
                        by seqadmin



                        The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                        Avian Conservation
                        Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                        03-08-2024, 10:41 AM

                      ad_right_rmr

                      Collapse

                      News

                      Collapse

                      Topics Statistics Last Post
                      Started by seqadmin, Yesterday, 06:37 PM
                      0 responses
                      11 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, Yesterday, 06:07 PM
                      0 responses
                      10 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 03-22-2024, 10:03 AM
                      0 responses
                      51 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 03-21-2024, 07:32 AM
                      0 responses
                      67 views
                      0 likes
                      Last Post seqadmin  
                      Working...
                      X