Removing more bad uses of SampleDataSource creation

This commit is contained in:
Mark DePristo 2011-09-29 12:16:34 -04:00
parent 5c9227cf5e
commit 5043d76c3d
2 changed files with 1 additions and 27 deletions

View File

@ -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<Sample> 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

View File

@ -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.<File>emptyList());
}
}