Have UG emit calls at sites from one or more 'trigger' tracks when provided

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3257 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-04-26 05:04:43 +00:00
parent 8f2bfac7a6
commit d9bf441391
4 changed files with 13 additions and 9 deletions

View File

@ -145,7 +145,7 @@ public class VariantAnnotatorEngine {
List<ReferenceOrderedDataSource> dataSources = engine.getRodDataSources(); List<ReferenceOrderedDataSource> dataSources = engine.getRodDataSources();
for ( ReferenceOrderedDataSource source : dataSources ) { for ( ReferenceOrderedDataSource source : dataSources ) {
RMDTrack rod = source.getReferenceOrderedData(); RMDTrack rod = source.getReferenceOrderedData();
if ( rod.getType().equals(rodDbSNP.class) ) { if ( rod.getName().equals(rodDbSNP.STANDARD_DBSNP_TRACK_NAME) ) {
annotateDbsnp = true; annotateDbsnp = true;
} }
if ( rod.getName().equals("hapmap2") ) { if ( rod.getName().equals("hapmap2") ) {

View File

@ -54,10 +54,13 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
// find the alternate allele with the largest sum of quality scores // find the alternate allele with the largest sum of quality scores
initializeBestAlternateAllele(ref, contexts); initializeBestAlternateAllele(ref, contexts);
// did we trigger on the provided track?
boolean triggerTrack = tracker.getReferenceMetaData(UnifiedGenotyperEngine.TRIGGER_TRACK_NAME, false).size() > 0;
// if there are no non-ref bases... // if there are no non-ref bases...
if ( bestAlternateAllele == null ) { if ( bestAlternateAllele == null ) {
// if we don't want all bases, then we don't need to calculate genotype likelihoods // if we don't want all bases, then we don't need to calculate genotype likelihoods
if ( !ALL_BASE_MODE && !GENOTYPE_MODE ) { if ( !triggerTrack && !ALL_BASE_MODE && !GENOTYPE_MODE ) {
VariantCallContext vcc = new VariantCallContext(false); VariantCallContext vcc = new VariantCallContext(false);
estimateReferenceConfidence(vcc, contexts, DiploidGenotypePriors.HUMAN_HETEROZYGOSITY, false); estimateReferenceConfidence(vcc, contexts, DiploidGenotypePriors.HUMAN_HETEROZYGOSITY, false);
return vcc; return vcc;
@ -77,7 +80,7 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
if ( verboseWriter != null ) if ( verboseWriter != null )
printAlleleFrequencyData(ref, loc, frequencyEstimationPoints); printAlleleFrequencyData(ref, loc, frequencyEstimationPoints);
VariantCallContext vcc = createCalls(tracker, ref, contexts, loc, frequencyEstimationPoints); VariantCallContext vcc = createCalls(tracker, ref, contexts, loc, frequencyEstimationPoints, triggerTrack);
// technically, at this point our confidence in a reference call isn't accurately // technically, at this point our confidence in a reference call isn't accurately
// estimated because it didn't take into account samples with no data // estimated because it didn't take into account samples with no data
@ -323,7 +326,7 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
return new HashMap<String, Genotype>(); return new HashMap<String, Genotype>();
} }
protected VariantCallContext createCalls(RefMetaDataTracker tracker, char ref, Map<String, StratifiedAlignmentContext> contexts, GenomeLoc loc, int frequencyEstimationPoints) { protected VariantCallContext createCalls(RefMetaDataTracker tracker, char ref, Map<String, StratifiedAlignmentContext> contexts, GenomeLoc loc, int frequencyEstimationPoints, boolean triggerTrack) {
// only need to look at the most likely alternate allele // only need to look at the most likely alternate allele
int indexOfMax = BaseUtils.simpleBaseToBaseIndex(bestAlternateAllele); int indexOfMax = BaseUtils.simpleBaseToBaseIndex(bestAlternateAllele);
@ -347,7 +350,7 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
} }
// return a null call if we don't pass the confidence cutoff or the most likely allele frequency is zero // return a null call if we don't pass the confidence cutoff or the most likely allele frequency is zero
if ( !ALL_BASE_MODE && ((!GENOTYPE_MODE && bestAFguess == 0) || phredScaledConfidence < CONFIDENCE_THRESHOLD) ) if ( !triggerTrack && !ALL_BASE_MODE && ((!GENOTYPE_MODE && bestAFguess == 0) || phredScaledConfidence < CONFIDENCE_THRESHOLD) )
return new VariantCallContext(phredScaledConfidence >= CONFIDENCE_THRESHOLD); return new VariantCallContext(phredScaledConfidence >= CONFIDENCE_THRESHOLD);
// output to beagle file if requested // output to beagle file if requested

View File

@ -41,8 +41,8 @@ import java.io.File;
/** /**
* A variant caller which unifies the approaches of several disparate callers. Works for single-sample, * A variant caller which unifies the approaches of several disparate callers. Works for single-sample and
* multi-sample, and pooled data. The user can choose from several different incorporated calculation models. * multi-sample data. The user can choose from several different incorporated calculation models.
*/ */
@Reference(window=@Window(start=-20,stop=20)) @Reference(window=@Window(start=-20,stop=20))
@By(DataSource.REFERENCE) @By(DataSource.REFERENCE)

View File

@ -56,6 +56,8 @@ import java.util.*;
public class UnifiedGenotyperEngine { public class UnifiedGenotyperEngine {
public static final String TRIGGER_TRACK_NAME = "trigger";
// should we annotate dbsnp? // should we annotate dbsnp?
protected boolean annotateDbsnp = false; protected boolean annotateDbsnp = false;
// should we annotate hapmap2? // should we annotate hapmap2?
@ -122,7 +124,7 @@ public class UnifiedGenotyperEngine {
List<ReferenceOrderedDataSource> dataSources = toolkit.getRodDataSources(); List<ReferenceOrderedDataSource> dataSources = toolkit.getRodDataSources();
for ( ReferenceOrderedDataSource source : dataSources ) { for ( ReferenceOrderedDataSource source : dataSources ) {
RMDTrack rod = source.getReferenceOrderedData(); RMDTrack rod = source.getReferenceOrderedData();
if ( rod.getType().equals(rodDbSNP.class) ) { if ( rod.getName().equals(rodDbSNP.STANDARD_DBSNP_TRACK_NAME) ) {
this.annotateDbsnp = true; this.annotateDbsnp = true;
} }
if ( rod.getName().equals("hapmap2") ) { if ( rod.getName().equals("hapmap2") ) {
@ -212,7 +214,6 @@ public class UnifiedGenotyperEngine {
return null; return null;
// stratify the AlignmentContext and cut by sample // stratify the AlignmentContext and cut by sample
// Note that for testing purposes, we may want to throw multi-samples at pooled mode
Map<String, StratifiedAlignmentContext> stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(pileup, UAC.ASSUME_SINGLE_SAMPLE, null); Map<String, StratifiedAlignmentContext> stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(pileup, UAC.ASSUME_SINGLE_SAMPLE, null);
if ( stratifiedContexts == null ) if ( stratifiedContexts == null )
return null; return null;