From ee9a7bf05bc111a236f2c069f102e7fb13bc3ae3 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 28 Feb 2019 08:50:59 +0000 Subject: [PATCH] updated debugging --- vapor/dbg.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vapor/dbg.py b/vapor/dbg.py index c873caa..d271490 100644 --- a/vapor/dbg.py +++ b/vapor/dbg.py @@ -103,7 +103,7 @@ def mask_against_bridge(self, query, bridge, gapl): mask.append(gapl+i) return mask - def extend_bridge(self, kmer, n, direction=1): + def extend_bridge(self, kmer, n, direction, debug=True): """ Walks along the wDBG n positions making heuristic locally optimal decisions @@ -279,8 +279,8 @@ def query(self, kmers, min_kmer_prop, debug=False): for gapl, gapr in gaps: if gapl != 0 and gapr != len(kmers): gapstring = kmers2str(kmers[gapl:gapr])[self.k-1:] - bridge, bridge_scores = self.extend_bridge(kmers[gapl-1], gapr-gapl) - bridge_rev, bridge_scores_rev = self.extend_bridge(kmers[gapr], gapr-gapl, -1) + bridge, bridge_scores = self.extend_bridge(kmers[gapl-1], gapr-gapl, 1, debug) + bridge_rev, bridge_scores_rev = self.extend_bridge(kmers[gapr], gapr-gapl, -1, debug) gapstring_rev = kmers2str(kmers[gapl:gapr])[:-self.k+1] if sum(bridge_scores_rev) > sum(bridge_scores): mask = self.mask_against_bridge(gapstring_rev, bridge_rev, gapl) @@ -291,13 +291,13 @@ def query(self, kmers, min_kmer_prop, debug=False): elif gapr != len(kmers) and gapl == 0: gapstring = kmers2str(kmers[gapl:gapr])[self.k-1:] - bridge, bridge_scores = self.extend_bridge(kmers[gapr], gapr-gapl, -1) + bridge, bridge_scores = self.extend_bridge(kmers[gapr], gapr-gapl, -1, debug) mask = self.mask_against_bridge(gapstring, bridge, gapl) filled_weight_array[gapl:gapr] = bridge_scores elif gapl > 0 and gapr == len(kmers): gapstring = kmers2str(kmers[gapl:gapr])[self.k-1:] - bridge, bridge_scores = self.extend_bridge(kmers[gapl-1], gapr-gapl) + bridge, bridge_scores = self.extend_bridge(kmers[gapl-1], gapr-gapl, 1, debug) mask = self.mask_against_bridge(gapstring, bridge, gapl) filled_weight_array[gapl:gapr] = bridge_scores all_masks += mask