Calculates regulatory activities using ULM.
Usage
run_ulm(
mat,
network,
.source = source,
.target = target,
.mor = mor,
.likelihood = likelihood,
sparse = FALSE,
center = FALSE,
na.rm = FALSE,
minsize = 5L
)
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 innetwork
.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
Deprecated argument. Now it will always be set to 1.
- sparse
Deprecated parameter.
- center
Logical value indicating if
mat
must be centered bybase::rowMeans()
.- na.rm
Should missing values (including NaN) be omitted from the calculations of
base::rowMeans()
?- minsize
Integer indicating the minimum number of targets per source.
Value
A long format tibble of the enrichment scores for each source across the samples. Resulting tibble contains the following columns:
statistic
: Indicates which method is associated with which score.source
: Source nodes ofnetwork
.condition
: Condition representing each column ofmat
.score
: Regulatory activity (enrichment score).
Details
ULM fits a linear model for each sample and regulator, where the observed
molecular readouts in mat are the response variable and the regulator weights
in net are the explanatory one. Target features with no associated weight
are set to zero. The obtained t-value from the fitted model is the activity
ulm
of a given regulator.
Examples
inputs_dir <- system.file("testdata", "inputs", package = "decoupleR")
mat <- readRDS(file.path(inputs_dir, "mat.rds"))
net <- readRDS(file.path(inputs_dir, "net.rds"))
run_ulm(mat, net, minsize=0)
#> # A tibble: 72 × 5
#> statistic source condition score p_value
#> <chr> <chr> <chr> <dbl> <dbl>
#> 1 ulm T1 S01 4.21 0.00180
#> 2 ulm T1 S02 4.07 0.00224
#> 3 ulm T1 S03 3.85 0.00319
#> 4 ulm T1 S04 4.60 0.000979
#> 5 ulm T1 S05 3.90 0.00298
#> 6 ulm T1 S06 3.66 0.00442
#> 7 ulm T1 S07 4.31 0.00153
#> 8 ulm T1 S08 4.65 0.000902
#> 9 ulm T1 S09 4.49 0.00117
#> 10 ulm T1 S10 4.07 0.00225
#> # ℹ 62 more rows