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:
parent
bb7e0c27fd
commit
cdec84aa8f
|
|
@ -56,7 +56,7 @@ public class ApplyVariantClustersWalker extends RodWalker<ExpandingArrayList<Var
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Command Line Arguments
|
// 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;
|
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)
|
@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;
|
private int DESIRED_NUM_VARIANTS = 0;
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,15 @@ public class VariantDataManager {
|
||||||
|
|
||||||
public VariantDataManager( final ExpandingArrayList<VariantDatum> dataList, final ExpandingArrayList<String> _annotationKeys ) {
|
public VariantDataManager( final ExpandingArrayList<VariantDatum> dataList, final ExpandingArrayList<String> _annotationKeys ) {
|
||||||
numVariants = dataList.size();
|
numVariants = dataList.size();
|
||||||
data = dataList.toArray( new VariantDatum[numVariants]);
|
data = dataList.toArray( new VariantDatum[numVariants] );
|
||||||
if( numVariants <= 0 ) {
|
if( numVariants <= 0 ) {
|
||||||
throw new StingException( "There are zero variants! (or possibly a problem with integer overflow)" );
|
throw new StingException( "There are zero variants! (or possibly a problem with integer overflow)" );
|
||||||
}
|
}
|
||||||
|
if( _annotationKeys == null ) {
|
||||||
|
numAnnotations = 0;
|
||||||
|
meanVector = null;
|
||||||
|
varianceVector = null;
|
||||||
|
} else {
|
||||||
numAnnotations = _annotationKeys.size() + 1; // +1 for QUAL
|
numAnnotations = _annotationKeys.size() + 1; // +1 for QUAL
|
||||||
if( numAnnotations <= 0 ) {
|
if( numAnnotations <= 0 ) {
|
||||||
throw new StingException( "There are zero annotations! (or possibly a problem with integer overflow)" );
|
throw new StingException( "There are zero annotations! (or possibly a problem with integer overflow)" );
|
||||||
|
|
@ -58,6 +63,7 @@ public class VariantDataManager {
|
||||||
meanVector = new double[numAnnotations];
|
meanVector = new double[numAnnotations];
|
||||||
varianceVector = new double[numAnnotations];
|
varianceVector = new double[numAnnotations];
|
||||||
isNormalized = false;
|
isNormalized = false;
|
||||||
|
}
|
||||||
annotationKeys = _annotationKeys;
|
annotationKeys = _annotationKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,5 +35,6 @@ public class VariantDatum {
|
||||||
public double[] annotations;
|
public double[] annotations;
|
||||||
public boolean isTransition;
|
public boolean isTransition;
|
||||||
public boolean isKnown;
|
public boolean isKnown;
|
||||||
|
public boolean isTrueVariant;
|
||||||
public double qual;
|
public double qual;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,7 @@ public final class VariantGaussianMixtureModel extends VariantOptimizationModel
|
||||||
outputFile.println(-1);
|
outputFile.println(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
outputFile.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
|
|
@ -384,6 +385,8 @@ public final class VariantGaussianMixtureModel extends VariantOptimizationModel
|
||||||
( numKnownTi ==0 || numKnownTv == 0 ? "NaN" : ( ((double)numKnownTi) / ((double)numKnownTv) ) ) + "," +
|
( numKnownTi ==0 || numKnownTv == 0 ? "NaN" : ( ((double)numKnownTi) / ((double)numKnownTv) ) ) + "," +
|
||||||
( numNovelTi ==0 || numNovelTv == 0 ? "NaN" : ( ((double)numNovelTi) / ((double)numNovelTv) )));
|
( numNovelTi ==0 || numNovelTv == 0 ? "NaN" : ( ((double)numNovelTi) / ((double)numNovelTv) )));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outputFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class VariantOptimizer extends RodWalker<ExpandingArrayList<VariantDatum>
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Command Line Arguments
|
// 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;
|
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)
|
@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;
|
private boolean IGNORE_INPUT_FILTERS = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue