MSig 0.2.0
Changelog
All notable changes to MSig are documented here. The format follows
Keep a Changelog and the project adheres
to Semantic Versioning.
[0.2.0] — 2026-05-XX
Fixed
- 2D Gaussian rectangle CDF —
vars_indep_time_markovin the
gaussian_theoreticalbranch now uses the inclusion-exclusion formula
F(b1,b2) − F(a1,b2) − F(b1,a2) + F(a1,a2). Affects everygaussian_theoretical
result. Empirical and KDE branches are unchanged. None of the published
case studies usegaussian_theoretical, so paper tables are not affected. - Empirical conditional consistent normalization — numerator and
denominator both use the lag-1 marginal overn−1transition pairs.
Removes an/(n−1)bias that previously triggered thecond_p > 1clamp
on small series. - KDE conditional uses lag-1 marginal — denominator now integrates
gaussian_kde(y[:-1])for theoretical consistency with the bivariate
KDE numerator. set_significancealways setsself.pvalue— every return path
(includingp_Q ∈ {0, 1}andn_matches ≥ max_possible_matches) now
populates the attribute, eliminating discrepancy between return value
and stored attribute.- Three momenti scripts —
NameErroron undefinedm(nows) and
wrong relative data paths (../data/→../../data/). The MOMENTI
experiments now run. scripts/compare_results.pyschema — reads the actual CSV columns
produced by experiment scripts (median_pvalue,median_probability,
#sig_motifs(≤0.01),#sig_hochberg,significantas percentage)
rather than the never-implementedpvalue/significant/pattern_probabilitycolumns.- Population-density MOMENTI — adds
s = 48to motif lengths,
matching paper Table 4 and the LAMA script. - Logger consistency —
logging.info→logger.infoinMSig.py. __init__.pyversion drift —__version__reads from
importlib.metadata.version("msig"). No more manual sync with
pyproject.toml.vars_dep_time_markovdocstring — cites paper Eq. (4) for the
unimplemented variable-dependent null-model formula.
Added
pattern_prob_floorkwarg onMotif.set_significance— opt-in
Laplace floor forp_Q = 0cases (zero-frequency problem). Default
Nonepreserves 0.1.x behaviour.EXCLUSION_ZONE_FACTORconstant in every experiment script and
experiments/common_utils.py— surfaces the trivial-match factor
(default0.5, matching published tables; paper §3.2 default is0.25).AVERAGE_DELTAmodule constant — replaces the per-script
average_delta = 0.3hardcode.experiments.common_utils.get_dataset_paths— single-source helper
for resolving data and results paths regardless of cwd; adopted by all
nine experiment scripts.tests/golden/— paper-reproducibility regression suite locks in
the CSV outputs so future drift is caught.CITATION.cff,CONTRIBUTING.md,REPRODUCING_EXPERIMENTS.md— accessibility documentation.msig/py.typed— PEP 561 marker enabling downstream type checking.- Validation that
δ = 0is rejected forkdeandgaussian_theoretical
null models (silently producedp_Q = 0before). - Private helpers
_rect_prob_1dand_rect_prob_2dinmsig/MSig.py
centralise the rectangle-probability computation across model branches.
Changed
bonferroni_correction(n_tests, alpha=0.05)— first parameter renamed.
Backward-compatible: still accepts iterables for 0.1.x callers.idd_correctiondocumentation — corrected to "identically-distributed
dimensions" (was wrongly described as "Independent Dimension Discovery"
applying BH FDR).- mSTUMP "conservative" regime comment clarifies that the formula is
D_max = √s · δ · 0.5(which produced the published tables), not the
paper'sD_max = (1/q) Σ δ_j(no√sscaling). - Python support range aligned to
>=3.11,<3.14acrosspyproject.toml,
environment.yml,requirements.txt, classifiers, mypy, and black. bonferroni_correctionandbenjamini_hochberg_fdrtest coverage —
new canonical Benjamini & Hochberg (1995) §3 example replaces a
non-standard "returns α when nothing significant" assertion.
Removed
PYPI_DESCRIPTION.md— duplicate ofREADME.md; never reached PyPI
(pyproject.tomlusesreadme = "README.md"). Removed to eliminate
drift between the two.- Dead
OverflowErrorfallback inset_significance—scipy.stats.binom.sf
underflows silently and never raises this exception.
Migration from 0.1.x
bonferroni_correction([0.1, 0.2, 0.3])continues to work; new code
should passbonferroni_correction(3)directly.- If any user code relied on
gaussian_theoreticalp-values, expect
numerically different results after the inclusion-exclusion fix. - If any user code relied on inspecting
motif.pvalueafter the
p_Q ∈ {0, 1}edge cases, the attribute is now always correct.
[0.1.3] — 2025-10-27
- Hotfix release.
[0.1.2] — 2025-10-26
- Maintenance release.
[0.1.1] — 2024-07-03
- Initial PyPI publication; corresponds to paper-submission code.
[0.1.0] — 2024-07-03
- First release.