Visualize methylation and copy-number data from BedMethyl files
Project description
crstlmeth
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.gzfiles - 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.gzinput 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, orMLPA_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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crstlmeth-0.1.2.tar.gz.
File metadata
- Download URL: crstlmeth-0.1.2.tar.gz
- Upload date:
- Size: 108.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75e7fcb25e4b132ebb152b5feea676d38f599c5d3e247d373c68b317bd8d4b89
|
|
| MD5 |
b56903daf58f3492d83cc1c6b2870206
|
|
| BLAKE2b-256 |
051887a9c7b4539885790be6dc1e54f077277420ecb7056d10c81cffe2d4d8a5
|
Provenance
The following attestation bundles were made for crstlmeth-0.1.2.tar.gz:
Publisher:
release.yaml on IHGGM-Aachen/crstlmeth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crstlmeth-0.1.2.tar.gz -
Subject digest:
75e7fcb25e4b132ebb152b5feea676d38f599c5d3e247d373c68b317bd8d4b89 - Sigstore transparency entry: 2256140361
- Sigstore integration time:
-
Permalink:
IHGGM-Aachen/crstlmeth@39e05044940d88dd1a00096c8320ffdd87a188c1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/IHGGM-Aachen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@39e05044940d88dd1a00096c8320ffdd87a188c1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file crstlmeth-0.1.2-py3-none-any.whl.
File metadata
- Download URL: crstlmeth-0.1.2-py3-none-any.whl
- Upload date:
- Size: 127.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c485cd35b091872b6080195f5bf08b50f3d468ccfe0a0f7e1ba8a0243c82bcb
|
|
| MD5 |
c64465d8716bc3cb9eff0eaf0a2b1ea4
|
|
| BLAKE2b-256 |
a36bb0ab346b540c4f76c378ce96e4b81404d5298d9ec078e98c4847c2c4665d
|
Provenance
The following attestation bundles were made for crstlmeth-0.1.2-py3-none-any.whl:
Publisher:
release.yaml on IHGGM-Aachen/crstlmeth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crstlmeth-0.1.2-py3-none-any.whl -
Subject digest:
3c485cd35b091872b6080195f5bf08b50f3d468ccfe0a0f7e1ba8a0243c82bcb - Sigstore transparency entry: 2256140362
- Sigstore integration time:
-
Permalink:
IHGGM-Aachen/crstlmeth@39e05044940d88dd1a00096c8320ffdd87a188c1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/IHGGM-Aachen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@39e05044940d88dd1a00096c8320ffdd87a188c1 -
Trigger Event:
workflow_dispatch
-
Statement type: