From bfd6bf9ec5dbabb2c71c2ab58de690ca84cb5828 Mon Sep 17 00:00:00 2001 From: asivache Date: Tue, 29 Dec 2009 20:16:34 +0000 Subject: [PATCH] PileupWalker just got a new option: --showIndelPileups. When this option is used, two lines are printed for every genomic location that has indels associated with it: first line is a conventional base pileup, the second line is an "extended event" (indel) pileup. The refence base in that second line is always set to "E" (for Extended), and the pileup string contains I,D,. symbols for insertion, deletion, noevent, respectively. Only this simple short format for indel pileups is implemented so far. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2472 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/PileupWalker.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java index bcdc3db42..a5168c682 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java @@ -31,6 +31,7 @@ import org.broadinstitute.sting.gatk.refdata.rodDbSNP; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.utils.cmdLine.Argument; import org.broadinstitute.sting.utils.pileup.ReadBackedPileup; +import org.broadinstitute.sting.utils.pileup.ReadBackedExtendedEventPileup; import org.broadinstitute.sting.utils.Utils; import java.util.ArrayList; @@ -62,20 +63,34 @@ public class PileupWalker extends LocusWalker implements TreeR @Argument(fullName="ignore_uncovered_bases",shortName="skip_uncov",doc="Output nothing when a base is uncovered") public boolean IGNORE_UNCOVERED_BASES = false; - + + @Argument(fullName="showIndelPileups",shortName="show_indels",doc="In addition to base pileups, generate pileups of extended indel events") + public boolean SHOW_INDEL_PILEUPS = false; + public void initialize() { } + public boolean generateExtendedEvents() { return SHOW_INDEL_PILEUPS; } + public Integer map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) { - ReadBackedPileup pileup = context.getPileup(); - - String secondBasePileup = ""; - if(shouldShowSecondaryBasePileup(pileup)) - secondBasePileup = getSecondBasePileup(pileup); + String rods = getReferenceOrderedData( tracker ); - out.printf("%s%s %s%n", pileup.getPileupString(ref.getBase()), secondBasePileup, rods); + if ( context.hasBasePileup() ) { + ReadBackedPileup basePileup = context.getBasePileup(); + + String secondBasePileup = ""; + if(shouldShowSecondaryBasePileup(basePileup)) + secondBasePileup = getSecondBasePileup(basePileup); + + out.printf("%s%s %s%n", basePileup.getPileupString(ref.getBase()), secondBasePileup, rods); + } + + if ( context.hasExtendedEventPileup() ) { + ReadBackedExtendedEventPileup indelPileup = context.getExtendedEventPileup(); + out.printf("%s %s%n", indelPileup.getShortPileupString(), rods); + } return 1; }