浏览代码

corrected most bugs !

nicolas-zimmermann 5 年前
父节点
当前提交
62a46d113f
共有 1 个文件被更改,包括 28 次插入0 次删除
  1. 28 0
      debruijn/debruijn.py

+ 28 - 0
debruijn/debruijn.py 查看文件

@@ -2,6 +2,7 @@
2 2
 Small assembly module based on de bruijn graphs
3 3
 """
4 4
 import os
5
+import sys
5 6
 import statistics
6 7
 import networkx as nx
7 8
 from networkx import algorithms
@@ -259,6 +260,11 @@ def solve_bubble(graph, ancestor_node, descendent_node):
259 260
         graph, nx.DiGraph: the same graph without the bubble
260 261
     """
261 262
     paths = algorithms.all_simple_paths(graph, ancestor_node, descendent_node)
263
+    paths2= []
264
+    for p in paths:
265
+        paths2.append(p)
266
+
267
+    paths = paths2
262 268
 
263 269
     weights = []
264 270
     path_lens = []
@@ -294,3 +300,25 @@ def solve_entry_tips():
294 300
 
295 301
 def solve_out_tips():
296 302
     pass
303
+
304
+def main():
305
+    fichier = str(sys.argv[1])
306
+    k-size = int(sys.argv[2])
307
+    hash_table = build_kmer_dict(fichier, k-size)
308
+    G = build_graph(hash_table)
309
+    
310
+    nb = 0
311
+    for n in G:
312
+        if G.in_degree(n) > 1:
313
+            nb += 1
314
+    
315
+    print("il y a {} bulles dans le graphe\n".format(nb))
316
+    
317
+    simplify_bubbles(G)
318
+    
319
+    nb = 0
320
+    for n in G:
321
+        if G.in_degree(n) > 1:
322
+            nb += 1
323
+
324
+    print("il y a {} bulles dans le graphe\n".format(nb))