Skip to main content

crstlmeth logo

crstlmeth

Checks Docker Lint PyPI Python versions License GitHub stars

Clinical and ReSearch Tool for anaLysis of METHylation data

crstlmeth is a modular toolkit for analyzing, visualizing, and inspecting tabix-indexed bedMethyl data.

It supports haplotype-resolved methylation analysis, copy-number visualization, cohort reference creation, CpG-level methylation profiles, and an interactive Streamlit web interface.

Features

  • Command-line interface and Streamlit web UI
  • Methylation and copy-number analysis from bgzipped .bedmethyl.gz files
  • Haplotype-aware sample handling for hap1, hap2, and ungrouped tracks
  • CMETH cohort references with region-level and CpG-level summaries
  • Interactive CpG profile plots with genomic coordinates and CpG tables
  • Support for built-in kits and custom BED region files
  • Reproducible CLI workflows and structured logs

Installation

Requirements:

  • Python >= 3.12
  • tabix
  • bgzipped and tabix-indexed .bedmethyl.gz input files

From PyPI

pip install crstlmeth

From source

git clone https://github.com/IHGGM-Aachen/crstlmeth.git
cd crstlmeth
pip install -e .

Development install

git clone https://github.com/IHGGM-Aachen/crstlmeth.git
cd crstlmeth
pip install -e ".[all]"

Usage

Launch the web interface

crstlmeth web

This starts the multi-page Streamlit app on port 8501.

Show available commands

crstlmeth --help
crstlmeth reference --help
crstlmeth plot --help

Create a CMETH reference

crstlmeth reference create \
  --kit regions.bed \
  --include-cpgs \
  --description "Example cohort reference" \
  -o reference.cmeth.gz \
  CTRL001_1.bedmethyl.gz \
  CTRL001_2.bedmethyl.gz \
  CTRL001_ungrouped.bedmethyl.gz \
  CTRL002_1.bedmethyl.gz \
  CTRL002_2.bedmethyl.gz \
  CTRL002_ungrouped.bedmethyl.gz

Validate a CMETH reference

crstlmeth reference validate reference.cmeth.gz

Plot a CpG methylation profile

crstlmeth plot cpg-profile \
  --cmeth reference.cmeth.gz \
  --region "SNURF:TSS-DMR" \
  --sample-track both_haps \
  --x-mode index \
  --export-cpg-table snurf_cpg_profile.tsv \
  --out-html snurf_cpg_profile.html \
  --out snurf_cpg_profile.png \
  SAMPLE_1.bedmethyl.gz \
  SAMPLE_2.bedmethyl.gz \
  SAMPLE_ungrouped.bedmethyl.gz

Plot methylation

crstlmeth plot methylation \
  --cmeth reference.cmeth.gz \
  --kit regions.bed \
  --out methylation.png \
  SAMPLE_ungrouped.bedmethyl.gz

Plot copy number

crstlmeth plot copynumber \
  --cmeth reference.cmeth.gz \
  --kit regions.bed \
  --out copy_number.png \
  SAMPLE_1.bedmethyl.gz \
  SAMPLE_2.bedmethyl.gz \
  SAMPLE_ungrouped.bedmethyl.gz

Input expectations

Input files must be bgzipped and tabix-indexed:

sample.bedmethyl.gz
sample.bedmethyl.gz.tbi

Supported sample role suffixes are:

SAMPLE_1.bedmethyl.gz
SAMPLE_2.bedmethyl.gz
SAMPLE_ungrouped.bedmethyl.gz

SAMPLE.1.bedmethyl.gz
SAMPLE.2.bedmethyl.gz
SAMPLE.ungrouped.bedmethyl.gz

SAMPLE-1.bedmethyl.gz
SAMPLE-2.bedmethyl.gz
SAMPLE-ungrouped.bedmethyl.gz

The web sample collector detects hap1, hap2, ungrouped, and matching .tbi files before running plots.

Region input

Regions can be provided as:

  • built-in kit names, for example ME030, ME032, ME034, or MLPA_all
  • custom BED files

Custom BED files should contain at least four columns:

chrom    start    end    name

Coordinates are expected to be BED-style zero-based half-open intervals.

CMETH references

CMETH references store cohort-level summary statistics.

A CMETH file can contain two feature levels:

feature_type = region
feature_type = cpg

Region rows store DMR-level aggregate summaries.

CpG rows store observed CpG or methylation-locus summaries inside each parent region. These rows are used for CpG-resolution profile plots.

Small clinical or demo CMETH references may be packaged under:

crstlmeth/refs/

Large genome-wide CpG references should be generated or downloaded as external artifacts instead of being committed into the Python package.

Development checks

Run the local test suite:

python -m py_compile $(find crstlmeth tests -name "*.py")
pytest -q

Build the package:

python -m build
twine check dist/*

Build the Docker image:

docker build -t crstlmeth:dev .
docker run --rm crstlmeth:dev crstlmeth --help

License

MIT. See LICENSE.

Metadata

Release files for crstlmeth 0.1.4

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

Source distribution (sdist)

Source distribution for crstlmeth 0.1.4
File Size Uploaded
crstlmeth-0.1.4.tar.gz 108.7 kB Details

Built distribution (wheel)

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

Total release size: 236.7 kB

Release files / crstlmeth-0.1.4.tar.gz

Download URL crstlmeth-0.1.4.tar.gz
Size 108.7 kB
Tags Source
SHA-256 checksum
How to use checksums
73794a24a0c815ef443c120d9769c0ee0534d24240347071a647de0e6f304e15
BLAKE2b-256 checksum
How to use checksums
6da215ec88314f5cd030839a21b0f056034f2a7d498534af5aea12a27fe170d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release files / crstlmeth-0.1.4-py3-none-any.whl

Download URL crstlmeth-0.1.4-py3-none-any.whl
Size 128.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58d8513d53543ba46600994f4b5afa90f70779e04f072f2c2ca1d13c1c0698bd
BLAKE2b-256 checksum
How to use checksums
4aefaf9af6c778342376c6f1dd90f97b5c4c96f12ffc8ece95bd1ac04651063f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

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