API Reference

The API reference is generated from the package docstrings. Rebuilding the docs is enough to pick up docstring updates.

Workflow objects

MethylSegPathway

High-level API that coordinates preparation, training, and segmentation.

MethylDataPrep

Normalize methylation input tables into the canonical SampleInfo schema.

SampleInfo

Simple container for sample metadata and prepared methylation rows.

MethylSegConfig

Lightweight helper that knows how to build a serializable dictionary from a MethylSegPathway instance and how to write/read YAML.

MethylStateAssigner

Create per-CpG window summaries and assign coarse methylation states.

MethylStateAnalyzer

Analyze learned state separation and define rule-based CpG states.

MethylSegmentor

Class to handle segmentation of methylation data using HMMs.

Enums and labels

MethylStateAssignmentMethod

Strategies for mapping emissions to biological methylation states.

MethylationStates

Canonical biological methylation states used throughout the package.

HMMType

Supported HMM model types for segmentation.

HMM backends

MethylSegHMM

Abstract base class for methylseg HMM backends.

StickyCategoricalMethylSegHMM

Categorical HMM with strong self-transition priors for smoother segments.

CTMethylSegHMM

Continuous-time HMM backend for sparsely spaced CpGs along a chromosome.

Utility helpers

get_biological_state_colors

Return a fixed biological-state palette keyed by the canonical enum values.

get_cluster_colors

Return a discrete colormap and color lookup for integer cluster labels.