Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • liu_xt005
    Member
    • Jun 2011
    • 24

    #1

    Pileup / extract information from BAM/SAM files

    I am aiming to extract the full information at each site: read depth, # ref reads, # variant reads (for all non-reference alleles), strand information, etc. An old thread started by nilmot13 suggested "genomeCoverageBed", but the output seems to contain only simple read depth.

    My problem started from an observation that SAMtools and GATK generate very different REF/ALT read depth at some site from the same BAM file, while BAMview and IGV both tend to support GATK counts at the site.
  • clk
    Junior Member
    • Nov 2010
    • 4

    #2
    Hi,
    looking for an answer to the same question I came across your post... Did you ever find an answer to this question? The discrepancies I see between IGV and samtools mpileup are huge in my data, which is RNAseq data...


    Thanks!

    Comment

    • liu_xt005
      Member
      • Jun 2011
      • 24

      #3
      Sorry I did not find a good solution.
      But my study showed that SAMtools tend to keep longer tails for indels than GATK and others. For example, SAMtools gives TAAAA:TAAA (REF:ALT), while GATK gives TA:T.

      Comment

      • clk
        Junior Member
        • Nov 2010
        • 4

        #4
        Thanks for responding. I finally found a solution to this, so I'll post it here in case is useful for others.

        I found out that samtools filters reads before including them in the pileup; it reads the flag field in the bam file and discards reads that
        a) are not paired
        b) not properly mapped
        c) mate is not mapped
        d) alignment is not primary
        e) reads fail quality control of vendor
        f) is marked as PCR duplicates.

        If the filters (a) and (c) are not desired, you can use the parameter -A.
        In addition, samtools performs realignment unless the parameter -B is used, and discards low quality reads unless -Q0 is used. Finally, it stops at a certain number of reads unless the -d parameter is invoqued.


        I really needed a good quantification of the reads at each position, so I needed to make sure I could trust the pileup (or vcf) files generated by samtools. So I wrote a small script that parses the bam file, reading the flag field, and removes specific reads from the alignment. In this way, I was finally able to produce an alignment that gave me the exact same counts with IGV and samtools pileup.

        It would be really great if all these little details were more clear in the documentation, but in the end, the filtering criteria used by samtools was adequate for my needs. Except for the "anomalous read pairs" parameter (-A), which not very appropriate for RNA-seq data.

        Hope that helps somebody!

        Comment

        • zyxue
          Junior Member
          • May 2014
          • 3

          #5
          Hi clk, where did you find the information? Did you analyze the source code for samtools mpileup? Thanks!

          Comment

          Latest Articles

          Collapse

          • SEQadmin2
            Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
            by SEQadmin2



            CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

            Despite this, “CRISPR helped turn genome editing from a specialized technique into
            ...
            07-31-2026, 11:01 AM
          • SEQadmin2
            Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
            by SEQadmin2


            Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

            The systematic characterization of the human proteome has
            ...
            07-20-2026, 11:48 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 08-11-2026, 10:35 AM
          0 responses
          10 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 08-06-2026, 07:41 AM
          0 responses
          29 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 08-03-2026, 10:13 AM
          0 responses
          47 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-31-2026, 02:55 AM
          0 responses
          48 views
          0 reactions
          Last Post SEQadmin2  
          Working...