/** * Returns the reads clipped at their anchors. * * @param reads target reads. * @return never {@code null}. */ protected Map<GATKSAMRecord, GATKSAMRecord> anchorClippedReads(final HaplotypeGraph haplotypeGraph, final List<GATKSAMRecord> reads) { final Map<GATKSAMRecord, GATKSAMRecord> result = new HashMap<>(reads.size()); for (final GATKSAMRecord r : reads) { final ReadAnchoring anchoring = new ReadAnchoring(r,haplotypeGraph); if (anchoring.isAnchoredSomewhere()) continue; final int start = anchoring.leftAnchorIndex; final int end = anchoring.rightAnchorIndex + haplotypeGraph.getKmerSize(); final GATKSAMRecord clipped = new ClippedGATKSAMRecord(r, start, end); result.put(r, clipped); } return result; }