Fixing PairHMMIndelErrorModel boundary issue
When checking the limits of a read to clip, it wasn't considering reads that may already been clipped before.
This commit is contained in:
parent
dd571d9aa0
commit
f603d4c48c
|
|
@ -198,21 +198,19 @@ public class PairHMMIndelErrorModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
final int refWindowStart = ref.getWindow().getStart();
|
||||||
|
final int refWindowStop = ref.getWindow().getStop();
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
System.out.format("Read Name:%s, aln start:%d aln stop:%d orig cigar:%s\n",p.getRead().getReadName(), p.getRead().getAlignmentStart(), p.getRead().getAlignmentEnd(), p.getRead().getCigarString());
|
System.out.format("Read Name:%s, aln start:%d aln stop:%d orig cigar:%s\n",p.getRead().getReadName(), p.getRead().getAlignmentStart(), p.getRead().getAlignmentEnd(), p.getRead().getCigarString());
|
||||||
}
|
}
|
||||||
|
|
||||||
GATKSAMRecord read = ReadClipper.hardClipAdaptorSequence(p.getRead());
|
GATKSAMRecord read = ReadClipper.hardClipAdaptorSequence(p.getRead());
|
||||||
|
|
||||||
if (read.isEmpty())
|
if (!read.isEmpty() && (read.getSoftEnd() > refWindowStop && read.getSoftStart() < refWindowStop))
|
||||||
continue;
|
|
||||||
|
|
||||||
if (read.getSoftEnd() > ref.getWindow().getStop())
|
|
||||||
read = ReadClipper.hardClipByReferenceCoordinatesRightTail(read, ref.getWindow().getStop());
|
read = ReadClipper.hardClipByReferenceCoordinatesRightTail(read, ref.getWindow().getStop());
|
||||||
|
|
||||||
if (read.isEmpty())
|
if (!read.isEmpty() && (read.getSoftStart() < refWindowStart && read.getSoftEnd() > refWindowStart))
|
||||||
continue;
|
|
||||||
|
|
||||||
if (read.getSoftStart() < ref.getWindow().getStart())
|
|
||||||
read = ReadClipper.hardClipByReferenceCoordinatesLeftTail (read, ref.getWindow().getStart());
|
read = ReadClipper.hardClipByReferenceCoordinatesLeftTail (read, ref.getWindow().getStart());
|
||||||
|
|
||||||
if (read.isEmpty())
|
if (read.isEmpty())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue