is_module: Determine if an object is a module or a list of modules

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Check content of a given object to determine if it's a module or a list of modules, meaning a single vector of characters which are gene names, or a named list of these vectors

Usage

1
is_module(module, is_list = FALSE)

Arguments

module

vector or list, object to test to be a module or list of modules

is_list

boolean, indicate if module must be tested as a single module or a list of modules

Value

list, a boolean as first element and in second element NULL or the reason why boolean is set to FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
single_module <- c("BIRC3", "PMAIP1", "CASP8", "JUN", "BCL2L11", "MCL1",
                   "IL1B", "SPTAN1", "DIABLO", "BAX", "BIK", "IL1A", "BID",
                   "CDKN1A", "GADD45A")
is_module(single_module)

multi_module <- list(mod1 = single_module,
                     mod2 = c("TAF1C", "TARBP2", "POLH", "CETN2", "POLD1",
                     "CANT1", "PDE4B", "DGCR8", "RAD51", "SURF1", "PNP",
                     "ADA", "NME3", "GTF3C5", "NT5C"))
is_module(multi_module$modules, is_list = TRUE)

GWENA documentation built on Feb. 17, 2021, 2:01 a.m.