From 5b8bd819918956b2e3b31e10db41bffb559c860c Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Mon, 4 Jun 2012 19:03:43 -0400 Subject: [PATCH] An option to not actually write out the results of select variants -- Useful for performance testing of the SV operations themselves. --- .../gatk/walkers/variantutils/SelectVariants.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java index 690cc71ac..d37d1f895 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java @@ -319,6 +319,10 @@ public class SelectVariants extends RodWalker implements TreeR @Argument(fullName="forceGenotypesDecode", doc="If true, the incoming VariantContext will have its genotypes forcibly decoded by computing AC across all genotypes. For efficiency testing only", required=false) private boolean forceGenotypesDecode = false; + @Hidden + @Argument(fullName="justRead", doc="If true, we won't actually write the output file. For efficiency testing only", required=false) + private boolean justRead = false; + /* Private class used to store the intermediate variants in the integer random selection process */ private class RandomVariantStructure { @@ -505,8 +509,10 @@ public class SelectVariants extends RodWalker implements TreeR vc = vc.fullyDecode(vcfRods.get(vc.getSource())); // an option for performance testing only - if ( forceGenotypesDecode ) - logger.info("forceGenotypesDecode with getCalledChrCount() = " + vc.getCalledChrCount()); + if ( forceGenotypesDecode ) { + final int x = vc.getCalledChrCount(); + //logger.info("forceGenotypesDecode with getCalledChrCount() = " + ); + } if ( IDsToKeep != null && ! IDsToKeep.contains(vc.getID()) ) continue; @@ -572,7 +578,8 @@ public class SelectVariants extends RodWalker implements TreeR randomlyAddVariant(++variantNumber, sub); } else if (!SELECT_RANDOM_FRACTION || ( GenomeAnalysisEngine.getRandomGenerator().nextDouble() < fractionRandom)) { - vcfWriter.add(sub); + if ( ! justRead ) + vcfWriter.add(sub); } } }