Skip to contents

Function to generate a consensus score between methods from the result of the decouple function.

Usage

run_consensus(df, include_time = FALSE, seed = NULL)

Arguments

df

decouple data frame result

include_time

Should the time per statistic evaluated be informed?

seed

Deprecated parameter.

Value

Updated tibble with the computed consensus score between methods

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"))

results <- decouple(
   mat = mat,
   network = net,
   .source = "source",
   .target = "target",
   statistics = c("wmean", "ulm"),
   args = list(
            wmean = list(.mor = "mor", .likelihood = "likelihood"),
            ulm = list(.mor = "mor", .likelihood = "likelihood")
        ),
   consensus_score = FALSE,
   minsize = 0
   )
run_consensus(results)
#> # A tibble: 72 × 6
#>    condition run_id statistic source  score p_value
#>    <chr>      <dbl> <chr>     <chr>   <dbl>   <dbl>
#>  1 S01            3 consensus T1      1.21    0.227
#>  2 S01            3 consensus T2     -0.327   0.744
#>  3 S01            3 consensus T3     -0.217   0.828
#>  4 S02            3 consensus T1      1.21    0.226
#>  5 S02            3 consensus T2     -0.267   0.789
#>  6 S02            3 consensus T3     -0.289   0.773
#>  7 S03            3 consensus T1      1.20    0.229
#>  8 S03            3 consensus T2     -0.320   0.749
#>  9 S03            3 consensus T3     -0.196   0.845
#> 10 S04            3 consensus T1      1.21    0.228
#> # ℹ 62 more rows