Skip to content

Commit

Permalink
updated debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
asouthgate committed Feb 28, 2019
1 parent e83ba86 commit ee9a7bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vapor/dbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit ee9a7bf

Please sign in to comment.