Fix error in command-line validation: don't ever allow intervaled access to unindexed read stream, no

matter what type of traversal it is.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4997 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2011-01-14 02:49:04 +00:00
parent 00310c05bb
commit bfbf75fe3e
1 changed files with 4 additions and 9 deletions

View File

@ -265,18 +265,13 @@ public class GenomeAnalysisEngine {
* @return a new microscheduler * @return a new microscheduler
*/ */
private MicroScheduler createMicroscheduler() { private MicroScheduler createMicroscheduler() {
Walker my_walker = this.walker;
// the mircoscheduler to return
MicroScheduler microScheduler = null;
// Temporarily require all walkers to have a reference, even if that reference is not conceptually necessary. // Temporarily require all walkers to have a reference, even if that reference is not conceptually necessary.
if ((my_walker instanceof ReadWalker || my_walker instanceof DuplicateWalker || my_walker instanceof ReadPairWalker) && if ((walker instanceof ReadWalker || walker instanceof DuplicateWalker || walker instanceof ReadPairWalker) &&
this.getArguments().referenceFile == null) { this.getArguments().referenceFile == null) {
throw new UserException.CommandLineException("Read-based traversals require a reference file but none was given"); throw new UserException.CommandLineException("Read-based traversals require a reference file but none was given");
} }
return MicroScheduler.create(this,my_walker,this.getReadsDataSource(),this.getReferenceDataSource().getReference(),this.getRodDataSources(),this.getArguments().numberOfThreads); return MicroScheduler.create(this,walker,this.getReadsDataSource(),this.getReferenceDataSource().getReference(),this.getRodDataSources(),this.getArguments().numberOfThreads);
} }
protected DownsamplingMethod getDownsamplingMethod() { protected DownsamplingMethod getDownsamplingMethod() {
@ -383,8 +378,8 @@ public class GenomeAnalysisEngine {
if(readsDataSource != null && !readsDataSource.hasIndex() ) { if(readsDataSource != null && !readsDataSource.hasIndex() ) {
if(!exclusions.contains(ValidationExclusion.TYPE.ALLOW_UNINDEXED_BAM)) if(!exclusions.contains(ValidationExclusion.TYPE.ALLOW_UNINDEXED_BAM))
throw new UserException.CommandLineException("The GATK cannot currently process unindexed BAM files without the -U ALLOW_UNINDEXED_BAM"); throw new UserException.CommandLineException("The GATK cannot currently process unindexed BAM files without the -U ALLOW_UNINDEXED_BAM");
if(intervals != null && WalkerManager.getWalkerDataSource(walker) != DataSource.REFERENCE) if(intervals != null)
throw new UserException.CommandLineException("Cannot perform interval processing when walker is not driven by reference and no index is available."); throw new UserException.CommandLineException("Cannot perform interval processing when reads are present but no index is available.");
Shard.ShardType shardType; Shard.ShardType shardType;
if(walker instanceof LocusWalker) { if(walker instanceof LocusWalker) {