bdext 0.1.65__py3-none-any.whl → 0.1.67__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.
- README.md +165 -103
- bdeissct_dl/__init__.py +1 -3
- bdeissct_dl/bdeissct_model.py +11 -65
- bdeissct_dl/dl_model.py +7 -119
- bdeissct_dl/estimator.py +8 -108
- bdeissct_dl/model_serializer.py +4 -34
- bdeissct_dl/scaler_fitting.py +3 -6
- bdeissct_dl/sumstat_checker.py +2 -2
- bdeissct_dl/training.py +9 -30
- bdeissct_dl/tree_encoder.py +13 -32
- bdext-0.1.67.dist-info/METADATA +240 -0
- bdext-0.1.67.dist-info/RECORD +17 -0
- {bdext-0.1.65.dist-info → bdext-0.1.67.dist-info}/entry_points.txt +0 -2
- bdeissct_dl/estimator_ct.py +0 -63
- bdeissct_dl/main_covid.py +0 -76
- bdeissct_dl/model_finder.py +0 -47
- bdeissct_dl/pinball_loss.py +0 -48
- bdeissct_dl/train_ct.py +0 -125
- bdext-0.1.65.dist-info/METADATA +0 -178
- bdext-0.1.65.dist-info/RECORD +0 -22
- {bdext-0.1.65.dist-info → bdext-0.1.67.dist-info}/LICENSE +0 -0
- {bdext-0.1.65.dist-info → bdext-0.1.67.dist-info}/WHEEL +0 -0
- {bdext-0.1.65.dist-info → bdext-0.1.67.dist-info}/top_level.txt +0 -0
bdext-0.1.65.dist-info/METADATA
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: bdext
|
|
3
|
-
Version: 0.1.65
|
|
4
|
-
Summary: Estimation of BDEISS-CT parameters from phylogenetic trees.
|
|
5
|
-
Home-page: https://github.com/modpath/bdeissct
|
|
6
|
-
Author: Anna Zhukova
|
|
7
|
-
Author-email: anna.zhukova@pasteur.fr
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Keywords: phylogenetics,birth-death model,incubation,super-spreading,contact tracing
|
|
10
|
-
Platform: UNKNOWN
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Environment :: Console
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
15
|
-
Classifier: Topic :: Software Development
|
|
16
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
-
Description-Content-Type: text/markdown
|
|
18
|
-
Requires-Dist: tensorflow==2.19.0
|
|
19
|
-
Requires-Dist: six
|
|
20
|
-
Requires-Dist: ete3
|
|
21
|
-
Requires-Dist: numpy==2.0.2
|
|
22
|
-
Requires-Dist: scipy==1.14.1
|
|
23
|
-
Requires-Dist: biopython
|
|
24
|
-
Requires-Dist: scikit-learn==1.5.2
|
|
25
|
-
Requires-Dist: pandas==2.2.3
|
|
26
|
-
Requires-Dist: treesumstats==0.7
|
|
27
|
-
|
|
28
|
-
# bdeissct_dl
|
|
29
|
-
|
|
30
|
-
Estimator of BDEISS-CT model parameters from phylogenetic trees
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[//]: # ([](https://doi.org/10.1093/sysbio/syad059))
|
|
35
|
-
[](https://github.com/evolbioinfo/bdeissct_dl/releases)
|
|
36
|
-
[](https://pypi.org/project/bdeissct_dl/)
|
|
37
|
-
[](https://pypi.org/project/bdeissct_dl/)
|
|
38
|
-
[](https://hub.docker.com/r/evolbioinfo/bdeissct/tags)
|
|
39
|
-
|
|
40
|
-
## BDEISS-CT model
|
|
41
|
-
|
|
42
|
-
BD-PN model extends the classical birth-death (BD) model with incomplete sampling [[Stadler 2009]](https://pubmed.ncbi.nlm.nih.gov/19631666/), by adding partner notification (PN).
|
|
43
|
-
Under this model, infected individuals can transmit their pathogen with a constant rate λ,
|
|
44
|
-
get removed (become non-infectious) with a constant rate ψ,
|
|
45
|
-
and their pathogen can be sampled upon removal
|
|
46
|
-
with a constant probability ρ. On top of that, in the BD-PN model,
|
|
47
|
-
at the moment of sampling the sampled individual
|
|
48
|
-
might notify their most recent partner with a constant probability υ.
|
|
49
|
-
Upon notification, the partner is removed almost instantaneously (modeled via a constant notified
|
|
50
|
-
removal rate φ >> ψ) and their pathogen is sampled.
|
|
51
|
-
|
|
52
|
-
BD-PN model therefore has 5 parameters:
|
|
53
|
-
* λ -- transmission rate
|
|
54
|
-
* ψ -- removal rate
|
|
55
|
-
* ρ -- sampling probability upon removal
|
|
56
|
-
* υ -- probability to notify the last partner upon sampling
|
|
57
|
-
* φ -- removal (and sampling) rate after notification
|
|
58
|
-
|
|
59
|
-
These parameters can be expressed in terms of the following epidemiological parameters:
|
|
60
|
-
* R<sub>0</sub>=λ/ψ -- reproduction number
|
|
61
|
-
* 1/ψ -- infectious time
|
|
62
|
-
* 1/φ -- partner removal time
|
|
63
|
-
|
|
64
|
-
BD-CT model makes 3 assumptions:
|
|
65
|
-
1. only observed individuals can notify (instead of any removed individual);
|
|
66
|
-
2. notified individuals are always observed upon removal;
|
|
67
|
-
3. only the most recent partner can get notified.
|
|
68
|
-
|
|
69
|
-
For identifiability, BD-PN model requires one of the three BD model parameters (λ, ψ, ρ) to be fixed.
|
|
70
|
-
|
|
71
|
-
## BDEISS-CT parameter estimator
|
|
72
|
-
|
|
73
|
-
The bdeissct_dl package provides deep-learning-based BDEISS-CT model parameter estimator
|
|
74
|
-
from a user-supplied time-scaled phylogenetic tree.
|
|
75
|
-
User must also provide a value for one of the three BD model parameters (λ, ψ, or ρ).
|
|
76
|
-
We recommend providing the sampling probability ρ,
|
|
77
|
-
which could be estimated as the number of tree tips divided by the number of declared cases for the same time period.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
## Input data
|
|
81
|
-
One needs to supply a time-scaled phylogenetic tree in newick format.
|
|
82
|
-
In the examples below we will use an HIV tree reconstructed from 200 sequences,
|
|
83
|
-
published in [[Rasmussen _et al._ PLoS Comput. Biol. 2017]](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005448),
|
|
84
|
-
which you can find at [PairTree GitHub](https://github.com/davidrasm/PairTree)
|
|
85
|
-
and in [hiv_zurich/Zurich.nwk](hiv_zurich/Zurich.nwk).
|
|
86
|
-
|
|
87
|
-
## Installation
|
|
88
|
-
|
|
89
|
-
There are 4 alternative ways to run __bdeissct_dl__ on your computer:
|
|
90
|
-
with [docker](https://www.docker.com/community-edition),
|
|
91
|
-
[apptainer](https://apptainer.org/),
|
|
92
|
-
in Python3, or via command line (requires installation with Python3).
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
### Run in python3 or command-line (for linux systems, recommended Ubuntu 21 or newer versions)
|
|
97
|
-
|
|
98
|
-
You could either install python (version 3.9 or higher) system-wide and then install bdeissct_dl via pip:
|
|
99
|
-
```bash
|
|
100
|
-
sudo apt install -y python3 python3-pip python3-setuptools python3-distutils
|
|
101
|
-
pip3 install bdeissct_dl
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
or alternatively, you could install python (version 3.9 or higher) and bdeissct_dl via [conda](https://conda.io/docs/) (make sure that conda is installed first).
|
|
105
|
-
Here we will create a conda environment called _phyloenv_:
|
|
106
|
-
```bash
|
|
107
|
-
conda create --name phyloenv python=3.12
|
|
108
|
-
conda activate phyloenv
|
|
109
|
-
pip install bdeissct_dl
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
#### Basic usage in a command line
|
|
114
|
-
If you installed __bdeissct_dl__ in a conda environment (here named _phyloenv_), do not forget to first activate it, e.g.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
conda activate phyloenv
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Run the following command to estimate the BDEISS_CT parameters and their 95% CIs for this tree, assuming the sampling probability of 0.25,
|
|
121
|
-
and save the estimated parameters to a comma-separated file estimates.csv.
|
|
122
|
-
```bash
|
|
123
|
-
bdeissct_infer --nwk Zurich.nwk --ci --p 0.25 --log estimates.csv
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
#### Help
|
|
127
|
-
|
|
128
|
-
To see detailed options, run:
|
|
129
|
-
```bash
|
|
130
|
-
bdeissct_infer --help
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
### Run with docker
|
|
135
|
-
|
|
136
|
-
#### Basic usage
|
|
137
|
-
Once [docker](https://www.docker.com/community-edition) is installed,
|
|
138
|
-
run the following command to estimate BDEISS-CT model parameters:
|
|
139
|
-
```bash
|
|
140
|
-
docker run -v <path_to_the_folder_containing_the_tree>:/data:rw -t evolbioinfo/bdeissct --nwk /data/Zurich.nwk --ci --p 0.25 --log /data/estimates.csv
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
This will produce a comma-separated file estimates.csv in the <path_to_the_folder_containing_the_tree> folder,
|
|
144
|
-
containing the estimated parameter values and their 95% CIs (can be viewed with a text editor, Excel or Libre Office Calc).
|
|
145
|
-
|
|
146
|
-
#### Help
|
|
147
|
-
|
|
148
|
-
To see advanced options, run
|
|
149
|
-
```bash
|
|
150
|
-
docker run -t evolbioinfo/bdeissct -h
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
### Run with apptainer
|
|
156
|
-
|
|
157
|
-
#### Basic usage
|
|
158
|
-
Once [apptainer](https://apptainer.org/docs/user/latest/quick_start.html#installation) is installed,
|
|
159
|
-
run the following command to estimate BDEISS-CT model parameters (from the folder where the Zurich.nwk tree is contained):
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
apptainer run docker://evolbioinfo/bdeissct --nwk Zurich.nwk --ci --p 0.25 --log estimates.csv
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
This will produce a comma-separated file estimates.csv,
|
|
166
|
-
containing the estimated parameter values and their 95% CIs (can be viewed with a text editor, Excel or Libre Office Calc).
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
#### Help
|
|
170
|
-
|
|
171
|
-
To see advanced options, run
|
|
172
|
-
```bash
|
|
173
|
-
apptainer run docker://evolbioinfo/bdeissct -h
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
bdext-0.1.65.dist-info/RECORD
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
README.md,sha256=Fk-VeZXo2zltZ9NXdFnnHS3ETwtiBPRiZ86ttUQUgTE,5894
|
|
2
|
-
bdeissct_dl/__init__.py,sha256=glAW73vlD9Abbb_Fto-sKys078qVEn5iTcx2Mq3Z72s,361
|
|
3
|
-
bdeissct_dl/bdeissct_model.py,sha256=JoimpolW2x6q29P4whDoQDyxmIDw_eDl03ZbUE4bl4Y,3503
|
|
4
|
-
bdeissct_dl/dl_model.py,sha256=q8RFbbd2n52Y0_HMKSEHdIgBouE4LbHL5CZO3M_3G3E,7364
|
|
5
|
-
bdeissct_dl/estimator.py,sha256=UIQAy62I0_2HKagfck9WBGbbHU6l_WfRypP9CyeHrFE,7313
|
|
6
|
-
bdeissct_dl/estimator_ct.py,sha256=P5Up-NnAYS2Nen5_KPEYP04VXr5hm1Dtjq5TuW5OHjM,2604
|
|
7
|
-
bdeissct_dl/main_covid.py,sha256=wCeJgc4XzEPjcVCaQt_-zGiVX0wdpQhFq2qh9xQzc7w,2882
|
|
8
|
-
bdeissct_dl/model_finder.py,sha256=TC6EcIE6rBO6PefaYfn2reEl6HPkORbIgTzQGsDoXcU,1763
|
|
9
|
-
bdeissct_dl/model_serializer.py,sha256=Ojhy-fUElc4NClhJaF0EWnrAJGK0omk8e7cwwrBk3Yk,3768
|
|
10
|
-
bdeissct_dl/pinball_loss.py,sha256=Xg2jFDlwPOt0AhBY574lWB0yRyuA0bQRiyOYHGL6P54,1602
|
|
11
|
-
bdeissct_dl/scaler_fitting.py,sha256=ekaokmRFmZIInNylaCV5oQznpLKnRwNVAvaSyud3iSk,1925
|
|
12
|
-
bdeissct_dl/sumstat_checker.py,sha256=BHMgoqjymHc3Ic-Sv7m-zuvCeLlCt4OCDVaKDltSII0,1867
|
|
13
|
-
bdeissct_dl/train_ct.py,sha256=nog5l_VN1hUfMxma8U4faHcki4NdFYUXcbDxBvJVhOs,5361
|
|
14
|
-
bdeissct_dl/training.py,sha256=QBjly8e_8yqvxDbHGPw0F4LeL8BbA6UQ8SANFc0NCYY,8990
|
|
15
|
-
bdeissct_dl/tree_encoder.py,sha256=WrrSk_HXOF_rAKHpU7u9_i_gCmp5tz7Tk_Jvbwx0N_g,19193
|
|
16
|
-
bdeissct_dl/tree_manager.py,sha256=UXxUVmEkxwUhKpJeACVgiXZ8Kp1o_hiv8Qb80b6qmVU,11814
|
|
17
|
-
bdext-0.1.65.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
18
|
-
bdext-0.1.65.dist-info/METADATA,sha256=F2hZ8vFtl1FLUPeTZiKC97itDEF9T1Nmistd-twTKPo,6834
|
|
19
|
-
bdext-0.1.65.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
20
|
-
bdext-0.1.65.dist-info/entry_points.txt,sha256=En4b5js0-eCuBp0Jiqye0fte6svXbXSLiSJOW_KdzV4,286
|
|
21
|
-
bdext-0.1.65.dist-info/top_level.txt,sha256=z4dadFfcLghr4lwROy7QR3zEICpa-eCPT6mmcoHeEJY,12
|
|
22
|
-
bdext-0.1.65.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|