Throw exception for -dcov argument given to ActiveRegionWalkers
This commit is contained in:
parent
b5f20bbb00
commit
2cbaef2fb2
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue