Initial commit for Andrey of plumbing for indels. Not finished - need to track down bug with him.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2967 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
0a49dffa8f
commit
f096a958d6
|
|
@ -19,7 +19,8 @@ public abstract class GenotypeCalculationModel implements Cloneable {
|
||||||
|
|
||||||
public enum Model {
|
public enum Model {
|
||||||
JOINT_ESTIMATE,
|
JOINT_ESTIMATE,
|
||||||
POOLED
|
POOLED,
|
||||||
|
INDELS
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BaseMismatchModel baseModel;
|
protected BaseMismatchModel baseModel;
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@ public class GenotypeCalculationModelFactory {
|
||||||
case POOLED:
|
case POOLED:
|
||||||
gcm = new PooledCalculationModel();
|
gcm = new PooledCalculationModel();
|
||||||
break;
|
break;
|
||||||
|
case INDELS:
|
||||||
|
gcm = new SimpleIndelCalculationModel();
|
||||||
|
break;
|
||||||
default: throw new RuntimeException("Unexpected GenotypeCalculationModel " + UAC.genotypeModel);
|
default: throw new RuntimeException("Unexpected GenotypeCalculationModel " + UAC.genotypeModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.broadinstitute.sting.gatk.walkers.genotyper;
|
||||||
|
|
||||||
|
import org.broadinstitute.sting.utils.*;
|
||||||
|
import org.broadinstitute.sting.utils.pileup.*;
|
||||||
|
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||||
|
import org.broadinstitute.sting.gatk.refdata.rodDbSNP;
|
||||||
|
import org.broadinstitute.sting.gatk.contexts.*;
|
||||||
|
import org.broadinstitute.sting.gatk.contexts.variantcontext.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class SimpleIndelCalculationModel extends GenotypeCalculationModel {
|
||||||
|
|
||||||
|
protected SimpleIndelCalculationModel() {}
|
||||||
|
|
||||||
|
public VariantCallContext callLocus(RefMetaDataTracker tracker, char ref, GenomeLoc loc, Map<String, StratifiedAlignmentContext> contexts, DiploidGenotypePriors priors) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
//VariantContext vc = new MutableVariantContext("UG_indel_call", loc, alleles, genotypes, phredScaledConfidence/10.0, null, attributes);
|
||||||
|
//return new VariantCallContext(vc, phredScaledConfidence >= CONFIDENCE_THRESHOLD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -62,9 +62,13 @@ public class UnifiedGenotyper extends LocusWalker<VariantCallContext, UnifiedGen
|
||||||
// the calculation arguments
|
// the calculation arguments
|
||||||
private UnifiedGenotyperEngine UG_engine = null;
|
private UnifiedGenotyperEngine UG_engine = null;
|
||||||
|
|
||||||
// Enable deletions in the pileup
|
// enable deletions in the pileup
|
||||||
public boolean includeReadsWithDeletionAtLoci() { return true; }
|
public boolean includeReadsWithDeletionAtLoci() { return true; }
|
||||||
|
|
||||||
|
// enable extended events for indels
|
||||||
|
public boolean generateExtendedEvents() { return true; }
|
||||||
|
//public boolean generateExtendedEvents() { return UAC.genotypeModel == GenotypeCalculationModel.Model.INDELS; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class for collecting output statistics from the UG
|
* Inner class for collecting output statistics from the UG
|
||||||
*/
|
*/
|
||||||
|
|
@ -170,6 +174,8 @@ public class UnifiedGenotyper extends LocusWalker<VariantCallContext, UnifiedGen
|
||||||
* @return the VariantCallContext object
|
* @return the VariantCallContext object
|
||||||
*/
|
*/
|
||||||
public VariantCallContext map(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext) {
|
public VariantCallContext map(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext) {
|
||||||
|
if ( rawContext.hasExtendedEventPileup() )
|
||||||
|
System.out.println("Saw extended event at location " + rawContext.getLocation());
|
||||||
return UG_engine.runGenotyper(tracker, refContext, rawContext);
|
return UG_engine.runGenotyper(tracker, refContext, rawContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,9 @@ public class UnifiedGenotyperEngine {
|
||||||
this.beagleWriter = beagleWriter;
|
this.beagleWriter = beagleWriter;
|
||||||
|
|
||||||
// deal with input errors
|
// deal with input errors
|
||||||
|
if ( UAC.genotypeModel == GenotypeCalculationModel.Model.INDELS && !(genotypeWriter instanceof VCFGenotypeWriter) ) {
|
||||||
|
throw new IllegalArgumentException("Attempting to use an output format other than VCF with indels. Please set the output format to VCF.");
|
||||||
|
}
|
||||||
if ( UAC.POOLSIZE > 0 && UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) {
|
if ( UAC.POOLSIZE > 0 && UAC.genotypeModel != GenotypeCalculationModel.Model.POOLED ) {
|
||||||
throw new IllegalArgumentException("Attempting to use a model other than POOLED with pooled data. Please set the model to POOLED.");
|
throw new IllegalArgumentException("Attempting to use a model other than POOLED with pooled data. Please set the model to POOLED.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue