You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to disable module, enzyme, and gene names in the network? #24
Please see if the code below helps. The original publication figure had small modifications with a graphical editor (e.g. putting a white background behind node labels for better readability) but you can tweak the plotting to hide node labels, change colours, etc
Let me know if that helps
Sergi
# example on how to customise the plotting attributes of the sub-graph
library(igraph)
library(FELLA)
data("FELLA.sample")
data("input.sample")
myAnalysis<- enrich(
compounds=input.sample,
method="diffusion",
approx="normality",
data=FELLA.sample)
# default FELLA plotting
plot(myAnalysis, method="diffusion", data=FELLA.sample)
# export the graphg<- generateResultsGraph(object=myAnalysis, data=FELLA.sample)
# again, default plotting
plotGraph(g)
# custom plotting# currently there is no way to get the default parameters for the graph # and change them - would be a nice improvement to allow it# you can still find them by printing FELLA's plotting function
print(FELLA::plotGraph)
# see ?igraph.plotting for a list of options# Example customised parametersv.size<- c(
"1"=10,
"2"=6,
"3"=5,
"4"=4,
"5"=2
)
v.color<-stats::setNames(grDevices::palette()[1:5], 1:5)
# default igraph plotting - no params
plot(g)
# igraph plotting - custom params
plot(g,
vertex.size=v.size[V(g)$com],
vertex.color=v.color[V(g)$com],
vertex.label.dist=1,
vertex.label.color= ifelse(V(g)$name%in%input.sample,
"indianred1", "gray20"),
edge.curved=TRUE,
edge.width=3)
# you can also remove text by setting labels to ""
plot(g,
vertex.size=v.size[V(g)$com],
vertex.color=v.color[V(g)$com],
# only show level 1 (pathway) and 5 (compound)vertex.label= ifelse(V(g)$com%in% c(1, 5), V(g)$label, ""),
vertex.label.dist=1,
vertex.label.color= ifelse(V(g)$name%in%input.sample,
"indianred1", "gray20"),
edge.width=3)
Activity
SergiPicart commentedon Mar 5, 2023
Dear Dong,
Please see if the code below helps. The original publication figure had small modifications with a graphical editor (e.g. putting a white background behind node labels for better readability) but you can tweak the plotting to hide node labels, change colours, etc
Let me know if that helps
Sergi
YonghuiDong commentedon Mar 6, 2023
Dear Sergi,
Thanks a lot for your kind help!
Dong