corrected most bugs !
parent
e6337ad43e
commit
62a46d113f
|
|
@ -2,6 +2,7 @@
|
||||||
Small assembly module based on de bruijn graphs
|
Small assembly module based on de bruijn graphs
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import statistics
|
import statistics
|
||||||
import networkx as nx
|
import networkx as nx
|
||||||
from networkx import algorithms
|
from networkx import algorithms
|
||||||
|
|
@ -259,6 +260,11 @@ def solve_bubble(graph, ancestor_node, descendent_node):
|
||||||
graph, nx.DiGraph: the same graph without the bubble
|
graph, nx.DiGraph: the same graph without the bubble
|
||||||
"""
|
"""
|
||||||
paths = algorithms.all_simple_paths(graph, ancestor_node, descendent_node)
|
paths = algorithms.all_simple_paths(graph, ancestor_node, descendent_node)
|
||||||
|
paths2= []
|
||||||
|
for p in paths:
|
||||||
|
paths2.append(p)
|
||||||
|
|
||||||
|
paths = paths2
|
||||||
|
|
||||||
weights = []
|
weights = []
|
||||||
path_lens = []
|
path_lens = []
|
||||||
|
|
@ -294,3 +300,25 @@ def solve_entry_tips():
|
||||||
|
|
||||||
def solve_out_tips():
|
def solve_out_tips():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def main():
|
||||||
|
fichier = str(sys.argv[1])
|
||||||
|
k-size = int(sys.argv[2])
|
||||||
|
hash_table = build_kmer_dict(fichier, k-size)
|
||||||
|
G = build_graph(hash_table)
|
||||||
|
|
||||||
|
nb = 0
|
||||||
|
for n in G:
|
||||||
|
if G.in_degree(n) > 1:
|
||||||
|
nb += 1
|
||||||
|
|
||||||
|
print("il y a {} bulles dans le graphe\n".format(nb))
|
||||||
|
|
||||||
|
simplify_bubbles(G)
|
||||||
|
|
||||||
|
nb = 0
|
||||||
|
for n in G:
|
||||||
|
if G.in_degree(n) > 1:
|
||||||
|
nb += 1
|
||||||
|
|
||||||
|
print("il y a {} bulles dans le graphe\n".format(nb))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue