Allowing empty samples list in LIBS

-- Right now we cannot process BAM files without read groups because we enforce the samples list to not be empty when there's a SAM record.  Now if there are reads and there are no samples we add the "null" sample so that LIBS walks the reads properly
This commit is contained in:
Mark DePristo 2011-10-05 21:26:21 -07:00
parent a3c5a31686
commit 8e6845806a
1 changed files with 6 additions and 2 deletions

View File

@ -282,8 +282,12 @@ public class LocusIteratorByState extends LocusIterator {
// 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");
if ( this.samples.isEmpty() && samIterator.hasNext() ) {
// actually we cannot process BAMs without read groups unless we tolerate empty
// sample lists. In the empty case we need to add the null element to the samples
this.samples.add(null);
//throw new IllegalArgumentException("samples list must not be empty");
}
}
/**