Merged bug fix from Stable into Unstable
This commit is contained in:
commit
abb168e1ba
|
|
@ -261,6 +261,13 @@ public class ReduceReads extends ReadWalker<LinkedList<GATKSAMRecord>, ReduceRea
|
||||||
read.setTemporaryAttribute(GATKSAMRecord.REDUCED_READ_ORIGINAL_ALIGNMENT_START_SHIFT, read.getAlignmentStart());
|
read.setTemporaryAttribute(GATKSAMRecord.REDUCED_READ_ORIGINAL_ALIGNMENT_START_SHIFT, read.getAlignmentStart());
|
||||||
read.setTemporaryAttribute(GATKSAMRecord.REDUCED_READ_ORIGINAL_ALIGNMENT_END_SHIFT, read.getAlignmentEnd());
|
read.setTemporaryAttribute(GATKSAMRecord.REDUCED_READ_ORIGINAL_ALIGNMENT_END_SHIFT, read.getAlignmentEnd());
|
||||||
|
|
||||||
|
// Check if the read goes beyond the boundaries of the chromosome, and hard clip those boundaries.
|
||||||
|
int chromosomeLength = ref.getGenomeLocParser().getContigInfo(read.getReferenceName()).getSequenceLength();
|
||||||
|
if (read.getSoftStart() < 0)
|
||||||
|
read = ReadClipper.hardClipByReadCoordinates(read, 0, -read.getSoftStart() - 1);
|
||||||
|
if (read.getSoftEnd() > chromosomeLength)
|
||||||
|
read = ReadClipper.hardClipByReadCoordinates(read, chromosomeLength - read.getSoftStart() + 1, read.getReadLength() - 1);
|
||||||
|
|
||||||
if (!DONT_SIMPLIFY_READS)
|
if (!DONT_SIMPLIFY_READS)
|
||||||
read.simplify(); // Clear all unnecessary attributes
|
read.simplify(); // Clear all unnecessary attributes
|
||||||
if (!DONT_CLIP_ADAPTOR_SEQUENCES)
|
if (!DONT_CLIP_ADAPTOR_SEQUENCES)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue