run_ora {decoupleR} | R Documentation

## Over Representation Analysis (ORA)

### Description

Calculates regulatory activities using ORA.

### Usage

    run_ora(
      mat,
      network,
      .source = .data$source,
      .target = .data$target,
      n_up = ceiling(0.05 * nrow(mat)),
      n_bottom = 0,
      n_background = 20000,
      with_ties = TRUE,
      seed = 42,
      minsize = 5,
      ...
    )

### 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.
`n_up` | Integer indicating the number of top targets to slice from mat.
`n_bottom` | Integer indicating the number of bottom targets to slice from mat.
`n_background` | Integer indicating the background size of the sliced targets. If not specified the number of background targets is determined by the total number of unique targets in the union of `mat` and `network`.
`with_ties` | Should ties be kept together? The default, `TRUE`, may return more rows than you request. Use `FALSE` to ignore ties, and return the first `n` rows.
`seed` | A single value, interpreted as an integer, or NULL for random number generation.
`minsize` | Integer indicating the minimum number of targets per source.
`...` | Arguments passed on to `stats::fisher.test` `workspace` an integer specifying the size of the workspace used in the network algorithm. In units of 4 bytes. Only used for non-simulated p-values larger than 2 by 2 tables. Since R version 3.5.0, this also increases the internal stack size which allows larger problems to be solved, however sometimes needing hours. In such cases, `simulate.p.values=TRUE` may be more reasonable. `hybrid` a logical. Only used for larger than 2 by 2 tables, in which cases it indicates whether the exact probabilities (default) or a hybrid approximation thereof should be computed. `hybridPars` a numeric vector of length 3, by default describing “Cochran's conditions” for the validity of the chisquare approximation, see ‘Details’. `control` a list with named components for low level algorithm control. At present the only one used is `"mult"`, a positive integer ≥ 2 with default 30 used only for larger than 2 by 2 tables. This says how many times as much space should be allocated to paths as to keys: see file ‘fexact.c’ in the sources of this package. `or` the hypothesized odds ratio. Only used in the 2 by 2 case. `alternative` indicates the alternative hypothesis and must be one of `"two.sided"`, `"greater"` or `"less"`. You can specify just the initial letter. Only used in the 2 by 2 case. `conf.int` logical indicating if a confidence interval for the odds ratio in a 2 by 2 table should be computed (and returned). `conf.level` confidence level for the returned confidence interval. Only used in the 2 by 2 case and if `conf.int = TRUE`. `simulate.p.value` a logical indicating whether to compute p-values by Monte Carlo simulation, in larger than 2 by 2 tables. `B` an integer specifying the number of replicates used in the Monte Carlo test.

### Details

ORA measures the overlap between the target feature set and a list of most altered molecular features in mat. The most altered molecular features can be selected from the top and or bottom of the molecular readout distribution, by default it is the top 5% positive values. With these, a contingency table is build and a one-tailed Fisher’s exact test is computed to determine if a regulator’s set of features are over-represented in the selected features from the data. The resulting score, `ora`, is the minus log10 of the obtained p-value.

### Value

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

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

2. `source`: Source nodes of `network`.

3. `condition`: Condition representing each column of `mat`.

4. `score`: Regulatory activity (enrichment score).

### See Also

Other decoupleR statistics: `decouple()`, `run_aucell()`, `run_fgsea()`, `run_gsva()`, `run_mdt()`, `run_mlm()`, `run_udt()`, `run_ulm()`, `run_viper()`, `run_wmean()`, `run_wsum()`

### 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_ora(mat, network, .source='tf')

[Package decoupleR version 2.0.1 Index]