clipping both ends of the reads was modifying the original read

This goes against the ReadClipper contract, and was affecting the second part of the read that spans over multiple intervals. Fixed.
This commit is contained in:
Mauricio Carneiro 2011-09-28 12:10:47 -04:00
parent 1b45f21774
commit 5c9b659c02
1 changed files with 3 additions and 2 deletions

View File

@ -93,8 +93,9 @@ public class ReadClipper {
public SAMRecord hardClipBothEndsByReferenceCoordinates(int left, int right) {
if (left == right)
return new SAMRecord(read.getHeader());
this.read = hardClipByReferenceCoordinates(right, -1);
return hardClipByReferenceCoordinates(-1, left);
SAMRecord leftTailRead = hardClipByReferenceCoordinates(right, -1);
ReadClipper clipper = new ReadClipper(leftTailRead);
return clipper.hardClipByReferenceCoordinatesLeftTail(left);
}
public SAMRecord hardClipLowQualEnds(byte lowQual) {