Check for well-encoded reads while fixing mis-encoded ones

This commit is contained in:
Eric Banks 2012-12-26 14:30:51 -05:00
parent 64c3a0ff62
commit efceb0d48c
1 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,8 @@ public class MisencodedBaseQualityReadTransformer extends ReadTransformer {
final byte[] quals = read.getBaseQualities();
for ( int i = 0; i < quals.length; i++ ) {
quals[i] -= encodingFixValue;
if ( quals[i] < 0 )
throw new UserException.BadInput("while fixing mis-encoded base qualities we encountered a read that was correctly encoded; we cannot handle such a mixture of reads so unfortunately the BAM must be fixed with some other tool");
}
read.setBaseQualities(quals);
return read;