run_mean {decoupleR}R Documentation

Weighted mean

Description

Calculate the activity of all regulons in network through the conditions in the mat matrix by calculating the mean over the expression of all genes.

Usage

run_mean(
  mat,
  network,
  .source = .data$tf,
  .target = .data$target,
  .mor = .data$mor,
  .likelihood = .data$likelihood,
  times = 2,
  seed = 42,
  sparse = TRUE,
  randomize_type = "rows"
)

Arguments

mat

Matrix to evaluate (e.g. expression matrix). Target nodes in rows and conditions in columns. rownames(mat) must have at least one intersection with the elements in network .target column.

network

Tibble or dataframe with edges and it's associated metadata.

.source

Column with source nodes.

.target

Column with target nodes.

.mor

Column with edge mode of regulation (i.e. mor).

.likelihood

Column with edge likelihood.

times

How many permutations to do?

seed

A single value, interpreted as an integer, or NULL for random number generation.

sparse

Should the matrices used for the calculation be sparse?

randomize_type

How to randomize the expression matrix.

Details

run_mean() calculates the activity score, but in addition, it takes advantage of the permutations used to calculate the p-value, to provide the normalized activity score. This is represented in the statistic column which will contain two values for each call to run_mean(); mean and normalized_mean.

Value

A long format tibble of the enrichment scores for each tf across the samples. Resulting tibble contains the following columns:

  1. statistic: Indicates which method is associated with which score.

  2. tf: Source nodes of network.

  3. condition: Condition representing each column of mat.

  4. score: Regulatory activity (enrichment score).

  5. p_value: p-value for the score of mean method.

See Also

Other decoupleR statistics: decouple(), run_gsva(), run_ora(), run_pscira(), run_scira(), run_viper()

Examples

inputs_dir <- system.file("testdata", "inputs", package = "decoupleR")

mat <- readRDS(file.path(inputs_dir, "input-expr_matrix.rds"))
network <- readRDS(file.path(inputs_dir, "input-dorothea_genesets.rds"))

run_mean(mat, network, tf, target, mor, likelihood)

[Package decoupleR version 1.0.0 Index]