final, buggy..

master
nzimme 2019-10-24 21:49:58 +02:00
parent 1b9fe1030d
commit 85d52b80ca
1 changed files with 11 additions and 8 deletions

View File

@ -286,15 +286,18 @@ def simplify_bubbles(graph):
graph, nx.DiGraph: a bubble-less de bruijn graph
"""
fork_nodes = []# empty list containing nodes with 2 or more ancestors
f=1
while f == 1:
for node in graph:
if graph.in_degree(node) >= 2: # if 2 or more ancestor add node
pred = [n for n in graph.predecessors(node)]
if len(pred) > 2:
f = 1
else:
f = 0
ancestor = algorithms.lowest_common_ancestor(graph,pred[0], pred[1])
graph = solve_bubble(graph, ancestor, node)
return graph
def solve_entry_tips():