decouple {decoupleR}R Documentation

Evaluate multiple statistics with same input data

Description

Calculate the TF activity per sample out of a gene expression matrix by coupling a regulon network with a variety of statistics.

Usage

decouple(
  mat,
  network,
  .source,
  .target,
  statistics,
  args = list(NULL),
  include_time = FALSE,
  show_toy_call = FALSE
)

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.

statistics

Statistical methods to be coupled.

args

A list of argument-lists the same length as statistics (or length 1). The default argument, list(NULL), will be recycled to the same length as statistics, and will call each function with no arguments (apart from mat, network, .source and, .target).

include_time

Should the time per statistic evaluated be informed?

show_toy_call

The call of each statistic must be informed?

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. statistic_time: If requested, internal execution time indicator.

  6. ...: Columns of metadata generated by certain statistics.

See Also

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

Examples

if (FALSE) {
    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"))

    decouple(
        mat = mat,
        network = network,
        .source = "tf",
        .target = "target",
        statistics = c("gsva", "mean", "pscira", "scira", "viper"),
        args = list(
            gsva = list(verbose = FALSE),
            mean = list(.mor = "mor", .likelihood = "likelihood"),
            pscira = list(.mor = "mor"),
            scira = list(.mor = "mor"),
            viper = list(
                .mor = "mor",
                .likelihood = "likelihood",
                verbose = FALSE
            )
        )
    )
}

[Package decoupleR version 1.0.0 Index]