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:
parent
8f2bfac7a6
commit
d9bf441391
|
|
@ -145,7 +145,7 @@ public class VariantAnnotatorEngine {
|
|||
List<ReferenceOrderedDataSource> dataSources = engine.getRodDataSources();
|
||||
for ( ReferenceOrderedDataSource source : dataSources ) {
|
||||
RMDTrack rod = source.getReferenceOrderedData();
|
||||
if ( rod.getType().equals(rodDbSNP.class) ) {
|
||||
if ( rod.getName().equals(rodDbSNP.STANDARD_DBSNP_TRACK_NAME) ) {
|
||||
annotateDbsnp = true;
|
||||
}
|
||||
if ( rod.getName().equals("hapmap2") ) {
|
||||
|
|
|
|||
|
|
@ -54,10 +54,13 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
|
|||
// find the alternate allele with the largest sum of quality scores
|
||||
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 ( bestAlternateAllele == null ) {
|
||||
// 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);
|
||||
estimateReferenceConfidence(vcc, contexts, DiploidGenotypePriors.HUMAN_HETEROZYGOSITY, false);
|
||||
return vcc;
|
||||
|
|
@ -77,7 +80,7 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
|
|||
if ( verboseWriter != null )
|
||||
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
|
||||
// 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>();
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
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);
|
||||
|
||||
// output to beagle file if requested
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ import java.io.File;
|
|||
|
||||
|
||||
/**
|
||||
* A variant caller which unifies the approaches of several disparate callers. Works for single-sample,
|
||||
* multi-sample, and pooled data. The user can choose from several different incorporated calculation models.
|
||||
* A variant caller which unifies the approaches of several disparate callers. Works for single-sample and
|
||||
* multi-sample data. The user can choose from several different incorporated calculation models.
|
||||
*/
|
||||
@Reference(window=@Window(start=-20,stop=20))
|
||||
@By(DataSource.REFERENCE)
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ import java.util.*;
|
|||
|
||||
public class UnifiedGenotyperEngine {
|
||||
|
||||
public static final String TRIGGER_TRACK_NAME = "trigger";
|
||||
|
||||
// should we annotate dbsnp?
|
||||
protected boolean annotateDbsnp = false;
|
||||
// should we annotate hapmap2?
|
||||
|
|
@ -122,7 +124,7 @@ public class UnifiedGenotyperEngine {
|
|||
List<ReferenceOrderedDataSource> dataSources = toolkit.getRodDataSources();
|
||||
for ( ReferenceOrderedDataSource source : dataSources ) {
|
||||
RMDTrack rod = source.getReferenceOrderedData();
|
||||
if ( rod.getType().equals(rodDbSNP.class) ) {
|
||||
if ( rod.getName().equals(rodDbSNP.STANDARD_DBSNP_TRACK_NAME) ) {
|
||||
this.annotateDbsnp = true;
|
||||
}
|
||||
if ( rod.getName().equals("hapmap2") ) {
|
||||
|
|
@ -212,7 +214,6 @@ public class UnifiedGenotyperEngine {
|
|||
return null;
|
||||
|
||||
// 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);
|
||||
if ( stratifiedContexts == null )
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue