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:
parent
457c59e737
commit
bd2af33a16
|
|
@ -242,18 +242,8 @@ public class GenerateVariantClustersWalker extends RodWalker<ExpandingArrayList<
|
||||||
|
|
||||||
dataManager.normalizeData(); // Each data point is now [ (x - mean) / standard deviation ]
|
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
|
// Create the Gaussian Mixture Model model and run it
|
||||||
switch (OPTIMIZATION_MODEL) {
|
theModel = new VariantGaussianMixtureModel( dataManager, MAX_GAUSSIANS, MAX_ITERATIONS, FORCE_INDEPENDENT, STD_THRESHOLD, SHRINKAGE, DIRICHLET_PARAMETER );
|
||||||
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" );
|
|
||||||
}
|
|
||||||
|
|
||||||
theModel.run( CLUSTER_FILE );
|
theModel.run( CLUSTER_FILE );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ public class Tranche implements Comparable<Tranche> {
|
||||||
header = vals;
|
header = vals;
|
||||||
if ( header.length == 5 )
|
if ( header.length == 5 )
|
||||||
// old style tranches file, throw an error
|
// 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 )
|
if ( header.length != 8 && header.length != 11 )
|
||||||
throw new UserException.MalformedFile(f, "Expected 8 elements in header line " + line);
|
throw new UserException.MalformedFile(f, "Expected 8 elements in header line " + line);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,7 @@ package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
public abstract class VariantOptimizationModel implements VariantOptimizationInterface {
|
public abstract class VariantOptimizationModel implements VariantOptimizationInterface {
|
||||||
|
|
||||||
public enum Model {
|
public enum Model {
|
||||||
GAUSSIAN_MIXTURE_MODEL,
|
GAUSSIAN_MIXTURE_MODEL
|
||||||
K_NEAREST_NEIGHBORS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final double targetTITV;
|
protected final double targetTITV;
|
||||||
|
|
@ -53,8 +52,6 @@ public abstract class VariantOptimizationModel implements VariantOptimizationInt
|
||||||
if( titv > targetTITV ) { titv -= 2.0f*(titv-targetTITV); }
|
if( titv > targetTITV ) { titv -= 2.0f*(titv-targetTITV); }
|
||||||
if( titv < 0.5 ) { titv = 0.5; }
|
if( titv < 0.5 ) { titv = 0.5; }
|
||||||
return ( (titv - 0.5) / (targetTITV - 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 ) {
|
public final double calcTruePositiveRateFromKnownTITV( final double knownTITV, final double _novelTITV, final double overallTITV, final double knownAlphaFactor ) {
|
||||||
|
|
|
||||||
|
|
@ -164,21 +164,11 @@ public class VariantRecalibrator extends RodWalker<ExpandingArrayList<VariantDat
|
||||||
ignoreInputFilterSet = new TreeSet<String>(Arrays.asList(IGNORE_INPUT_FILTERS));
|
ignoreInputFilterSet = new TreeSet<String>(Arrays.asList(IGNORE_INPUT_FILTERS));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (OPTIMIZATION_MODEL) {
|
theModel = new VariantGaussianMixtureModel( TARGET_TITV, CLUSTER_FILE, BACKOFF_FACTOR );
|
||||||
case GAUSSIAN_MIXTURE_MODEL:
|
if ( SINGLETON_FP_RATE != -1 ) {
|
||||||
theModel = new VariantGaussianMixtureModel( TARGET_TITV, CLUSTER_FILE, BACKOFF_FACTOR );
|
theModel.setSingletonFPRate(SINGLETON_FP_RATE);
|
||||||
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" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// deal with annotations
|
// deal with annotations
|
||||||
if ( USE_ANNOTATIONS != null ) {
|
if ( USE_ANNOTATIONS != null ) {
|
||||||
for ( String annotation : USE_ANNOTATIONS ) {
|
for ( String annotation : USE_ANNOTATIONS ) {
|
||||||
|
|
@ -265,9 +255,6 @@ public class VariantRecalibrator extends RodWalker<ExpandingArrayList<VariantDat
|
||||||
}
|
}
|
||||||
nTruthSites += isAtTruthSite ? 1 : 0;
|
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) ) {
|
for( final VariantContext vc : tracker.getVariantContexts(ref, inputNames, null, context.getLocation(), false, false) ) {
|
||||||
if( vc != null && vc.isSNP() ) {
|
if( vc != null && vc.isSNP() ) {
|
||||||
if( !vc.isFiltered() || IGNORE_ALL_INPUT_FILTERS || (ignoreInputFilterSet != null && ignoreInputFilterSet.containsAll(vc.getFilters())) ) {
|
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);
|
variantDatum.lod = round4(lod);
|
||||||
|
|
||||||
// deal with the truth calculation
|
// deal with the truth calculation
|
||||||
variantDatum.atTruthSite = isAtTruthSite; //vcTruth != null && vcTruth.isVariant();
|
variantDatum.atTruthSite = isAtTruthSite;
|
||||||
|
|
||||||
mapList.add( variantDatum );
|
mapList.add( variantDatum );
|
||||||
final Map<String, Object> attrs = new HashMap<String, Object>(vc.getAttributes());
|
final Map<String, Object> attrs = new HashMap<String, Object>(vc.getAttributes());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue