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:
ebanks 2010-03-09 19:13:01 +00:00
parent 0a49dffa8f
commit f096a958d6
5 changed files with 38 additions and 2 deletions

View File

@ -19,7 +19,8 @@ public abstract class GenotypeCalculationModel implements Cloneable {
public enum Model {
JOINT_ESTIMATE,
POOLED
POOLED,
INDELS
}
protected BaseMismatchModel baseModel;

View File

@ -70,6 +70,9 @@ public class GenotypeCalculationModelFactory {
case POOLED:
gcm = new PooledCalculationModel();
break;
case INDELS:
gcm = new SimpleIndelCalculationModel();
break;
default: throw new RuntimeException("Unexpected GenotypeCalculationModel " + UAC.genotypeModel);
}

View File

@ -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);
}
}

View File

@ -62,9 +62,13 @@ public class UnifiedGenotyper extends LocusWalker<VariantCallContext, UnifiedGen
// the calculation arguments
private UnifiedGenotyperEngine UG_engine = null;
// Enable deletions in the pileup
// enable deletions in the pileup
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
*/
@ -170,6 +174,8 @@ public class UnifiedGenotyper extends LocusWalker<VariantCallContext, UnifiedGen
* @return the VariantCallContext object
*/
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);
}

View File

@ -87,6 +87,9 @@ public class UnifiedGenotyperEngine {
this.beagleWriter = beagleWriter;
// 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 ) {
throw new IllegalArgumentException("Attempting to use a model other than POOLED with pooled data. Please set the model to POOLED.");
}