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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tombolo-0.2.2.tar.gz
  • Upload date:
  • Size: 117.9 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.2.tar.gz
Algorithm Hash digest
SHA256 5da87c1998851f4a3f895ee4c3004abc847dfcb784153b6f62a13af78e61c0a3
MD5 d0903e26703b82246768586c75a45f14
BLAKE2b-256 2d91d1dfb8c3fde1e76a4af6287826572ef58c0220e243b9cadd09670fad24e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tombolo-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d4fcd56ea490ec81d95f6d63b7d11d72f62d17710aea8bff6a2b5ee072cdafd6
MD5 e41c3f877942bdef88c53bf145fbddf1
BLAKE2b-256 7496e57d1230f30fe7c23c5fdfa87d3257a667f1e06f9b801f692ea300aafddb

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