bella-companion 0.0.45__py3-none-any.whl → 0.0.47__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bella-companion might be problematic. Click here for more details.
- bella_companion/__pycache__/cli.cpython-310.pyc +0 -0
- bella_companion/cli.py +7 -2
- bella_companion/eucovid/run_beast.py +80 -73
- bella_companion/platyrrhine/__pycache__/results.cpython-310.pyc +0 -0
- bella_companion/platyrrhine/__pycache__/run_beast.cpython-310.pyc +0 -0
- bella_companion/platyrrhine/__pycache__/summarize.cpython-310.pyc +0 -0
- bella_companion/platyrrhine/results.py +109 -27
- bella_companion/platyrrhine/run_beast.py +12 -11
- bella_companion/simulations/__pycache__/generate_data.cpython-310.pyc +0 -0
- bella_companion/simulations/__pycache__/generate_figures.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/__pycache__/epi_multitype.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/__pycache__/epi_skyline.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/__pycache__/fbd_2traits.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/__pycache__/fbd_no_traits.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/__pycache__/scenarios.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/__pycache__/utils.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/explain/__pycache__/pdp.cpython-310.pyc +0 -0
- bella_companion/simulations/figures/explain/__pycache__/shap.cpython-310.pyc +0 -0
- bella_companion/simulations/generate_figures.py +0 -9
- bella_companion/simulations/run_beast.py +5 -1
- bella_companion/utils/__pycache__/beast.cpython-310.pyc +0 -0
- {bella_companion-0.0.45.dist-info → bella_companion-0.0.47.dist-info}/METADATA +3 -3
- {bella_companion-0.0.45.dist-info → bella_companion-0.0.47.dist-info}/RECORD +26 -26
- {bella_companion-0.0.45.dist-info → bella_companion-0.0.47.dist-info}/WHEEL +0 -0
- {bella_companion-0.0.45.dist-info → bella_companion-0.0.47.dist-info}/entry_points.txt +0 -0
- {bella_companion-0.0.45.dist-info → bella_companion-0.0.47.dist-info}/top_level.txt +0 -0
|
Binary file
|
bella_companion/cli.py
CHANGED
|
@@ -2,6 +2,7 @@ import argparse
|
|
|
2
2
|
import os
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
|
|
5
|
+
import matplotlib.pyplot as plt
|
|
5
6
|
from dotenv import load_dotenv
|
|
6
7
|
|
|
7
8
|
from bella_companion.eucovid import run_beast as run_eucovid_beast
|
|
@@ -21,12 +22,16 @@ def main():
|
|
|
21
22
|
os.getenv("JAVA_OPTIONS", ""),
|
|
22
23
|
f"-jar {Path(__file__).parent / 'BELLA.jar'}",
|
|
23
24
|
f"-version_file {Path(__file__).parent / 'version.xml'}",
|
|
24
|
-
"-seed 42",
|
|
25
25
|
"-overwrite",
|
|
26
26
|
"-statefile /tmp/state",
|
|
27
|
-
"-DFout /dev/null",
|
|
28
27
|
]
|
|
29
28
|
)
|
|
29
|
+
plt.rcParams["pdf.fonttype"] = 42
|
|
30
|
+
plt.rcParams["xtick.labelsize"] = 14
|
|
31
|
+
plt.rcParams["ytick.labelsize"] = 14
|
|
32
|
+
plt.rcParams["font.size"] = 14
|
|
33
|
+
plt.rcParams["figure.constrained_layout.use"] = True
|
|
34
|
+
plt.rcParams["lines.linewidth"] = 3
|
|
30
35
|
|
|
31
36
|
parser = argparse.ArgumentParser(
|
|
32
37
|
prog="bella",
|
|
@@ -33,79 +33,86 @@ def run_beast():
|
|
|
33
33
|
]
|
|
34
34
|
)
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
" ".join(
|
|
39
|
-
[
|
|
40
|
-
os.environ["BELLA_RUN_BEAST_CMD"],
|
|
41
|
-
f"-D aligned_fasta={msa_file}",
|
|
42
|
-
f"-prefix {output_dir / 'Nonparametric'}{os.sep}",
|
|
43
|
-
str(beast_configs_dir / "Nonparametric.xml"),
|
|
44
|
-
]
|
|
45
|
-
),
|
|
46
|
-
base_log_dir / "Nonparametric",
|
|
47
|
-
cpus=128,
|
|
48
|
-
mem_per_cpu=12000,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
os.makedirs(output_dir / "all-predictors-GLM", exist_ok=True)
|
|
52
|
-
submit_job(
|
|
53
|
-
" ".join(
|
|
54
|
-
[
|
|
55
|
-
os.environ["BELLA_RUN_BEAST_CMD"],
|
|
56
|
-
all_predictors_data,
|
|
57
|
-
f"-prefix {output_dir / 'all-predictors-GLM'}{os.sep}",
|
|
58
|
-
str(beast_configs_dir / "GLM.xml"),
|
|
59
|
-
]
|
|
60
|
-
),
|
|
61
|
-
base_log_dir / "all-predictors-GLM",
|
|
62
|
-
cpus=128,
|
|
63
|
-
mem_per_cpu=12000,
|
|
64
|
-
)
|
|
36
|
+
for seed in range(1, 3):
|
|
37
|
+
run_beast_cmd = [os.environ["BELLA_RUN_BEAST_CMD"], f"-seed {42 + seed}"]
|
|
65
38
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
39
|
+
"""
|
|
40
|
+
os.makedirs(output_dir / "Nonparametric", exist_ok=True)
|
|
41
|
+
submit_job(
|
|
42
|
+
" ".join(
|
|
43
|
+
[
|
|
44
|
+
*run_beast_cmd,
|
|
45
|
+
f"-D aligned_fasta={msa_file}",
|
|
46
|
+
f"-prefix {output_dir / 'Nonparametric'}{os.sep}{seed}-",
|
|
47
|
+
str(beast_configs_dir / "Nonparametric.xml"),
|
|
48
|
+
]
|
|
49
|
+
),
|
|
50
|
+
base_log_dir / "Nonparametric" / str(seed),
|
|
51
|
+
cpus=128,
|
|
52
|
+
mem_per_cpu=12000,
|
|
53
|
+
)
|
|
54
|
+
"""
|
|
80
55
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
56
|
+
os.makedirs(output_dir / "all-predictors-GLM", exist_ok=True)
|
|
57
|
+
submit_job(
|
|
58
|
+
" ".join(
|
|
59
|
+
[
|
|
60
|
+
*run_beast_cmd,
|
|
61
|
+
all_predictors_data,
|
|
62
|
+
f"-prefix {output_dir / 'all-predictors-GLM'}{os.sep}{seed}-",
|
|
63
|
+
str(beast_configs_dir / "GLM.xml"),
|
|
64
|
+
]
|
|
65
|
+
),
|
|
66
|
+
base_log_dir / "all-predictors-GLM" / str(seed),
|
|
67
|
+
cpus=128,
|
|
68
|
+
mem_per_cpu=12000,
|
|
69
|
+
)
|
|
70
|
+
"""
|
|
71
|
+
os.makedirs(output_dir / "flights-GLM", exist_ok=True)
|
|
72
|
+
submit_job(
|
|
73
|
+
" ".join(
|
|
74
|
+
[
|
|
75
|
+
*run_beast_cmd,
|
|
76
|
+
flight_predictor_data,
|
|
77
|
+
f"-prefix {output_dir / 'flights-GLM'}{os.sep}{seed}-",
|
|
78
|
+
str(beast_configs_dir / "GLM.xml"),
|
|
79
|
+
]
|
|
80
|
+
),
|
|
81
|
+
base_log_dir / "flights-GLM" / str(seed),
|
|
82
|
+
cpus=128,
|
|
83
|
+
mem_per_cpu=12000,
|
|
84
|
+
)
|
|
85
|
+
"""
|
|
96
86
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
87
|
+
os.makedirs(output_dir / "all-predictors-MLP", exist_ok=True)
|
|
88
|
+
submit_job(
|
|
89
|
+
" ".join(
|
|
90
|
+
[
|
|
91
|
+
*run_beast_cmd,
|
|
92
|
+
'-D layersRange="0,1,2",nodes="16 8"',
|
|
93
|
+
all_predictors_data,
|
|
94
|
+
f"-prefix {output_dir / 'all-predictors-MLP'}{os.sep}{seed}-",
|
|
95
|
+
str(beast_configs_dir / "MLP.xml"),
|
|
96
|
+
]
|
|
97
|
+
),
|
|
98
|
+
base_log_dir / "all-predictors-MLP" / str(seed),
|
|
99
|
+
cpus=128,
|
|
100
|
+
mem_per_cpu=12000,
|
|
101
|
+
)
|
|
102
|
+
"""
|
|
103
|
+
os.makedirs(output_dir / "flights-MLP", exist_ok=True)
|
|
104
|
+
submit_job(
|
|
105
|
+
" ".join(
|
|
106
|
+
[
|
|
107
|
+
*run_beast_cmd,
|
|
108
|
+
'-D layersRange="0,1,2",nodes="16 8"',
|
|
109
|
+
flight_predictor_data,
|
|
110
|
+
f"-prefix {output_dir / 'flights-MLP'}{os.sep}{seed}-",
|
|
111
|
+
str(beast_configs_dir / "MLP.xml"),
|
|
112
|
+
]
|
|
113
|
+
),
|
|
114
|
+
base_log_dir / "flights-MLP" / str(seed),
|
|
115
|
+
cpus=128,
|
|
116
|
+
mem_per_cpu=12000,
|
|
117
|
+
)
|
|
118
|
+
"""
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,13 +4,71 @@ from pathlib import Path
|
|
|
4
4
|
import matplotlib.pyplot as plt
|
|
5
5
|
import numpy as np
|
|
6
6
|
import polars as pl
|
|
7
|
+
from matplotlib.colors import LinearSegmentedColormap, ListedColormap
|
|
7
8
|
from numpy.typing import NDArray
|
|
8
9
|
from phylogenie import draw_tree, get_node_depths, load_newick, load_nexus
|
|
9
10
|
|
|
11
|
+
DATA_DIR = Path(__file__).parent / "data"
|
|
12
|
+
CHANGE_TIMES = (
|
|
13
|
+
pl.read_csv(DATA_DIR / "change_times.csv", has_header=False).to_series().to_list()
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _plot_marginal_rates(output_dir: Path, trees_file: str | Path):
|
|
18
|
+
trees = load_newick(trees_file)
|
|
19
|
+
all_node_depths = [get_node_depths(tree) for tree in trees]
|
|
20
|
+
max_time = max(max(node_depths.values()) for node_depths in all_node_depths)
|
|
21
|
+
time_bins = np.array(list(reversed([0.0, *CHANGE_TIMES, max_time])))
|
|
22
|
+
for tree in trees:
|
|
23
|
+
for node in tree:
|
|
24
|
+
node["diversificationRateSP"] = node["birthRateSP"] - node["deathRateSP"]
|
|
25
|
+
|
|
26
|
+
for i, rate in enumerate(["birthRateSP", "deathRateSP", "diversificationRateSP"]):
|
|
27
|
+
marginal_rates: list[list[float]] = [[] for _ in range(len(CHANGE_TIMES) + 1)]
|
|
28
|
+
for tree, node_depths in zip(trees, all_node_depths):
|
|
29
|
+
root_age = tree.height
|
|
30
|
+
for node in tree:
|
|
31
|
+
if node.parent is None:
|
|
32
|
+
marginal_rates[0].append(node[rate])
|
|
33
|
+
continue
|
|
34
|
+
parent_age = root_age - node_depths[node.parent] # pyright: ignore
|
|
35
|
+
node_age = root_age - node_depths[node]
|
|
36
|
+
t1 = np.where(time_bins >= parent_age)[0][-1]
|
|
37
|
+
t2 = np.where(time_bins > node_age)[0][-1]
|
|
38
|
+
for t in range(t1, t2 + 1):
|
|
39
|
+
marginal_rates[t].append(node[rate])
|
|
40
|
+
|
|
41
|
+
median = [float(np.median(rates)) for rates in marginal_rates]
|
|
42
|
+
lower = [float(np.percentile(rates, 2.5)) for rates in marginal_rates]
|
|
43
|
+
upper = [float(np.percentile(rates, 97.5)) for rates in marginal_rates]
|
|
44
|
+
plt.step( # pyright: ignore
|
|
45
|
+
time_bins, [median[0], *median], color=f"C{i}", label=type
|
|
46
|
+
)
|
|
47
|
+
plt.fill_between( # pyright: ignore
|
|
48
|
+
time_bins,
|
|
49
|
+
[lower[0], *lower],
|
|
50
|
+
[upper[0], *upper],
|
|
51
|
+
color=f"C{i}",
|
|
52
|
+
alpha=0.2,
|
|
53
|
+
step="pre",
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
plt.gca().invert_xaxis()
|
|
57
|
+
plt.xlabel("Time (mya)") # pyright: ignore
|
|
58
|
+
plt.ylabel( # pyright: ignore
|
|
59
|
+
r"$\lambda$"
|
|
60
|
+
if rate == "birthRateSP"
|
|
61
|
+
else r"$\mu$"
|
|
62
|
+
if rate == "deathRateSP"
|
|
63
|
+
else r"$d$"
|
|
64
|
+
)
|
|
65
|
+
plt.savefig(output_dir / f"marginal-{rate}.svg") # pyright: ignore
|
|
66
|
+
plt.close()
|
|
67
|
+
|
|
10
68
|
|
|
11
69
|
def _plot_tree(output_dir: Path, tree_file: str | Path):
|
|
12
70
|
sample_trees = load_nexus(tree_file)
|
|
13
|
-
trees = [sample_trees[f"STATE_{i*100_000}"] for i in range(11, 101)]
|
|
71
|
+
trees = [sample_trees[f"STATE_{i * 100_000}"] for i in range(11, 101)]
|
|
14
72
|
|
|
15
73
|
for tree in trees:
|
|
16
74
|
for node in tree:
|
|
@@ -21,44 +79,63 @@ def _plot_tree(output_dir: Path, tree_file: str | Path):
|
|
|
21
79
|
for node in avg_tree:
|
|
22
80
|
node.clear()
|
|
23
81
|
for avg_node, nodes in zip(avg_tree, zip(*trees)):
|
|
24
|
-
avg_node
|
|
25
|
-
avg_node
|
|
82
|
+
avg_node["birthRateSP"] = np.mean([n["birthRateSP"] for n in nodes])
|
|
83
|
+
avg_node["deathRateSP"] = np.mean([n["deathRateSP"] for n in nodes])
|
|
84
|
+
avg_node["diversificationRateSP"] = (
|
|
85
|
+
avg_node["birthRateSP"] - avg_node["deathRateSP"]
|
|
86
|
+
)
|
|
87
|
+
avg_node["type"] = int(np.median([int(n["type"]) for n in nodes]))
|
|
26
88
|
|
|
27
89
|
avg_tree.ladderize()
|
|
28
|
-
|
|
90
|
+
cmaps: dict[str, LinearSegmentedColormap] = {
|
|
91
|
+
"birthRateSP": plt.cm.Blues, # pyright: ignore
|
|
92
|
+
"deathRateSP": plt.cm.Oranges, # pyright: ignore
|
|
93
|
+
"diversificationRateSP": plt.cm.Greens, # pyright: ignore
|
|
94
|
+
"type": plt.cm.Purples, # pyright: ignore
|
|
95
|
+
}
|
|
96
|
+
for color_by, cm in cmaps.items():
|
|
29
97
|
ax = plt.gca()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
98
|
+
if color_by == "type":
|
|
99
|
+
cmap = ListedColormap(cm(np.linspace(0.3, 1, 4))) # pyright: ignore
|
|
100
|
+
draw_tree(
|
|
101
|
+
avg_tree,
|
|
102
|
+
ax,
|
|
103
|
+
color_by=color_by,
|
|
104
|
+
legend_kwargs={"title": "Body mass", "loc": "upper left"},
|
|
105
|
+
colormap=cmap,
|
|
106
|
+
)
|
|
107
|
+
else:
|
|
108
|
+
cmap = LinearSegmentedColormap.from_list(
|
|
109
|
+
"cmap",
|
|
110
|
+
cm(np.linspace(0.2, 1, 256)), # pyright: ignore
|
|
111
|
+
)
|
|
112
|
+
draw_tree(
|
|
113
|
+
avg_tree,
|
|
114
|
+
ax,
|
|
115
|
+
color_by=color_by,
|
|
116
|
+
hist_axes_kwargs={
|
|
117
|
+
"loc": "upper left",
|
|
118
|
+
"bbox_to_anchor": (0.06, 0, 1, 1),
|
|
119
|
+
"bbox_transform": ax.transAxes,
|
|
120
|
+
},
|
|
121
|
+
colormap=cmap,
|
|
122
|
+
)
|
|
40
123
|
height = avg_tree.height
|
|
41
124
|
ticks = np.arange(height, 0, -10)
|
|
42
125
|
ax.set_xticks(ticks, [str(round(height - t)) for t in ticks]) # pyright: ignore
|
|
43
|
-
|
|
44
|
-
plt.savefig(output_dir / f"{
|
|
126
|
+
ax.set_xlabel("Time (mya)") # pyright: ignore
|
|
127
|
+
plt.savefig(output_dir / f"{color_by}-tree.svg") # pyright: ignore
|
|
45
128
|
plt.close()
|
|
46
129
|
|
|
47
130
|
|
|
48
131
|
def _plot_predictions(output_dir: Path, log_summary_file: str | Path):
|
|
49
132
|
log_summary = pl.read_csv(log_summary_file)
|
|
50
133
|
|
|
51
|
-
data_dir = Path(__file__).parent / "data"
|
|
52
|
-
change_times = (
|
|
53
|
-
pl.read_csv(data_dir / "change_times.csv", has_header=False)
|
|
54
|
-
.to_series()
|
|
55
|
-
.to_list()
|
|
56
|
-
)
|
|
57
134
|
max_time = max(
|
|
58
135
|
max(get_node_depths(tree).values())
|
|
59
|
-
for tree in load_newick(
|
|
136
|
+
for tree in load_newick(DATA_DIR / "trees.nwk")
|
|
60
137
|
)
|
|
61
|
-
time_bins = list(reversed([0.0, *
|
|
138
|
+
time_bins = list(reversed([0.0, *CHANGE_TIMES, max_time]))
|
|
62
139
|
|
|
63
140
|
gradient = np.linspace(0.4, 0.9, 4)
|
|
64
141
|
colors: dict[str, NDArray[np.floating]] = {
|
|
@@ -73,14 +150,14 @@ def _plot_predictions(output_dir: Path, log_summary_file: str | Path):
|
|
|
73
150
|
[
|
|
74
151
|
pl.col(f"birthRateSPi{i}_{type}_median")
|
|
75
152
|
- pl.col(f"deathRateSPi{i}_{type}_median")
|
|
76
|
-
for i in range(len(
|
|
153
|
+
for i in range(len(CHANGE_TIMES) + 1)
|
|
77
154
|
]
|
|
78
155
|
).to_numpy()
|
|
79
156
|
else:
|
|
80
157
|
estimates = log_summary.select(
|
|
81
158
|
[
|
|
82
159
|
pl.col(f"{rate}i{i}_{type}_median")
|
|
83
|
-
for i in range(len(
|
|
160
|
+
for i in range(len(CHANGE_TIMES) + 1)
|
|
84
161
|
]
|
|
85
162
|
).to_numpy()
|
|
86
163
|
median = np.median(estimates, axis=0)
|
|
@@ -95,8 +172,12 @@ def _plot_predictions(output_dir: Path, log_summary_file: str | Path):
|
|
|
95
172
|
plt.ylabel( # pyright: ignore
|
|
96
173
|
r"$\lambda$"
|
|
97
174
|
if rate == "birthRateSP"
|
|
98
|
-
else r"$\mu$"
|
|
175
|
+
else r"$\mu$"
|
|
176
|
+
if rate == "deathRateSP"
|
|
177
|
+
else r"$d$"
|
|
99
178
|
)
|
|
179
|
+
if rate in ["birthRateSP", "deathRateSP"]:
|
|
180
|
+
plt.ylim(0, 0.4) # pyright: ignore
|
|
100
181
|
plt.savefig(output_dir / f"{rate}-predictions.svg") # pyright: ignore
|
|
101
182
|
plt.close()
|
|
102
183
|
|
|
@@ -107,3 +188,4 @@ def plot_platyrrhine_results():
|
|
|
107
188
|
os.makedirs(output_dir, exist_ok=True)
|
|
108
189
|
_plot_predictions(output_dir, summaries_dir / "MLP.csv")
|
|
109
190
|
_plot_tree(output_dir, summaries_dir / "sample-trees.nexus")
|
|
191
|
+
_plot_marginal_rates(output_dir, summaries_dir / "trees.nwk")
|
|
@@ -39,22 +39,23 @@ def run_beast():
|
|
|
39
39
|
command = " ".join(
|
|
40
40
|
[
|
|
41
41
|
os.environ["BELLA_RUN_BEAST_CMD"],
|
|
42
|
+
"-seed 42",
|
|
42
43
|
f'-D types="{",".join(types)}"',
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
'-D startTypePriorProbs="0.25 0.25 0.25 0.25"',
|
|
45
|
+
"-D birthRateUpper=5",
|
|
46
|
+
"-D deathRateUpper=5",
|
|
47
|
+
'-D samplingChangeTimes="2.58 5.333 23.03"',
|
|
48
|
+
"-D samplingRateUpper=5",
|
|
49
|
+
'-D samplingRateInit="2.5 2.5 2.5 2.5"',
|
|
50
|
+
"-D migrationRateUpper=5",
|
|
51
|
+
'-D migrationRateInit="2.5 0 0 2.5 2.5 0 0 2.5 2.5 0 0 2.5"',
|
|
52
|
+
'-D nodes="16 8"',
|
|
53
|
+
'-D layersRange="0,1,2"',
|
|
53
54
|
f"-D treeFile={tree_file}",
|
|
54
55
|
f"-D treeIndex={i}",
|
|
55
56
|
f"-D changeTimesFile={change_times_file}",
|
|
56
57
|
f"-D traitsFile={traits_file}",
|
|
57
|
-
|
|
58
|
+
"-D traitValueCol=3",
|
|
58
59
|
f"-D processLength={process_length}",
|
|
59
60
|
f'-D timePredictor="{time_predictor}"',
|
|
60
61
|
f'-D log10BMPredictor="{log10BM_predictor}"',
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import matplotlib.pyplot as plt
|
|
2
|
-
|
|
3
1
|
from bella_companion.simulations.figures import (
|
|
4
2
|
plot_epi_multitype_results,
|
|
5
3
|
plot_epi_skyline_results,
|
|
@@ -10,13 +8,6 @@ from bella_companion.simulations.figures import (
|
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
def generate_figures():
|
|
13
|
-
plt.rcParams["pdf.fonttype"] = 42
|
|
14
|
-
plt.rcParams["xtick.labelsize"] = 14
|
|
15
|
-
plt.rcParams["ytick.labelsize"] = 14
|
|
16
|
-
plt.rcParams["font.size"] = 14
|
|
17
|
-
plt.rcParams["figure.constrained_layout.use"] = True
|
|
18
|
-
plt.rcParams["lines.linewidth"] = 3
|
|
19
|
-
|
|
20
11
|
plot_scenarios()
|
|
21
12
|
plot_epi_skyline_results()
|
|
22
13
|
plot_epi_multitype_results()
|
|
@@ -56,7 +56,11 @@ def run_beast():
|
|
|
56
56
|
f"-D lastSampleTime={max(get_node_depths(tree).values())}"
|
|
57
57
|
)
|
|
58
58
|
|
|
59
|
-
base_command = [
|
|
59
|
+
base_command = [
|
|
60
|
+
os.environ["BELLA_RUN_BEAST_CMD"],
|
|
61
|
+
"-seed 42",
|
|
62
|
+
*beast_args,
|
|
63
|
+
]
|
|
60
64
|
if model in ["Nonparametric", "GLM"]:
|
|
61
65
|
command = " ".join(
|
|
62
66
|
[*base_command, str(inference_configs_dir / f"{model}.xml")]
|
|
Binary file
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bella-companion
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.0.47
|
|
4
|
+
Summary: Bayesian Evolutionary Layered Learning Architectures (BELLA) companion
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
Requires-Dist: arviz>=0.22.0
|
|
8
8
|
Requires-Dist: bella-lumiere>=0.0.14
|
|
9
9
|
Requires-Dist: dotenv>=0.9.9
|
|
10
|
-
Requires-Dist: phylogenie>=3.1.
|
|
10
|
+
Requires-Dist: phylogenie>=3.1.4
|
|
11
11
|
Requires-Dist: poetry>=2.2.1
|
|
12
12
|
Requires-Dist: seaborn>=0.13.2
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
bella_companion/BELLA.jar,sha256=4mKDzPfz263rTqA9KS2f4Mc-UWGMuj8G48ZDonKSqVw,67408597
|
|
2
2
|
bella_companion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
bella_companion/cli.py,sha256=
|
|
3
|
+
bella_companion/cli.py,sha256=CrtV2CG6G1nKCCVu02gtNlpHNJHLnFtSaru-LFiHKKc,3014
|
|
4
4
|
bella_companion/version.xml,sha256=Gr3nsYqFhVNP0Mszl_IfilxefsPN8ZpQlGlB8OJSwnE,522
|
|
5
5
|
bella_companion/__pycache__/__init__.cpython-310.pyc,sha256=OWbv3-oQ0uVrCKYMlnplMpvDhv5Ytf3aYb7Eu_UONkU,151
|
|
6
|
-
bella_companion/__pycache__/cli.cpython-310.pyc,sha256
|
|
6
|
+
bella_companion/__pycache__/cli.cpython-310.pyc,sha256=-k34T2uplWxW_fUrSVadFAYEDos-bvonW2RDeyHuj0A,2680
|
|
7
7
|
bella_companion/eucovid/__init__.py,sha256=09Ld_G7fZvCDCgEWsmaOyLVQ8pFc9QHAGnXKJ9Zm2AM,81
|
|
8
|
-
bella_companion/eucovid/run_beast.py,sha256=
|
|
8
|
+
bella_companion/eucovid/run_beast.py,sha256=wsNLqRMfloqTeXuxSUSD2ow15S-a2q1wyMVKdrDI6_E,3911
|
|
9
9
|
bella_companion/eucovid/__pycache__/__init__.cpython-310.pyc,sha256=cwLb8j-Jrl5beRcoZEtbpvQlG9KENPuB2F4fa1RBYIQ,248
|
|
10
10
|
bella_companion/eucovid/__pycache__/run_beast.cpython-310.pyc,sha256=jEqqaPBugV7B8YZQjNIgYnhpCwDOV21xyG1N_IbRdJo,1922
|
|
11
11
|
bella_companion/eucovid/beast_configs/GLM.xml,sha256=b5rAeKVEam3u2AGSJsm7EHB6LcC0l9bp1SyZT2QyjpI,10892
|
|
@@ -29,13 +29,13 @@ bella_companion/eucovid/data/predictors/all/pop_y_7e_ls.tsv,sha256=Ku39Ts0HW9r5l
|
|
|
29
29
|
bella_companion/eucovid/data/predictors/all/sharedborders_7e_nt.tsv,sha256=pPVT5DIaZuc3B0mSs-B3kw3G2zja1LfmL_xLwlNtLDo,280
|
|
30
30
|
bella_companion/platyrrhine/__init__.py,sha256=gySgNPoKaEdhcZppKMsCmS-aAcYw_rDEw0viz72Udaw,259
|
|
31
31
|
bella_companion/platyrrhine/beast_config.xml,sha256=bLzavt-Zd8cmSgQQnlCBfZ9KyM7d1inOGx12VNjPFb4,7056
|
|
32
|
-
bella_companion/platyrrhine/results.py,sha256=
|
|
33
|
-
bella_companion/platyrrhine/run_beast.py,sha256=
|
|
32
|
+
bella_companion/platyrrhine/results.py,sha256=aRx9MkI43f5bhr-16UkShDH-_oMNFzhHxfU2WK1L3BY,7468
|
|
33
|
+
bella_companion/platyrrhine/run_beast.py,sha256=t1gUmn_HEXKqxgGXYCdohGDWeL-QEpW7r3bKXlRfdog,2494
|
|
34
34
|
bella_companion/platyrrhine/summarize.py,sha256=Qc3GE2vUspTqU_QjLdULvK0r7AZ3JTdqsBmd71izt7M,1356
|
|
35
35
|
bella_companion/platyrrhine/__pycache__/__init__.cpython-310.pyc,sha256=_7OOgWWr8apuTVm7TLhvmP41QHTDFlDNjTtJ9J3vpZc,425
|
|
36
|
-
bella_companion/platyrrhine/__pycache__/results.cpython-310.pyc,sha256=
|
|
37
|
-
bella_companion/platyrrhine/__pycache__/run_beast.cpython-310.pyc,sha256=
|
|
38
|
-
bella_companion/platyrrhine/__pycache__/summarize.cpython-310.pyc,sha256=
|
|
36
|
+
bella_companion/platyrrhine/__pycache__/results.cpython-310.pyc,sha256=ytoolBYXSbQHjso0byIJXWwGSE94TeM5ko8L0tOCrTk,6627
|
|
37
|
+
bella_companion/platyrrhine/__pycache__/run_beast.cpython-310.pyc,sha256=Z5nfOPwht1yR_uDJoTt2Zj-ZR_Tr-QeIqGWtZYEBbBQ,2172
|
|
38
|
+
bella_companion/platyrrhine/__pycache__/summarize.cpython-310.pyc,sha256=m9ruJb4uO_az3qn4T8Iq3zPR0LSsFLBjeISn6y5-DXM,1622
|
|
39
39
|
bella_companion/platyrrhine/__pycache__/summarize_logs.cpython-310.pyc,sha256=yKvebBShpNqMoVI2g3VzseuJrMG43A8U8vF7Yg288AE,1616
|
|
40
40
|
bella_companion/platyrrhine/data/change_times.csv,sha256=tedobHbaY7-6M3V6F6HSqGAU9dpeeajR5mu1XGJfp6w,68
|
|
41
41
|
bella_companion/platyrrhine/data/traits.csv,sha256=N_mCnaM9Gy0Qot7-l_mK0vMvr7e_5BZ4bgUHpcoG9UM,3949
|
|
@@ -43,14 +43,14 @@ bella_companion/platyrrhine/data/trees.nwk,sha256=lpSiGUG5s3zE--IKPOyWrJ5vpJb_xA
|
|
|
43
43
|
bella_companion/simulations/__init__.py,sha256=gjO_QB2wp335l7UO-zA9fFQ5vmZauGItBuO-QZFu93E,439
|
|
44
44
|
bella_companion/simulations/features.py,sha256=DZOBpJGlQ0UinqUZYbEtoemZ2eQGVLV_i-DfpW31qJI,104
|
|
45
45
|
bella_companion/simulations/generate_data.py,sha256=edfhXrs76hl30i_xizup4z6qgzXZyaDzX_PVC62Ytpw,849
|
|
46
|
-
bella_companion/simulations/generate_figures.py,sha256=
|
|
46
|
+
bella_companion/simulations/generate_figures.py,sha256=r3zGKnLGDpuVzzWVQIumkt1sTMl_4w1iKnVNy-fTJAg,371
|
|
47
47
|
bella_companion/simulations/metrics.py,sha256=kSX7-B4a-LDm1V--S8CvEJDktlJ8qkpo_gY6V7XbOXw,1930
|
|
48
|
-
bella_companion/simulations/run_beast.py,sha256
|
|
48
|
+
bella_companion/simulations/run_beast.py,sha256=-L5PHkpPK-NGQoXxmeH7LMIWxtodvL4TOo-KkR2ISVQ,3299
|
|
49
49
|
bella_companion/simulations/summarize.py,sha256=hfYpgmv2irD8wNQ-GYtJA324w94SKoYhx0bpDG2bb3w,1207
|
|
50
50
|
bella_companion/simulations/__pycache__/__init__.cpython-310.pyc,sha256=IoVTIDdo1s8l5t8qtw71HwOMnHnc-HrfbapHEuY_ItA,588
|
|
51
51
|
bella_companion/simulations/__pycache__/features.cpython-310.pyc,sha256=lKPxu0fteOgho5ZuC0MNQJssIGZ1L5YP6G6wtdKZhH0,437
|
|
52
|
-
bella_companion/simulations/__pycache__/generate_data.cpython-310.pyc,sha256=
|
|
53
|
-
bella_companion/simulations/__pycache__/generate_figures.cpython-310.pyc,sha256=
|
|
52
|
+
bella_companion/simulations/__pycache__/generate_data.cpython-310.pyc,sha256=02XU0jjLp_OpbdRXHCuESRb7gLIPc6r7ZlgWOt90oTc,1273
|
|
53
|
+
bella_companion/simulations/__pycache__/generate_figures.cpython-310.pyc,sha256=tU90zwDopaeqgz5v7p_uMnVmdZoRqxN84-zsiKu1t-U,560
|
|
54
54
|
bella_companion/simulations/__pycache__/metrics.cpython-310.pyc,sha256=39dzyU2PWUDpR0npJlO-MMha1jTFJ40sDQF9BLhPZRE,2652
|
|
55
55
|
bella_companion/simulations/__pycache__/run_beast.cpython-310.pyc,sha256=ByrndOcAAyCJ8vOCCSsISLPjGRMDzkDCsZAqMge2iAw,2635
|
|
56
56
|
bella_companion/simulations/__pycache__/summarize.cpython-310.pyc,sha256=bIi5Iwro1QlZ5iDtdoG_Ze4mW-2yWHglyeaRWpbUXdI,1340
|
|
@@ -75,18 +75,18 @@ bella_companion/simulations/figures/fbd_no_traits.py,sha256=-_c-qnrFAYZ7vd4Ieeb-
|
|
|
75
75
|
bella_companion/simulations/figures/scenarios.py,sha256=gbMz1TUxxT2RSIq2kQlFioNdgSHk-gQY2OQuf6-7Fww,2817
|
|
76
76
|
bella_companion/simulations/figures/utils.py,sha256=0M5OrxaEuqcj9rR2uAc_O7utQvhEceZGH0sKrGRWaWs,3129
|
|
77
77
|
bella_companion/simulations/figures/__pycache__/__init__.cpython-310.pyc,sha256=hCtbzMhTC_u8-mCqttWA6ZIWKWxEMuqCZRBPcc2UJrg,693
|
|
78
|
-
bella_companion/simulations/figures/__pycache__/epi_multitype.cpython-310.pyc,sha256=
|
|
79
|
-
bella_companion/simulations/figures/__pycache__/epi_skyline.cpython-310.pyc,sha256=
|
|
80
|
-
bella_companion/simulations/figures/__pycache__/fbd_2traits.cpython-310.pyc,sha256=
|
|
81
|
-
bella_companion/simulations/figures/__pycache__/fbd_no_traits.cpython-310.pyc,sha256=
|
|
82
|
-
bella_companion/simulations/figures/__pycache__/scenarios.cpython-310.pyc,sha256=
|
|
83
|
-
bella_companion/simulations/figures/__pycache__/utils.cpython-310.pyc,sha256=
|
|
78
|
+
bella_companion/simulations/figures/__pycache__/epi_multitype.cpython-310.pyc,sha256=67fkvg26_7BBIdGC9W9yw6xe46EXygCVgSkg8pSffOg,2716
|
|
79
|
+
bella_companion/simulations/figures/__pycache__/epi_skyline.cpython-310.pyc,sha256=zFWaeMyNQkynbJGZ--ya9YjviunoL5o8mlnjxxRHuRE,1705
|
|
80
|
+
bella_companion/simulations/figures/__pycache__/fbd_2traits.cpython-310.pyc,sha256=_URcHHm3IbMcDHDf3m_DWrwuhzArIQtESxJttcS71yc,2764
|
|
81
|
+
bella_companion/simulations/figures/__pycache__/fbd_no_traits.cpython-310.pyc,sha256=GUqMEJSVrtei5kAs-OEVwW6ETcY6RLXtYGqK-xue4c0,1781
|
|
82
|
+
bella_companion/simulations/figures/__pycache__/scenarios.cpython-310.pyc,sha256=Dlp6Dg5sMkwA5vScLd1TQH0v_q6k3JLeF8TyB7Oes5Y,2140
|
|
83
|
+
bella_companion/simulations/figures/__pycache__/utils.cpython-310.pyc,sha256=gr5wL9ASi0ZS34_rEeIxKrmE-Aw1nORq-DbEDCLnXfU,3979
|
|
84
84
|
bella_companion/simulations/figures/explain/__init__.py,sha256=DnmVIWO65nTT5VsWnbS7NyYgKEY_eo4oMCtCY_ML2Vk,260
|
|
85
85
|
bella_companion/simulations/figures/explain/pdp.py,sha256=3n3ssgufW_43pn2hO5V5J_jgcJH3Fpb8stIRtTnlQ8w,3801
|
|
86
86
|
bella_companion/simulations/figures/explain/shap.py,sha256=1PkbCgynbW-PXkkRpIcY7JoBYqOxqmu1OEOif_roFY8,2207
|
|
87
87
|
bella_companion/simulations/figures/explain/__pycache__/__init__.cpython-310.pyc,sha256=fTqKAgUlMz5E6IXn_bFMd2H5ZzUkF0RAkhZdmC1BOpg,407
|
|
88
|
-
bella_companion/simulations/figures/explain/__pycache__/pdp.cpython-310.pyc,sha256=
|
|
89
|
-
bella_companion/simulations/figures/explain/__pycache__/shap.cpython-310.pyc,sha256=
|
|
88
|
+
bella_companion/simulations/figures/explain/__pycache__/pdp.cpython-310.pyc,sha256=_Np-khsYmnoISKlyt-5v-A6lTkqdqy5rQMV3VfqH81U,3474
|
|
89
|
+
bella_companion/simulations/figures/explain/__pycache__/shap.cpython-310.pyc,sha256=5IY_KT6WrAKbkbttaUVTBT-NrsuL5TrI6JDpqLubEHU,2756
|
|
90
90
|
bella_companion/simulations/scenarios/__init__.py,sha256=3Kl1lKcFpfb3vLX64DmSW4XCF5kXU1ZoHtstFH-ZIzU,876
|
|
91
91
|
bella_companion/simulations/scenarios/common.py,sha256=_ddaSuTvEVdttGkXB4HPc2B7IB1F_GBOCW3cVOPZ-ZM,807
|
|
92
92
|
bella_companion/simulations/scenarios/epi_multitype.py,sha256=fTkFeGHxyV_1f2nX3g_Oyr_e6wkorhXEicJjIAgeZKA,2439
|
|
@@ -106,11 +106,11 @@ bella_companion/utils/beast.py,sha256=TBa0cLklX1_tXqoQE4LRYvds7mLg_9fS2-6U6OHENH
|
|
|
106
106
|
bella_companion/utils/explain.py,sha256=uP7HPyn2YiykAI69BQV3RooDpC6qKoCLXfp3Uibp4zk,1475
|
|
107
107
|
bella_companion/utils/slurm.py,sha256=xEyf-Jxk8fy71t3fko_Ic9WtUFSdLFE3w4tR17gaBPw,1868
|
|
108
108
|
bella_companion/utils/__pycache__/__init__.cpython-310.pyc,sha256=QKECw9gSF8x3G4oXI06atZpaLDPSxm3k4qJ_-0nADbo,527
|
|
109
|
-
bella_companion/utils/__pycache__/beast.cpython-310.pyc,sha256=
|
|
109
|
+
bella_companion/utils/__pycache__/beast.cpython-310.pyc,sha256=OeIB4XTx6zZnQG1Eikaf-qUfC5ONSGnMeDVbhdIyHSU,2537
|
|
110
110
|
bella_companion/utils/__pycache__/explain.cpython-310.pyc,sha256=K7YHxY520Q0nJtTVa-eEKw3B99MsrO_b-U50X_yihGQ,1819
|
|
111
111
|
bella_companion/utils/__pycache__/slurm.cpython-310.pyc,sha256=kKWmJwCTlotpPuXi4kzXNx2-zY9BXuzjhGi5ZrcN0oI,1785
|
|
112
|
-
bella_companion-0.0.
|
|
113
|
-
bella_companion-0.0.
|
|
114
|
-
bella_companion-0.0.
|
|
115
|
-
bella_companion-0.0.
|
|
116
|
-
bella_companion-0.0.
|
|
112
|
+
bella_companion-0.0.47.dist-info/METADATA,sha256=MMvsZAJNo1nikOwAlFZwYbvITPB-wW2iSRB2sxW7NbY,392
|
|
113
|
+
bella_companion-0.0.47.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
114
|
+
bella_companion-0.0.47.dist-info/entry_points.txt,sha256=SVEYDBrkBWPrOGwnEH2aO5TSVIAvfKE37sqm-9ut9jg,51
|
|
115
|
+
bella_companion-0.0.47.dist-info/top_level.txt,sha256=q0loZYv4vf3zF_tOATyAJqeyLOEuPyLbObNqIGP7Fmc,16
|
|
116
|
+
bella_companion-0.0.47.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|