From 12453fa1635ed06678446a1b9baa86d09f09511a Mon Sep 17 00:00:00 2001 From: ebanks Date: Sun, 17 Jan 2010 04:38:52 +0000 Subject: [PATCH] Misc cleanup of UG args git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2620 348d0f76-0448-11de-a6fe-93d51630548a --- .../genotyper/GenotypeCalculationModel.java | 1 - ...JointEstimateGenotypeCalculationModel.java | 28 ------------------- .../genotyper/UnifiedArgumentCollection.java | 6 ---- .../walkers/genotyper/UnifiedGenotyper.java | 16 ++--------- .../UnifiedGenotyperIntegrationTest.java | 26 ++++++++--------- 5 files changed, 16 insertions(+), 61 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java index d85bbd6bc..13c10bc73 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GenotypeCalculationModel.java @@ -70,7 +70,6 @@ public abstract class GenotypeCalculationModel implements Cloneable { GENOTYPE_MODE = UAC.GENOTYPE; POOL_SIZE = UAC.POOLSIZE; CONFIDENCE_THRESHOLD = UAC.CONFIDENCE_THRESHOLD; - MINIMUM_ALLELE_FREQUENCY = UAC.MINIMUM_ALLELE_FREQUENCY; REPORT_SLOD = ! UAC.NO_SLOD; this.verboseWriter = verboseWriter; this.beagleWriter = beagleWriter; diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java index 1f9cdc0e9..e4480385e 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java @@ -228,34 +228,6 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc PofFs[baseIndex] = Math.min(sum, 1.0); // deal with precision errors } - /*** - protected double[] getHardyWeinbergValues(double f) { - double[] HWvalues = hardyWeinbergValueCache.get(f); - - // if it hasn't been calculated yet, do so now - if ( HWvalues == null ) { - - // create Hardy-Weinberg based allele frequencies (p^2, 2pq, q^2) converted to log-space - double p = 1.0 - f; - double q = f; - - // allele frequencies don't actually equal 0... - if ( MathUtils.compareDoubles(q, 0.0) == 0 ) { - q = MINIMUM_ALLELE_FREQUENCY; - p -= MINIMUM_ALLELE_FREQUENCY; - } else if ( MathUtils.compareDoubles(p, 0.0) == 0 ) { - p = MINIMUM_ALLELE_FREQUENCY; - q -= MINIMUM_ALLELE_FREQUENCY; - } - - HWvalues = new double[] { Math.pow(p, 2), 2.0 * p * q, Math.pow(q, 2) }; - hardyWeinbergValueCache.put(f, HWvalues); - } - - return HWvalues; - } - ***/ - /** * @param ref the ref base * @param loc the GenomeLoc diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java index bd774783c..1c79382d9 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java @@ -66,9 +66,6 @@ public class UnifiedArgumentCollection { // control the various parameters to be used - @Argument(fullName = "lod_threshold", shortName = "lod", doc = "[DEPRECATED] The lod threshold by which variants should be filtered", required = false) - public double LOD_THRESHOLD = Double.MIN_VALUE; - @Argument(fullName = "min_confidence_threshold", shortName = "confidence", doc = "The phred-scaled confidence threshold by which variants should be filtered", required = false) public double CONFIDENCE_THRESHOLD = 0.0; @@ -89,7 +86,4 @@ public class UnifiedArgumentCollection { @Argument(fullName = "max_coverage", shortName = "mc", doc = "Maximum reads at this locus for it to be callable; to disable, provide value < 1 [default:10,000]", required = false) public Integer MAX_READS_IN_PILEUP = 10000; - - @Argument(fullName = "min_allele_frequency", shortName = "min_freq", doc = "The minimum possible allele frequency in a population (advanced)", required = false) - public double MINIMUM_ALLELE_FREQUENCY = 1e-8; } diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index d42c40680..a96eb8037 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -96,22 +96,12 @@ public class UnifiedGenotyper extends LocusWalker 1 ) { - // no ASSUME_SINGLE_SAMPLE because the IO system doesn't know how to get the sample name - if ( UAC.ASSUME_SINGLE_SAMPLE != null ) - throw new IllegalArgumentException("For technical reasons, the ASSUME_SINGLE_SAMPLE argument cannot be used with multiple threads"); + if ( getToolkit().getArguments().numberOfThreads > 1 && UAC.ASSUME_SINGLE_SAMPLE != null ) { + // the ASSUME_SINGLE_SAMPLE argument can't be handled (at least for now) while we are multi-threaded because the IO system doesn't know how to get the sample name + throw new IllegalArgumentException("For technical reasons, the ASSUME_SINGLE_SAMPLE argument cannot be used with multiple threads"); } // get all of the unique sample names - unless we're in POOLED mode, in which case we ignore the sample names diff --git a/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java b/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java index 1326ce591..581ed4359 100755 --- a/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperIntegrationTest.java @@ -22,7 +22,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMultiSamplePilot1PointEM() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,023,400-10,024,000 -bm empirical -gm EM_POINT_ESTIMATE -confidence 30", 1, - Arrays.asList("f033627f849ca8148fe4168c8172eb32")); + Arrays.asList("6a36a1237b1f2b704c682ac947aeb692")); executeTest("testMultiSamplePilot1 - Point Estimate EM", spec); } @@ -30,7 +30,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMultiSamplePilot2PointEM() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -varout %s -L 20:10,000,000-10,010,000 -bm empirical -gm EM_POINT_ESTIMATE -confidence 30", 1, - Arrays.asList("2d181aa420f200fb19a0b5f40855dfd7")); + Arrays.asList("4f221d23a8c218ea592fb7158736a407")); executeTest("testMultiSamplePilot2 - Point Estimate EM", spec); } @@ -43,7 +43,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testPooled1() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,023,000-10,024,000 -bm empirical -gm POOLED -ps 60 -confidence 30", 1, - Arrays.asList("1fc421c8e5ccba7ba2f803fc17c27565")); + Arrays.asList("e344fa16b155be00bc4d9b8cc3221187")); executeTest("testPooled1", spec); } @@ -56,7 +56,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMultiSamplePilot1Joint() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "low_coverage_CEU.chr1.10k-11k.bam -varout %s -L 1:10,022,000-10,025,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1, - Arrays.asList("b8b937e5d44114c265cfa86dbb5e45c8")); + Arrays.asList("6f85a0d0134675be6fe8d3af9e9f7467")); executeTest("testMultiSamplePilot1 - Joint Estimate", spec); } @@ -64,7 +64,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testMultiSamplePilot2Joint() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -varout %s -L 20:10,000,000-10,050,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1, - Arrays.asList("499a589c9da3a6adcccc4561b84dfde1")); + Arrays.asList("4a7e44e834d100b143e52beffdd79d1f")); executeTest("testMultiSamplePilot2 - Joint Estimate", spec); } @@ -72,7 +72,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testSingleSamplePilot2Joint() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -varout %s -L 1:10,000,000-10,100,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30", 1, - Arrays.asList("1dc507fbe54e289f18d9738398426050")); + Arrays.asList("d3adfbae8c9d18851cab13659239bc03")); executeTest("testSingleSamplePilot2 - Joint Estimate", spec); } @@ -85,7 +85,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testParallelization() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -varout %s -L 1:10,000,000-10,400,000 -bm empirical -gm JOINT_ESTIMATE -confidence 30 -nt 4", 1, - Arrays.asList("6ae7741b72024781aa2969c785ede392")); + Arrays.asList("a57dabbe7dd12015759de72fef8bc879")); executeTest("test parallelization", spec); } @@ -98,11 +98,11 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { @Test public void testParameter() { HashMap e = new HashMap(); - e.put( "-genotype", "094c15be4f9b7c348a12f4bc27efb6e3" ); - e.put( "-all_bases", "0097049976ba72dc70476670f1ab2ec6" ); - e.put( "--min_base_quality_score 26", "fa88be0dc1f6807829f15df82d3cf393" ); - e.put( "--min_mapping_quality_score 26", "225f47a2f73cd4ca16606e0fcc09ba51" ); - e.put( "--max_mismatches_in_40bp_window 5", "d8192dc36ebc205aaaaae7734a6144b5" ); + e.put( "-genotype", "65abc7cbf940f89037ec61b764054060" ); + e.put( "-all_bases", "ff63408d7b5aeb90bc85e471d9de1390" ); + e.put( "--min_base_quality_score 26", "287858958aa8cf3be8b43c12cb317ebc" ); + e.put( "--min_mapping_quality_score 26", "4e70544703309610e70164db100c66b7" ); + e.put( "--max_mismatches_in_40bp_window 5", "14e17c27b6559f9b98d91842c271db3f" ); for ( Map.Entry entry : e.entrySet() ) { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( @@ -116,7 +116,7 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest { public void testConfidence() { WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T UnifiedGenotyper -R " + oneKGLocation + "reference/human_b36_both.fasta -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -varout %s -L 1:10,000,000-10,010,000 -bm empirical -gm JOINT_ESTIMATE -confidence 10 ", 1, - Arrays.asList("63b37207255069ca47a6ffd77bf562f0")); + Arrays.asList("ae98a5e96af774514eac5dea31078e0c")); executeTest("testConfidence", spec); }