How to convert data frame obtained with enrichPathway back to an enrichPathway result after editing/subsetting?
1
1
Entering edit mode
@dorothyjrobbert-13893
Last seen 2.5 years ago

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?

ReactomePA • 1.3k views
ADD COMMENT
1
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 8 months ago
China/Guangzhou/Southern Medical Univer…

x@result = x@result[x@result$ID %in% your_id_list, ]

ADD COMMENT
0
Entering edit mode

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?

ADD REPLY
0
Entering edit mode

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!

ADD REPLY
0
Entering edit mode

you should emapplot(x) but not using x@result.

ADD REPLY
0
Entering edit mode

Yes, my x12 in the code is the enrichment result!

ADD REPLY

Login before adding your answer.

Traffic: 142 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