Closed sarahalshammery closed 2 years ago
Please provide your complete code and data, I will find out where the problem is.
Please provide your complete code and data, I will find out where the problem is.
Hello Huerqiang, thank you for the help. I am unsure of how to provide such large and confidential data. The code above is all the code used for this. I can provide context for my data objects used above. mygenes object <- has all of my differentially expressed genes following edgeR differential gene expression tt$ENTREZID <- a vector of the Entrezid from my universe (all genes in the experiment) Again here is the code for the reactome enrichment analysis (which works and produces a compareCluster result)
my_reac<-compareCluster(ENTREZID~direction,data=mygenes,fun="enrichPathway",
pvalueCutoff = 0.05,universe=tt$ENTREZID,readable=T)
I can also plot this using the dotplot function, however when I try to plot using cnetplot function it gives the error.
cnetplot(my_reac)
Error in sum(y_union[ii, 9]) : invalid 'type' (character) of argument
The cnetplots work completely fine using an enrichResult object.
I would appreciate any advise on how to proceed. Thank you.
You can send the data to my email 13766876214@163.com.
Hi, I also have a problem in generating a cnetplot from a compareCluster result, also same error with emapplot.
cnetplot(cgo, showCategory = 5, foldChange = NULL, layout = "kk")
Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘cnetplot’ for signature ‘"compareClusterResult"’
But it runs well with enrichGO result. Here are my codes for enrichGO and compareCluster:
ego <- enrichGO(gene$ENTREZID, OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 1, qvalueCutoff = 1, keyType = "ENTREZID", readable = TRUE)
cgo <- compareCluster(geneCluster = com, fun = "enrichGO", OrgDb = org.Hs.eg.db, ont = "BP", pAdjustMethod = "BH", pvalueCutoff = 1, qvalueCutoff = 1, keyType = "ENTREZID", readable = TRUE)
Thanks!
@zofieLin
clusterProfiler
I observed exactly the same problem when I try to make a cnetplot from compareClusterResult:
sigDGE_entrez_DownUp <- tibble(Entrez = sigDGE$entrezgene_id, group = sigDGE$Down_Up) %>% dplyr::filter(!is.na(Entrez) & !duplicated(Entrez)) %>% as.data.frame() dim(sigDGE_entrez_DownUp) [1] 376 2
kk_DownUp <- compareCluster(Entrez~group, data = sigDGE_entrez_DownUp, fun = "enrichKEGG", organism = 'mmu', universe = bckg_entrez, pvalueCutoff = 0.05, pAdjustMethod = "BH")
kk_DownUp@readable <- F kk_DownUp_read <- setReadable(kk_DownUp, OrgDb = org.Mm.eg.db, keyType = "ENTREZID") dim(as.data.frame(kk_DownUp_read)) [1] 8 11
enrichplot::cnetplot(kk_DownUp_read, layout = "kk")
Error in sum(y_union[ii, 9]) : invalid 'type' (character) of argument
@VictorGoitea Please use the latest version of enrichplot in github.
You are right, I'm sorry, I was using clusterProfiler 3.16 and I see this was fixed in the last version 3.18... Thanks @huerqiang
Hello, Thank you @huerqiang for all of your help with this issue.
However, i've also noticed that the cnetplots made with a compareCluster result will not colour the genes even when supplied with a sorted gene vector object as in 3.1 input here
I've tested this using the same data where the cnetplots will not colour if the input is a compareClusterResult but will colour if the input is an enrichResult object.
Would appreciate any help regarding this.
@sarahalshammery how did you end up fixing this issue? I have similar problem and do not seem to find the solution. Thanks
@sarahalshammery how did you end up fixing this issue? I have similar problem and do not seem to find the solution. Thanks
Hi Zahra, Unfortunately, I couldn't find a solution, and didn't get a reply to I just didn't go ahead with the cnet plots. if you find a solution please let me know as well!
Thank you for your response. May I ask what alternative you chose?
Best, Zahra
On Tue, May 25, 2021 at 6:43 PM sarahalshammery @.***> wrote:
@sarahalshammery https://github.com/sarahalshammery how did you end up fixing this issue? I have similar problem and do not seem to find the solution. Thanks
Hi Zahra, Unfortunately, I couldn't find a solution, and didn't get a reply to I just didn't go ahead with the cnet plots. if you find a solution please let me know as well!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/YuLab-SMU/clusterProfiler/issues/301#issuecomment-848393485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUGRVMETFTMH6WTRJW6BXBTTPRG3RANCNFSM4TQMWLVQ .
-- Zahra Mesrizadeh Graduate Student, Bioengineering University of California, San Diego
Hello,
I've been using clusterProfiler to identify enriched pathways in my data and it's been working quite well (minus a lot of troubleshooting).. I've had this problem for a while in which I can't produce a barplot/cnet plot of my compareCluster results. I did look into the cnetplot function and I can see that a compareClusterResult can be an input.. however I am getting errors as you can see below.
When I use the enrichGO/enrichKEGG/enrichPathway functions, I get different results from when I use the compareCluster function with fun =enrichGO/enrichKEGG/enrichPathway. Example of the reactome work where I'm making comparisons by direction (i.e 'up' or 'down') using the compareCluster function and then using the same objects but through the enrichPathway function. The compareCluster gives me 27 enriched pathways, while the enrichPathway gives 860 enriched pathways.... When I try to generate a cnetplot using the compareCluster results, it won't work.
I have tried the reinstalling, updating packages etc. Nothing works. I have searched and didn't find anyone having the same problem as me so I thought I'd give this a try.
Thank you all in advance.