Changing HardClipper contract to allow UNMAPPED reads
shifted the contract to functions that operate on reference based coordinates. The clipper should do the right thing with unmapped reads, but it needs more testing (Ryan is using it at the moment and says it works). Will write some unit tests.
This commit is contained in:
parent
598a21d01c
commit
62a2e335bc
|
|
@ -247,7 +247,7 @@ public class ClippingOp {
|
|||
return newCigar;
|
||||
}
|
||||
|
||||
@Requires({"start <= stop", "start == 0 || stop == read.getReadLength() - 1", "!read.getReadUnmappedFlag()"})
|
||||
@Requires({"start <= stop", "start == 0 || stop == read.getReadLength() - 1"})
|
||||
private GATKSAMRecord hardClip (GATKSAMRecord read, int start, int stop) {
|
||||
if (start == 0 && stop == read.getReadLength() - 1)
|
||||
return new GATKSAMRecord(read.getHeader());
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public class ReadClipper {
|
|||
return hardClipByReferenceCoordinates(refStart, -1);
|
||||
}
|
||||
|
||||
@Requires("!read.getReadUnmappedFlag()")
|
||||
protected GATKSAMRecord hardClipByReferenceCoordinates(int refStart, int refStop) {
|
||||
int start = (refStart < 0) ? 0 : ReadUtils.getReadCoordinateForReferenceCoordinate(read, refStart, ReadUtils.ClippingTail.RIGHT_TAIL);
|
||||
int stop = (refStop < 0) ? read.getReadLength() - 1 : ReadUtils.getReadCoordinateForReferenceCoordinate(read, refStop, ReadUtils.ClippingTail.LEFT_TAIL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue