nzimme 5 years ago
parent
commit
1b9fe1030d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      debruijn/debruijn.py

+ 4 - 2
debruijn/debruijn.py View File

286
         graph, nx.DiGraph: a bubble-less de bruijn graph
286
         graph, nx.DiGraph: a bubble-less de bruijn graph
287
     """
287
     """
288
     fork_nodes = []# empty list containing nodes with 2 or more ancestors
288
     fork_nodes = []# empty list containing nodes with 2 or more ancestors
289
+
289
     for node in graph:
290
     for node in graph:
290
-        while graph.in_degree(node) >= 2: # if 2 or more ancestor add node
291
+        if graph.in_degree(node) >= 2: # if 2 or more ancestor add node
291
             pred = [n for n in graph.predecessors(node)] 
292
             pred = [n for n in graph.predecessors(node)] 
292
             ancestor = algorithms.lowest_common_ancestor(graph,pred[0], pred[1])
293
             ancestor = algorithms.lowest_common_ancestor(graph,pred[0], pred[1])
293
             graph = solve_bubble(graph, ancestor, node)
294
             graph = solve_bubble(graph, ancestor, node)
294
 
295
 
296
+
297
+
295
     return graph
298
     return graph
296
 
299
 
297
 def solve_entry_tips():
300
 def solve_entry_tips():
302
     pass
305
     pass
303
 
306
 
304
 def main():
307
 def main():
305
-    print(sys.argv[1])
306
     fichier = str(sys.argv[1])
308
     fichier = str(sys.argv[1])
307
     k = int(sys.argv[2])
309
     k = int(sys.argv[2])
308
     hash_table = build_kmer_dict(fichier, k)
310
     hash_table = build_kmer_dict(fichier, k)