From d580c235321b46cc3b5c0a73ebdf2eb3ba5d4f70 Mon Sep 17 00:00:00 2001 From: "Brian P. Walenz" Date: Thu, 25 Jan 2018 00:36:25 -0500 Subject: [PATCH] Compute how much of the read-to-be-placed is actually covered by overlaps, not just the extent of the overlaps. --- src/bogart/AS_BAT_PlaceReadUsingOverlaps.C | 62 ++++++++++++++++++++-- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/src/bogart/AS_BAT_PlaceReadUsingOverlaps.C b/src/bogart/AS_BAT_PlaceReadUsingOverlaps.C index 1584c692a..088196c19 100644 --- a/src/bogart/AS_BAT_PlaceReadUsingOverlaps.C +++ b/src/bogart/AS_BAT_PlaceReadUsingOverlaps.C @@ -279,9 +279,9 @@ placeRead_assignPlacementsToCluster(uint32 bgn, uint32 end, void placeRead_findFirstLastOverlapping(overlapPlacement &op, - Unitig *tig, uint32 os, uint32 oe, - overlapPlacement *ovlPlace) { + overlapPlacement *ovlPlace, + Unitig *tig) { op.tigFidx = UINT32_MAX; op.tigLidx = 0; @@ -465,6 +465,59 @@ placeRead_computePlacement(overlapPlacement &op, +// Compute how much of the read is covered by overlaps to the contig. +// +// There's a bit of dead code in placeRead_computePlacement() above, that computes this coverage +// using the extent of overlaps, but ignoring any gaps in coverage in the middle. +// +void +placeRead_computeCoverage(overlapPlacement &op, + uint32 os, + uint32 oe, + overlapPlacement *ovlPlace, + Unitig *tig) { + intervalList readCov; + + // Recompute op.covered, for no good reason except that the computation above should be removed. + + op.covered.bgn = INT32_MAX; // Covered interval is always in + op.covered.end = INT32_MIN; // forward read coordinates + + for (uint32 oo=os; ooreadLength(op.frgID); + int32 bCov = 0; + + for (uint32 ii=0; ii