MARADONER
MARADONER: Motif Activity Response Analysis Done Right
MARADONER is a tool for analyzing motif activities using promoter expression data. It provides a streamlined workflow to estimate parameters, predict deviations, and export results in a tabular form.
Installation
MARADONER needs Python 3.11 or newer:
pip install maradoner
Input files
All tables are plain text (.tsv or .csv, optionally gzipped) with named rows and named columns: the first line holds the column names and the first column holds the row names.
- Promoter expression (
ppromoters xssamples), in log scale. Rows are promoters, columns are samples. - Motif loadings (
ppromoters xmmotifs): how strongly each motif is associated with each promoter. Rows must use the same promoter names as the expression table; promoters that are missing from either table are dropped. Several loading matrices can be supplied at once (see--loading-postfix). - (Optional) Sample groups: which samples are replicates of the same condition. Either a JSON dictionary
{"control": ["sample_1", "sample_2"], "treated": ["sample_3", "sample_4"]}
or a text file with one group per line: the group name followed by its sample names. Without it every sample is a group of its own. - (Optional) Covariates (
--covariates): a table with sample names in the first column and one column per covariate (e.g. sex, age). Numeric covariates are z-scored, categorical ones are one-hot encoded.
Basic Workflow
A typical MARADONER analysis session involves running commands sequentially for a given project:
-
create: Initialize the project. This step parses your input files (promoter expression, motif loadings, optional motif expression, and sample groupings), performs initial filtering, and sets up the project's internal data structures.# Example: Initialize a project named 'my_project' maradoner create my_project path/to/expression.tsv path/to/loadings.tsv --sample-groups path/to/groups.json [other options...]
- Input files are typically tabular (.tsv, .csv), potentially compressed.
- You only need to provide input data files at this stage.
- Read the warnings:
createreports promoters, samples and motifs that it had to drop.
-
fit: Estimate the model's variance parameters and mean motif activities using the data prepared bycreate.maradoner fit my_project [options...]
-
predict: Estimate the deviations of motif activities from their means for each sample or group, based on the parameters estimated byfit.maradoner predict my_project [options...]
-
export: Save the final results, including estimated motif activities (mean + deviations), parameter estimates, goodness-of-fit statistics, and potentially statistical test results (like ANOVA) to a specified output folder.maradoner export my_project path/to/output_folder [options...]
The commands depend on each other: fit needs create, predict needs fit, and the commands that report results (export, gof, anova, contrast, grn) need predict. Re-running an earlier step invalidates the later ones: after a new fit run predict again (results of the outdated later steps are removed automatically).
What export writes
| Path | Content |
|---|---|
README.md |
Generated description of every file in the folder and of its columns. contrast, anova, grn, select-motifs, bayes_linreg and mara export add their files to it when they write into the same folder. |
activities/activity_group_raw.tsv, activity_group_raw_std.tsv |
Predicted deviations of motif activities per group (motifs x groups) and their posterior standard deviations. |
activities/activity.tsv |
The two tables above divided by each other, i.e. standardized activities. |
activities/z_score.tsv |
Absolute z-scores per group and an overall score per motif. |
activities/activity_raw.tsv |
Predicted deviations per sample. |
params/motif_means.tsv |
Mean activity of each motif and its standard error (params/covariates/ holds the same for every covariate, and tests/covariates/ a joint test for each covariate of more than two levels). |
params/motif_variances.tsv, params/group_variances.tsv |
Variance parameters with standard errors: tau per motif; error variance sigma and activity variance nu per group. filtered_motif_variances.tsv lists the motifs that predict left out because their variance is negligible. |
params/promoter_means.tsv, params/sample_means.tsv |
Promoter-wise and sample-wise intercepts. |
params/correlations/ |
Correlations between the parameter estimates. |
tests/asymptotics_based/sign.tsv |
Is the mean activity of a motif positive or negative? z statistic, one-sided p-values (pvalue_pos, pvalue_neg) and their FDR. |
tests/asymptotics_based/anova.tsv |
Does the activity of a motif vary across samples at all (tau > 0)? stat, p-value, FDR are a likelihood-ratio test; the wald_* columns hold the older, much less powerful Wald test. |
tests/prediction_based/anova.tsv |
Does the activity of a motif differ between groups? Based on the predicted deviations. |
params/family_variances.tsv, params/family_factors.tsv, tests/asymptotics_based/family_anova.tsv |
With fit --motif-families: the variance omega shared by the motifs of each family with its standard error, the factors of the covariance between families (fit --motif-lowrank) and a likelihood-ratio test of omega = 0. Without families the factors go to params/motif_factors.tsv. params/activity_correlations.tsv holds the correlations between motif activities that the fitted covariance implies. |
fov/ |
Goodness-of-fit statistics, if gof was run. |
Motifs appear in the activity and test tables only if predict kept them (see predict --filter-motifs).
Other Useful Commands
gof: Afterpredict, calculate Goodness-of-Fit statistics (like Fraction of Variance Explained or Correlation) to evaluate how well the model components explain the observed expression data.maradoner gof my_project [options...]
To evaluate the model on promoters it has not seen, hold some of them out at thefitstage and estimate their promoter-specific means beforegof:maradoner fit my_project --test-chromosomes 3 --test-chromosomes X # or --test-promoters-filename names.txt maradoner predict my_project maradoner estimate-promoter-mean my_project maradoner gof my_project
The held-out promoters take no part infit. Note, however, that the low-expression filter ofcreatehas already seen all promoters; usecreate --filter-lowexp-w 1if the testing set must not influence anything at all.anova: Test whether motif activities differ between the listed groups.maradoner anova my_project anova.tsv control treated_6h treated_24h
contrast: Test a linear combination of group activities, written as an algebraic expression of group names.maradoner contrast my_project "treated - control" path/to/output_folder maradoner contrast my_project "(a + b + c) / 3 - d" path/to/output_folder
With--covariates, the variables are covariates in place of groups, and their effects on motif activities are compared (covariate_contrast.tsv). The reference level of a categorical covariate stands for zero.maradoner contrast my_project "tissue_liver - tissue_muscle" path/to/output_folder --covariates
grn: Test each promoter against each motif in each group ("gene regulatory network"). The output is large: one promoters x motifs table per group.maradoner grn my_project path/to/output_folder
In a project with covariates,--covariate <name>tests the effect of a covariate on motif activities in place of the activities. All samples are used, and one table per covariate is written tobelief/covariates.maradoner grn my_project path/to/output_folder --covariate age
select-rank: Choose the number of factors forfit --activity-lowrank. Models with 1, 2, ... factors are fitted, and a factor is accepted if it lowers the REML deviance more than a factor does on data simulated from the model without it. Needs a fitted project and changes nothing in it.maradoner select-rank my_project --max-rank 3
select-motifs: If you provided multiple loading matrices increate(e.g., from different databases) with unique postfixes, this command helps select the single "best" variant for each motif based on statistical criteria. The output is a list of motif names intended to be used with the--motif-filenameoption in a subsequentcreaterun.maradoner select-motifs my_project best_motifs.txt # Then, potentially re-run create using the generated list: # maradoner create my_project_filtered ... --motif-filename best_motifs.txt
bayes_linreg: A different, single-sample model for data without replication across samples (fitneeds at least two samples). It goes straight from a project to result files.maradoner bayes_linreg my_project path/to/output_folder
generate: Create a synthetic dataset with known properties for testing or demonstration purposes.maradoner generate path/to/synthetic_data_output [options...]
mara: The classical (IS)MARA model, for comparison purposes (maradoner mara --help).
Model extensions
create --covariates covariates.tsv: mean motif activities depend on sample covariates.create --covariates covariates.tsv --formula "age * sex + batch": a formula chooses columns of the table and adds their interactions (a:b;a * bstands fora + b + a:b).fit --error-lowrank k/fit --activity-lowrank k: low-rank corrections for correlated noise / correlated activities across samples.exportwrites the factors toparams/error_factors.tsv/params/factors.tsv; the latter is a valid table forcreate --covariates.fit --motif-families families.txt/fit --motif-lowrank k: correlated activities of motifs. The covariance between motifs turns from the diagonalSigmaintoSigma + F (Omega + L L^T) F^T:Ftells which motifs belong to which family, the diagonalOmegaholds a variance per family, and the optionalLofkcolumns is a covariance between families. The file of families is a JSON dictionary{"family": ["motif", ...]}or a text file with a family per line (family motif motif ...). Without families each motif forms a family of one, and the covariance isSigma + L L^T.fit --motif-mean-prior ridge|families|covariance: a prior on the mean activities of motifs, with its variances estimated by REML. It shrinks the means when the motifs are many for the number of promoters, and the levels of held-out promoters are predicted better.fit --clustering KMeans|NMF --num-clusters k: replace motifs by clusters of motifs with similar loadings (useful when there are more motifs than the data can tell apart); all later commands then report clusters.fit --no-motif-variance: one common variance for all motifs, closer to the classical (IS)MARA.fit --promoter-variance(experimental): heuristic reweighting of promoters by their noise level.
Performance
MARADONER uses one thread for linear algebra by default: it mostly works with many small matrices, where the usual one-thread-per-core setting makes it considerably slower. Use maradoner --threads N <command> ... (or the MARADONER_THREADS environment variable) to change it; if OMP_NUM_THREADS and the like are already set in your environment they are respected.
On small and medium datasets a large part of the run time is spent compiling numerical code, the same code on every run. Set the environment variable MARADONER_JAX_CACHE to a folder (e.g. export MARADONER_JAX_CACHE=~/.cache/maradoner) to keep the compiled code between runs; repeated runs then start several times faster.
When something goes wrong
Problems with the input (a malformed table, sample names that do not match, a step that was skipped) are reported as a short Error: ... message that says what to fix. A long traceback, on the other hand, means an unexpected internal error: please report it via the issue tracker. Set the environment variable MARADONER_DEBUG=1 to get a traceback for every error.
Getting Help
Each command has various options for customization. To see the full list of commands and their detailed options, use the --help flag:
maradoner --help
maradoner create --help
maradoner fit --help
# and so on for each command
There's also a project doumentation available at maradoner.georgy.top.
Cite
Please cite the conference paper on MARADONER:
@inproceedings{meshcheryakov2026,
title={MARADONER: Motif Activity Response Analysis Done Right},
author={Meshcheryakov, Georgy and Buyan, Andrey and Favorov, Alexander and Makeev, Vsevolod Jurievich and Kulakovskiy, Ivan Vladimirovich},
booktitle={Proceedings of the 2026 18th International Conference on Bioinformatics and Biomedical Technology},
series={ICBBT 2026},
pages={264--269},
year={2026},
month=may,
publisher={ACM},
location={Suzhou, China},
doi={10.1145/3822521.3822537},
url={https://doi.org/10.1145/3822521.3822537},
}
The arXiv preprint is a longer manuscript with the mathematics in more detail, and it can be cited as well:
@misc{meshcheryakov2026arxiv,
title={MARADONER: Motif Activity Response Analysis Done Right},
author={Georgy Meshcheryakov and Andrey I. Buyan},
year={2026},
eprint={2602.03343},
archivePrefix={arXiv},
primaryClass={stat.CO},
url={https://arxiv.org/abs/2602.03343},
}
Metadata
Release files for maradoner 0.34.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| maradoner-0.34.0.tar.gz | 208.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| maradoner-0.34.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 426.6 kB
Release files / maradoner-0.34.0.tar.gz
| Download URL | maradoner-0.34.0.tar.gz |
|---|---|
| Size | 208.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2842eab2ca67d4568e34f11576135de4d6b98d3c493163b1222e1ad754c0cd13
|
|
BLAKE2b-256 checksum How to use checksums |
50072bf522957106b75e2fb575789a98003703ce8c6ef1bc933d2f4af6cce47e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / maradoner-0.34.0-py3-none-any.whl
| Download URL | maradoner-0.34.0-py3-none-any.whl |
|---|---|
| Size | 217.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf068e483091f301f6c9a535f1c8bdeb3bb63112d04a7468eaf9ce53cbcfd8db
|
|
BLAKE2b-256 checksum How to use checksums |
573e7df053180ebfce950f6ec880fc2c31852e3cfb9facb5b01161d29bac4518
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|