We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

indels in Pileup output

akiezunakiezun Cambridge, MAMember

Hi, to get to indel information in pileup output (eg number and lengths of deletions spanning the position), do I have to run the verbose option? I'm asking because the verbose output produces all that per-read info that I don't need right now - just need the indels. Samtools pileup includes indel info in the standard output and like any other base.




  • ebanksebanks Broad InstituteMember, Broadie, Dev ✭✭✭✭

    Hey Adam,
    The standard output should give you deletions in the pileup (using the 'D' character).
    The verbose output will additionally give you the total number of spanning deletions (plus all that other info you don't need).
    But there's currently no way to get the length of deletions.
    This would be fairly straightforward to implement though, so if you want to give it a shot we'd be thrilled to incorporate a patch from you... :)

  • akiezunakiezun Cambridge, MAMember

    Thanks Eric. Do I need anything special to get this to work, I don't see any indication of indels in the output (samtools reports an indel though)? I'm on v2.7-2-g701cd16.
    Here's what I get from samtools mpileup:

    13  32920968    N   136 AAAA**AAAAA**AAA*A**aa****A*aAaAA**AAA**AaA*A*Aa******a**AAa**A*Aa*A*a*AaAA*a*aa*A*a**A**A*aA**aaa**a**aa**aa*AA**aAAA*A*a**aA***A*a*Aa*    EE[email protected]GIGGGIIFIGGGGFIGIGGGIGG>GEGGI?IEGGIFIBIEFIHGIGIG6GCGEGEIFHDHFEHFFFCECF
    13  32920969    N   138 A$A$A$A$**AAAAA**AAA*A**aa****A*aAaAA**AAA**AaA*A*Aa******a**AAa**A*Aa*A*a*AaAA*a*aa*A*a**A**A$*aA**aaa**a**aa**aa*AA**aAAA*A*a**aA***A*a*Aa*^]a^]a ECDECFFIGIFGGGGHEIEGEHHIIEHEHIEHFIIGIGIIHIGIIGEIBGG[email protected]GGGEGEIFHIIFEHFFECGEFA>
    13  32920971    N   134 **AAAAA**AAA*A**aa****A*aAaAA**AAA**AaA*A*Aa******a**AAa**A*Aa*A*a*AaAA*a*aa*A*a**A***aA**aaa**a**aa**aa*AA**aAAA*A*a**aA***A*a*Aa*aaa  CFFGEDBGGFFDEIEGGIHIIEFEIDG[email protected]IGGGIFIAIEFIGGHFIGGFAEEFEIFHIGFEHDFECFDFC7B

    and this is from GATK Pileup:

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Hmm, weird. Have you tried running on another region that has a clear indel, to see if all indels are being mishandled or just this one? To be honest, this might be a bug, but unfortunately we're all up to our ears in work and fixing this won't be a priority...

  • akiezunakiezun Cambridge, MAMember


    This indel is pretty clean. For your convenience I cut a small region that shows the same result. On the Broad servers it's here; /xchip/cga_home/akiezun/forSharing/debugPileupOnIndels

    If you do confirm it is a bug, I will take a shot at fixing it, but I do want to make sure I'm not missing something trivial like an option or something.

    thanks Geraldine

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Nope, there are no other options, so I'd call it a bug. FYI we have another pileup-related tool called CheckPileup that compares the output from our Pileup to the samtools one. I'm not sure but maybe that could be helpful for debugging? In any case, would be awesome to get a fix from you.

  • akiezunakiezun Cambridge, MAMember

    Thanks. I got a bizarre error when running CheckPileup
    the SAM pileup line didn't have the expected number of tokens (expected = 10, saw = 6 on line ...

    this is strange because the sam pileup format is in fact 6 columns, per GATK docs: http://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_sting_utils_codecs_sampileup_SAMPileupCodec.html
    and per samtools docs:

    I'm puzzled. I'm missing something super trivial.

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Hmm, it's calling the SAMPileupCodec which does specify it wants 10 tokens:

    public class SAMPileupCodec extends AsciiFeatureCodec<SAMPileupFeature> {
        // the number of tokens we expect to parse from a pileup line
        private static final int expectedTokenCount = 10;

    I wonder if this is an old codec that hasn't been updated in a while. I'll ask GSA if they know what's going on here.

  • KurtKurt Member ✭✭✭

    There always was some confusion as to what the definition of the format of pileup was from samtools. There was the simple pileup which is 6 columns and there was the "consensus" or extended pileup that a lot of people called pileup that was 10 columns (It was the original 6 plus 4 extra columns, which most people used pre-vcf)...I forget what those extra 4 columns were...

  • akiezunakiezun Cambridge, MAMember

    OK, I think I know what may be going on. The old samtools command, pileup (now deprecated), used to have a flag -c which generated a consensus sequence and had 10 columns in the output. The doc is wrong then because it exploicity shows 6 columns: http://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_sting_utils_codecs_sampileup_SAMPileupCodec.html

    With that, I was able to validate the pileup with the checker. I'm still missing the indels though - I guess the checker must just actively ignore them because they're right there in the pileup output. Will try to fix this.

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Ah, that makes sense, thanks. I'll fix the docs accordingly.

  • akiezunakiezun Cambridge, MAMember

    Hmm, Eric says that the output should contain indels but the Pileup walker inherits the default implementation of org.broadinstitute.sting.gatk.walkers.Walker.includeReadsWithDeletionAtLoci() which returns false so indels are not even seen by the walker in the pileup so it seems to have no chance of including indels right now.

  • KatieKatie United StatesMember ✭✭

    Hi, Is there a way to generate a GATK pileup while excluding reads falling below a minimum mapping quality and base quality? I am essentially wondering the equivalent of samtools mpileup -q and -Q options. Thank you!

Sign In or Register to comment.