MARADONER

Motif activities

Predicting activities

After the parameters are estimated, motif activities are obtained with the predict command:

> maradoner predict MyProject

In MARADONER, the activity of a motif in a group of samples is a sum of 2 terms: the mean activity of the motif and a deviation from it in that group. The mean is a parameter and was estimated by fit. The deviations are what predict computes, and everywhere in the exported tables "activity" stands for the deviation.

Why "predict" and why not "estimate"? In the model the deviations are random variables, and a random variable is predicted. The prediction is the maximum-a-posteriori one, i.e. the most probable value of the deviations given the data and the parameters. For a group of $n$ samples with an error variance $σ$ and a multiplier $ν$ it is $$u = {n}/{σ} Z B^T \ov Y,\: Z = ({1}/{ν} Σ^{-1} + {n}/{σ} B^T B)^{-1}.$$ Here, $\ov Y$ is the average expression of the group with all the means subtracted, and $Σ$ is a diagonal matrix of the motif variances $τ$. The matrix $Z$ is the posterior covariance of the deviations, and the square roots of its diagonal are exported as their standard deviations.

Informally, this is a ridge regression with a separate penalty for each motif. The smaller the variance of a motif is against the noise of the group, the stronger its activity is pulled to the mean.

Motifs of low variance

A motif whose variance $τ$ was estimated as zero has a deviation of exactly zero in every group, and there is nothing to predict. By default, predict leaves out the motifs with a variance several orders of magnitude below the median one:

Name Description Default value
--filter-order <int> A motif variance is considered low if it is this many orders of magnitude smaller than the median motif variance 5
--no-filter-motifs Deviations are predicted for all motifs --filter-motifs

The motifs left out are absent from the tables of activities and from the tests built on them. They keep their mean activity and the test of its sign. After export, they are listed in params/filtered_motif_variances.tsv.

Tuning with cross-validation

The ratio of $ν$ to $σ$ plays the role of a signal-to-noise ratio of a group. The higher it is, the less the activities are shrunk, and in the limit the prediction turns into an ordinary least squares solution with the risk of overfitting. The ratio can be treated as a hyperparameter and tuned by cross-validation:

> maradoner predict MyProject --tau-search

Here, MARADONER tries several multipliers of the activity variance for each group. For each multiplier, activities are predicted from a part of the promoters and are used to predict the expression of the remaining ones, and the multiplier of the smallest error wins. The paper expects a slight improvement of the activities from this step.

Name Description Default value
--tau-left <float> The smallest multiplier to try 0.1
--tau-right <float> The largest multiplier to try. A value above 1 allows for an underestimated variance 1.0
--tau-num <int> Number of multipliers, evenly spaced between the 2 bounds 10
--cv-splits <int> Number of parts the promoters are split into 5
--cv-repeats <int> Number of times the split is repeated 3

Tables of activities

The activities are written by the export command into the activities folder:

File Content
activity_group_raw.tsv The predicted deviation of each motif in each group
activity_group_raw_std.tsv Posterior standard deviations of the above
activity.tsv The first table divided by the second one, i.e. signed z-scores
z_score.tsv Absolute values of the z-scores and an overall column: the root mean square of the z-scores of a motif over groups
activity_raw.tsv The deviation predicted from each sample alone, with no standard deviations

The z-scores are the numbers to start with. The overall column ranks motifs by how much their activity changes across groups in total, and the columns of activity.tsv tell in what groups a motif is more or less active than on average.

On this page