MARADONER

Introduction

MARADONER, Motif Activity Response Analysis Done Right, is a command-line Python tool for estimating activities of transcription factor binding motifs from promoter-level expression data (e.g. RNA-Seq, CAGE-Seq, et cetera).

MARADONER takes 2 tables. The first is the expression of promoters (or genes) across samples. The second is a matrix of motif loadings: a score of how well each motif matches the sequence of each promoter, as obtained with a motif scanner. Expression is modeled as a linear function of the loadings, and the coefficients of that function are the motif activities. A motif with a high activity in a group of samples is a candidate regulator there.

= × +
Click a block for details.
promoter 1 promoter 2 promoter 3 promoter 4 promoter 5 group A group B 6 samples

Expression

A table of promoters (or genes) by samples in a log scale, e.g. log2(TPM + 1). It is the first of the 2 tables supplied by a user.

Samples that are replicates of one condition form a group. A group shares its motif activities and its level of noise. The promoter-wise and the sample-wise means are of no interest, and MARADONER takes them out of the table before the rest is estimated.

More: Data formats, Why not just center the data?

sequence of a promoter 2 motif 1 0 motif 2 1 motif 3 its row of the table

Loadings

A table of promoters by motifs, the second table supplied by a user. A loading tells how strongly a motif is associated with a promoter.

It comes from scanning the sequence of each promoter with each motif: e.g. the number of predicted binding sites, as in the picture, or the score of the best one. By default, create brings the loadings of all motifs to one scale.

More: Data formats, Loading transformations

0 mean group A group B group C activity of a motif

Activities

A table of motifs by samples, and the thing MARADONER is run for. It is not observed and is estimated from the other 2 tables.

The activity of a motif is a sum of a mean and a deviation of each group. The mean tells an activator from a repressor, the deviations tell the groups apart, and both come with tests. Properties of samples such as age can be added to the sum as covariates.

More: Motif activities, Tests, Covariates

group A group B group C a variance of noise per group

Noise

The part of expression that the motifs leave unexplained. Each group of samples has a variance of noise.

These variances are estimated first, with restricted maximum likelihood, and everything else (variances of motifs, activities, tests) is built on them. An error made here spreads to all the results. That is why most of the effort behind MARADONER went into this step.

More: Parameters estimation, Does it work?

Expression and loadings are supplied by a user, and the highlighted table is estimated. This is the model of MARA [1] and ISMARA [2]. MARADONER keeps the model and replaces the way its parameters are estimated.

Key features:

A quick introduction to motif activity analysis with MARADONER is given in the Quickstart section of the tutorial.

MARADONER Features

Unbiased variance estimates
Variance parameters are estimated with restricted maximum likelihood (REML) after the mean parameters are projected out of the data. Mean parameters are then estimated with generalized least squares.
Motif-specific variances
Each motif has a variance of its activity across samples. A motif of constant activity gets a variance close to zero, and there is a test for that.
Mean activities
The mean activity of each motif is a parameter of the model with a standard error. Its sign tells whether the motif activates or represses transcription on average.
Groups of samples
Replicates of one condition form a group. A group has one activity per motif, one error variance and one multiplier of the activity variance.
Statistical tests
MARADONER tests whether the activity of a motif varies at all, whether it differs between chosen groups and whether a linear combination of groups (say, treated minus control) differs from zero.
Covariates
Sex, age, batch and other properties of samples can enter the model. Each covariate gets an effect on each motif with a test, e.g. the change of a motif activity with age. Covariates may interact, and their effects can be compared. Covariates that were not recorded can be reconstructed from the data.
Held-out promoters
Promoters of chosen chromosomes can be held out of the fit, and the fraction of explained variance is then reported for them separately.
Gene regulatory network
For each promoter, motif and group MARADONER computes a posterior probability that the motif contributes to the expression of the promoter.
Single-sample data
Data without replication across samples are covered by a separate Bayesian regression model.
It is fast
No step of the algorithm is cubic in the number of promoters or samples. A project of 2000 promoters, 500 motifs and 57 samples is fitted in 5 seconds on one CPU thread.
Classic MARA
For the old school or the suspicious, MARADONER also includes a reimplementation of the classic MARA and ISMARA models.

Why "done right"?

Classic MARA makes 4 simplifications, and MARADONER removes each of them.

Centering
MARA subtracts row and column averages from the expression table and then treats the result as ordinary data. The subtraction is a multiplication by a matrix of incomplete rank, and the noise of the centered table has a singular covariance matrix. With that ignored, variance estimates are biased, and the bias grows as samples get fewer. MARADONER multiplies the data by an orthogonal complement of the vector of ones (a relative of the Helmert matrix). The means vanish likewise, and the noise stays independent.
Least squares
Centering amounts to estimating the means with ordinary least squares. That estimator is unbiased and loses efficiency, as it ignores the weights implied by the variances. MARADONER estimates the means with generalized least squares once the variances are known.
Zero mean activity
MARA assumes that the mean activity of every motif is zero. The reported activities are then deviations from an unknown mean, and an activator cannot be told from a repressor. In MARADONER the mean activity is a parameter.
One variance for all motifs
In MARA the activities of all motifs share one prior variance. In MARADONER the variance is estimated per motif, with a multiplier per group of samples.

The derivations are in the paper [3], and How it works gives a summary without proofs.

Does it work?

We have tested MARADONER on synthetic data generated from the model with known parameters: 39 configurations of the generator, each with 20 random seeds, 780 datasets in total [3]. The configurations differ in the number of promoters (1000 to 20000), the number of samples (2 to 128), the share of variance explained by motifs, the share of inactive motifs and the spread of motif and promoter variances. The figures are in the paper.

The generator and the MARA baseline are parts of the package, so a comparison takes a few commands. Below is the mean absolute percentage error of the error variance estimates on datasets of 5000 promoters, 100 motifs and 4 groups. Each row is one dataset, and MARA was run with the default settings of the mara fit command.

Samples per group MARADONER MARA
2 1.8% 12.1%
4 0.3% 5.9%
16 0.4% 1.4%

The gap closes as samples are added: the bias of the MARA estimates matters when samples are few. MARA estimates a variance per sample, and the table averages them within a group.

References

  1. FANTOM Consortium (2009). The transcriptional network that controls growth arrest and differentiation in a human myeloid leukemia cell line. Nature Genetics, 41(5), 553-562.
    DOI: 10.1038/ng.375
  2. Balwierz, P. J., Pachkov, M., Arnold, P., Gruber, A. J., Zavolan, M., & van Nimwegen, E. (2014). ISMARA: automated modeling of genomic signals as a democracy of regulatory motifs. Genome Research, 24(5), 869-884.
    DOI: 10.1101/gr.169508.113
  3. Meshcheryakov, G., & Buyan, A. I. (2026). MARADONER: Motif Activity Response Analysis Done Right. arXiv preprint.
    DOI: 10.48550/arXiv.2602.03343
On this page