Skip to main content

build codecov PyPI

ctDNA: Circulating tumor DNA

Python package to compute the shedding of a biomarker from cancer cells into the bloodstream and its analysis in liquid biopsies (small blood samples). The package can be run from the command line or various methods can be important for customized calculations. See examples below. See preprint Avanzini et al. (2020) for further technical details: https://doi.org/10.1101/2020.02.12.946228

Releases

  • ctdna 0.1.0 2020-05-06: Initial release of package.
  • ctdna 0.1.1 2020-08-18: Added various examples and unittests. Added methods to calculate detection probabilities.

Installation and Setup

  1. Easiest is to install Mini anaconda and create a new python environment in a terminal window with conda create --name py36 python=3.6 and activate it with conda activate py36
  2. Clone the repository from GitHub with git clone https://github.com/reiterlab/ctdna.git
  3. If you want to have system-wide access, create distribution packages by going into the main folder with cd <CTDNA_DIRECTORY>, run python setup.py clean sdist bdist_wheel and install ctdna to your python environment by executing pip install -e <CTDNA_DIRECTORY>
  4. Test installation with python -c 'import ctdna' and pytest <CTDNA_DIRECTORY>/tests/
  5. To uninstall the package use pip uninstall ctdna or conda remove ctdna

Manual

ctdna can be run in the following modes:

  1. dynamics: simulates the evolutionary dynamics of a tumor and its biomarkers over time
  2. distribution: simulates the biomarker distribution at a given tumor size or tumor age
  3. detection: simulates the detection size of a growing tumor for repeated testing at a desired annual false positive rate or a specified p-value threshold
  4. roc: computes the ROC (receiver operating characteristic)

See <CTDNA_DIRECTORY>/ctdna/settings.py for default parameter values.

Examples

  • example.ipynb: Calculate the probability to detect a specific actionable mutation in tumors with diameters of 1, 1.2, 1.5, and 2 cm with a specificity of 99%

  • Simulate tumor growth and ctDNA shedding dynamics of 10 cancers: ctdna dynamics -b 0.14 -d 0.13 -M 1e10 -n 10

  • Simulate ctDNA at a given tumor size for 100 subjects: ctdna distribution -b 0.14 -d 0.13 -n 100 -M 1e8 --q_d=1.4e-4

  • Simulate monthly relapse testing for previously simulated tumor growth and shedding dynamics: ctdna detection monthly -b 0.14 -d 0.13 -M 1e10 --panel_size 20 --n_muts 20 --annual_fpr 0.05 --seq_eff 0.5 --imaging_det_size 1e9

  • Simulate annual screening with CancerSEEK for previously simulated tumor growth and shedding dynamics: ctdna detection annually -b 0.14 -d 0.136 -M 1e11 --panel_size 2000 --n_muts 1 --annual_fpr 0.01 --seq_eff 0.5 --diagnosis_size 2.25e10

  • Simulate annual screening with CAPPSeq for previously simulated tumor growth and shedding dynamics: ctdna detection annually -b 0.14 -d 0.136 -M 1e11 --panel_size 300000 --n_muts 10 --pval_th 1.5e-7 --seq_eff 0.5 --diagnosis_size 2.25e10

Arguments

  • -b <> or --birth_rate <>: birth rate of cancer cells

  • -d <> or --death_rate <>: death rate of cancer cells

  • --q_d <>: ctDNA shedding probability per cell death

  • --q_b <>: ctDNA shedding probability per cell birth

  • --lambda1 <>: ctDNA shedding probability per cell per day

  • --t12_mins <>: cfDNA half-life time in minutes

  • --tube_size <>: size of blood sample tube (liters; default 0.015 l)

  • --panel_size <>: sequencing panel size

  • --seq_err <>: sequencing error rate per base-pair (default: 1e-5)

  • --seq_eff <>: sequencing efficiency, ie. fraction of the sampled molecules that are actually successfully sequenced (default: 0.5)

  • --n_muts <>: number of clonal mutations in the cancer that are covered by the sequencing panel

  • -M <> or --det_size <>: tumor detection size where biomarker level is evaluated or size where dynamics simulations are stopped

  • -T <> or --sim_time <>: simulations end when cancer reaches the given time

  • --exact_th <>: approximate growth of tumor after this given threshold is reached

  • -o <> or --output_dir <>: output directory for files (default is defined in <CTDNA_DIRECTORY>/ctdna/settings.py)

  • --biomarker_wt_freq_ml <> Optional argument to fix the wildtype haploid genome equivalents (hGE) per plasma ml to the given number instead of sampling the plasma DNA concentration from a Gamma distribution with parameters specified in <CTDNA_DIRECTORY>/ctdna/settings.py

Detection mode

  • --annual_fpr <>: Specifies desired annual false positive rate (1 - specificity) if test is repeated at the given frequency over a year
  • --pval_th <>: Instead of the desired annual false positive rate --annual_fpr, one can directly provide a p-value threshold that calls somatic point mutations in ctDNA

Authors: Stefano Avanzini & Johannes Reiter, Stanford University, https://reiterlab.stanford.edu

Metadata

Release files for ctdna 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ctdna 0.1.1
File Size Uploaded
ctdna-0.1.1.tar.gz 46.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ctdna 0.1.1
File Interpreter ABI Platform
ctdna-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 112.4 kB

Release files / ctdna-0.1.1.tar.gz

Download URL ctdna-0.1.1.tar.gz
Size 46.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a9d212ef4dc5823d06eb47eb9fcb30d44c6a0fcf84d9efd24121a1d0298bc88d
BLAKE2b-256 checksum
How to use checksums
7431a118b51dfc561c9a9c038d141e359cf10bfd8b282ae614b783e155b5ce99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.12

Release files / ctdna-0.1.1-py3-none-any.whl

Download URL ctdna-0.1.1-py3-none-any.whl
Size 66.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2435d0e53a76233393faa35bc84b7eeeabf6e46d82016302fb022090b3816848
BLAKE2b-256 checksum
How to use checksums
61f56b0f7b2046ab45752018e569a4e13f53630b21d7b5164a1484c0db164f3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.12

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page