Map module membership to gene list and return module gene list.

getModuleGenes(module.colors, genes, add.prefix = T)

Arguments

module.colors

Vector of module membership (usually colors). Must be same length as gene list.

genes

Vector of genes.

add.prefix

Logical specifying whether to add "M#." prefix to each module name.

Value

Named list, where names are module names and entries are module genes.

Author

Nicholas Mikolajewicz

Examples


module.list.1 <- getModuleGenes(modules.1, SubGeneNames, add.prefix = F)
#> Error in unique(module.colors): object 'modules.1' not found
module.list.2 <- getModuleGenes(modules.2_new, SubGeneNames, add.prefix = F)
#> Error in unique(module.colors): object 'modules.2_new' not found

# get genes that are common to both network modules
module.union.list <- list()
common.modules <- intersect(modules.1, modules.2_new)
#> Error in intersect(modules.1, modules.2_new): object 'modules.1' not found
for (i in 1:length(common.modules)){
  common.genes <- intersect(module.list.1[[common.modules[i]]], module.list.2[[common.modules[i]]])
  module.union.list[[common.modules[i]]] <- common.genes
}
#> Error in eval(expr, envir, enclos): object 'common.modules' not found