diff --git a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index d6d0528ea..10ef3d375 100755 --- a/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -626,8 +626,9 @@ public class GenomeAnalysisEngine { SHARD_SIZE, maxIterations); } } else if (walker instanceof LocusWindowWalker) { - if (intervals == null || intervals.isEmpty()) - throw new StingException("Unable to shard: walker is of type LocusWindow, but no intervals were provided"); + if ((intervals == null || intervals.isEmpty()) && !this.argCollection.unsafe) + Utils.warnUser("walker is of type LocusWindow (which operates over intervals), but no intervals were provided." + + "This may be unintentional, check your command-line arguments."); shardStrategy = ShardStrategyFactory.shatter(ShardStrategyFactory.SHATTER_STRATEGY.INTERVAL, drivingDataSource.getSequenceDictionary(), SHARD_SIZE, diff --git a/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategy.java b/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategy.java index 1cc1eb34d..51d18f728 100755 --- a/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategy.java +++ b/java/src/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategy.java @@ -57,7 +57,7 @@ public class IntervalShardStrategy implements ShardStrategy { * @param size the next recommended shard size. */ public void adjustNextShardSize( long size ) { - this.size = size; + this.size = size; // we don't do anything with the size in this case, but we should store it anyway } /** @@ -67,26 +67,11 @@ public class IntervalShardStrategy implements ShardStrategy { * @param locations */ IntervalShardStrategy( long size, GenomeLocSortedSet locations, Shard.ShardType shardType ) { - if (locations == null || locations.isEmpty()) { - throw new StingException("IntervalShardStrategy: genomic regions list is empty."); - } type = shardType; - this.regions = locations.clone(); + this.regions = locations == null ? new GenomeLocSortedSet() : locations.clone(); this.size = size; } - /** - * the default constructor - * - * @param dict the sequence dictionary to use - */ - IntervalShardStrategy( SAMSequenceDictionary dict, GenomeLocSortedSet locations ) { - if (locations == null || locations.isEmpty()) { - throw new StingException("IntervalShardStrategy: genomic regions list is empty."); - } - this.regions = locations.clone(); - } - /** * returns true if there are additional shards * diff --git a/java/test/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategyTest.java b/java/test/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategyTest.java index cca28ad85..e94a4d908 100755 --- a/java/test/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategyTest.java +++ b/java/test/org/broadinstitute/sting/gatk/datasources/shards/IntervalShardStrategyTest.java @@ -65,8 +65,8 @@ public class IntervalShardStrategyTest extends BaseTest { mSortedSet = new GenomeLocSortedSet(); } - @Test(expected = StingException.class) - public void testExceptionOnEmpty() { + @Test + public void testNoExceptionOnEmpty() { IntervalShardStrategy strat = new IntervalShardStrategy(100, mSortedSet,Shard.ShardType.LOCUS_INTERVAL); }