ggs_graph {GeneTonic} | R Documentation |
Construct a gene-geneset-graph from the results of a functional enrichment analysis
ggs_graph( res_enrich, res_de, annotation_obj = NULL, gtl = NULL, n_gs = 15, gs_ids = NULL, prettify = TRUE, geneset_graph_color = "gold", genes_graph_colpal = NULL )
res_enrich |
A |
res_de |
A |
annotation_obj |
A |
gtl |
A |
n_gs |
Integer value, corresponding to the maximal number of gene sets to be included |
gs_ids |
Character vector, containing a subset of |
prettify |
Logical, controlling the aspect of the returned graph object. If TRUE (default value), different shapes of the nodes are returned, based on the node type |
geneset_graph_color |
Character value, specifying which color should be used for the fill of the shapes related to the gene sets. |
genes_graph_colpal |
A vector of colors, also provided with their hex string, to be used as a palette for coloring the gene nodes. If unspecified, defaults to a color ramp palette interpolating from blue through yellow to red. |
An igraph
object to be further manipulated or processed/plotted (e.g.
via igraph::plot.igraph()
or
visNetwork::visIgraph())
library("macrophage") library("DESeq2") library("org.Hs.eg.db") library("AnnotationDbi") # dds object data("gse", package = "macrophage") dds_macrophage <- DESeqDataSet(gse, design = ~ line + condition) rownames(dds_macrophage) <- substr(rownames(dds_macrophage), 1, 15) dds_macrophage <- estimateSizeFactors(dds_macrophage) # annotation object anno_df <- data.frame( gene_id = rownames(dds_macrophage), gene_name = mapIds(org.Hs.eg.db, keys = rownames(dds_macrophage), column = "SYMBOL", keytype = "ENSEMBL" ), stringsAsFactors = FALSE, row.names = rownames(dds_macrophage) ) # res object data(res_de_macrophage, package = "GeneTonic") res_de <- res_macrophage_IFNg_vs_naive # res_enrich object data(res_enrich_macrophage, package = "GeneTonic") res_enrich <- shake_topGOtableResult(topgoDE_macrophage_IFNg_vs_naive) res_enrich <- get_aggrscores(res_enrich, res_de, anno_df) ggs <- ggs_graph( res_enrich, res_de, anno_df ) ggs #' # could be viewed interactively with # library(visNetwork) # library(magrittr) # ggs %>% # visIgraph() %>% # visOptions(highlightNearest = list(enabled = TRUE, # degree = 1, # hover = TRUE), # nodesIdSelection = TRUE)