-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtask_1d.py
More file actions
30 lines (25 loc) · 827 Bytes
/
Copy pathtask_1d.py
File metadata and controls
30 lines (25 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import networkx as nx
from utils.graph_utils import (
transform,
wbmg_from_network,
print_graph_diff,
)
from utils.tree_utils import create_gene_tree_n_leaves
from utils.bic_cherry import restricted_bic_cherry_extension
def generated_examples_test():
species = 2
leaves = 10
species_tree_age = 1
for i in range(10):
tree = create_gene_tree_n_leaves(leaves, species, species_tree_age).gene_tree
network = transform(tree, 10)
wbmg = wbmg_from_network(network)
network2 = restricted_bic_cherry_extension(wbmg)
wbmg2 = wbmg_from_network(network2)
if nx.is_isomorphic(wbmg, wbmg2):
print("success")
else:
print("fail")
print_graph_diff(wbmg, wbmg2)
# some fails, some successes...
generated_examples_test()