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
This commit is contained in:
asivache 2009-12-29 20:16:34 +00:00
parent 9652692019
commit bfd6bf9ec5
1 changed files with 22 additions and 7 deletions

View File

@ -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<Integer, Integer> 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;
}