I have a list of 291 genes which I had enriched for pathway analysis using the "enrichPathway" function of ReactomePA. I then visualised the enrichment as pathways using the dotplot, emapplot and cnetplot functions.
In the emapplot visualisation, I get broadly two distinct connected sets of pathways (mRNA degradation and cytokine signalling). For aesthetic and publication purposes, I require only one of these connected pathway sets to be shown (cytokine signalling) by literally cutting out the other pathways that I am not interested in (mRNA degradation). I tried to do this by:
1. Converting the enrichResult object to a data frame and then editing this to contain only the pathways I want to visualise. But, I am unable to convert back the edited data frame into enrichResult object for making an emapplot.
2. Picking out genes from the pathway and repeating enrichment. But, every gene is now split into further pathways which is not what I want.
Is there a way this can be accomplished? Maybe by being able to pick the pathway IDs and making an emapplot?
I tried this where x@result was my enrichResult. The command worked. But the emapplot and cnetplot function show the same error
" Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘emapplot’ for signature ‘"data.frame"’
It looks like the command outputs a data.frame that cannot be used further with emapplot and cnetplot. Any way around this?
It worked when I specified the gene list in the emapplot and cnetplot function itself like:
id_list<-c("R-MMU-512988
","R-MMU-451927
","R-MMU-912526
")
cnetplot(x12,ID=id_list,foldChange=lfc12,vertex.label.cex = 1.2)
Thanks for your help!
you should
emapplot(x)
but not usingx@result
.Yes, my x12 in the code is the enrichment result!