It wouldn't harm integrationtests if we had our logic right... :-)

This commit is contained in:
Mauricio Carneiro 2011-11-10 14:03:22 -05:00
parent bb4cd59475
commit 060c7ce8ae
1 changed files with 9 additions and 3 deletions

View File

@ -129,8 +129,14 @@ public class MalformedReadFilter extends ReadFilter {
* @return true if they have the same number. False otherwise.
*/
private static boolean checkMismatchingBasesAndQuals(SAMRecord read, boolean filterMismatchingBaseAndQuals) {
if (!filterMismatchingBaseAndQuals)
throw new UserException.MalformedBAM(read, "BAM file has a read with mismatching number of bases and base qualities. Offender: " + read.getReadName() +" [" + read.getReadLength() + " bases] [" +read.getBaseQualities().length +"] quals");
return (read.getReadLength() == read.getBaseQualities().length);
boolean result;
if (read.getReadLength() == read.getBaseQualities().length)
result = true;
else if (filterMismatchingBaseAndQuals)
result = false;
else
throw new UserException.MalformedBAM(read, String.format("BAM file has a read with mismatching number of bases and base qualities. Offender: %s [%d bases] [%d quals]", read.getReadName(), read.getReadLength(), read.getBaseQualities().length));
return result;
}
}