Only throws an error when there are no samples but there are reads

-- Handles the case when you are running a ROD traversal and yet the LIBS is still used to return null everywhere.
This commit is contained in:
Mark DePristo 2011-10-04 06:50:54 -07:00
parent f552aede42
commit fee89e47ff
1 changed files with 3 additions and 1 deletions

View File

@ -280,7 +280,9 @@ public class LocusIteratorByState extends LocusIterator {
this.samples = new ArrayList<String>(samples);
this.readStates = new ReadStateManager(samIterator,readInformation.getDownsamplingMethod());
if ( this.samples.isEmpty() )
// currently the GATK expects this LocusIteratorByState to accept empty sample lists, when
// there's no read data. So we need to throw this error only when samIterator.hasNext() is true
if ( this.samples.isEmpty() && samIterator.hasNext() )
throw new IllegalArgumentException("samples list must not be empty");
}