Commit d200f04f by MARIJON Pierre

update to networkx 2.0

parent 82d70025
......@@ -22,14 +22,14 @@ def read_gfa(filename):
gfaparser = csv.reader(gfafile, delimiter="\t")
for row in gfaparser:
if row[0] == "S":
G.add_node(correct_name(row[1]), {"color": "#000000FF"})
G.add_node(correct_name(row[1]), color="#000000FF")
elif row[0] == "L":
if not G.has_node(row[1]):
G.add_node(correct_name(row[1]), {"color": "#000000FF"})
G.add_node(correct_name(row[1]), color="#000000FF")
if not G.has_node(row[3]):
G.add_node(correct_name(row[3]), {"color": "#000000FF"})
G.add_node(correct_name(row[3]), color="#000000FF")
G.add_edge(correct_name(row[1]), correct_name(row[3]), {"nothing": "empty"})
G.add_edge(correct_name(row[1]), correct_name(row[3]), nothing="empty")
return G
......@@ -135,7 +135,7 @@ def main(first_gfa: "A gfa file",
connected_components = [c for c in nx.connected_components(first_graph)]
color_map = color_map_gene(len(connected_components))
if canu_tig_file != "":
read2info, _ = read_contig_layout(canu_tig_file)
id2name = parse_canu_read_name(read_name, True)
......@@ -159,7 +159,7 @@ def main(first_gfa: "A gfa file",
out_csv_writer = csv.writer(outfile, delimiter=",")
out_csv_writer.writerow(["Node name", "color"])
for node in composed_graph.nodes_iter():
for node in composed_graph.nodes():
out_csv_writer.writerow([node, composed_graph.node[node]["color"]])
if canu_tig_file != "" and (node in id2name or canu_mode):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment