Bug fix: fully clipping GATKSAMRecords and flushing ops

Reads that are emptied after clipping become new GATKSAMRecords.
When applying ClippingOps, the ops are cleared after the clipping
This commit is contained in:
Roger Zurawicki 2011-11-18 00:19:59 -05:00
parent 68b2a0968c
commit f48d4cfa79
1 changed files with 4 additions and 1 deletions

View File

@ -121,7 +121,7 @@ public class ReadClipper {
public GATKSAMRecord hardClipSoftClippedBases () {
if (read.isEmpty())
return read;
return new GATKSAMRecord(read.getHeader());
int readIndex = 0;
int cutLeft = -1; // first position to hard clip (inclusive)
@ -171,6 +171,9 @@ public class ReadClipper {
clippedRead = op.apply(algorithm, clippedRead);
}
wasClipped = true;
ops.clear();
if ( clippedRead.isEmpty() )
return new GATKSAMRecord( clippedRead.getHeader() );
return clippedRead;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e); // this should never happen