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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tombolo-0.2.0.tar.gz
  • Upload date:
  • Size: 117.6 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.0.tar.gz
Algorithm Hash digest
SHA256 c4cdcc9c6686adce8f6180f42bad0dd2d8427dc1e1918ca0dfa1244d0d7aed23
MD5 086fdb1663f4e91588e9c031a943a7e8
BLAKE2b-256 86de7753267bbf65d3eb3e11998fd9dfedf778740d49d89568d888a8e15e7537

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tombolo-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 409d9f06c4505c6ddb3b465a07b3b0ae057cff27bd3f28b906e50cf17ec91a12
MD5 3a8a063b1a85c4c617a10b85fc86f6c5
BLAKE2b-256 03261f5aac21fafbe46ea3ce85855d6278a99744fa82cbf9bf957b1872f7ca6a

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