From 5043d76c3d308d45db816cfb685fe14085d41acb Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Thu, 29 Sep 2011 12:16:34 -0400 Subject: [PATCH] Removing more bad uses of SampleDataSource creation --- .../sting/utils/MendelianViolation.java | 26 ------------------- .../samples/SampleDataSourceUnitTest.java | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/utils/MendelianViolation.java b/public/java/src/org/broadinstitute/sting/utils/MendelianViolation.java index a87a73a2d..a89bad2fd 100755 --- a/public/java/src/org/broadinstitute/sting/utils/MendelianViolation.java +++ b/public/java/src/org/broadinstitute/sting/utils/MendelianViolation.java @@ -1,6 +1,5 @@ package org.broadinstitute.sting.utils; -import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.samples.Sample; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.variantcontext.Genotype; @@ -94,31 +93,6 @@ public class MendelianViolation { minGenotypeQuality = minGenotypeQualityP; } - - /** - * The most common constructor to be used when give a YAML file with the relationships to the engine with the -SM option. - * @param engine - The GATK engine, use getToolkit(). That's where the sample information is stored. - * @param minGenotypeQualityP - the minimum phred scaled genotype quality score necessary to asses mendelian violation - */ - public MendelianViolation(GenomeAnalysisEngine engine, double minGenotypeQualityP) { - boolean gotSampleInformation = false; - Collection samples = engine.getSampleDB().getSamples(); - // Iterate through all samples in the sample_metadata file but we really can only take one. - for (Sample sample : samples) { - if (sample.getMother() != null && sample.getFather() != null) { - sampleMom = sample.getMother().getID(); - sampleDad = sample.getFather().getID(); - sampleChild = sample.getID(); - minGenotypeQuality = minGenotypeQualityP; - gotSampleInformation = true; - break; // we can only deal with one trio information - } - } - if (!gotSampleInformation) - throw new UserException("YAML file has no sample with relationship information (mother/father)"); - } - - /** * This method prepares the object to evaluate for violation. Typically you won't call it directly, a call to * isViolation(vc) will take care of this. But if you want to know whether your site was a valid comparison site diff --git a/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDataSourceUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDataSourceUnitTest.java index ccbfd5c99..3d40d4de8 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDataSourceUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/samples/SampleDataSourceUnitTest.java @@ -29,6 +29,6 @@ public class SampleDataSourceUnitTest extends BaseTest { // make sure samples are created from the SAM file correctly @Test() public void loadSAMSamplesTest() { - SampleDataSource s = new SampleDataSource(header, null); + SampleDataSource s = new SampleDataSource(header, Collections.emptyList()); } }