Skip to contents

Centrality-based KEGG enrichment analysis

Usage

retrieve_all_kegg_graphs(organism = "hsa")

ora_kegg_topology(
  genes,
  universe = NULL,
  centrality = igraph::degree,
  organism = "hsa",
  pl = NULL,
  nperm = 1000,
  min_hits = 3,
  min_size = 5,
  max_size = 2500,
  verbose = TRUE
)

gsea_kegg_topology(
  s,
  centrality = igraph::degree,
  null_side = c("both", "right", "left"),
  abs = TRUE,
  organism = "hsa",
  pl = NULL,
  nperm = 1000,
  min_size = 5,
  max_size = 2500,
  verbose = TRUE
)

Arguments

organism

KEGG organism code.

genes

A vector of genes, must be in the EntreZ ID type.

universe

A vector of universe genes. If it is not specified, the total genes in the KEGG pathways are used.

centrality

Centrality method. The value should be a function which accepts an igraph object and returns a vector of centrality values.

pl

A list of KEGG pathways as igraph objects. If the organism is one of "hsa", "mmu" or "rno", the corresponding pl is already generated and will be loaded automatically. For other organisms, use retrieve_all_kegg_graphs() to generate one.

nperm

Number of permutations.

min_hits

Minimal number of the overlapping genes in genes and pathways.

min_size

Minimal number of genes in pathways.

max_size

Maximal number of genes in pathways.

verbose

Whether to print messages?

s

A numeric vector of gene scores. Names must be in the EntreZ ID type.

null_side

How to calculate p-values?

abs

Whether use absolute values of s?

Details

The following lists several useful centrality measures, written as functions. They can be assigned to the centrality argument.

  • in-degree: function(g) igraph::degree(g, mode = "in")

  • out-degree: function(g) igraph::degree(g, mode = "out")

  • betweenness: igraph::betweenness

  • page rank: igraph::page_rank

  • in-reach: function(g) CePa::reach(g, mode = "in")

  • out-reach: function(g) CePa::reach(g, mode = "out")

And many more in the igraph and CePa packages.

ora_kegg_topology() is the ORA-extension.

gsea_kegg_topology() is the GSEA extension. The geneset-level score is calculated as mean(abs(s*w)).