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.1.tar.gz (117.7 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.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tombolo-0.2.1.tar.gz
  • Upload date:
  • Size: 117.7 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.1.tar.gz
Algorithm Hash digest
SHA256 1a0483788b6f13e63709f9ac89c0c84b7557b0360439862d977c1963b8daaadb
MD5 d1b120f269130c85192abb31e2ffba4e
BLAKE2b-256 11e4a256280b8f622e73a701256476f2a822eabff5e9d30267642eab6975d6e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tombolo-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c774d43f80cf054aacea0b660fac58f65f9625191a89a31579b3089661b1a31
MD5 beeb68e7933508274595a807d9fe944e
BLAKE2b-256 5ffeffa40c66342855f1eae0213b871ec1f22a4a0e3dc6b197247a90b9eba5c4

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