Skip to main content

Estimation of BDPN parameters from phylogenetic trees.

Project description

bdpn

Estimator of BDPN model parameters from phylogenetic trees.

BD-PN model

BD-PN model has 5 parameters:

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

As in the basic birth-death model [Stadler 2009], all the individuals are in the same state. They can transmit with a constant rate λ, get removed with a constant rate ψ, and their pathogen can be sampled upon removal with a constant probability p. 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 pn. Upon notification, the partner is removed almost instantaneously (modeled via a constant notified removal rate φ >> ψ) and their pathogen is sampled.

BD-PN 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.

Epidemiological parameters:

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

Installation

To install bdpn:

python3 setup.py install

Usage in command line

BDPN parameter estimation

The following command estimated the BDPN parameters for a given tree tree.nwk and a given sampling probability p=0.4, and saves the estimated parameters to a comma-separated file estimates.csv:

bdpn_infer --p 0.4 --nwk tree.nwk --log estimates.csv

To see detailed options, run:

bdpn_infer --help

PN test

The following command applies the PN test to a given tree tree.nwk and saves the PN-test value to the file cherry_test.txt:

pn_test --nwk tree.nwk --log cherry_test.txt

To see detailed options, run:

pn_test --help

Project details


Download files

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

Source Distribution

bdpn-0.1.5.tar.gz (30.3 kB view hashes)

Uploaded Source

Built Distribution

bdpn-0.1.5-py3-none-any.whl (32.8 kB view hashes)

Uploaded Python 3

Supported by

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