Analysis: an

Analysis: an#

Downstream statistical analysis library. Pure functions with no project-specific knowledge, organised into four subpackages by role:

Subpackage

Input

Output

compute

numpy arrays / DataFrames

arrays / dicts (no I/O)

plot

results + output_path

figure written to disk

filters

obs or var DataFrame

boolean np.ndarray mask

config

none (static)

configuration dicts

Compute#

Pure statistical compute functions. No AnnData dependency (except ep_classification).

smftools.analysis.compute.autocorrelation

autocorrelation.py — NaN-aware binary autocorrelation over irregularly spaced positions.

smftools.analysis.compute.pearson

NaN-aware position × position Pearson correlation matrices.

smftools.analysis.compute.hmm_features

Interval extraction from binary HMM feature layers.

smftools.analysis.compute.ep_classification

Enhancer/promoter NDR state classification per read.

smftools.analysis.compute.ls_periodicity

ls_periodicity.py — Lomb-Scargle periodogram utilities for nucleosome analysis.

smftools.analysis.compute.dimensionality_reduction

dimensionality_reduction.py — PCA → UMAP → KNN → Leiden pipeline for per-read matrices.

smftools.analysis.compute.metrics_store

metrics_store.py — Per-run Zarr store for computed per-read analysis metrics.

smftools.analysis.compute.ml_cnn

Matrix-level helpers for 1D CNN binary classifiers.

smftools.analysis.compute.ml_metrics

Matrix-level helpers for binary classifier fitting and evaluation.

smftools.analysis.compute.ml_splits

Matrix/table-level split helpers for machine-learning evaluation.

smftools.analysis.compute.read_cache

Reader/writer utilities for the per-read modification matrix cache.

Plot#

Figure rendering. Accepts results and an explicit output_path; writes a figure to disk.

smftools.analysis.plot.heatmaps

heatmaps.py — Pearson correlation and covariance heatmap rendering.

smftools.analysis.plot.histograms

histograms.py — Interval distribution histograms with rolling mean, peak calling, and optional Gaussian fit overlay.

smftools.analysis.plot.autocorr

autocorr.py — ACF overlay, LS periodogram, paired barplot, and metric histogram rendering.

smftools.analysis.plot.embeddings

embeddings.py — Scatter and density plots for 2D embeddings (PCA/UMAP).

smftools.analysis.plot.locus

locus.py — Locus map rendering for SMF accessibility data.

smftools.analysis.plot.ml

Generic plotting helpers for binary classifier evaluation.

Filters#

Boolean mask builders for obs-level and var-level (position) selection.

smftools.analysis.filters.obs_filters

Composable obs-level filters for AnnData.

smftools.analysis.filters.position_filters

position_filters.py — Genomic position selection from AnnData var coordinates.

Config#

Static configuration objects; no runtime inputs.

smftools.analysis.config.hmm_histogram

Per-feature-type binning, rolling-mean, and peak-calling config for HMM feature histograms.