Bug fix for variant optimizer. Remember to close the PrintStreams it uses to output the cluster files.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3046 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
rpoplin 2010-03-19 15:07:32 +00:00
parent bb7e0c27fd
commit cdec84aa8f
5 changed files with 19 additions and 9 deletions

View File

@ -56,7 +56,7 @@ public class ApplyVariantClustersWalker extends RodWalker<ExpandingArrayList<Var
/////////////////////////////
// Command Line Arguments
/////////////////////////////
@Argument(fullName="target_titv", shortName="titv", doc="The target Ti/Tv ratio towards which to optimize. (~~2.2 for whole genome experiments)", required=true)
@Argument(fullName="target_titv", shortName="titv", doc="The target Ti/Tv ratio towards which to optimize. (~~2.1 for whole genome experiments)", required=true)
private double TARGET_TITV = 2.1;
@Argument(fullName="desired_num_variants", shortName="dV", doc="The desired number of variants to keep in a theoretically filtered set", required=false)
private int DESIRED_NUM_VARIANTS = 0;

View File

@ -47,17 +47,23 @@ public class VariantDataManager {
public VariantDataManager( final ExpandingArrayList<VariantDatum> dataList, final ExpandingArrayList<String> _annotationKeys ) {
numVariants = dataList.size();
data = dataList.toArray( new VariantDatum[numVariants]);
data = dataList.toArray( new VariantDatum[numVariants] );
if( numVariants <= 0 ) {
throw new StingException( "There are zero variants! (or possibly a problem with integer overflow)" );
}
numAnnotations = _annotationKeys.size() + 1; // +1 for QUAL
if( numAnnotations <= 0 ) {
throw new StingException( "There are zero annotations! (or possibly a problem with integer overflow)" );
if( _annotationKeys == null ) {
numAnnotations = 0;
meanVector = null;
varianceVector = null;
} else {
numAnnotations = _annotationKeys.size() + 1; // +1 for QUAL
if( numAnnotations <= 0 ) {
throw new StingException( "There are zero annotations! (or possibly a problem with integer overflow)" );
}
meanVector = new double[numAnnotations];
varianceVector = new double[numAnnotations];
isNormalized = false;
}
meanVector = new double[numAnnotations];
varianceVector = new double[numAnnotations];
isNormalized = false;
annotationKeys = _annotationKeys;
}

View File

@ -35,5 +35,6 @@ public class VariantDatum {
public double[] annotations;
public boolean isTransition;
public boolean isKnown;
public boolean isTrueVariant;
public double qual;
}

View File

@ -282,6 +282,7 @@ public final class VariantGaussianMixtureModel extends VariantOptimizationModel
outputFile.println(-1);
}
}
outputFile.close();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
@ -384,6 +385,8 @@ public final class VariantGaussianMixtureModel extends VariantOptimizationModel
( numKnownTi ==0 || numKnownTv == 0 ? "NaN" : ( ((double)numKnownTi) / ((double)numKnownTv) ) ) + "," +
( numNovelTi ==0 || numNovelTv == 0 ? "NaN" : ( ((double)numNovelTi) / ((double)numNovelTv) )));
}
outputFile.close();
}

View File

@ -51,7 +51,7 @@ public class VariantOptimizer extends RodWalker<ExpandingArrayList<VariantDatum>
/////////////////////////////
// Command Line Arguments
/////////////////////////////
@Argument(fullName="target_titv", shortName="titv", doc="The target Ti/Tv ratio towards which to optimize. (~~2.2 for whole genome experiments)", required=true)
@Argument(fullName="target_titv", shortName="titv", doc="The target Ti/Tv ratio towards which to optimize. (~~2.1 for whole genome experiments)", required=true)
private double TARGET_TITV = 2.1;
@Argument(fullName="ignore_input_filters", shortName="ignoreFilters", doc="If specified the optimizer will use variants even if the FILTER column is marked in the VCF file", required=false)
private boolean IGNORE_INPUT_FILTERS = false;