Question: How to convert data frame obtained with enrichPathway back to an enrichPathway result after editing/subsetting?
1
gravatar for dorothy.jrobbert
3 months ago by
dorothy.jrobbert20 wrote:

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 • 153 views
ADD COMMENTlink modified 3 months ago by Guangchuang Yu1.1k • written 3 months ago by dorothy.jrobbert20
Answer: How to convert data frame obtained with enrichPathway back to an enrichPathway r
1
gravatar for Guangchuang Yu
3 months ago by
Guangchuang Yu1.1k
China/Guangzhou/Southern Medical University
Guangchuang Yu1.1k wrote:

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

ADD COMMENTlink written 3 months ago by Guangchuang Yu1.1k

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 REPLYlink written 3 months ago by dorothy.jrobbert20

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 REPLYlink written 3 months ago by dorothy.jrobbert20

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

ADD REPLYlink written 3 months ago by Guangchuang Yu1.1k

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

ADD REPLYlink written 3 months ago by dorothy.jrobbert20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 351 users visited in the last hour