cnetplot: cnetplot

cnetplotR Documentation

cnetplot

Description

Gene-Concept Network

Usage

cnetplot(x, ...)

## S4 method for signature 'enrichResult'
cnetplot(x, ...)

## S4 method for signature 'list'
cnetplot(x, ...)

## S4 method for signature 'gseaResult'
cnetplot(x, ...)

## S4 method for signature 'compareClusterResult'
cnetplot(x, ...)

cnetplot.enrichResult(
  x,
  showCategory = 5,
  foldChange = NULL,
  layout = "kk",
  colorEdge = FALSE,
  circular = FALSE,
  node_label = "all",
  cex_category = 1,
  cex_gene = 1,
  cex_label_category = 1,
  cex_label_gene = 1,
  color_category = "#E5C494",
  color_gene = "#B3B3B3",
  shadowtext = "all",
  color.params = list(foldChange = NULL, edge = FALSE, category = "#E5C494", gene =
    "#B3B3B3"),
  cex.params = list(category_node = 1, gene_node = 1, category_label = 1, gene_label = 1),
  hilight.params = list(category = NULL, alpha_hilight = 1, alpha_no_hilight = 0.3),
  ...
)

Arguments

x

Enrichment result.

...

Additional parameters

showCategory

A number or a vector of terms. If it is a number, the first n terms will be displayed. If it is a vector of terms, the selected terms will be displayed.

foldChange

Fold Change of nodes, the default value is NULL. If the user provides the Fold Change value of the nodes, it can be used to set the color of the gene node. Will be removed in the next version.

layout

Layout of the map, e.g. 'star', 'circle', 'gem', 'dh', 'graphopt', 'grid', 'mds', 'randomly', 'fr', 'kk', 'drl' or 'lgl'.

colorEdge

Logical, whether coloring edge by enriched terms, the default value is FALSE. Will be removed in the next version.

circular

Logical, whether using circular layout, the default value is FALSE. Will be removed in the next version.

node_label

Select which labels to be displayed. one of 'category', 'gene', 'all'(the default) and 'none'.

cex_category

Number indicating the amount by which plotting category nodes should be scaled relative to the default, the default value is 1. Will be removed in the next version.

cex_gene

Number indicating the amount by which plotting gene nodes should be scaled relative to the default, the default value is 1. Will be removed in the next version.

cex_label_category

Scale of category node label size, the default value is 1. Will be removed in the next version.

cex_label_gene

Scale of gene node label size, the default value is 1. Will be removed in the next version.

color_category

Color of category node. Will be removed in the next version.

color_gene

Color of gene node. Will be removed in the next version.

shadowtext

select which node labels to use shadow font, one of 'category', 'gene', 'all' and 'none', default is 'all'.

color.params

list, the parameters to control the attributes of highlighted nodes and edges. see the color.params in the following. color.params control the attributes of highlight, it can be referred to the following parameters:

  • foldChange Fold Change of nodes for enrichResult, or size of nodes for compareClusterResult, the default value is NULL.

  • edge Logical, whether coloring edge by enriched terms, the default value is FALSE.

  • category Color of category node.

  • gene Color of gene node.

cex.params

list, the parameters to control the size of nodes and lables. see the cex.params in the following. cex.params control the attributes of highlight, it can be referred to the following parameters:

  • foldChange only used in compareClusterResult object, fold Change of nodes, the default value is NULL. If the user provides the Fold Change value of the nodes, it can be used to set the size of the gene node.

  • category_node Number indicating the amount by which plotting category nodes should be scaled relative to the default, the default value is 1.

  • gene_node Number indicating the amount by which plotting gene nodes should be scaled relative to the default, the default value is 1.

  • category_label Scale of category node label size, the default value is 1.

  • gene_label Scale of gene node label size, the default value is 1.

hilight.params

list, the parameters to control the attributes of highlighted nodes and edges. see the hilight.params in the following. hilight.params control the attributes of highlight, it can be referred to the following parameters:

  • category category nodes to be highlight.

  • alpha_hilight alpha of highlighted nodes.

  • alpha_no_hilight alpha of unhighlighted nodes.

Details

plot linkages of genes and enriched concepts (e.g. GO categories, KEGG pathways)

Value

ggplot object

Author(s)

Guangchuang Yu

Examples

## Not run: 
    library(DOSE)
    data(geneList)
    de <- names(geneList)[1:100]
    x <- enrichDO(de)
    x2 <- pairwise_termsim(x)
    cnetplot(x2)
    # use `layout` to change the layout of map
    cnetplot(x2, layout = "star")
    # use `showCategory` to select the displayed terms. It can be a number of a vector of terms.
    cnetplot(x2, showCategory = 10)
    categorys <- c("pre-malignant neoplasm", "intestinal disease",
                   "breast ductal carcinoma", "non-small cell lung carcinoma")
    cnetplot(x2, showCategory = categorys)
    # 'compareClusterResult' object is also supported.
    library(clusterProfiler)
    library(DOSE)
    library(org.Hs.eg.db)
    data(gcSample)
    xx <- compareCluster(gcSample, fun="enrichGO", OrgDb="org.Hs.eg.db")
    xx2 <- pairwise_termsim(xx)
    cnetplot(xx2)

## End(Not run)

YuLab-SMU/enrichplot documentation built on April 15, 2024, 5:18 p.m.