Merge pull request #813 from broadinstitute/rhl_throw_exception_dcov

Throw exception for -dcov argument given to ActiveRegionWalkers
This commit is contained in:
jmthibault79 2015-02-19 13:43:32 -05:00
commit 9491c0333f
3 changed files with 34 additions and 7 deletions

View File

@ -424,4 +424,20 @@ public class HaplotypeCallerIntegrationTest extends WalkerTest {
" -o %s",
1, UserException.HardwareFeatureException.class));
}
@Test
public void testHaplotypeCallerDcovException(){
executeTest("HaplotypeCallerDcovException",
new WalkerTest.WalkerTestSpec(
" -T HaplotypeCaller" +
" --contamination_fraction_to_filter 0.05 --disableDithering --pcr_indel_model NONE --maxReadsInRegionPerSample 1000 " +
" --minReadsPerAlignmentStart 5 --maxProbPropagationDistance 50 --activeProbabilityThreshold 0.002 " +
" --no_cmdline_in_header -minPruning 3 -pairHMM VECTOR_LOGLESS_CACHING -pairHMMSub " + HMM_SUB_IMPLEMENTATION +
" -dcov 50" +
" -R " + REF +
" -I " + NA12878_BAM +
" -L " + INTERVALS_FILE +
" -o %s",
1, UserException.CommandLineException.class));
}
}

View File

@ -203,9 +203,8 @@ public class CommandLineGATK extends CommandLineExecutable {
// If no analysis name is present, fill in extra help on the walkers.
WalkerManager walkerManager = engine.getWalkerManager();
String analysisName = getAnalysisName();
if(analysisName != null && walkerManager.exists(getAnalysisName()))
additionalHelp = getWalkerHelp(walkerManager.getWalkerClassByName(getAnalysisName()));
if(analysisName != null && walkerManager.exists(analysisName))
additionalHelp = getWalkerHelp(walkerManager.getWalkerClassByName(analysisName));
else
additionalHelp = getAllWalkerHelp();

View File

@ -259,13 +259,16 @@ public class GenomeAnalysisEngine {
// validate our parameters
if (args == null) {
throw new ReviewedGATKException("The GATKArgumentCollection passed to GenomeAnalysisEngine can not be null.");
throw new ReviewedGATKException("The GATKArgumentCollection passed to GenomeAnalysisEngine cannot be null.");
}
// validate our parameters
if (this.walker == null)
throw new ReviewedGATKException("The walker passed to GenomeAnalysisEngine can not be null.");
throw new ReviewedGATKException("The walker passed to GenomeAnalysisEngine cannot be null.");
// check that active region walkers do not use the downsampling to coverage argument
checkDownSamplingToCoverage();
if (args.nonDeterministicRandomSeed)
Utils.resetRandomGenerator(System.currentTimeMillis());
@ -465,8 +468,6 @@ public class GenomeAnalysisEngine {
return this.threadAllocation == null ? 1 : threadAllocation.getTotalNumThreads();
}
/**
* Allow subclasses and others within this package direct access to the walker manager.
* @return The walker manager used by this package.
@ -556,6 +557,17 @@ public class GenomeAnalysisEngine {
checkForDuplicateSamFiles();
}
/**
* Check that active region walkers do not use the downsampling to coverage argument
*
* @throws UserException if an active region walker is using the -dcov or --downsample_to_coverage downsampling arguments
*/
private void checkDownSamplingToCoverage() {
if (argCollection.downsampleCoverage != null && walker instanceof ActiveRegionWalker) {
throw new UserException.CommandLineException("Cannot use -dcov or --downsample_to_coverage for ActiveRegionWalkers, use another downsampling argument");
}
}
/**
* Checks whether there are SAM files that appear multiple times in the fully unpacked list of
* SAM files (samReaderIDs). If there are, throws an ArgumentException listing the files in question.