BDEIVH · Phylodynamic inference for Oropouche virus
Estimate vector-mediated transmission from a dated Oropouche virus (OROV) phylogeny and a human genomic sampling probability. The repository pairs the Birth–Death Exposed–Infectious Vector–Human (BDEIVH) model with a convolutional neural network adapted from PhyloCNN. The pretrained estimator accepts a single cluster with 30–350 sampled tips and returns six epidemiological estimates. It can also repeat inference as samples accumulate over time.
Associated manuscript
Ighor Arantes, Gonzalo Bello, Felipe Gomes Naveca, Edson Delatorre, Antonio Silva Lima Neto, Sebastian Duchene and Anna Zhukova. Deep Learning-based Phylodynamic Inference of Oropouche Virus Transmission Dynamics in Brazil Between 2023 and 2025.
[//]: # ([](https://pypi.org/project/bdeivh))
BDEIVH model
The Birth-Death Exposed-Infectious Vector-Human (BDEIVH) model is a special case of the Multi-Type Birth-Death model [Stadler et al. 2013]. It represents exposed (E) and infectious (I) states in humans (H) and vectors (V), infected with an arbovirus (e.g., Oropouche virus). An infectious human can infect vectors, and an infectious vector can infect humans. The viruses from infected humans may get sampled and used to reconstruct a time-scaled phylogenetic tree (to be used as a proxy of the observed transmission tree).
The BDEIVH model has 4 infected states:
- EV, exposed vector, i.e. infected but not yet infectious
- IV, infectious vector
- EH, exposed human, i.e. infected but not yet infectious
- IH, infectious human
and 3 removed states (i.e., that cannot transmit anymore):
- RVU, unobserved removed vector, i.e., dead vector with virus unsampled
- RHU, unobserved removed human, i.e., the human stopped transmitting further but their virus was not sampled
- RHO, observed removed human, i.e., the human stopped transmitting further and their virus sampled -- this state corresponds to the tips in the input tree
It has 2 non-zero state transition rate parameters:
- μV -- transition rate from state EV to state IV, corresponding to the incubation in vectors
- μH -- transition rate from state EH to state IH, corresponding to the incubation in humans
It has 2 non-zero transmission rate parameters:
- λVH -- transmission rate from state IV (donor) to state EH (recipient), corresponding to the vector-to-human transmission
- λHV -- transmission rate from state IH (donor) to state EV (recipient), corresponding to the human-to-vector transmission
It also has 2 non-zero removal (becoming non-infectious) rate parameters:
- ψV -- removal rate of state VI, corresponding to death or recovery (i.e., inability to transmit further) of infectious vectors, i.e., a state change from IV to RVU
- ψH -- removal rate of state HI, corresponding to recovery, self-isolation or death (i.e., inability to transmit further) of infectious humans, i.e., a state change from IH to RHU or RHO, according to the sampling probability (see below).
Finally, it has one non-zero sampling probability upon removal parameter:
- ρH -- probability to sample the pathogen of a human upon removal (leading to an observed removed state RHO)
Using these probabilities, one can calculate the equilibrium frequencies of the model's states, where 0 ≤ πj ≤ 1, Σjπj = 1, and j ∈ {VE, VI, HE, HI}. We can also define the equilibrium frequency of humans and vectors as:
- πH=πHE + πHI, and
- πV=πVE + πVI respectively.
The BDEIVH model has the following epidemiological parameters:
- RHV = λH/ψH -- human-to-vector reproduction number, i.e., the expected number of humans infected by one infectious vector
- RVH = λV/ψV -- vector-to-human reproduction number, i.e., the expected number of vectors infected by one infectious human
- RHH = RHVRVH -- human-to-human reproduction number, i.e., the expected number of secondary human infections generated by a single infectious human through one complete vector-mediated transmission cycle
- dinc,V = 1/μV -- vector incubation period
- dinc,H = 1/μH -- human incubation period
- dinf,V = 1/ψV -- vector infectious time
- dinf,H = 1/ψH -- human infectious time
- dV = dinc,V + dinf,V -- total duration of infection in vectors, including incubation and infectious periods
- dH = dinc,H + dinf,H -- total duration of infection in humans, including incubation and infectious periods
- R = πHRH + πVRV -- host-unaware reproduction number
- d = πHdH + πVdV -- host-unaware infection time
- V/H = πV / πH -- vector to human ratio
Predict BDEIVH parameters from a dated phylogenetic tree
Pretrained DL BDEIVH estimator
The folder bdeivh/models contains pretrained BDEIVH estimators for idealistic transmission trees and OROV-like trees with 30–49, 50–149, 150–249 and 250–350 tips. They were trained under the following BDEIVH parameter ranges, where U stands for uniform distribution:
| Parameter | Range / Value |
|---|---|
| RHH | U (1, 5) |
| RVH | U (0.5, RHH ) |
| RHV | RHH / RVH |
| dV | U (10, 20) [days] |
| dinc,V | U (1, dV − 1) [days] |
| dinf,V | dV - dinc,V [days] |
| dH | U (3, 15) [days] |
| dinc,H | U (1, dH − 1) [days] |
| dinf,H | dH - dinc,H [days] |
| ρH | U (0.01, 0.5) |
| Tree size | 30–50, or 50–150, or 150–250, or 250–350 [tips] |
Example OROV clusters
In the folder genomic_clusters we provide 3 example OROV clusters with their estimated sampling probabilities (ρH) from the corresponding studies. The trees are in Newick format and have branch lengths in years. The sampling probabilities were estimated as the number of cluster genomes divided by the estimated number of associated cases in the same location and time interval. The table below summarizes the information about these clusters.
| Example tree | Cluster | Size [tips] | ρH |
|---|---|---|---|
| cea.nwk | CE-2024, Ceará | 86 | 0.396 |
| es1.nwk | ES-I, Espírito Santo | 123 | 0.016 |
| am1.nwk | AM-I, Amazonas | 258 | 0.109 */ |
Installation
There are 3 alternative ways to run bdeivh on your computer: with apptainer, in Python3, or via command line (requires installation with Python3, potentially using conda).
Installation and use in python3 or command-line (for linux systems, recommended Ubuntu 21 or newer versions)
You could either install python (version 3.10 or higher) system-wide and then install bdeivh via pip:
sudo apt install -y python3 python3-pip python3-setuptools python3-distutils
pip3 install bdeivh
or alternatively, you could install python (version 3.10 or higher) and bdeivh via conda (make sure that conda is installed first). Here we will create a conda environment called phylodyn:
conda create --name phylodyn python=3.10
conda activate phylodyn
pip install bdeivh
Basic usage in a command line
If you installed bdeivh in a conda environment (here named phylodyn), do not forget to first activate it, e.g.
conda activate phylodyn
To see available options, run the command with the --help option:
bdeivh_infer --help
Estimating epidemiological parameters
On the full tree
The following example estimates the parameters of the Ceará tree cea.nwk (option --tree)
with the BDEIVH model trained on OROV-like trees (options --tree_type),
and assuming the sampling probability is 0.396 (option --sampling_probability).
The tree's branch lengths are measured in years (option --tree_scale, where 1 stands for years (default) and 0 for days).
bdeivh_infer --tree ../genomic_clusters/cea.nwk --tree_scale 1 --sampling_probability 0.396 --tree_type OROV
The tree is encoded, the parameters are estimated, and the results are written to a file cea_predicted_parameters.csv in the same folder as the input tree.
Adding an option --keep_intermediate will additionally save the tree with branches measured in days (cea_rescaled_trees.nwk) and its encoding as a TSV table (cea_encoded_trees.tsv).
Cumulative estimates through time
In order to see how estimates change over time,
one can run the estimation of the parameters cumulatively through time,
i.e., by cutting the tree at different time points
and running the inference on the subtrees (containing all the tips sampled till the cutoff time point).
This is achieved with the option --temporal.
The following example estimates the parameters though time on the Ceará tree cea.nwk (option --tree),
with the BDEIVH model trained on OROV-like trees (option ----tree_type),
assuming the sampling probability is 0.396 (option --sampling_probability).
The tree's branch lengths are measured in years (option --tree_scale, where 1 stands for years (default) and 0 for days).
The option --step_days indicates the number of days between consecutive predictions.
Here we set it to 7 days, i.e.,
we will run the inference on the subtrees containing all the tips sampled till 7, 14, 21, ... days
from the root of the tree.
The final cutoff includes the full tree.
The same sampling probability applies throughout.
The parameters will only be estimated for the cut-offs that have the number of sampled tips within the pre-trained model ranges.
bdeivh_infer --tree ../genomic_clusters/cea.nwk --tree_scale 1 --sampling_probability 0.396 --tree_type OROV \
--temporal --step_days 7
The tree is encoded, the parameters are cumulatively
estimated and the results are written to a file cea_temporal_predictions.csv
(a table with the cutoff, tip count, BDEIVH model used, status -- predicted or skipped due to tip size outside of the pretrained range -- and parameter estimates).
The choice between the pretrained models for 30–49, 50–149, 150–249 and 250–350 tips is made automatically.
Use with apptainer
Once apptainer is installed, run the following command (update the version as needed, here v0.1.0 is used as an example):
apptainer run docker://evolbioinfo/bdeivh:v0.1.0
This will launch a terminal session within the container, in which you can run bdeivh commands following the instructions for the command line ("Basic usage in a command line") above.
Interpreting the predictions
Each target has three CSV columns: the target name contains the median, and the suffixes _lower and _upper identifying the lower (2.5th) and the upper (97.5th) bounds of the 95% confidence interval predictions.
| Target | Interpretation |
|---|---|
Rvh |
RVH, expected number of humans infected by one infectious vector |
Rhv |
RHV, expected number of vectors infected by one infectious human |
Rhh |
RHH, expected secondary human infections from one infectious human over a complete human–vector–human cycle |
d_v |
dV, total duration of infection in vectors, including incubation and infectious periods, in days |
d_h |
dH, total duration of infection in humans, including incubation and infectious periods, in days |
v2h_ratio |
V/H, ratio of infected vectors to infected humans in the model |
In the transmission model, RHH=RHVRVH,
however the CNN estimates each target value quantiles separately, so use the Rhh column for the median cycle-level estimate.
The genomic prediction script exports raw model quantiles.
Reproduce training and evaluation
Pretrained prediction starts directly from a dated tree. To regenerate an estimator, follow the training/test/calibration workflows in the tree_simulation folder, then run the DL model training/testing notebooks in the bdeivh_training_testing folder.
Metadata
Release files for bdeivh 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bdeivh-0.1.1.tar.gz | 774.4 kB | Without provenance | Details for bdeivh-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bdeivh-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for bdeivh-0.1.1-py3-none-any.whl |
Total release size: 1.5 MB
Release files / bdeivh-0.1.1.tar.gz
| Download URL | bdeivh-0.1.1.tar.gz |
|---|---|
| Size | 774.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05951ef9c2556c10658ceedfdbf1adb6b984acc439f4a257a1e6a1796b166a92
|
|
BLAKE2b-256 checksum How to use checksums |
ee9ba9b3cd616cfcaa70f6b993e390e5ca014a335c43bd3896dc526326b84c06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.18
|
Release files / bdeivh-0.1.1-py3-none-any.whl
| Download URL | bdeivh-0.1.1-py3-none-any.whl |
|---|---|
| Size | 770.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
349c35569fbb9947561d3d99d7fbf4f1fe9b80b2ff2ff83380678158add5f015
|
|
BLAKE2b-256 checksum How to use checksums |
ffd43a80f07dd3fb586137b0c856c32be291be60ed39f88dfae2af5401e28b1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.18
|
Security for bdeivh 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.