Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • unagaswamy
    Member
    • May 2010
    • 13

    Extracting base coverage and quality values from BAM files

    Experts,
    I am interested in extracting base coverage and quality values for non SNP reads from a BAM file?
    Thanks,
    -Uma
  • wenhuang
    Member
    • Feb 2010
    • 30

    #2
    pileup in samtools may be what you need.

    Comment

    • bioinfosm
      Senior Member
      • Jan 2008
      • 483

      #3
      Yes, pileup is the tool from samtools to display coverage / quality information
      --
      bioinfosm

      Comment

      • unagaswamy
        Member
        • May 2010
        • 13

        #4
        Thanks for the info.
        Here is what I have tried so far to view the file for a given sample:
        samtools view filename.bam chr:start-end

        For non SNP positions, I am getting the base coverage using the following command:
        samtools view filename.bam chr:start-end |wc -l

        Sometimes the actual position is missing when I grep it and ~50 bases around it are printed. My question is how can I trust the wc -l value for a position if that position itself is missing in the BAM file?
        Last edited by unagaswamy; 10-21-2010, 12:37 PM.

        Comment

        • unagaswamy
          Member
          • May 2010
          • 13

          #5
          Hi Experts,
          Can anyone tell me how to extract the base quality from the CQ field of the BAM file? I colleague of mine mentioned that every two ASCII character corresponds to the SOLiD color space. Do I take the average of every overlapping 2 or the max? Any input in this regard is gretaly appreciated!

          Comment

          • nilshomer
            Nils Homer
            • Nov 2008
            • 1283

            #6
            Originally posted by unagaswamy View Post
            Hi Experts,
            Can anyone tell me how to extract the base quality from the CQ field of the BAM file? I colleague of mine mentioned that every two ASCII character corresponds to the SOLiD color space. Do I take the average of every overlapping 2 or the max? Any input in this regard is gretaly appreciated!
            Is the base quality not already reported in the SAM record (it should be)? As to how to calculate the base qualities during alignment from color qualities, here is the formula MAQ/BWA/BFAST uses: https://sourceforge.net/apps/mediawi...apping_Quality.

            Comment

            • unagaswamy
              Member
              • May 2010
              • 13

              #7
              Hi nilshomer,
              Thanks for the reply. We are generating SAM record only for the SNP positions which does have the base quality. I am interested in the Non-SNP positions as well and hence I'm trying to calcuate the base quality for these positions from the BAM file.
              -Uma

              Comment

              • unagaswamy
                Member
                • May 2010
                • 13

                #8
                Hi All,
                I generated a raw pileup for all reference positions using the samtools. An exmaple record for a non-SNP position is below:
                chrY 11936864 G G 51 0 60 8 ,,.,,,.. "%`".B"`

                This base has a coverage of 8. Which one of these fields (51,0,60) represent the base quality in this case? I am still confused about the ABI's SOLiD base quality!

                Any input is greatly appreciated!

                Comment

                • Bruins
                  Member
                  • Feb 2010
                  • 78

                  #9
                  Did you see the SAM FAQ?
                  Download SAM tools for free. SAM (Sequence Alignment/Map) is a flexible generic format for storing nucleotide sequence alignment. SAMtools provide efficient utilities on manipulating alignments in the SAM format.


                  Hope this helps.

                  Comment

                  • unagaswamy
                    Member
                    • May 2010
                    • 13

                    #10
                    Hi Bruins,
                    Thanks for this very useful link. It definitely answers some of my questions.
                    -Uma

                    Comment

                    Latest Articles

                    Collapse

                    • SEQadmin2
                      From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                      by SEQadmin2


                      Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                      The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                      ...
                      Yesterday, 10:05 AM
                    • SEQadmin2
                      Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
                      by SEQadmin2


                      With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


                      Introduction

                      Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
                      05-22-2026, 06:42 AM
                    • SEQadmin2
                      Environmental Genomics in the Age of NGS: From Microbes to Conservation Strategies
                      by SEQadmin2

                      Studying ecosystems means dealing with complex, multi-species communities that are hard to observe at scale. This complexity, however, hides many important questions to be answered, from how biogeochemical cycles work and how climate change can affect species distribution to how conservation strategies can work best.


                      Genomics, particularly since the expansion of NGS, has transformed ecosystem ecology. By sequencing environmental DNA, we can now assess biodiversity without direct...
                      05-06-2026, 09:04 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, Yesterday, 12:03 PM
                    0 responses
                    17 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, Yesterday, 11:40 AM
                    0 responses
                    13 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 05-28-2026, 11:40 AM
                    0 responses
                    29 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 05-26-2026, 10:12 AM
                    0 responses
                    31 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...