This is a test version of Biostars. For the public version, visit https://www.biostars.org.
cnetplot enrichment graph to cytoscape

Hello everyone

I am trying to save graph (network) from cnetplot after enrichment analysis in clusterProfiler package. I want to develop network in cytoscape from saved network file.

> cnt_enrichment <- enrichplot::cnetplot(formula_res, circular = TRUE, colorEdge = TRUE,cex_label_gene = 0.5, cex_label_category =2,fixed=FALSE)

> attributes(cnt_enrichment)
$names
[1] "data"        "layers"      "scales"      "mapping"     "theme"      
[6] "coordinates" "facet"       "plot_env"    "labels"     

$class
[1] "ggraph" "gg"     "ggplot"

Next, tried to export edge information from object.

> library(igraph)
 Edata <- as.data.frame(get.edgelist(cnt_enrichment))
 Edata$edgewidth <- E(g)$width
Vdata <- data.frame(pathway=V(g)$name, color=V(g)$color)
 map_data <- list(edge_data=Edata, vertex_data=Vdata)

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': Not a graph object

I would appreciate all suggestion.

Thanks !!

clusterprofiler cnetplot enrichplot

0 answers

No answers yet.

Log in to answer this question.