bella-companion 0.0.16__py3-none-any.whl → 0.0.18__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/cli.py +16 -11
- bella_companion/eucovid/__init__.py +3 -0
- bella_companion/eucovid/beast_configs/GLM.xml +200 -0
- bella_companion/eucovid/beast_configs/MLP.xml +200 -0
- bella_companion/eucovid/beast_configs/Nonparametric.xml +214 -0
- bella_companion/eucovid/data/case_data.tsv +346 -0
- bella_companion/eucovid/data/change_dates.tsv +8 -0
- bella_companion/eucovid/data/msa.fasta +79500 -0
- bella_companion/eucovid/data/osi.tsv +376 -0
- bella_companion/eucovid/data/predictors/all/closedborders_7e_nt.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/dist_7e_ls.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/flight_7e_ls.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/flight_pop_x_7e_ls.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/osi_x_7e_ls.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/osi_y_7e_ls.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/pop_x_7e_ls.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/pop_y_7e_ls.tsv +35 -0
- bella_companion/eucovid/data/predictors/all/sharedborders_7e_nt.tsv +35 -0
- bella_companion/eucovid/data/predictors/changetimes_all_7e.tsv +6 -0
- bella_companion/eucovid/data/predictors/changetimes_flights_4e.tsv +3 -0
- bella_companion/eucovid/data/predictors/flight_pop_x_4e_ls.tsv +20 -0
- bella_companion/eucovid/run_beast.py +111 -0
- bella_companion/platyrrhine/__init__.py +5 -0
- bella_companion/{fbd_empirical → platyrrhine}/beast_config.xml +1 -1
- bella_companion/platyrrhine/data/trees.nwk +100 -0
- bella_companion/{fbd_empirical → platyrrhine}/results.py +3 -22
- bella_companion/{fbd_empirical → platyrrhine}/run_beast.py +3 -3
- bella_companion/{fbd_empirical → platyrrhine}/summarize_logs.py +2 -2
- {bella_companion-0.0.16.dist-info → bella_companion-0.0.18.dist-info}/METADATA +2 -2
- {bella_companion-0.0.16.dist-info → bella_companion-0.0.18.dist-info}/RECORD +34 -13
- bella_companion/fbd_empirical/__init__.py +0 -5
- bella_companion/fbd_empirical/data/trees.nwk +0 -100
- /bella_companion/{fbd_empirical → platyrrhine}/data/change_times.csv +0 -0
- /bella_companion/{fbd_empirical → platyrrhine}/data/traits.csv +0 -0
- {bella_companion-0.0.16.dist-info → bella_companion-0.0.18.dist-info}/WHEEL +0 -0
- {bella_companion-0.0.16.dist-info → bella_companion-0.0.18.dist-info}/entry_points.txt +0 -0
|
@@ -10,7 +10,7 @@ from phylogenie import get_node_depths, load_newick
|
|
|
10
10
|
|
|
11
11
|
def _plot_predictions(output_dir: Path):
|
|
12
12
|
log_summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"])
|
|
13
|
-
log_summary = pl.read_csv(log_summaries_dir / "
|
|
13
|
+
log_summary = pl.read_csv(log_summaries_dir / "platyrrhine" / "MLP.csv")
|
|
14
14
|
|
|
15
15
|
data_dir = Path(__file__).parent / "data"
|
|
16
16
|
change_times = (
|
|
@@ -46,27 +46,8 @@ def _plot_predictions(output_dir: Path):
|
|
|
46
46
|
for i in range(len(change_times) + 1)
|
|
47
47
|
]
|
|
48
48
|
).to_numpy()
|
|
49
|
-
|
|
50
49
|
median = np.median(estimates, axis=0)
|
|
51
|
-
lower = np.percentile(estimates, 2.5, axis=0)
|
|
52
|
-
upper = np.percentile(estimates, 97.5, axis=0)
|
|
53
|
-
|
|
54
50
|
color = colors[rate][type]
|
|
55
|
-
|
|
56
|
-
plt.fill_between( # pyright: ignore
|
|
57
|
-
time_bins,
|
|
58
|
-
[lower[0], *lower],
|
|
59
|
-
[upper[0], *upper],
|
|
60
|
-
step="pre",
|
|
61
|
-
alpha=0.25,
|
|
62
|
-
color=color,
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
for estimate in estimates:
|
|
66
|
-
plt.step( # pyright: ignore
|
|
67
|
-
time_bins, [estimate[0], *estimate], color=color, alpha=0.15
|
|
68
|
-
)
|
|
69
|
-
|
|
70
51
|
plt.step( # pyright: ignore
|
|
71
52
|
time_bins, [median[0], *median], color=color, label=type
|
|
72
53
|
)
|
|
@@ -82,7 +63,7 @@ def _plot_predictions(output_dir: Path):
|
|
|
82
63
|
plt.close()
|
|
83
64
|
|
|
84
65
|
|
|
85
|
-
def
|
|
86
|
-
output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "
|
|
66
|
+
def plot_platyrrhine_results():
|
|
67
|
+
output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "platyrrhine"
|
|
87
68
|
os.makedirs(output_dir, exist_ok=True)
|
|
88
69
|
_plot_predictions(output_dir)
|
|
@@ -12,7 +12,7 @@ from bella_companion.utils import submit_job
|
|
|
12
12
|
|
|
13
13
|
def run_beast():
|
|
14
14
|
base_output_dir = Path(os.environ["BELLA_BEAST_OUTPUT_DIR"])
|
|
15
|
-
output_dir = base_output_dir / "
|
|
15
|
+
output_dir = base_output_dir / "platyrrhine"
|
|
16
16
|
os.makedirs(output_dir, exist_ok=True)
|
|
17
17
|
|
|
18
18
|
data_dir = Path(__file__).parent / "data"
|
|
@@ -64,9 +64,9 @@ def run_beast():
|
|
|
64
64
|
)
|
|
65
65
|
job_ids[i] = submit_job(
|
|
66
66
|
command,
|
|
67
|
-
Path(os.environ["BELLA_SBATCH_LOG_DIR"]) / "
|
|
67
|
+
Path(os.environ["BELLA_SBATCH_LOG_DIR"]) / "platyrrhine" / str(i),
|
|
68
68
|
mem_per_cpu="12000",
|
|
69
69
|
)
|
|
70
70
|
|
|
71
|
-
with open(base_output_dir / "
|
|
71
|
+
with open(base_output_dir / "platyrrhine_job_ids.json", "w") as f:
|
|
72
72
|
json.dump(job_ids, f)
|
|
@@ -12,7 +12,7 @@ def summarize_logs():
|
|
|
12
12
|
change_times = pl.read_csv(data_dir / "change_times.csv", has_header=False)
|
|
13
13
|
n_time_bins = len(change_times) + 1
|
|
14
14
|
|
|
15
|
-
logs_dir = Path(os.environ["BELLA_BEAST_OUTPUT_DIR"]) / "
|
|
15
|
+
logs_dir = Path(os.environ["BELLA_BEAST_OUTPUT_DIR"]) / "platyrrhine"
|
|
16
16
|
summaries = summarize_logs_dir(
|
|
17
17
|
logs_dir=logs_dir,
|
|
18
18
|
target_columns=[
|
|
@@ -24,7 +24,7 @@ def summarize_logs():
|
|
|
24
24
|
)
|
|
25
25
|
weights = read_weights_dir(logs_dir)
|
|
26
26
|
|
|
27
|
-
summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"], "
|
|
27
|
+
summaries_dir = Path(os.environ["BELLA_LOG_SUMMARIES_DIR"], "platyrrhine")
|
|
28
28
|
os.makedirs(summaries_dir, exist_ok=True)
|
|
29
29
|
summaries.write_csv(summaries_dir / "MLP.csv")
|
|
30
30
|
joblib.dump(weights, summaries_dir / "MLP.weights.pkl")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bella-companion
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.18
|
|
4
4
|
Summary:
|
|
5
5
|
Author: gabriele-marino
|
|
6
6
|
Author-email: gabmarino.8601@gmail.com
|
|
@@ -12,5 +12,5 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
12
12
|
Requires-Dist: arviz (>=0.22.0,<0.23.0)
|
|
13
13
|
Requires-Dist: bella-lumiere (>=0.0.14,<0.0.15)
|
|
14
14
|
Requires-Dist: dotenv (>=0.9.9,<0.10.0)
|
|
15
|
-
Requires-Dist: phylogenie (>=3.1.
|
|
15
|
+
Requires-Dist: phylogenie (>=3.1.2,<4.0.0)
|
|
16
16
|
Requires-Dist: seaborn (>=0.13.2,<0.14.0)
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
bella_companion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
bella_companion/cli.py,sha256=
|
|
3
|
-
bella_companion/
|
|
4
|
-
bella_companion/
|
|
5
|
-
bella_companion/
|
|
6
|
-
bella_companion/
|
|
7
|
-
bella_companion/
|
|
8
|
-
bella_companion/
|
|
9
|
-
bella_companion/
|
|
10
|
-
bella_companion/
|
|
2
|
+
bella_companion/cli.py,sha256=0SwDxkDPqvsp36kGnrBMLPIhAQM8PIpNXrztZayqmDc,2409
|
|
3
|
+
bella_companion/eucovid/__init__.py,sha256=09Ld_G7fZvCDCgEWsmaOyLVQ8pFc9QHAGnXKJ9Zm2AM,81
|
|
4
|
+
bella_companion/eucovid/beast_configs/GLM.xml,sha256=Qn3AP1NvMDXnCQp_qZvVOjoDQujuurQop4IqgJs6lKQ,11670
|
|
5
|
+
bella_companion/eucovid/beast_configs/MLP.xml,sha256=4niHx3FmSsmKyDv9eNS1g9cZ6ShHbWjzXIbfg8pQa-k,11347
|
|
6
|
+
bella_companion/eucovid/beast_configs/Nonparametric.xml,sha256=S9B7mzbPWAQ2ngjpaaswUBF8Cigfha1StkFJtSVz2fo,11620
|
|
7
|
+
bella_companion/eucovid/data/case_data.tsv,sha256=XaSzZh5NcEMVt9d_XlQ19T8UuEkHGrjpSFXhe9IycNg,12412
|
|
8
|
+
bella_companion/eucovid/data/change_dates.tsv,sha256=_pmVFYiL4X9Pd79uYVgyz3sKeRap7xVcXk0OjqVhuVQ,227
|
|
9
|
+
bella_companion/eucovid/data/msa.fasta,sha256=sWaVSINSJDDLjmwlpl31JWM5VnKF7yViSpERI69glQc,4839354
|
|
10
|
+
bella_companion/eucovid/data/osi.tsv,sha256=iTDWL_-PnVQPg_-hWROXWKNFakDq_S1fEig1A_MqMVI,9228
|
|
11
|
+
bella_companion/eucovid/data/predictors/all/closedborders_7e_nt.tsv,sha256=5gP-cEzgKSCvlK0_PlkrimYGEwOaLPO0GiiM4PIKU-M,280
|
|
12
|
+
bella_companion/eucovid/data/predictors/all/dist_7e_ls.tsv,sha256=rr71QPiJu35CYbySMJyH_GDX51D2iTIncZImwAXIvlo,1890
|
|
13
|
+
bella_companion/eucovid/data/predictors/all/flight_7e_ls.tsv,sha256=5WztZpQrjK7puERA1oxsCn5t2G1w9NGTGKjr85gMQ54,1873
|
|
14
|
+
bella_companion/eucovid/data/predictors/all/flight_pop_x_7e_ls.tsv,sha256=qfRTXyZItzEm8pxurhFYO-DvpJXD-J4lMH5eyZKF0aE,1862
|
|
15
|
+
bella_companion/eucovid/data/predictors/all/osi_x_7e_ls.tsv,sha256=kke2eHlVuc84qMj1WBllhBG2BQt7JHUWDZeiVoAP8Lw,1900
|
|
16
|
+
bella_companion/eucovid/data/predictors/all/osi_y_7e_ls.tsv,sha256=5YDXe4GstyyRKP15213cAAEm5lVFW_bC98R8ipc1XoE,1900
|
|
17
|
+
bella_companion/eucovid/data/predictors/all/pop_x_7e_ls.tsv,sha256=3fVYRQ1ylwsa7YptMU8f_xELwwqIF3Ux8akL9UaXKis,1904
|
|
18
|
+
bella_companion/eucovid/data/predictors/all/pop_y_7e_ls.tsv,sha256=Ku39Ts0HW9r5lThAZ01V7HJDi0aoRYs0aQs5EXlZCkQ,1904
|
|
19
|
+
bella_companion/eucovid/data/predictors/all/sharedborders_7e_nt.tsv,sha256=pPVT5DIaZuc3B0mSs-B3kw3G2zja1LfmL_xLwlNtLDo,280
|
|
20
|
+
bella_companion/eucovid/data/predictors/changetimes_all_7e.tsv,sha256=hH0xXD2lr_8RPQRqvENv6clPHauAXH22SGQHb3hlfzs,120
|
|
21
|
+
bella_companion/eucovid/data/predictors/changetimes_flights_4e.tsv,sha256=XEepIXKRwcKknJq4-ovKlorvCypGi67B8znuQ5f1LTg,60
|
|
22
|
+
bella_companion/eucovid/data/predictors/flight_pop_x_4e_ls.tsv,sha256=tMR9-tuGtC3rVABXUtNdV9irUX-9aCCVb_fwksHTn8U,1068
|
|
23
|
+
bella_companion/eucovid/run_beast.py,sha256=BTttqmFNaUslDfpXTwF8qcIbiyLg3cvsPmdQkuqGvG4,3654
|
|
24
|
+
bella_companion/platyrrhine/__init__.py,sha256=dIx6exNz-vuKiG5FZumvq74QUWcIEFd3L6ErqnOa83c,274
|
|
25
|
+
bella_companion/platyrrhine/beast_config.xml,sha256=8A6E5iPu9FqDL3UdlsqDbabLFlC6Qhfa4Ta47niRkVA,7090
|
|
26
|
+
bella_companion/platyrrhine/data/change_times.csv,sha256=tedobHbaY7-6M3V6F6HSqGAU9dpeeajR5mu1XGJfp6w,68
|
|
27
|
+
bella_companion/platyrrhine/data/traits.csv,sha256=N_mCnaM9Gy0Qot7-l_mK0vMvr7e_5BZ4bgUHpcoG9UM,3949
|
|
28
|
+
bella_companion/platyrrhine/data/trees.nwk,sha256=lpSiGUG5s3zE--IKPOyWrJ5vpJb_xAPnfxychs3YNIs,488232
|
|
29
|
+
bella_companion/platyrrhine/results.py,sha256=qosxqstTy7uadHARRt1WqmxZzxnQ3hiTjtw6V-YWKGA,2556
|
|
30
|
+
bella_companion/platyrrhine/run_beast.py,sha256=caUmebyZMzOukI8RdOlECsT3DStShi0NZNzEJ72qAaw,2554
|
|
31
|
+
bella_companion/platyrrhine/summarize_logs.py,sha256=82N7rcmLthCyQqmP4Yub4KUsIjNzQl9vEuFLMvIv03o,951
|
|
11
32
|
bella_companion/simulations/__init__.py,sha256=ShYRdp1iSjnS_SzcsH-8jbqXz6P1nyRQZqAtPZJCMVE,454
|
|
12
33
|
bella_companion/simulations/beast_configs/epi-multitype/GLM.xml,sha256=VymAYsaZVuB3EPE0DCQSXpKepVq8pPjKaB5yhEpaVkE,4334
|
|
13
34
|
bella_companion/simulations/beast_configs/epi-multitype/MLP.xml,sha256=J-OVblMRmk4XRhz9DHhLpMwaIzqSqYZ7Yq7dTMvQW1s,4094
|
|
@@ -48,7 +69,7 @@ bella_companion/utils/__init__.py,sha256=UtMwPK9dWf9NAl0ic8CSsgdW7aSm-5J49OqgvD7
|
|
|
48
69
|
bella_companion/utils/beast.py,sha256=TBa0cLklX1_tXqoQE4LRYvds7mLg_9fS2-6U6OHENHo,2184
|
|
49
70
|
bella_companion/utils/explain.py,sha256=uP7HPyn2YiykAI69BQV3RooDpC6qKoCLXfp3Uibp4zk,1475
|
|
50
71
|
bella_companion/utils/slurm.py,sha256=v5DaG7YHVyK8KRFptgGDC6I8jxEhyJuMVK9N08pZSAI,1812
|
|
51
|
-
bella_companion-0.0.
|
|
52
|
-
bella_companion-0.0.
|
|
53
|
-
bella_companion-0.0.
|
|
54
|
-
bella_companion-0.0.
|
|
72
|
+
bella_companion-0.0.18.dist-info/METADATA,sha256=Mha1XlV0JnOlM3ru7d0vSBc0uPwvX66v_ggOFcgJDKw,576
|
|
73
|
+
bella_companion-0.0.18.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
74
|
+
bella_companion-0.0.18.dist-info/entry_points.txt,sha256=rSeKoAhmjnQqAYFcXBv0gAM2ViJfJe0D8_dD-fWrXeg,50
|
|
75
|
+
bella_companion-0.0.18.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
from bella_companion.fbd_empirical.results import plot_fbd_empirical_results
|
|
2
|
-
from bella_companion.fbd_empirical.run_beast import run_beast
|
|
3
|
-
from bella_companion.fbd_empirical.summarize_logs import summarize_logs
|
|
4
|
-
|
|
5
|
-
__all__ = ["plot_fbd_empirical_results", "run_beast", "summarize_logs"]
|