Skip to content
Snippets Groups Projects
Commit 9940134b authored by Großhauser's avatar Großhauser
Browse files

big_tree_analysis

parent fa7b3d36
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,8 @@ def parse_ghost(ghost_string): ...@@ -128,6 +128,8 @@ def parse_ghost(ghost_string):
) )
return ghost_string return ghost_string
def gather_big_tree_info(superfolder): def gather_big_tree_info(superfolder):
for orig_tree_path in glob.glob(superfolder+"/**/*.orig_tree",recursive=True): for orig_tree_path in glob.glob(superfolder+"/**/*.orig_tree",recursive=True):
orig_tree = Tree(orig_tree_path) orig_tree = Tree(orig_tree_path)
...@@ -148,7 +150,6 @@ def gather_big_tree_info(superfolder): ...@@ -148,7 +150,6 @@ def gather_big_tree_info(superfolder):
ghost_newick = f.readline() ghost_newick = f.readline()
ghost_tree = Tree(parse_ghost(ghost_newick)) ghost_tree = Tree(parse_ghost(ghost_newick))
with open(mp_path,"r") as f: with open(mp_path,"r") as f:
mp_newick = f.readline() mp_newick = f.readline()
...@@ -168,6 +169,27 @@ def gather_big_tree_info(superfolder): ...@@ -168,6 +169,27 @@ def gather_big_tree_info(superfolder):
wag_rf = tree_rf_distance(orig_tree,wag_tree,size=size) wag_rf = tree_rf_distance(orig_tree,wag_tree,size=size)
modelfinder_rf = tree_rf_distance(orig_tree,modelfinder_tree,size=size) modelfinder_rf = tree_rf_distance(orig_tree,modelfinder_tree,size=size)
ghost_rf = tree_rf_distance(orig_tree,ghost_tree,size=size) ghost_rf = tree_rf_distance(orig_tree,ghost_tree,size=size)
parent_path = str(Path(orig_tree_path).parents[0])
dnn1_tree_path = glob.glob(parent_path+"/*dnn1*/qmc_tree.pickle")[0]
dnn2_tree_path = glob.glob(parent_path+"/*dnn2*/qmc_tree.pickle")[0]
dnn3_tree_path = glob.glob(parent_path+"/*dnn3*/qmc_tree.pickle")[0]
dnn1_correct_quartet_path = glob.glob(parent_path+"/*dnn1*/correct_proportion.pickle")[0]
dnn2_correct_quartet_path = glob.glob(parent_path+"/*dnn2*/correct_proportion.pickle")[0]
dnn3_correct_quartet_path = glob.glob(parent_path+"/*dnn3*/correct_proportion.pickle")[0]
dnn1_tree_rf_path = glob.glob(parent_path+"/*dnn1*/qmc_rf.pickle")[0]
dnn2_tree_rf_path = glob.glob(parent_path+"/*dnn2*/qmc_rf.pickle")[0]
dnn3_tree_rf_path = glob.glob(parent_path+"/*dnn3*/qmc_rf.pickle")[0]
dnn1_tree_quartet_path = glob.glob(parent_path+"/*dnn1*/quartets.tree.quartet_score")[0]
dnn2_tree_quartet_path = glob.glob(parent_path+"/*dnn2*/quartets.tree.quartet_score")[0]
dnn3_tree_quartet_path = glob.glob(parent_path+"/*dnn3*/quartets.tree.quartet_score")[0]
result_dict["mp_tree"]=mp_tree result_dict["mp_tree"]=mp_tree
...@@ -185,6 +207,29 @@ def gather_big_tree_info(superfolder): ...@@ -185,6 +207,29 @@ def gather_big_tree_info(superfolder):
result_dict["wag_rf"] = wag_rf result_dict["wag_rf"] = wag_rf
result_dict["modelfinder_rf"] = modelfinder_rf result_dict["modelfinder_rf"] = modelfinder_rf
result_dict["ghost_rf"] = ghost_rf result_dict["ghost_rf"] = ghost_rf
result_dict["dnn1_tree"] = pickle.load( open( dnn1_tree_path, "rb" ) )
result_dict["dnn2_tree"] = pickle.load( open( dnn2_tree_path, "rb" ) )
result_dict["dnn3_tree"] = pickle.load( open( dnn3_tree_path, "rb" ) )
result_dict["dnn1_correct_quartet"] = pickle.load( open( dnn1_correct_quartet_path, "rb" ) )
result_dict["dnn2_correct_quartet"] = pickle.load( open( dnn2_correct_quartet_path, "rb" ) )
result_dict["dnn3_correct_quartet"] = pickle.load( open( dnn3_correct_quartet_path, "rb" ) )
with open(dnn1_tree_quartet_path,"r") as f:
result_dict["dnn1_tree_quartet_accuracy"] = float(f.readline())
with open(dnn2_tree_quartet_path,"r") as f:
result_dict["dnn2_tree_quartet_accuracy"] = float(f.readline())
with open(dnn3_tree_quartet_path,"r") as f:
result_dict["dnn3_tree_quartet_accuracy"] = float(f.readline())
result_dict["dnn1_rf"] = pickle.load( open( dnn1_tree_rf_path, "rb" ) )
result_dict["dnn2_rf"] = pickle.load( open( dnn2_tree_rf_path, "rb" ) )
result_dict["dnn3_rf"] = pickle.load( open( dnn3_tree_rf_path, "rb" ) )
with open(orig_tree_path.replace("orig_tree","big_tree_results.pickle"),"wb") as f: with open(orig_tree_path.replace("orig_tree","big_tree_results.pickle"),"wb") as f:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment