'''run as executable to process the pb.dmp.nr.trees.184 trees file and save them to save_path''' import ivy import graph_tool.all as gt import NCBIgraph import tree_to_graph import convex_colored_subtrees import string ncbiG, ncbiG_tid2v, ncbiG_name2v = NCBIgraph.load_taxonomy_graph("db.xml") tid2name, name2tid = NCBIgraph.fetch_tid2name_name2tid(ncbiG) ncbiG_v2tid = ncbiG.vertex_properties['taxid'] Eukaryota_tid = name2tid['Eukaryota'] merged_nodes = NCBIgraph.fetch_mergednodes_dict() del_nodes = NCBIgraph.fetch_delnodes() ivy.newick.add_label_chars('/#&-') save_path = '/home/jstevensstein/Desktop/convex_subtrees_3/' f = open("pb.dmp.nr.trees.184") data = open(save_path + "tree_data.txt", "w") i = 0 for line in f: try: i += 1 print i
'''run as executable to load the NCBI hierarchy and associated structures''' import ivy import graph_tool.all as gt import NCBIgraph import tree_to_graph import convex_colored_subtrees ncbiG, ncbiG_tid2v, ncbiG_name2v = NCBIgraph.load_taxonomy_graph("db.xml") tid2name, name2tid = NCBIgraph.fetch_tid2name_name2tid(ncbiG) ncbiG_v2tid = ncbiG.vertex_properties['taxid'] merged_nodes = NCBIgraph.fetch_mergednodes_dict() del_nodes = NCBIgraph.fetch_delnodes()