private bool ReadsDoNotOverlap(BamAlignment read1, BamAlignment read2) { var overlaps = read1.OverlapsAlignment(read2); if (overlaps) { return(false); } if (_treatHalfAnchoredAsUnanchored) { return(true); } // Check for S/M overlap, if half-anchoring is allowed var read1ContainsUnanchoredRead2 = AnchoredRegionContainsUnanchoredEnds(read1, read2); var read2ContainsUnanchoredRead1 = AnchoredRegionContainsUnanchoredEnds(read2, read1); return(!(read1ContainsUnanchoredRead2 || read2ContainsUnanchoredRead1)); }