misc clean up in VQSR

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5014 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
rpoplin 2011-01-18 21:04:31 +00:00
parent 457c59e737
commit bd2af33a16
4 changed files with 8 additions and 34 deletions

View File

@ -242,18 +242,8 @@ public class GenerateVariantClustersWalker extends RodWalker<ExpandingArrayList<
dataManager.normalizeData(); // Each data point is now [ (x - mean) / standard deviation ]
// Create either the Gaussian Mixture Model or the Nearest Neighbors model and run it
switch (OPTIMIZATION_MODEL) {
case GAUSSIAN_MIXTURE_MODEL:
theModel = new VariantGaussianMixtureModel( dataManager, MAX_GAUSSIANS, MAX_ITERATIONS, FORCE_INDEPENDENT,
STD_THRESHOLD, SHRINKAGE, DIRICHLET_PARAMETER );
break;
//case K_NEAREST_NEIGHBORS:
// theModel = new VariantNearestNeighborsModel( dataManager, TARGET_TITV, NUM_KNN );
// break;
default:
throw new UserException.BadArgumentValue("OPTIMIZATION_MODEL", "Variant Optimization Model is unrecognized. Implemented options are GAUSSIAN_MIXTURE_MODEL and K_NEAREST_NEIGHBORS" );
}
// Create the Gaussian Mixture Model model and run it
theModel = new VariantGaussianMixtureModel( dataManager, MAX_GAUSSIANS, MAX_ITERATIONS, FORCE_INDEPENDENT, STD_THRESHOLD, SHRINKAGE, DIRICHLET_PARAMETER );
theModel.run( CLUSTER_FILE );
}

View File

@ -170,7 +170,7 @@ public class Tranche implements Comparable<Tranche> {
header = vals;
if ( header.length == 5 )
// old style tranches file, throw an error
throw new UserException.MalformedFile(f, "Unfortuanately, your tranches file is from a previous version of this tool and cannot be used with the latest code. Please rerun VariantRecalibrator");
throw new UserException.MalformedFile(f, "Unfortunately, your tranches file is from a previous version of this tool and cannot be used with the latest code. Please rerun VariantRecalibrator");
if ( header.length != 8 && header.length != 11 )
throw new UserException.MalformedFile(f, "Expected 8 elements in header line " + line);
} else {

View File

@ -34,8 +34,7 @@ package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
public abstract class VariantOptimizationModel implements VariantOptimizationInterface {
public enum Model {
GAUSSIAN_MIXTURE_MODEL,
K_NEAREST_NEIGHBORS
GAUSSIAN_MIXTURE_MODEL
}
protected final double targetTITV;
@ -53,8 +52,6 @@ public abstract class VariantOptimizationModel implements VariantOptimizationInt
if( titv > targetTITV ) { titv -= 2.0f*(titv-targetTITV); }
if( titv < 0.5 ) { titv = 0.5; }
return ( (titv - 0.5) / (targetTITV - 0.5) );
//if( titv < 0.0 ) { titv = 0.0; }
//return ( titv / targetTITV );
}
public final double calcTruePositiveRateFromKnownTITV( final double knownTITV, final double _novelTITV, final double overallTITV, final double knownAlphaFactor ) {

View File

@ -164,21 +164,11 @@ public class VariantRecalibrator extends RodWalker<ExpandingArrayList<VariantDat
ignoreInputFilterSet = new TreeSet<String>(Arrays.asList(IGNORE_INPUT_FILTERS));
}
switch (OPTIMIZATION_MODEL) {
case GAUSSIAN_MIXTURE_MODEL:
theModel = new VariantGaussianMixtureModel( TARGET_TITV, CLUSTER_FILE, BACKOFF_FACTOR );
if ( SINGLETON_FP_RATE != -1 ) {
theModel.setSingletonFPRate(SINGLETON_FP_RATE);
}
break;
//case K_NEAREST_NEIGHBORS:
// theModel = new VariantNearestNeighborsModel( dataManager, TARGET_TITV, NUM_KNN );
// break;
default:
throw new UserException.BadArgumentValue("OPTIMIZATION_MODEL", "Variant Optimization Model is unrecognized. Implemented options are GAUSSIAN_MIXTURE_MODEL and K_NEAREST_NEIGHBORS" );
theModel = new VariantGaussianMixtureModel( TARGET_TITV, CLUSTER_FILE, BACKOFF_FACTOR );
if ( SINGLETON_FP_RATE != -1 ) {
theModel.setSingletonFPRate(SINGLETON_FP_RATE);
}
// deal with annotations
if ( USE_ANNOTATIONS != null ) {
for ( String annotation : USE_ANNOTATIONS ) {
@ -265,9 +255,6 @@ public class VariantRecalibrator extends RodWalker<ExpandingArrayList<VariantDat
}
nTruthSites += isAtTruthSite ? 1 : 0;
//final VariantContext vcTruth = ( vcsTruth.size() != 0 ? vcsTruth.iterator().next() : null );
//nTruthSites += vcTruth != null && vcTruth.isVariant() ? 1 : 0;
for( final VariantContext vc : tracker.getVariantContexts(ref, inputNames, null, context.getLocation(), false, false) ) {
if( vc != null && vc.isSNP() ) {
if( !vc.isFiltered() || IGNORE_ALL_INPUT_FILTERS || (ignoreInputFilterSet != null && ignoreInputFilterSet.containsAll(vc.getFilters())) ) {
@ -345,7 +332,7 @@ public class VariantRecalibrator extends RodWalker<ExpandingArrayList<VariantDat
variantDatum.lod = round4(lod);
// deal with the truth calculation
variantDatum.atTruthSite = isAtTruthSite; //vcTruth != null && vcTruth.isVariant();
variantDatum.atTruthSite = isAtTruthSite;
mapList.add( variantDatum );
final Map<String, Object> attrs = new HashMap<String, Object>(vc.getAttributes());