cnetplot category names are too long
1
0
Entering edit mode
3.3 years ago
carov • 0

Hi all,

I am struggling with the visualization of my enrichResult. I want to make a network with cnetplot:

cnetplot(ego,colorEdge = TRUE, circular = TRUE)

But the category names, as you can see on the figure, are too long. Also, I want to color my category nodes corresponding to the edge colors. I've been trying different things and looking into the layers. But as I am a real noob here, I was not able to find a solution.

Can anyone help this noob out? :-)

enter image description here

clusterprofiler RNA-Seq enrichplot cnetplot • 968 views
ADD COMMENT
0
Entering edit mode
7 months ago
bkleiboeker ▴ 370

I'm sure someone could find a more elegant solution using stringr::str_wrap, but for a one-time solution I did this:

# my results of enrichGO are stored in this object, go_down
go_down <- setReadable(go_down, 'org.Hs.eg.db', 'ENTREZID')

# simply add a "\n" at an appropriate location in the Description string
go_down@result$Description <- gsub(" in ", " in\n", go_down@result$Description)

# I only had one row in this dataframe, but if you have more you could specify which like:
go_down@result$Description[1] <- gsub(" in ", " in\n", go_down@result$Description)
ADD COMMENT

Login before adding your answer.

Traffic: 1437 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6