From fee89e47ffccd57a28019766a3e3a0ddff77b6c6 Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Tue, 4 Oct 2011 06:50:54 -0700 Subject: [PATCH] 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. --- .../sting/gatk/iterators/LocusIteratorByState.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/iterators/LocusIteratorByState.java b/public/java/src/org/broadinstitute/sting/gatk/iterators/LocusIteratorByState.java index d16502b1d..896d6e3a2 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/iterators/LocusIteratorByState.java +++ b/public/java/src/org/broadinstitute/sting/gatk/iterators/LocusIteratorByState.java @@ -280,7 +280,9 @@ public class LocusIteratorByState extends LocusIterator { this.samples = new ArrayList(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"); }