Skip to main content

Estimation of BDEISS-CT parameters from phylogenetic trees.

Project description

bdeissct_dl

Estimator of BDEISS-CT model parameters from phylogenetic trees

GitHub release PyPI version PyPI downloads Docker pulls

BDEISS-CT model

BD-PN model extends the classical birth-death (BD) model with incomplete sampling [Stadler 2009], by adding partner notification (PN). Under this model, infected individuals can transmit their pathogen with a constant rate λ, get removed (become non-infectious) with a constant rate ψ, and their pathogen can be sampled upon removal with a constant probability ρ. On top of that, in the BD-PN model, at the moment of sampling the sampled individual might notify their most recent partner with a constant probability υ. Upon notification, the partner is removed almost instantaneously (modeled via a constant notified removal rate φ >> ψ) and their pathogen is sampled.

BD-PN model therefore has 5 parameters:

  • λ -- transmission rate
  • ψ -- removal rate
  • ρ -- sampling probability upon removal
  • υ -- probability to notify the last partner upon sampling
  • φ -- removal (and sampling) rate after notification

These parameters can be expressed in terms of the following epidemiological parameters:

  • R0=λ/ψ -- reproduction number
  • 1/ψ -- infectious time
  • 1/φ -- partner removal time

BD-CT model makes 3 assumptions:

  1. only observed individuals can notify (instead of any removed individual);
  2. notified individuals are always observed upon removal;
  3. only the most recent partner can get notified.

For identifiability, BD-PN model requires one of the three BD model parameters (λ, ψ, ρ) to be fixed.

BDEISS-CT parameter estimator

The bdeissct_dl package provides deep-learning-based BDEISS-CT model parameter estimator from a user-supplied time-scaled phylogenetic tree. User must also provide a value for one of the three BD model parameters (λ, ψ, or ρ). We recommend providing the sampling probability ρ, which could be estimated as the number of tree tips divided by the number of declared cases for the same time period.

Input data

One needs to supply a time-scaled phylogenetic tree in newick format. In the examples below we will use an HIV tree reconstructed from 200 sequences, published in [Rasmussen et al. PLoS Comput. Biol. 2017], which you can find at PairTree GitHub and in hiv_zurich/Zurich.nwk.

Installation

There are 4 alternative ways to run bdeissct_dl on your computer: with docker, apptainer, in Python3, or via command line (requires installation with Python3).

Run in python3 or command-line (for linux systems, recommended Ubuntu 21 or newer versions)

You could either install python (version 3.9 or higher) system-wide and then install bdeissct_dl via pip:

sudo apt install -y python3 python3-pip python3-setuptools python3-distutils
pip3 install bdeissct_dl

or alternatively, you could install python (version 3.9 or higher) and bdeissct_dl via conda (make sure that conda is installed first). Here we will create a conda environment called phyloenv:

conda create --name phyloenv python=3.12
conda activate phyloenv
pip install bdeissct_dl

Basic usage in a command line

If you installed bdeissct_dl in a conda environment (here named phyloenv), do not forget to first activate it, e.g.

conda activate phyloenv

Run the following command to estimate the BDEISS_CT parameters and their 95% CIs for this tree, assuming the sampling probability of 0.25, and save the estimated parameters to a comma-separated file estimates.csv.

bdeissct_infer --nwk Zurich.nwk --ci --p 0.25 --log estimates.csv

Help

To see detailed options, run:

bdeissct_infer --help

Run with docker

Basic usage

Once docker is installed, run the following command to estimate BDEISS-CT model parameters:

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

This will produce a comma-separated file estimates.csv in the <path_to_the_folder_containing_the_tree> folder, containing the estimated parameter values and their 95% CIs (can be viewed with a text editor, Excel or Libre Office Calc).

Help

To see advanced options, run

docker run -t evolbioinfo/bdeissct -h

Run with apptainer

Basic usage

Once apptainer is installed, run the following command to estimate BDEISS-CT model parameters (from the folder where the Zurich.nwk tree is contained):

apptainer run docker://evolbioinfo/bdeissct --nwk Zurich.nwk --ci --p 0.25 --log estimates.csv

This will produce a comma-separated file estimates.csv, containing the estimated parameter values and their 95% CIs (can be viewed with a text editor, Excel or Libre Office Calc).

Help

To see advanced options, run

apptainer run docker://evolbioinfo/bdeissct -h

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bdext-0.1.49.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bdext-0.1.49-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file bdext-0.1.49.tar.gz.

File metadata

  • Download URL: bdext-0.1.49.tar.gz
  • Upload date:
  • Size: 37.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for bdext-0.1.49.tar.gz
Algorithm Hash digest
SHA256 1d1b56b7316957590483425a164da1ae16bf01829c27940456b28e22e9762d39
MD5 32a7efa70d753ab26b364ebdac8c31a4
BLAKE2b-256 3b7b6f482b55371f091ca6cf8768f0b41412a5d0690e751b8bb1b5c6df71950f

See more details on using hashes here.

File details

Details for the file bdext-0.1.49-py3-none-any.whl.

File metadata

  • Download URL: bdext-0.1.49-py3-none-any.whl
  • Upload date:
  • Size: 43.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for bdext-0.1.49-py3-none-any.whl
Algorithm Hash digest
SHA256 747ce416381e2c795e5ee99d20d58efd0b18e2d01b17b4678ceb882060c24b06
MD5 c57c7e435bfe93b1045db6f0c2abd3ef
BLAKE2b-256 ec7ad7c7c75543b1b47c297a087bf2d55b15e774cd3b56fe21083c6423f69f29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page