pathway_gene_subnetworks: Extract subnetworks based on pathway genesets

View source: R/kernels.R

pathway_gene_subnetworksR Documentation

Extract subnetworks based on pathway genesets

Description

Extract subnetworks based on pathway genesets

Usage

pathway_gene_subnetworks(gene_network, gene_sets)

Arguments

gene_network

igraph object

gene_sets

list of gene sets

Value

list of kernel matrices

Examples

## Not run: 
pw_db <- msigdbr::msigdbr(species = "Homo sapiens", category = "C2", subcategory = "CP:KEGG")
pw_list <- lapply(split(pw_db, pw_db$gs_name), function(x) x$ensembl_gene)
pw_list <- pw_list[which(sapply(pw_list, length) <= 200 & sapply(pw_list, length) >= 5)]
ppi_net <- COPS::getHumanPPIfromSTRINGdb(gene_id_mart_column = "ensembl_gene_id")
ppi_pws <- COPS::pathway_gene_subnetworks(ppi_net, pw_list)
# Check the connected components to see if subnets are properly connected:
lapply(ppi_pws, function(x) igraph::components(x)$csize) # Not all are

## End(Not run)


vittoriofortino84/COPS documentation built on Jan. 28, 2025, 3:16 p.m.