bella-companion 0.0.43__py3-none-any.whl → 0.0.45__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.
Files changed (57) hide show
  1. bella_companion/BELLA.jar +0 -0
  2. bella_companion/__pycache__/__init__.cpython-310.pyc +0 -0
  3. bella_companion/__pycache__/cli.cpython-310.pyc +0 -0
  4. bella_companion/cli.py +14 -2
  5. bella_companion/eucovid/__pycache__/__init__.cpython-310.pyc +0 -0
  6. bella_companion/eucovid/__pycache__/run_beast.cpython-310.pyc +0 -0
  7. bella_companion/platyrrhine/__init__.py +2 -2
  8. bella_companion/platyrrhine/__pycache__/__init__.cpython-310.pyc +0 -0
  9. bella_companion/platyrrhine/__pycache__/results.cpython-310.pyc +0 -0
  10. bella_companion/platyrrhine/__pycache__/run_beast.cpython-310.pyc +0 -0
  11. bella_companion/platyrrhine/__pycache__/summarize.cpython-310.pyc +0 -0
  12. bella_companion/platyrrhine/__pycache__/summarize_logs.cpython-310.pyc +0 -0
  13. bella_companion/platyrrhine/results.py +54 -14
  14. bella_companion/platyrrhine/{summarize_logs.py → summarize.py} +6 -6
  15. bella_companion/simulations/__init__.py +2 -2
  16. bella_companion/simulations/__pycache__/__init__.cpython-310.pyc +0 -0
  17. bella_companion/simulations/__pycache__/features.cpython-310.pyc +0 -0
  18. bella_companion/simulations/__pycache__/generate_data.cpython-310.pyc +0 -0
  19. bella_companion/simulations/__pycache__/generate_figures.cpython-310.pyc +0 -0
  20. bella_companion/simulations/__pycache__/metrics.cpython-310.pyc +0 -0
  21. bella_companion/simulations/__pycache__/run_beast.cpython-310.pyc +0 -0
  22. bella_companion/simulations/__pycache__/summarize.cpython-310.pyc +0 -0
  23. bella_companion/simulations/__pycache__/summarize_logs.cpython-310.pyc +0 -0
  24. bella_companion/simulations/figures/__init__.py +4 -12
  25. bella_companion/simulations/figures/__pycache__/__init__.cpython-310.pyc +0 -0
  26. bella_companion/simulations/figures/__pycache__/epi_multitype.cpython-310.pyc +0 -0
  27. bella_companion/simulations/figures/__pycache__/epi_skyline.cpython-310.pyc +0 -0
  28. bella_companion/simulations/figures/__pycache__/fbd_2traits.cpython-310.pyc +0 -0
  29. bella_companion/simulations/figures/__pycache__/fbd_no_traits.cpython-310.pyc +0 -0
  30. bella_companion/simulations/figures/__pycache__/scenarios.cpython-310.pyc +0 -0
  31. bella_companion/simulations/figures/__pycache__/utils.cpython-310.pyc +0 -0
  32. bella_companion/simulations/figures/{epi_multitype_results.py → epi_multitype.py} +3 -3
  33. bella_companion/simulations/figures/{epi_skyline_results.py → epi_skyline.py} +7 -8
  34. bella_companion/simulations/figures/explain/__pycache__/__init__.cpython-310.pyc +0 -0
  35. bella_companion/simulations/figures/explain/__pycache__/pdp.cpython-310.pyc +0 -0
  36. bella_companion/simulations/figures/explain/__pycache__/shap.cpython-310.pyc +0 -0
  37. bella_companion/simulations/figures/{fbd_2traits_results.py → fbd_2traits.py} +3 -3
  38. bella_companion/simulations/figures/{fbd_no_traits_results.py → fbd_no_traits.py} +6 -8
  39. bella_companion/simulations/metrics.py +3 -2
  40. bella_companion/simulations/scenarios/__pycache__/__init__.cpython-310.pyc +0 -0
  41. bella_companion/simulations/scenarios/__pycache__/common.cpython-310.pyc +0 -0
  42. bella_companion/simulations/scenarios/__pycache__/epi_multitype.cpython-310.pyc +0 -0
  43. bella_companion/simulations/scenarios/__pycache__/epi_skyline.cpython-310.pyc +0 -0
  44. bella_companion/simulations/scenarios/__pycache__/fbd_2traits.cpython-310.pyc +0 -0
  45. bella_companion/simulations/scenarios/__pycache__/fbd_no_traits.cpython-310.pyc +0 -0
  46. bella_companion/simulations/scenarios/__pycache__/scenario.cpython-310.pyc +0 -0
  47. bella_companion/simulations/{summarize_logs.py → summarize.py} +2 -2
  48. bella_companion/utils/__pycache__/__init__.cpython-310.pyc +0 -0
  49. bella_companion/utils/__pycache__/beast.cpython-310.pyc +0 -0
  50. bella_companion/utils/__pycache__/explain.cpython-310.pyc +0 -0
  51. bella_companion/utils/__pycache__/slurm.cpython-310.pyc +0 -0
  52. bella_companion/version.xml +13 -0
  53. {bella_companion-0.0.43.dist-info → bella_companion-0.0.45.dist-info}/METADATA +2 -2
  54. {bella_companion-0.0.43.dist-info → bella_companion-0.0.45.dist-info}/RECORD +57 -17
  55. {bella_companion-0.0.43.dist-info → bella_companion-0.0.45.dist-info}/WHEEL +0 -0
  56. {bella_companion-0.0.43.dist-info → bella_companion-0.0.45.dist-info}/entry_points.txt +0 -0
  57. {bella_companion-0.0.43.dist-info → bella_companion-0.0.45.dist-info}/top_level.txt +0 -0
Binary file
bella_companion/cli.py CHANGED
@@ -7,14 +7,26 @@ from dotenv import load_dotenv
7
7
  from bella_companion.eucovid import run_beast as run_eucovid_beast
8
8
  from bella_companion.platyrrhine import plot_platyrrhine_results
9
9
  from bella_companion.platyrrhine import run_beast as run_platyrrhine
10
- from bella_companion.platyrrhine import summarize_logs as summarize_platyrrhine
10
+ from bella_companion.platyrrhine import summarize as summarize_platyrrhine
11
11
  from bella_companion.simulations import generate_data, generate_figures, print_metrics
12
12
  from bella_companion.simulations import run_beast as run_simulations
13
- from bella_companion.simulations import summarize_logs as summarize_simulations
13
+ from bella_companion.simulations import summarize as summarize_simulations
14
14
 
15
15
 
16
16
  def main():
17
17
  load_dotenv(Path(os.getcwd()) / ".env")
18
+ os.environ["BELLA_RUN_BEAST_CMD"] = " ".join(
19
+ [
20
+ "java",
21
+ os.getenv("JAVA_OPTIONS", ""),
22
+ f"-jar {Path(__file__).parent / 'BELLA.jar'}",
23
+ f"-version_file {Path(__file__).parent / 'version.xml'}",
24
+ "-seed 42",
25
+ "-overwrite",
26
+ "-statefile /tmp/state",
27
+ "-DFout /dev/null",
28
+ ]
29
+ )
18
30
 
19
31
  parser = argparse.ArgumentParser(
20
32
  prog="bella",
@@ -1,5 +1,5 @@
1
1
  from bella_companion.platyrrhine.results import plot_platyrrhine_results
2
2
  from bella_companion.platyrrhine.run_beast import run_beast
3
- from bella_companion.platyrrhine.summarize_logs import summarize_logs
3
+ from bella_companion.platyrrhine.summarize import summarize
4
4
 
5
- __all__ = ["plot_platyrrhine_results", "run_beast", "summarize_logs"]
5
+ __all__ = ["plot_platyrrhine_results", "run_beast", "summarize"]
@@ -5,12 +5,48 @@ import matplotlib.pyplot as plt
5
5
  import numpy as np
6
6
  import polars as pl
7
7
  from numpy.typing import NDArray
8
- from phylogenie import get_node_depths, load_newick
8
+ from phylogenie import draw_tree, get_node_depths, load_newick, load_nexus
9
9
 
10
10
 
11
- def _plot_predictions(output_dir: Path):
12
- log_summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"])
13
- log_summary = pl.read_csv(log_summaries_dir / "platyrrhine" / "MLP.csv")
11
+ def _plot_tree(output_dir: Path, tree_file: str | Path):
12
+ sample_trees = load_nexus(tree_file)
13
+ trees = [sample_trees[f"STATE_{i*100_000}"] for i in range(11, 101)]
14
+
15
+ for tree in trees:
16
+ for node in tree:
17
+ if node.parent is not None and not node.branch_length:
18
+ node.parent.remove_child(node)
19
+
20
+ avg_tree = trees[0].copy()
21
+ for node in avg_tree:
22
+ node.clear()
23
+ for avg_node, nodes in zip(avg_tree, zip(*trees)):
24
+ avg_node.set("birthRateSP", np.mean([n["birthRateSP"] for n in nodes]))
25
+ avg_node.set("deathRateSP", np.mean([n["deathRateSP"] for n in nodes]))
26
+
27
+ avg_tree.ladderize()
28
+ for rate in ["birthRateSP", "deathRateSP"]:
29
+ ax = plt.gca()
30
+ draw_tree(
31
+ avg_tree,
32
+ ax,
33
+ color_by=rate,
34
+ hist_axes_kwargs={
35
+ "loc": "upper left",
36
+ "bbox_to_anchor": (0.06, 0, 1, 1),
37
+ "bbox_transform": ax.transAxes,
38
+ },
39
+ )
40
+ height = avg_tree.height
41
+ ticks = np.arange(height, 0, -10)
42
+ ax.set_xticks(ticks, [str(round(height - t)) for t in ticks]) # pyright: ignore
43
+ plt.xlabel("Time (mya)") # pyright: ignore
44
+ plt.savefig(output_dir / f"{rate}-tree.svg") # pyright: ignore
45
+ plt.close()
46
+
47
+
48
+ def _plot_predictions(output_dir: Path, log_summary_file: str | Path):
49
+ log_summary = pl.read_csv(log_summary_file)
14
50
 
15
51
  data_dir = Path(__file__).parent / "data"
16
52
  change_times = (
@@ -24,14 +60,15 @@ def _plot_predictions(output_dir: Path):
24
60
  )
25
61
  time_bins = list(reversed([0.0, *change_times, max_time]))
26
62
 
63
+ gradient = np.linspace(0.4, 0.9, 4)
27
64
  colors: dict[str, NDArray[np.floating]] = {
28
- "birth": plt.cm.Blues(np.linspace(0.4, 0.9, 4)), # pyright: ignore
29
- "death": plt.cm.Oranges(np.linspace(0.4, 0.9, 4)), # pyright: ignore
30
- "diversification": plt.cm.Greens(np.linspace(0.4, 0.9, 4)), # pyright: ignore
65
+ "birthRateSP": plt.cm.Blues(gradient), # pyright: ignore
66
+ "deathRateSP": plt.cm.Oranges(gradient), # pyright: ignore
67
+ "diversificationRateSP": plt.cm.Greens(gradient), # pyright: ignore
31
68
  }
32
- for rate in ["birth", "death", "diversification"]:
69
+ for rate in colors:
33
70
  for type in [0, 1, 2, 3]:
34
- if rate == "diversification":
71
+ if rate == "diversificationRateSP":
35
72
  estimates = log_summary.select(
36
73
  [
37
74
  pl.col(f"birthRateSPi{i}_{type}_median")
@@ -42,7 +79,7 @@ def _plot_predictions(output_dir: Path):
42
79
  else:
43
80
  estimates = log_summary.select(
44
81
  [
45
- pl.col(f"{rate}RateSPi{i}_{type}_median")
82
+ pl.col(f"{rate}i{i}_{type}_median")
46
83
  for i in range(len(change_times) + 1)
47
84
  ]
48
85
  ).to_numpy()
@@ -52,18 +89,21 @@ def _plot_predictions(output_dir: Path):
52
89
  time_bins, [median[0], *median], color=color, label=type
53
90
  )
54
91
 
55
- ax = plt.gca()
56
- ax.invert_xaxis()
92
+ plt.gca().invert_xaxis()
57
93
  plt.legend(title="Body mass") # pyright: ignore
58
94
  plt.xlabel("Time (mya)") # pyright: ignore
59
95
  plt.ylabel( # pyright: ignore
60
- r"$\lambda$" if rate == "birth" else r"$\mu$" if rate == "death" else r"$d$"
96
+ r"$\lambda$"
97
+ if rate == "birthRateSP"
98
+ else r"$\mu$" if rate == "deathRateSP" else r"$d$"
61
99
  )
62
100
  plt.savefig(output_dir / f"{rate}-predictions.svg") # pyright: ignore
63
101
  plt.close()
64
102
 
65
103
 
66
104
  def plot_platyrrhine_results():
105
+ summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"]) / "platyrrhine"
67
106
  output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "platyrrhine"
68
107
  os.makedirs(output_dir, exist_ok=True)
69
- _plot_predictions(output_dir)
108
+ _plot_predictions(output_dir, summaries_dir / "MLP.csv")
109
+ _plot_tree(output_dir, summaries_dir / "sample-trees.nexus")
@@ -5,13 +5,13 @@ from pathlib import Path
5
5
 
6
6
  import joblib
7
7
  import polars as pl
8
- from phylogenie import Tree, load_nexus
8
+ from phylogenie import Tree, dump_newick, load_nexus
9
9
  from tqdm import tqdm
10
10
 
11
11
  from bella_companion.utils import read_weights_dir, summarize_logs_dir
12
12
 
13
13
 
14
- def summarize_logs():
14
+ def summarize():
15
15
  data_dir = Path(__file__).parent / "data"
16
16
  change_times = pl.read_csv(data_dir / "change_times.csv", has_header=False)
17
17
  n_time_bins = len(change_times) + 1
@@ -28,14 +28,14 @@ def summarize_logs():
28
28
  )
29
29
  weights = read_weights_dir(logs_dir)
30
30
 
31
- summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"], "platyrrhine")
31
+ summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"], "platyrrhine")
32
32
  os.makedirs(summaries_dir, exist_ok=True)
33
33
  summaries.write_csv(summaries_dir / "MLP.csv")
34
34
  joblib.dump(weights, summaries_dir / "MLP.weights.pkl")
35
35
 
36
36
  trees: list[Tree] = []
37
37
  for tree_file in tqdm(glob(str(logs_dir / "*.trees")), "Summarizing trees"):
38
- trees.extend(list(load_nexus(tree_file).values())[:-10])
39
- joblib.dump(trees, summaries_dir / "trees.pkl")
38
+ trees.extend(list(load_nexus(tree_file).values())[-10:])
39
+ dump_newick(trees, summaries_dir / "trees.nwk")
40
40
 
41
- shutil.copy(logs_dir / "0.trees", summaries_dir / "sample-tree.nexus")
41
+ shutil.copy(logs_dir / "0.trees", summaries_dir / "sample-trees.nexus")
@@ -2,12 +2,12 @@ from bella_companion.simulations.generate_data import generate_data
2
2
  from bella_companion.simulations.generate_figures import generate_figures
3
3
  from bella_companion.simulations.metrics import print_metrics
4
4
  from bella_companion.simulations.run_beast import run_beast
5
- from bella_companion.simulations.summarize_logs import summarize_logs
5
+ from bella_companion.simulations.summarize import summarize
6
6
 
7
7
  __all__ = [
8
8
  "generate_data",
9
9
  "generate_figures",
10
10
  "print_metrics",
11
11
  "run_beast",
12
- "summarize_logs",
12
+ "summarize",
13
13
  ]
@@ -1,15 +1,7 @@
1
- from bella_companion.simulations.figures.epi_multitype_results import (
2
- plot_epi_multitype_results,
3
- )
4
- from bella_companion.simulations.figures.epi_skyline_results import (
5
- plot_epi_skyline_results,
6
- )
7
- from bella_companion.simulations.figures.fbd_2traits_results import (
8
- plot_fbd_2traits_results,
9
- )
10
- from bella_companion.simulations.figures.fbd_no_traits_results import (
11
- plot_fbd_no_traits_results,
12
- )
1
+ from bella_companion.simulations.figures.epi_multitype import plot_epi_multitype_results
2
+ from bella_companion.simulations.figures.epi_skyline import plot_epi_skyline_results
3
+ from bella_companion.simulations.figures.fbd_2traits import plot_fbd_2traits_results
4
+ from bella_companion.simulations.figures.fbd_no_traits import plot_fbd_no_traits_results
13
5
  from bella_companion.simulations.figures.scenarios import plot_scenarios
14
6
 
15
7
  __all__ = [
@@ -58,10 +58,10 @@ def plot_epi_multitype_results():
58
58
  output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "epi-multitype"
59
59
  os.makedirs(output_dir, exist_ok=True)
60
60
 
61
- log_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"]) / "epi-multitype"
61
+ summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"]) / "epi-multitype"
62
62
  model = "MLP-32_16"
63
- log_summary = pl.read_csv(log_dir / f"{model}.csv")
64
- weights = joblib.load(log_dir / f"{model}.weights.pkl")
63
+ log_summary = pl.read_csv(summaries_dir / f"{model}.csv")
64
+ weights = joblib.load(summaries_dir / f"{model}.weights.pkl")
65
65
  weights = [w["migrationRate"] for w in weights]
66
66
 
67
67
  _plot_predictions(log_summary, output_dir)
@@ -14,11 +14,10 @@ from bella_companion.simulations.scenarios.epi_skyline import REPRODUCTION_NUMBE
14
14
 
15
15
 
16
16
  def plot_epi_skyline_results():
17
- output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "epi-skyline"
18
- os.makedirs(output_dir, exist_ok=True)
17
+ base_output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "epi-skyline"
19
18
 
20
19
  for i, reproduction_number in enumerate(REPRODUCTION_NUMBERS, start=1):
21
- summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"]) / f"epi-skyline_{i}"
20
+ summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"]) / f"epi-skyline_{i}"
22
21
  logs_summaries = {
23
22
  "Nonparametric": pl.read_csv(summaries_dir / "Nonparametric.csv"),
24
23
  "GLM": pl.read_csv(summaries_dir / "GLM.csv"),
@@ -26,6 +25,8 @@ def plot_epi_skyline_results():
26
25
  }
27
26
  true_values = {"reproductionNumberSP": reproduction_number}
28
27
 
28
+ output_dir = base_output_dir / str(i)
29
+ os.makedirs(output_dir, exist_ok=True)
29
30
  for log_summary in logs_summaries.values():
30
31
  step(
31
32
  [
@@ -35,12 +36,10 @@ def plot_epi_skyline_results():
35
36
  )
36
37
  step(reproduction_number, color="k", linestyle="--")
37
38
  plt.ylabel("Reproduction number") # pyright: ignore
38
- plt.savefig(output_dir / f"predictions-{i}.svg") # pyright: ignore
39
+ plt.savefig(output_dir / "predictions.svg") # pyright: ignore
39
40
  plt.close()
40
41
 
41
42
  plot_coverage_per_time_bin(
42
- logs_summaries, true_values, output_dir / f"coverage-{i}.svg"
43
- )
44
- plot_maes_per_time_bin(
45
- logs_summaries, true_values, output_dir / f"maes-{i}.svg"
43
+ logs_summaries, true_values, output_dir / "coverage.svg"
46
44
  )
45
+ plot_maes_per_time_bin(logs_summaries, true_values, output_dir / "maes.svg")
@@ -58,10 +58,10 @@ def _plot_predictions(log_summary: pl.DataFrame, output_dir: Path):
58
58
  def plot_fbd_2traits_results():
59
59
  output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "fbd-2traits"
60
60
 
61
- log_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"]) / "fbd-2traits"
61
+ summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"]) / "fbd-2traits"
62
62
  model = "MLP-32_16"
63
- log_summary = pl.read_csv(log_dir / f"{model}.csv")
64
- weights = joblib.load(log_dir / f"{model}.weights.pkl")
63
+ log_summary = pl.read_csv(summaries_dir / f"{model}.csv")
64
+ weights = joblib.load(summaries_dir / f"{model}.weights.pkl")
65
65
 
66
66
  for rate in RATES:
67
67
  os.makedirs(output_dir / rate, exist_ok=True)
@@ -14,13 +14,10 @@ from bella_companion.simulations.scenarios.fbd_no_traits import RATES
14
14
 
15
15
 
16
16
  def plot_fbd_no_traits_results():
17
- output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "fbd-no-traits"
18
- os.makedirs(output_dir, exist_ok=True)
17
+ base_output = Path(os.environ["BELLA_FIGURES_DIR"]) / "fbd-no-traits"
19
18
 
20
19
  for i, rates in enumerate(RATES, start=1):
21
- summaries_dir = (
22
- Path(os.environ["BELLA_LOG_SUMMARIES_DIR"]) / f"fbd-no-traits_{i}"
23
- )
20
+ summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"]) / f"fbd-no-traits_{i}"
24
21
  logs_summaries = {
25
22
  "Nonparametric": pl.read_csv(summaries_dir / "Nonparametric.csv"),
26
23
  "GLM": pl.read_csv(summaries_dir / "GLM.csv"),
@@ -28,6 +25,7 @@ def plot_fbd_no_traits_results():
28
25
  }
29
26
  true_values = {"birthRateSP": rates["birth"], "deathRateSP": rates["death"]}
30
27
 
28
+ output_dir = base_output / str(i)
31
29
  for id, rate in true_values.items():
32
30
  for log_summary in logs_summaries.values():
33
31
  step(
@@ -41,18 +39,18 @@ def plot_fbd_no_traits_results():
41
39
  plt.ylabel( # pyright: ignore
42
40
  r"$\lambda$" if id == "birthRateSP" else r"$\mu$"
43
41
  )
44
- plt.savefig(output_dir / f"{id}-predictions-{i}-.svg") # pyright: ignore
42
+ plt.savefig(output_dir / f"{id}-predictions.svg") # pyright: ignore
45
43
  plt.close()
46
44
 
47
45
  plot_coverage_per_time_bin(
48
46
  logs_summaries,
49
47
  true_values,
50
- output_dir / f"coverage-{i}.svg",
48
+ output_dir / "coverage.svg",
51
49
  reverse_xticks=True,
52
50
  )
53
51
  plot_maes_per_time_bin(
54
52
  logs_summaries,
55
53
  true_values,
56
- output_dir / f"maes-{i}.svg",
54
+ output_dir / "maes.svg",
57
55
  reverse_xticks=True,
58
56
  )
@@ -36,9 +36,10 @@ def _avg_ci_width(summary: pl.DataFrame, true_values: dict[str, float]) -> float
36
36
 
37
37
 
38
38
  def print_metrics():
39
+ base_summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"])
39
40
  metrics = {}
40
41
  for name, scenario in SCENARIOS.items():
41
- summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"]) / name
42
+ summaries_dir = base_summaries_dir / name
42
43
  summaries = {
43
44
  Path(log_summary).stem: pl.read_csv(log_summary)
44
45
  for log_summary in glob(str(summaries_dir / "*.csv"))
@@ -54,5 +55,5 @@ def print_metrics():
54
55
  }
55
56
  for target, true_values in scenario.targets.items()
56
57
  }
57
- with open("simulation-metrics.json", "w") as f:
58
+ with open(base_summaries_dir / "sim-metrics.json", "w") as f:
58
59
  json.dump(metrics, f)
@@ -8,13 +8,13 @@ from bella_companion.simulations.scenarios import SCENARIOS
8
8
  from bella_companion.utils import read_weights_dir, summarize_logs_dir
9
9
 
10
10
 
11
- def summarize_logs():
11
+ def summarize():
12
12
  output_dir = Path(os.environ["BELLA_BEAST_OUTPUT_DIR"])
13
13
  with open(output_dir / "simulations_job_ids.json", "r") as f:
14
14
  job_ids: dict[str, dict[str, dict[str, str]]] = json.load(f)
15
15
 
16
16
  for scenario_name, scenario in SCENARIOS.items():
17
- summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"]) / scenario_name
17
+ summaries_dir = Path(os.environ["BELLA_SUMMARIES_DIR"]) / scenario_name
18
18
  os.makedirs(summaries_dir, exist_ok=True)
19
19
  for model in job_ids[scenario_name]:
20
20
  logs_dir = output_dir / scenario_name / model
@@ -0,0 +1,13 @@
1
+ <addon name='BELLA' version='0.0.1'>
2
+ <depends on="BEAST.base" atleast="2.7.0" atmost="2.7.9"/>
3
+ <depends on="BEAST.app" atleast="2.7.0" atmost="2.7.9"/>
4
+
5
+ <service type="beast.base.core.BEASTInterface">
6
+ <provider classname="bella.BayesMLP"/>
7
+ <provider classname="bella.ReLu"/>
8
+ <provider classname="bella.SoftPlus"/>
9
+ <provider classname="bella.Sigmoid"/>
10
+ <provider classname="bella.Tanh"/>
11
+ <provider classname="bella.SkylineNodeTreeLogger"/>
12
+ </service>
13
+ </addon>
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bella-companion
3
- Version: 0.0.43
3
+ Version: 0.0.45
4
4
  Summary: Add your description here
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.2
10
+ Requires-Dist: phylogenie>=3.1.3
11
11
  Requires-Dist: poetry>=2.2.1
12
12
  Requires-Dist: seaborn>=0.13.2
@@ -1,7 +1,13 @@
1
+ bella_companion/BELLA.jar,sha256=4mKDzPfz263rTqA9KS2f4Mc-UWGMuj8G48ZDonKSqVw,67408597
1
2
  bella_companion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- bella_companion/cli.py,sha256=0SwDxkDPqvsp36kGnrBMLPIhAQM8PIpNXrztZayqmDc,2409
3
+ bella_companion/cli.py,sha256=v2kGrcZ9g448W4Bj-4AU5hwQGmpTRBIbgxhMT8li30s,2786
4
+ bella_companion/version.xml,sha256=Gr3nsYqFhVNP0Mszl_IfilxefsPN8ZpQlGlB8OJSwnE,522
5
+ bella_companion/__pycache__/__init__.cpython-310.pyc,sha256=OWbv3-oQ0uVrCKYMlnplMpvDhv5Ytf3aYb7Eu_UONkU,151
6
+ bella_companion/__pycache__/cli.cpython-310.pyc,sha256=KbutcYiFHY833JXUWR_zA5md-_XQK58BUPpsfpjTYB4,2425
3
7
  bella_companion/eucovid/__init__.py,sha256=09Ld_G7fZvCDCgEWsmaOyLVQ8pFc9QHAGnXKJ9Zm2AM,81
4
8
  bella_companion/eucovid/run_beast.py,sha256=etaD_4SVdy_Pmz5s4jvDLzp2K_QV8leEY8Pe3xySBsk,3443
9
+ bella_companion/eucovid/__pycache__/__init__.cpython-310.pyc,sha256=cwLb8j-Jrl5beRcoZEtbpvQlG9KENPuB2F4fa1RBYIQ,248
10
+ bella_companion/eucovid/__pycache__/run_beast.cpython-310.pyc,sha256=jEqqaPBugV7B8YZQjNIgYnhpCwDOV21xyG1N_IbRdJo,1922
5
11
  bella_companion/eucovid/beast_configs/GLM.xml,sha256=b5rAeKVEam3u2AGSJsm7EHB6LcC0l9bp1SyZT2QyjpI,10892
6
12
  bella_companion/eucovid/beast_configs/MLP.xml,sha256=M0_B6t0bZpjCAQqAmjrFshW96pt9sNREcoLUjwchX6Q,10616
7
13
  bella_companion/eucovid/beast_configs/Nonparametric.xml,sha256=n-t4sUfDS9AzC02tbIk5mx_RDg2l62ELhdR3I3_jjHE,17783
@@ -21,21 +27,34 @@ bella_companion/eucovid/data/predictors/all/osi_y_7e_ls.tsv,sha256=5YDXe4GstyyRK
21
27
  bella_companion/eucovid/data/predictors/all/pop_x_7e_ls.tsv,sha256=3fVYRQ1ylwsa7YptMU8f_xELwwqIF3Ux8akL9UaXKis,1904
22
28
  bella_companion/eucovid/data/predictors/all/pop_y_7e_ls.tsv,sha256=Ku39Ts0HW9r5lThAZ01V7HJDi0aoRYs0aQs5EXlZCkQ,1904
23
29
  bella_companion/eucovid/data/predictors/all/sharedborders_7e_nt.tsv,sha256=pPVT5DIaZuc3B0mSs-B3kw3G2zja1LfmL_xLwlNtLDo,280
24
- bella_companion/platyrrhine/__init__.py,sha256=dIx6exNz-vuKiG5FZumvq74QUWcIEFd3L6ErqnOa83c,274
30
+ bella_companion/platyrrhine/__init__.py,sha256=gySgNPoKaEdhcZppKMsCmS-aAcYw_rDEw0viz72Udaw,259
25
31
  bella_companion/platyrrhine/beast_config.xml,sha256=bLzavt-Zd8cmSgQQnlCBfZ9KyM7d1inOGx12VNjPFb4,7056
26
- bella_companion/platyrrhine/results.py,sha256=qosxqstTy7uadHARRt1WqmxZzxnQ3hiTjtw6V-YWKGA,2556
32
+ bella_companion/platyrrhine/results.py,sha256=x5NluhwATa136Gb1lEC_tfl7zhFzFaQnOp9ZRO11zhM,3991
27
33
  bella_companion/platyrrhine/run_beast.py,sha256=_9Ex2B65zu6I68uY6s3_dohPYPaFP3E7u-uyWuDLAJc,2477
28
- bella_companion/platyrrhine/summarize_logs.py,sha256=zVM8YvdXd3eFP14armkgNUVFpNC3P-XXKYytmfgobjg,1351
34
+ bella_companion/platyrrhine/summarize.py,sha256=Qc3GE2vUspTqU_QjLdULvK0r7AZ3JTdqsBmd71izt7M,1356
35
+ bella_companion/platyrrhine/__pycache__/__init__.cpython-310.pyc,sha256=_7OOgWWr8apuTVm7TLhvmP41QHTDFlDNjTtJ9J3vpZc,425
36
+ bella_companion/platyrrhine/__pycache__/results.cpython-310.pyc,sha256=q-9Hd0jDV6WSMI3lL-wiASAxVttekmmJ_FHSOGqaj9c,4028
37
+ bella_companion/platyrrhine/__pycache__/run_beast.cpython-310.pyc,sha256=oTFWqKQCeMUnS7ci8BuRMK2ChGFFV-G2xqcwfCOeI30,2172
38
+ bella_companion/platyrrhine/__pycache__/summarize.cpython-310.pyc,sha256=rU_4ZNKn-XmnGDxATy6bObTDlaRmHDSMBfP3aVlBNA4,1622
39
+ bella_companion/platyrrhine/__pycache__/summarize_logs.cpython-310.pyc,sha256=yKvebBShpNqMoVI2g3VzseuJrMG43A8U8vF7Yg288AE,1616
29
40
  bella_companion/platyrrhine/data/change_times.csv,sha256=tedobHbaY7-6M3V6F6HSqGAU9dpeeajR5mu1XGJfp6w,68
30
41
  bella_companion/platyrrhine/data/traits.csv,sha256=N_mCnaM9Gy0Qot7-l_mK0vMvr7e_5BZ4bgUHpcoG9UM,3949
31
42
  bella_companion/platyrrhine/data/trees.nwk,sha256=lpSiGUG5s3zE--IKPOyWrJ5vpJb_xAPnfxychs3YNIs,488232
32
- bella_companion/simulations/__init__.py,sha256=ShYRdp1iSjnS_SzcsH-8jbqXz6P1nyRQZqAtPZJCMVE,454
43
+ bella_companion/simulations/__init__.py,sha256=gjO_QB2wp335l7UO-zA9fFQ5vmZauGItBuO-QZFu93E,439
33
44
  bella_companion/simulations/features.py,sha256=DZOBpJGlQ0UinqUZYbEtoemZ2eQGVLV_i-DfpW31qJI,104
34
45
  bella_companion/simulations/generate_data.py,sha256=edfhXrs76hl30i_xizup4z6qgzXZyaDzX_PVC62Ytpw,849
35
46
  bella_companion/simulations/generate_figures.py,sha256=layMgoj3Bfl78Ceb1oE7YirAQ8zhjDyD9IrxDRXf6go,657
36
- bella_companion/simulations/metrics.py,sha256=duIkPb8cCXmIzjKA2yk9HLf4Y9eFIB_hRWaH05uIDws,1876
47
+ bella_companion/simulations/metrics.py,sha256=kSX7-B4a-LDm1V--S8CvEJDktlJ8qkpo_gY6V7XbOXw,1930
37
48
  bella_companion/simulations/run_beast.py,sha256=qniy326i-vDCeHzzHpQRrSnY2ULqNNrO0z3GEsWx4Mc,3208
38
- bella_companion/simulations/summarize_logs.py,sha256=Shf3Dx9k4lTbmO__MSLw-aIA8a8kTCXhbctBcV6Izug,1216
49
+ bella_companion/simulations/summarize.py,sha256=hfYpgmv2irD8wNQ-GYtJA324w94SKoYhx0bpDG2bb3w,1207
50
+ bella_companion/simulations/__pycache__/__init__.cpython-310.pyc,sha256=IoVTIDdo1s8l5t8qtw71HwOMnHnc-HrfbapHEuY_ItA,588
51
+ bella_companion/simulations/__pycache__/features.cpython-310.pyc,sha256=lKPxu0fteOgho5ZuC0MNQJssIGZ1L5YP6G6wtdKZhH0,437
52
+ bella_companion/simulations/__pycache__/generate_data.cpython-310.pyc,sha256=0lBmxKXXmllkzfzk2_s_T9Mi-ehbAOGeMb92_WGIHtk,1273
53
+ bella_companion/simulations/__pycache__/generate_figures.cpython-310.pyc,sha256=jB-WY4Wc3zRvAF6abzLyELklHqdF8GvleUCbvGN-Teo,816
54
+ bella_companion/simulations/__pycache__/metrics.cpython-310.pyc,sha256=39dzyU2PWUDpR0npJlO-MMha1jTFJ40sDQF9BLhPZRE,2652
55
+ bella_companion/simulations/__pycache__/run_beast.cpython-310.pyc,sha256=ByrndOcAAyCJ8vOCCSsISLPjGRMDzkDCsZAqMge2iAw,2635
56
+ bella_companion/simulations/__pycache__/summarize.cpython-310.pyc,sha256=bIi5Iwro1QlZ5iDtdoG_Ze4mW-2yWHglyeaRWpbUXdI,1340
57
+ bella_companion/simulations/__pycache__/summarize_logs.cpython-310.pyc,sha256=N3unUXsBHq5rrC4GHK6i0O0uzh71AIGdPFN3Lxb-el8,1359
39
58
  bella_companion/simulations/beast_configs/epi-multitype/GLM.xml,sha256=VymAYsaZVuB3EPE0DCQSXpKepVq8pPjKaB5yhEpaVkE,4334
40
59
  bella_companion/simulations/beast_configs/epi-multitype/MLP.xml,sha256=AoJyjvVcwKtut64d7sB2gnnenx5sXyuTTNCivykUyqU,4077
41
60
  bella_companion/simulations/beast_configs/epi-multitype/Nonparametric.xml,sha256=DfCMcLM53b-XP9oIiQ9wJWOVTEP3GnoZaL5BMzLLfIQ,3208
@@ -48,16 +67,26 @@ bella_companion/simulations/beast_configs/fbd-2traits/Nonparametric.xml,sha256=e
48
67
  bella_companion/simulations/beast_configs/fbd-no-traits/GLM.xml,sha256=Caq7Gxqx-wYAu3_YkMikVqni3DjBv1Wt00sc1Upo1X8,4743
49
68
  bella_companion/simulations/beast_configs/fbd-no-traits/MLP.xml,sha256=JE_cGh2DW5yPAXyXXr0D3DlovmV-aIbze7qrhENHK3w,4275
50
69
  bella_companion/simulations/beast_configs/fbd-no-traits/Nonparametric.xml,sha256=m2xaHZwskCFInvVY1QH1fwQqH6p_fgESlPX2BbBeUhk,2822
51
- bella_companion/simulations/figures/__init__.py,sha256=aBYbJntH4egFmkSSWiVMYDEApXPYxJD7eA3TCPNNegM,658
52
- bella_companion/simulations/figures/epi_multitype_results.py,sha256=j85WgvN5AyAtX-CalMegr2lwlAZBmzyJxkikBPXRjCc,2629
53
- bella_companion/simulations/figures/epi_skyline_results.py,sha256=jwognQspt0e1qvrhaYA-MQScsDxpDZd3YKJ5-RHfU6U,1659
54
- bella_companion/simulations/figures/fbd_2traits_results.py,sha256=JiXrbYkH1HwdJQhTHXj6KhMEXYgQmQ6LmDboAIO1CPA,2728
55
- bella_companion/simulations/figures/fbd_no_traits_results.py,sha256=kwDbgUTQUk-LXAvMGvKf1kInFvK7kTJld4BWpgS1sVU,1950
70
+ bella_companion/simulations/figures/__init__.py,sha256=LeHPeBb4vxJo0pxLZi_9s6iRBKvWC32yhAZBByqK2_8,590
71
+ bella_companion/simulations/figures/epi_multitype.py,sha256=Ni-hqIiPw0XV_WlypVQD7M1wlpDVz089SqIHly6NsLM,2643
72
+ bella_companion/simulations/figures/epi_skyline.py,sha256=SyFOsb8dwLuoN5IOCiQbG-ZCPDS8Wua_LL-cOuLtu_s,1673
73
+ bella_companion/simulations/figures/fbd_2traits.py,sha256=eU302inVrFDFvKLqNb6t7Z69HLrG0tBrDqRp9AlIjac,2742
74
+ bella_companion/simulations/figures/fbd_no_traits.py,sha256=-_c-qnrFAYZ7vd4Ieeb-uYA3VUwURfrcP11BN9PG8JY,1907
56
75
  bella_companion/simulations/figures/scenarios.py,sha256=gbMz1TUxxT2RSIq2kQlFioNdgSHk-gQY2OQuf6-7Fww,2817
57
76
  bella_companion/simulations/figures/utils.py,sha256=0M5OrxaEuqcj9rR2uAc_O7utQvhEceZGH0sKrGRWaWs,3129
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=Nfj99laMNw8DZ1C1brUQdUZF0-Xs-ly_DuommvooQVM,2716
79
+ bella_companion/simulations/figures/__pycache__/epi_skyline.cpython-310.pyc,sha256=2iGKtV-j4TYyNP5F0JUTVaIRuxZ28P2KgoOeKYsqcgc,1705
80
+ bella_companion/simulations/figures/__pycache__/fbd_2traits.cpython-310.pyc,sha256=YuaELsTfQPDE5-wr_RPLB8wd_GBbP9KpwbZgu5VT0xk,2764
81
+ bella_companion/simulations/figures/__pycache__/fbd_no_traits.cpython-310.pyc,sha256=cXjyTnxGiypA3weFvkg9x5IWXgC0T9W0Jkf9Xhp65ck,1781
82
+ bella_companion/simulations/figures/__pycache__/scenarios.cpython-310.pyc,sha256=vFCwHYIN9Ss5l87diB2eECycEEsSDZSgfL_jxzfxnp8,2140
83
+ bella_companion/simulations/figures/__pycache__/utils.cpython-310.pyc,sha256=ls2I9vw1jwKXyuESgGiHsyomon1c0QCGVRIe47mhTOM,3979
58
84
  bella_companion/simulations/figures/explain/__init__.py,sha256=DnmVIWO65nTT5VsWnbS7NyYgKEY_eo4oMCtCY_ML2Vk,260
59
85
  bella_companion/simulations/figures/explain/pdp.py,sha256=3n3ssgufW_43pn2hO5V5J_jgcJH3Fpb8stIRtTnlQ8w,3801
60
86
  bella_companion/simulations/figures/explain/shap.py,sha256=1PkbCgynbW-PXkkRpIcY7JoBYqOxqmu1OEOif_roFY8,2207
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=qr4hCch0Nw8TvQ4IhU0vaQcQnpeNx_j-WvhOF0ITvnY,3474
89
+ bella_companion/simulations/figures/explain/__pycache__/shap.cpython-310.pyc,sha256=AsZkMfZpjwiAK2gvbCD4flhCZOour-mIQU_fVd8RTQ0,2756
61
90
  bella_companion/simulations/scenarios/__init__.py,sha256=3Kl1lKcFpfb3vLX64DmSW4XCF5kXU1ZoHtstFH-ZIzU,876
62
91
  bella_companion/simulations/scenarios/common.py,sha256=_ddaSuTvEVdttGkXB4HPc2B7IB1F_GBOCW3cVOPZ-ZM,807
63
92
  bella_companion/simulations/scenarios/epi_multitype.py,sha256=fTkFeGHxyV_1f2nX3g_Oyr_e6wkorhXEicJjIAgeZKA,2439
@@ -65,12 +94,23 @@ bella_companion/simulations/scenarios/epi_skyline.py,sha256=JqnOVATECxBUqEbkR5lB
65
94
  bella_companion/simulations/scenarios/fbd_2traits.py,sha256=-amB3NX0GsVgYbFuHH71t93FuXUEnRUyhWf2Qpcpia4,3541
66
95
  bella_companion/simulations/scenarios/fbd_no_traits.py,sha256=R6CH0fVeQg-Iesl39pq2uY8ICVEO4VZbvUVUCGwauJU,2520
67
96
  bella_companion/simulations/scenarios/scenario.py,sha256=_FRWAyOFbw94lAzd3zCD-1ek4TrssoiXfXRQPShLiIA,620
97
+ bella_companion/simulations/scenarios/__pycache__/__init__.cpython-310.pyc,sha256=u8Myq0Jl4dr5i0IzQoZiBxkGfEHQrLfhS2gRnPgFm-g,1081
98
+ bella_companion/simulations/scenarios/__pycache__/common.cpython-310.pyc,sha256=qLAVMzuY5Q2YGmeUlaLUqa_81dAdhKnX2FkYdC82GEw,1226
99
+ bella_companion/simulations/scenarios/__pycache__/epi_multitype.cpython-310.pyc,sha256=qyesYumfFnaXSenM1T0p1sjqDKUnzT_-aMWt0bPEJ9Q,2390
100
+ bella_companion/simulations/scenarios/__pycache__/epi_skyline.cpython-310.pyc,sha256=wg5eyiA3grtlNE0KzSr-xAQaYHdw2d5UjpFT_MSXoyM,2194
101
+ bella_companion/simulations/scenarios/__pycache__/fbd_2traits.cpython-310.pyc,sha256=gg15HCp0Q_oqOxXYrbM9uOPjw58HpRNVWexO5p6Jb14,3028
102
+ bella_companion/simulations/scenarios/__pycache__/fbd_no_traits.cpython-310.pyc,sha256=TMz7ljrkXDCwKlqKP1wSOfbxvqvkFfzzUwZSqQtaQMs,2637
103
+ bella_companion/simulations/scenarios/__pycache__/scenario.cpython-310.pyc,sha256=1cWwz_MoZopfAt9ErEbWZnLutFODPwkujkTkS2NHsQg,1147
68
104
  bella_companion/utils/__init__.py,sha256=UtMwPK9dWf9NAl0ic8CSsgdW7aSm-5J49OqgvD7UpYw,480
69
105
  bella_companion/utils/beast.py,sha256=TBa0cLklX1_tXqoQE4LRYvds7mLg_9fS2-6U6OHENHo,2184
70
106
  bella_companion/utils/explain.py,sha256=uP7HPyn2YiykAI69BQV3RooDpC6qKoCLXfp3Uibp4zk,1475
71
107
  bella_companion/utils/slurm.py,sha256=xEyf-Jxk8fy71t3fko_Ic9WtUFSdLFE3w4tR17gaBPw,1868
72
- bella_companion-0.0.43.dist-info/METADATA,sha256=FHwaRLEDuz_6yvFM2QExhAlXKFQ3gdgV_Ez--8kk3BM,347
73
- bella_companion-0.0.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
- bella_companion-0.0.43.dist-info/entry_points.txt,sha256=SVEYDBrkBWPrOGwnEH2aO5TSVIAvfKE37sqm-9ut9jg,51
75
- bella_companion-0.0.43.dist-info/top_level.txt,sha256=q0loZYv4vf3zF_tOATyAJqeyLOEuPyLbObNqIGP7Fmc,16
76
- bella_companion-0.0.43.dist-info/RECORD,,
108
+ bella_companion/utils/__pycache__/__init__.cpython-310.pyc,sha256=QKECw9gSF8x3G4oXI06atZpaLDPSxm3k4qJ_-0nADbo,527
109
+ bella_companion/utils/__pycache__/beast.cpython-310.pyc,sha256=q6nsN-b5UBTLiZYOSqbUk9KlLFy_QE9unWLw-ldXz4c,2537
110
+ bella_companion/utils/__pycache__/explain.cpython-310.pyc,sha256=K7YHxY520Q0nJtTVa-eEKw3B99MsrO_b-U50X_yihGQ,1819
111
+ bella_companion/utils/__pycache__/slurm.cpython-310.pyc,sha256=kKWmJwCTlotpPuXi4kzXNx2-zY9BXuzjhGi5ZrcN0oI,1785
112
+ bella_companion-0.0.45.dist-info/METADATA,sha256=RbUbp2pwCDhwJe0YD2QX0r-Au1rlvg7Vv9ddZR5GbC4,347
113
+ bella_companion-0.0.45.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
114
+ bella_companion-0.0.45.dist-info/entry_points.txt,sha256=SVEYDBrkBWPrOGwnEH2aO5TSVIAvfKE37sqm-9ut9jg,51
115
+ bella_companion-0.0.45.dist-info/top_level.txt,sha256=q0loZYv4vf3zF_tOATyAJqeyLOEuPyLbObNqIGP7Fmc,16
116
+ bella_companion-0.0.45.dist-info/RECORD,,