Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Activities from networks

Pathway scores per sample take the genes of a set without signs. A transcription factor, though, raises some of its targets and lowers others, and a signalling pathway leaves a footprint of genes that respond to it, some up and some down. A network gives each such source signed weights on its targets, and its activity is read from them: high where the genes it raises are high and those it lowers are low. ulm scores every source of a network in every sample or contrast by default, as decoupler computes it Mompel et al., 2022, and mlm and weighted_aggregate compute two more of decoupler’s methods. Pathway and regulator activity scores the regulators and pathways of published data.

Networks of regulators and pathways

A Network gives each source, a transcription factor or a pathway, its target genes, each with a weight: positive where the source raises the gene and negative where it lowers it. Two networks are built in:

Both download their files on first use from where they were published, check them against pinned SHA-256 digests and keep them in a cache, so that a machine without a connection can use a file copied there. Each resource of CollecTRI keeps its own terms, which OmniPath records Türei et al., 2021. The default level, licence="commercial", keeps the interactions that a resource listed for commercial use supports, and licence="academic" adds those that only a resource listed for academic use supports (Datasets gives the terms and the counts). Any network given as a table of source, target and weight, or as gene sets, whose genes weigh 1, works the same way, and Network.select keeps some of its sources.

Profiles and targets

A profile is one vector of values over genes: a sample’s expression, or a contrast’s statistics. The activity functions score

Each profile uses the genes that have a value in it, NaN marking a missing one, so that a profile of a result keeps the genes its cell type tested. In sparse data, genes that are zero in every profile were not detected, and they are left out, as in decoupler. A source is scored in a profile when at least min_targets of its targets, matched by their ids, are among the profile’s genes. The result, an Activities, holds the scores of the profiles by sources, with their estimates (slopes, coefficients, or weighted means or sums), their p-values and the p-values adjusted by Benjamini and Hochberg’s method over the sources of each profile Benjamini & Hochberg, 1995; Activities.table lists them one per row. plot_activities draws the scores as a heatmap, and plot_top_activities draws a bar for each of the sources that score highest in absolute value in one profile, as decoupler’s pl.barplot does.

ULM

The univariate linear model fits, for each source, a line through the values ygy_g of the profile’s nn genes against the source’s weights xgx_g, which are zero at the genes outside its targets,

yg=β0+β1xg+εg,y_g = \beta_0 + \beta_1 x_g + \varepsilon_g,

and scores the source by the slope’s t-statistic, t=β^1/se(β^1)=r(n−2)/(1−r2)t = \hat\beta_1 / \mathrm{se}(\hat\beta_1) = r \sqrt{(n - 2) / (1 - r^2)} for the correlation rr between yy and xx, tested on n−2n - 2 degrees of freedom. Each source is tested against all the other genes, those of other sources included.

MLM

The multivariate linear model fits all the sources of a profile at once, with an intercept,

yg=β0+∑sβsxgs+εg,y_g = \beta_0 + \sum_s \beta_s x_{gs} + \varepsilon_g,

so that each score, the t-statistic of βs\beta_s with n−m−1n - m - 1 residual degrees of freedom for mm sources, measures a source beyond what the others explain: where two regulators share targets, ULM credits both with their response and MLM splits it between them. MLM needs at least two more genes than sources, and sources whose weights are not linear combinations of the weights of others; it refuses those that it cannot tell apart, by name.

The weighted aggregate

The weighted aggregate scores a source by the weighted mean of its targets’ values, ∑gwgyg/∑g∣wg∣\sum_g w_g y_g / \sum_g |w_g|; without the denominator, it is their weighted sum, PROGENy’s original score Schubert et al., 2018. With random permutations of the genes, the score becomes (ES−mean)/sd(\mathrm{ES} - \text{mean}) / \text{sd} over the permutations’ scores, and its two-sided p-value is twice the smaller one-sided one, (1+b)/(1+n)(1 + b)/(1 + n) for the bb of nn permutations that score at least, or at most, as high Phipson & Smyth, 2010.

Activities or scores

Activities use the signs and sizes of a network’s weights, so that a regulator’s repressed targets count against it, where pathway scores take the genes of a set without signs; Network.to_gene_sets gives each source’s targets as a set, without their signs, for the pathway scores and the gene-set tests. Scored on the statistics of a contrast, activities say which regulators drive a response, in each cell type. Scored on the samples, they can be compared, correlated with other measurements and tested with a design, as pathway scores are: limma takes the activities of samples with the cube’s design (Testing scores with a design). The activities of contrasts carry their own p-values, from each source’s test across genes, and limma refuses them.

Defaults and choices

Limits and differences

Checks and further reading

The activities, their bar plot and the networks are compared with decoupler 2.2.0 and progeny 1.28.0: exact (1e-10), the normalized scores given decoupler’s permutations, and within 1.2e-7 for ULM’s adjusted p-values, which decoupler keeps in single precision. The networks hold every interaction of decoupler’s CollecTRI, and the 185 that its loader drops; CollecTRI’s licence levels follow OmniPath’s records, and PROGENy’s weights are progeny’s (Validation). The tests of activities with a design are those of pathway scores (Checks and further reading).

Further reading:

Aligning studies begins the last part of the book, on several studies.

References
  1. Badia-i Mompel, P., Vélez Santiago, J., Braunger, J., Geiss, C., Dimitrov, D., Müller-Dott, S., Taus, P., Dugourd, A., Holland, C. H., Ramirez Flores, R. O., & Saez-Rodriguez, J. (2022). decoupleR: ensemble of computational methods to infer biological activities from omics data. Bioinformatics Advances, 2(1), vbac016. 10.1093/bioadv/vbac016
  2. Müller-Dott, S., Tsirvouli, E., Vazquez, M., Ramirez Flores, R. O., Badia-i Mompel, P., Fallegger, R., Türei, D., Lægreid, A., & Saez-Rodriguez, J. (2023). Expanding the coverage of regulons from high-confidence prior knowledge for accurate estimation of transcription factor activities. Nucleic Acids Research, 51(20), 10934–10949. 10.1093/nar/gkad841
  3. Schubert, M., Klinger, B., Klünemann, M., Sieber, A., Uhlitz, F., Sauer, S., Garnett, M. J., Blüthgen, N., & Saez-Rodriguez, J. (2018). Perturbation-response genes reveal signaling footprints in cancer gene expression. Nature Communications, 9(1), 20. 10.1038/s41467-017-02391-6
  4. Holland, C. H., Szalai, B., & Saez-Rodriguez, J. (2020). Transfer of regulatory knowledge from human to mouse for functional genomics analysis. Biochimica et Biophysica Acta (BBA) - Gene Regulatory Mechanisms, 1863(6), 194431. 10.1016/j.bbagrm.2019.194431
  5. Türei, D., Valdeolivas, A., Gul, L., Palacio-Escat, N., Klein, M., Ivanova, O., Ölbei, M., Gábor, A., Theis, F., Módos, D., Korcsmáros, T., & Saez-Rodriguez, J. (2021). Integrated intra- and intercellular signaling knowledge for multicellular omics analysis. Molecular Systems Biology, 17(3), e9923. 10.15252/msb.20209923
  6. Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society: Series B (Methodological), 57(1), 289–300. 10.1111/j.2517-6161.1995.tb02031.x
  7. Phipson, B., & Smyth, G. K. (2010). Permutation p-values should never be zero: calculating exact p-values when permutations are randomly drawn. Statistical Applications in Genetics and Molecular Biology, 9(1), Article 39. 10.2202/1544-6115.1585
  8. Holland, C. H., Tanevski, J., Perales-Patón, J., Gleixner, J., Kumar, M. P., Mereu, E., Joughin, B. A., Stegle, O., Lauffenburger, D. A., Heyn, H., Szalai, B., & Saez-Rodriguez, J. (2020). Robustness and applicability of transcription factor and pathway analysis tools on single-cell RNA-seq data. Genome Biology, 21(1), 36. 10.1186/s13059-020-1949-z