Merge pull request #1441 from broadinstitute/rhl_printreads_bqsr_fail

Throw an exception if the BQSR input covariants file is not found
This commit is contained in:
Ron Levine 2016-08-11 16:16:08 -04:00 committed by GitHub
commit 27e56b2bb9
2 changed files with 21 additions and 2 deletions

View File

@ -269,8 +269,13 @@ public class GenomeAnalysisEngine {
Utils.resetRandomGenerator(System.currentTimeMillis());
// if the use specified an input BQSR recalibration table then enable on the fly recalibration
if (args.BQSR_RECAL_FILE != null)
setBaseRecalibration(args);
if (args.BQSR_RECAL_FILE != null) {
if (args.BQSR_RECAL_FILE.exists()) {
setBaseRecalibration(args);
} else {
throw new UserException("The BQSR recalibration file, " + args.BQSR_RECAL_FILE.getAbsolutePath() + ", does not exist");
}
}
// setup the runtime limits
setupRuntimeLimits(args);

View File

@ -135,4 +135,18 @@ public class PrintReadsIntegrationTest extends WalkerTest {
executeTest("testPrintReadsException-"+params.args, spec);
}
@Test
public void testPrintReadsNoBQSRFile() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T PrintReads" +
" -R " + hg18Reference +
" -I " + privateTestDir + "HiSeq.1mb.bam" +
" -BSQR bqsrFile" +
" --no_pg_tag" +
" -o %s",
1, UserException.class);
executeTest("testPrintReadsNoBQSRFile-", spec);
}
}