Skip to main content

Python interface to R statistics via Docker

Project description

tombolo

Python interface to R statistics via Docker.

Requirements

Docker must be installed and running, and the tombolo image must be pulled:

docker pull ethandavisecd/tombolo:latest

Installation

pip install tombolo

Usage

Network meta-analysis

nma expects pairwise contrast data. Each row is a comparison between two treatments within one study, expressed as a mean difference and its standard error:

import tombolo

data = [
    {"studlab": "Study A", "treat1": "X", "treat2": "Y", "TE": 0.32, "seTE": 0.12},
    {"studlab": "Study A", "treat1": "X", "treat2": "Z", "TE": 0.48, "seTE": 0.14},
    {"studlab": "Study B", "treat1": "X", "treat2": "Z", "TE": 0.51, "seTE": 0.18},
    {"studlab": "Study C", "treat1": "Y", "treat2": "Z", "TE": 0.19, "seTE": 0.15},
]

result = tombolo.nma(data, greater_is_better=True)

Bayesian network meta-analysis

bnma expects arm-level summary statistics:

data = [
    {"study": "Study A", "treatment": "X", "mean": 0.82, "std.dev": 0.21, "sampleSize": 30},
    {"study": "Study A", "treatment": "Y", "mean": 0.74, "std.dev": 0.19, "sampleSize": 30},
    {"study": "Study B", "treatment": "X", "mean": 0.79, "std.dev": 0.23, "sampleSize": 25},
    {"study": "Study B", "treatment": "Z", "mean": 0.61, "std.dev": 0.25, "sampleSize": 25},
]

result = tombolo.bnma(data, greater_is_better=True)

greater_is_better controls the direction of ranking. Set to False when lower values are preferable (e.g. error rates).

Plots

from tombolo.plots import (
    ranking_plot,
    league_table,
    forest_plot,
    heterogeneity_table,
    prediction_table,  # nma only
    convergence_table, # bnma only
)

ranking_plot(result)
league_table(result)
forest_plot(result, reference="X")
heterogeneity_table(result)

Each function returns a matplotlib.figure.Figure.

Configuration

By default tombolo uses the ethandavisecd/tombolo:latest Docker image. To use a different image:

export TOMBOLO=myorg/tombolo:v1.0

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

tombolo-0.2.3.tar.gz (118.2 kB view details)

Uploaded Source

Built Distribution

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

tombolo-0.2.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file tombolo-0.2.3.tar.gz.

File metadata

  • Download URL: tombolo-0.2.3.tar.gz
  • Upload date:
  • Size: 118.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tombolo-0.2.3.tar.gz
Algorithm Hash digest
SHA256 6e849000ccd5a5351d0619bd25178f5124f0b9932e184c788f26886743905fd1
MD5 dcc4430ffb825e189310f8835bef7504
BLAKE2b-256 a4ae240a01c2fb822b39fc00cf7b66dddcb6238418d6170d5c23f987972c78d3

See more details on using hashes here.

File details

Details for the file tombolo-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: tombolo-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tombolo-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2b7fab3dadc1b971125186f9145cdbcbc2fa3cd00e20dd0e6fd00e195d8f6c
MD5 a02bdbcefbffb38e01110bc31a44b7d4
BLAKE2b-256 3f96182eda0bbb4c78b68ffc5c2b7de9dad491c673af3f5b981d41036f4a0b70

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