Skip to content

Commit

Permalink
Fix BQSR Dataflow test that was failing due to lack of sequence dicti…
Browse files Browse the repository at this point in the history
…onary validation

Now that sequence dictionary validation is in, we can re-enable this test,
which was previously failing with a java.lang.OutOfMemoryError due to lack
of upfront validation of the reads vs. reference sequence dictionaries.
  • Loading branch information
droazen committed Jul 20, 2015
1 parent 435db5f commit 2b471ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Expand Up @@ -22,10 +22,7 @@
import org.broadinstitute.hellbender.dev.BunnyLog;
import org.broadinstitute.hellbender.dev.pipelines.bqsr.BaseRecalibratorDataflowUtils;
import org.broadinstitute.hellbender.dev.pipelines.bqsr.DataflowReadFilter;
import org.broadinstitute.hellbender.engine.FeatureDataSource;
import org.broadinstitute.hellbender.engine.FeatureInput;
import org.broadinstitute.hellbender.engine.FeatureManager;
import org.broadinstitute.hellbender.engine.ReadsDataSource;
import org.broadinstitute.hellbender.engine.*;
import org.broadinstitute.hellbender.engine.dataflow.DataflowCommandLineProgram;
import org.broadinstitute.hellbender.engine.dataflow.ReadsSource;
import org.broadinstitute.hellbender.engine.dataflow.coders.GATKReadCoder;
Expand All @@ -34,6 +31,7 @@
import org.broadinstitute.hellbender.exceptions.UserException;
import org.broadinstitute.hellbender.tools.recalibration.RecalibrationTables;
import org.broadinstitute.hellbender.utils.IntervalUtils;
import org.broadinstitute.hellbender.utils.SequenceDictionaryUtils;
import org.broadinstitute.hellbender.utils.SimpleInterval;
import org.broadinstitute.hellbender.utils.dataflow.BucketUtils;
import org.broadinstitute.hellbender.utils.dataflow.DataflowUtils;
Expand Down Expand Up @@ -116,6 +114,7 @@ protected void setupPipeline(Pipeline pipeline) {
BaseRecalibratorDataflowUtils.ensureReferenceIsReadable(pipeline.getOptions(), referencePath);
baseRecalibratorWorker = BaseRecalibratorWorker.fromArgs(header, BRAC);
baseRecalibratorWorker.checkClientArguments();
checkSequenceDictionaries();

// 2. set up computation
PCollection<RecalibrationTables> aggregated =
Expand All @@ -142,6 +141,15 @@ protected void setupPipeline(Pipeline pipeline) {
}
}

private void checkSequenceDictionaries() {
try ( final ReferenceDataSource refSource = new ReferenceDataSource(new File(referencePath)) ) {
final SAMSequenceDictionary refDictionary = refSource.getSequenceDictionary();
final SAMSequenceDictionary readsDictionary = header.getSequenceDictionary();

SequenceDictionaryUtils.validateDictionaries("reference", refDictionary, "reads", readsDictionary, true, null);
}
}

@Override
protected void afterPipeline(Pipeline p) {
bunny.stepEnd("dataflow");
Expand Down
Expand Up @@ -238,8 +238,7 @@ public void testBQSRFailWithoutDBSNP() throws IOException {
spec.executeTest("testBQSRFailWithoutDBSNP", this);
}

// TODO: re-enable this once sequence dictionary validation is in
@Test(enabled = false)
@Test
public void testBQSRFailWithIncompatibleReference() throws IOException {
final String resourceDir = getTestDataDir() + "/" + "BQSR" + "/";

Expand All @@ -250,7 +249,7 @@ public void testBQSRFailWithIncompatibleReference() throws IOException {
IntegrationTestSpec spec = new IntegrationTestSpec(
params.getCommandLine(),
1,
UserException.MissingContigInSequenceDictionary.class);
UserException.IncompatibleSequenceDictionaries.class);
spec.executeTest("testBQSRFailWithIncompatibleReference", this);
}
}

0 comments on commit 2b471ca

Please sign in to comment.