Had some free time, so I unplugged extended events from the walkers. Now they exist only in LocusIteratorByState, but ReadProperties.generateExtendedEvents() always returns false so that block is never actually executed anymore. I don't want to touch LIBS because I think David is in there right now.

This commit is contained in:
Eric Banks 2012-04-02 14:27:36 -04:00
parent 4075bc7d3d
commit 99d27ddcc4
12 changed files with 3 additions and 153 deletions

View File

@ -356,10 +356,6 @@ public class GenomeAnalysisEngine {
public BAQ.QualityMode getWalkerBAQQualityMode() { return WalkerManager.getBAQQualityMode(walker); }
public BAQ.ApplicationTime getWalkerBAQApplicationTime() { return WalkerManager.getBAQApplicationTime(walker); }
protected boolean generateExtendedEvents() {
return walker.generateExtendedEvents();
}
protected boolean includeReadsWithDeletionAtLoci() {
return walker.includeReadsWithDeletionAtLoci();
}
@ -766,7 +762,6 @@ public class GenomeAnalysisEngine {
new ValidationExclusion(Arrays.asList(argCollection.unsafe)),
filters,
includeReadsWithDeletionAtLoci(),
generateExtendedEvents(),
getWalkerBAQApplicationTime() == BAQ.ApplicationTime.ON_INPUT ? argCollection.BAQMode : BAQ.CalculationMode.OFF,
getWalkerBAQQualityMode(),
refReader,

View File

@ -36,7 +36,6 @@ public class ReadProperties {
private final Collection<ReadFilter> supplementalFilters;
private final boolean includeReadsWithDeletionAtLoci;
private final boolean useOriginalBaseQualities;
private final boolean generateExtendedEvents;
private final BAQ.CalculationMode cmode;
private final BAQ.QualityMode qmode;
private final IndexedFastaSequenceFile refReader; // read for BAQ, if desired
@ -52,16 +51,9 @@ public class ReadProperties {
return includeReadsWithDeletionAtLoci;
}
/**
* Return true if the walker wants to see additional piles of "extended" events (indels). An indel is associated,
* by convention, with the reference base immediately preceding the insertion/deletion, and if this flag is set
* to 'true', any locus with an indel associated with it will cause exactly two subsequent calls to walker's map(): first call
* will be made with a "conventional" base pileup, the next call will be made with a pileup of extended (indel/noevent)
* events.
* @return
*/
@Deprecated
public boolean generateExtendedEvents() {
return generateExtendedEvents;
return false;
}
/**
@ -144,9 +136,6 @@ public class ReadProperties {
* @param downsamplingMethod Method for downsampling reads at a given locus.
* @param exclusionList what safety checks we're willing to let slide
* @param supplementalFilters additional filters to dynamically apply.
* @param generateExtendedEvents if true, the engine will issue an extra call to walker's map() with
* a pile of indel/noevent extended events at every locus with at least one indel associated with it
* (in addition to a "regular" call to map() at this locus performed with base pileup)
* @param includeReadsWithDeletionAtLoci if 'true', the base pileups sent to the walker's map() method
* will explicitly list reads with deletion over the current reference base; otherwise, only observed
* bases will be seen in the pileups, and the deletions will be skipped silently.
@ -163,7 +152,6 @@ public class ReadProperties {
ValidationExclusion exclusionList,
Collection<ReadFilter> supplementalFilters,
boolean includeReadsWithDeletionAtLoci,
boolean generateExtendedEvents,
BAQ.CalculationMode cmode,
BAQ.QualityMode qmode,
IndexedFastaSequenceFile refReader,
@ -176,7 +164,6 @@ public class ReadProperties {
this.exclusionList = exclusionList == null ? new ValidationExclusion() : exclusionList;
this.supplementalFilters = supplementalFilters;
this.includeReadsWithDeletionAtLoci = includeReadsWithDeletionAtLoci;
this.generateExtendedEvents = generateExtendedEvents;
this.useOriginalBaseQualities = useOriginalBaseQualities;
this.cmode = cmode;
this.qmode = qmode;

View File

@ -168,7 +168,6 @@ public class SAMDataSource {
null,
new ValidationExclusion(),
new ArrayList<ReadFilter>(),
false,
false);
}
@ -186,8 +185,7 @@ public class SAMDataSource {
DownsamplingMethod downsamplingMethod,
ValidationExclusion exclusionList,
Collection<ReadFilter> supplementalFilters,
boolean includeReadsWithDeletionAtLoci,
boolean generateExtendedEvents) {
boolean includeReadsWithDeletionAtLoci) {
this( samFiles,
threadAllocation,
numFileHandles,
@ -199,7 +197,6 @@ public class SAMDataSource {
exclusionList,
supplementalFilters,
includeReadsWithDeletionAtLoci,
generateExtendedEvents,
BAQ.CalculationMode.OFF,
BAQ.QualityMode.DONT_MODIFY,
null, // no BAQ
@ -216,9 +213,6 @@ public class SAMDataSource {
* @param downsamplingMethod Method for downsampling reads at a given locus.
* @param exclusionList what safety checks we're willing to let slide
* @param supplementalFilters additional filters to dynamically apply.
* @param generateExtendedEvents if true, the engine will issue an extra call to walker's map() with
* a pile of indel/noevent extended events at every locus with at least one indel associated with it
* (in addition to a "regular" call to map() at this locus performed with base pileup)
* @param includeReadsWithDeletionAtLoci if 'true', the base pileups sent to the walker's map() method
* will explicitly list reads with deletion over the current reference base; otherwise, only observed
* bases will be seen in the pileups, and the deletions will be skipped silently.
@ -236,7 +230,6 @@ public class SAMDataSource {
ValidationExclusion exclusionList,
Collection<ReadFilter> supplementalFilters,
boolean includeReadsWithDeletionAtLoci,
boolean generateExtendedEvents,
BAQ.CalculationMode cmode,
BAQ.QualityMode qmode,
IndexedFastaSequenceFile refReader,
@ -309,7 +302,6 @@ public class SAMDataSource {
exclusionList,
supplementalFilters,
includeReadsWithDeletionAtLoci,
generateExtendedEvents,
cmode,
qmode,
refReader,

View File

@ -66,9 +66,6 @@ public class PileupWalker extends LocusWalker<Integer, Integer> implements TreeR
@Output
PrintStream out;
@Argument(fullName="showIndelPileups",shortName="show_indels",doc="In addition to base pileups, generate pileups of extended indel events")
public boolean SHOW_INDEL_PILEUPS = false;
@Argument(fullName="showVerbose",shortName="verbose",doc="Add an extra verbose section to the pileup output")
public boolean SHOW_VERBOSE = false;
@ -78,8 +75,6 @@ public class PileupWalker extends LocusWalker<Integer, Integer> implements TreeR
public void initialize() {
}
public boolean generateExtendedEvents() { return SHOW_INDEL_PILEUPS; }
public Integer map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
String rods = getReferenceOrderedData( tracker );
@ -92,17 +87,6 @@ public class PileupWalker extends LocusWalker<Integer, Integer> implements TreeR
out.println();
}
if ( context.hasExtendedEventPileup() ) {
ReadBackedExtendedEventPileup indelPileup = context.getExtendedEventPileup();
List<Pair<String,Integer>> eventCounts = indelPileup.getEventStringsWithCounts(ref.getBases());
out.printf("%s %s ", indelPileup.getShortPileupString(), rods);
int i = 0;
for ( ; i < eventCounts.size() - 1 ; i++ ) {
out.printf("%s:%d,",eventCounts.get(i).first,eventCounts.get(i).second);
}
out.printf("%s:%d%n",eventCounts.get(i).first,eventCounts.get(i).second);
}
return 1;
}

View File

@ -114,35 +114,6 @@ public abstract class Walker<MapType, ReduceType> {
return false;
}
/**
* This method states whether you want to see pileups of "extended events" (currently, indels only)
* at every locus that has at least one indel associated with it. Consider the following situation:
*
* ref: AT--CTGA (note that we expanded the ref here with -- to accomodate insertion in read3)
* read1: AT--CTGA (perfectly matches the ref)
* read2: AT----GA (deletion -CT w.r.t. the ref)
* read3: ATGGCTGA (insertion +GG w.r.t the ref)
*
* Normally, the locus iterator only returns read base pileups over reference bases, optionally with deleted bases
* included (see #includeReadsWithDeletionAtLoci()). In other words, the pileup over the second reference base (T)
* will be [T,T,T] (all reads count), for the next reference base (C) the pileup will be [C,C] (or [C,-,C] if
* #includeReadsWithDeletionAtLoci() is true), next pileup generated over the next reference
* base (T) will be either [T,T], or [T,'-',T], etc. In this default mode, a) insertions are not seen by a walker at all, and
* b) deletions are (optionally) seen only on a base-by-base basis (as the step-by-step traversal over the reference
* bases is performed). In the extended event mode, however, if there is at least one indel associated with a reference
* locus, the engine will generate an <i>additional</i> call to the walker's map() method, with a pileup of
* full-length extended indel/noevent calls. This call will be made <i>after</i> the conventional base pileup call
* at that locus. Thus, in the example above, a conventional call will be first made at the second reference base (T),
* with the [T,T,T] pileup of read bases, then an extended event call will be made at the <i>same</i> locus with
* pileup [no_event, -CT, +GG] (i.e. extended events associated with that reference base). After that, the traversal
* engine will move to the next reference base.
*
* @return false if you do not want to receive extra pileups with extended events, or true if you do.
*/
public boolean generateExtendedEvents() {
return false;
}
public void initialize() { }
/**

View File

@ -74,10 +74,6 @@ public class GCContentByIntervalWalker extends LocusWalker<Long, Long> {
public void initialize() {
}
public boolean generateExtendedEvents() {
return false;
}
public Long reduceInit() {
return 0L;
}

View File

@ -227,10 +227,6 @@ public class ReadBackedPhasingWalker extends RodWalker<PhasingStatsAndOutput, Ph
}
}
public boolean generateExtendedEvents() {
return false;
}
public PhasingStats reduceInit() {
return new PhasingStats();
}

View File

@ -1,56 +0,0 @@
package org.broadinstitute.sting.gatk.walkers.qc;
import org.broadinstitute.sting.commandline.Output;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.walkers.LocusWalker;
import org.broadinstitute.sting.gatk.walkers.TreeReducible;
import org.broadinstitute.sting.utils.sam.GATKSAMRecord;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.List;
/**
* At each locus in the input data set, prints the reference base, genomic location, and
* all aligning reads in a compact but human-readable form.
*/
public class PrintLocusContextWalker extends LocusWalker<AlignmentContext, Integer> implements TreeReducible<Integer> {
@Output
private PrintStream out;
public AlignmentContext map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
out.printf( "In map: ref = %s, loc = %s %s, reads = %s%n", ref.getBaseAsChar(),
context.getLocation(),
context.hasExtendedEventPileup() ? "[extended]" : "",
Arrays.deepToString( getReadNames(context.getReads()) ) );
return context;
}
public Integer reduceInit() { return 0; }
public Integer reduce(AlignmentContext context, Integer sum) {
return sum + 1;
}
public Integer treeReduce(Integer lhs, Integer rhs) {
return lhs + rhs;
}
private String[] getReadNames( List<GATKSAMRecord> reads ) {
String[] readNames = new String[ reads.size() ];
for( int i = 0; i < reads.size(); i++ ) {
readNames[i] = String.format("%nname = %s, start = %d, end = %d", reads.get(i).getReadName(), reads.get(i).getAlignmentStart(), reads.get(i).getAlignmentEnd());
}
//Arrays.sort(readNames);
return readNames;
}
@Override
public boolean generateExtendedEvents() {
return true;
}
}

View File

@ -76,7 +76,6 @@ public class DownsamplerBenchmark extends ReadProcessingBenchmark {
new ValidationExclusion(Collections.singletonList(ValidationExclusion.TYPE.ALL)),
Collections.<ReadFilter>emptyList(),
false,
false,
BAQ.CalculationMode.OFF,
BAQ.QualityMode.DONT_MODIFY,
null, // no BAQ

View File

@ -109,7 +109,6 @@ public class SAMDataSourceUnitTest extends BaseTest {
null,
new ValidationExclusion(),
new ArrayList<ReadFilter>(),
false,
false);
Iterable<Shard> strat = data.createShardIteratorOverMappedReads(seq.getSequenceDictionary(),new LocusShardBalancer());

View File

@ -354,7 +354,6 @@ public class LocusIteratorByStateUnitTest extends BaseTest {
new ValidationExclusion(),
Collections.<ReadFilter>emptyList(),
false,
false,
BAQ.CalculationMode.OFF,
BAQ.QualityMode.DONT_MODIFY,
null, // no BAQ

View File

@ -23,16 +23,4 @@ public class PileupWalkerIntegrationTest extends WalkerTest {
WalkerTestSpec spec = new WalkerTestSpec(gatk_args, 1, Arrays.asList(expected_md5));
executeTest("Testing the standard (no-indel) pileup on three merged FHS pools with 27 deletions in 969 bases", spec);
}
@Test
public void testExtendedEventPileup() {
String gatk_args = "-T Pileup -I " + validationDataLocation + "OV-0930.normal.chunk.bam "
+ "-R " + hg18Reference
+ " -show_indels -o %s";
String expected_md5="06eedc2e7927650961d99d703f4301a4";
WalkerTestSpec spec = new WalkerTestSpec(gatk_args,1,Arrays.asList(expected_md5));
executeTest("Testing the extended pileup with indel records included on a small chunk of Ovarian dataset with 20 indels (1 D, 19 I)", spec);
}
}