Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compareCluster - Error in check_gene_id - but work perfectly with standar procedure (not using compareCluster) #691

Open
philousap opened this issue Apr 27, 2024 · 1 comment

Comments

@philousap
Copy link

Hi,
I am trying to use compareCluster to compare enrichment analysis of different RNA-seq made on Apis mellifera (Honeybee).
however, i have got an error message
Error in check_gene_id(geneList, geneSets) :
--> No gene can be mapped....

Here my explanation:

Gene lists from data=universe
gL1<- geneList with logFC and names (geneID) for Apis mellifera.
gL2<- is the same but for another geneSet for APpis Mellifera

Example of gL:
geneID (names - characters): 725165 726592 724282 113219072 107965070 107964776 100577773 100578475
LogFC 1.190358 1.190266 1.189899 1.189409 1.188527 1.188432 1.188149 1.187474

When I run them individually as shown next

gseKEGG(geneList=gL1,organism="ame", pvalueCutoff = 0.05, pAdjustMethod = "BH")
gseKEGG(geneList=gL2,organism="ame", pvalueCutoff = 0.05, pAdjustMethod = "BH")

they work perfectly but I soon I switch to compareCluster I have the error:

compareCluster(geneClusters=gL1~gL2, data=universe, fun="gseKEGG", organism="ame",pAdjustMethod = "BH")

Error in check_gene_id(geneList, geneSets) :
--> No gene can be mapped....

I have also tried:

gL<-list(p1=gL1, p2=gL2)
compareCluster(geneClusters=gL, data=universe_annotation, fun="gseKEGG", organism="ame",pAdjustMethod = "BH")

I have the following error message:

Error in compareCluster(geneClusters = gL, data = universe_annotation, :
object 'grouping.formula' not found

However it does work when i do a simple compareCluster - ORA enrichKEGG analysis using same geneID
input database = bee. Here my code

compareCluster(geneID~Treatment, data=bee, fun="enrichKEGG", organism="ame", pAdjustMethod = "BH")

I am able to obtain a nice output so I am not sure what I am missing here and why compareCluster does not work with gseKEGG.

Thanks,

Phiphi

@philousap philousap changed the title compareCluster - Error in check_gene_id compareCluster - Error in check_gene_id - but work perfectly with standar procedure (not using compareCluster) Apr 27, 2024
@guidohooiveld
Copy link

guidohooiveld commented Apr 30, 2024

Your issue likely is caused how you defined your input (i.e. geneClusters). Also, for a GSEA analysis no universe should be provided (since you use as input a ranked list of all your genes), so the use of the argument data is not logic (and not expected).

Since you did not provide your input list, please have a look at my code below. Adapt it for your use case (at least the arguments geneClusters and organism but may be also keyType, significance and gene set size cutoffs should be adapted), and post here if it works now (or not).

> library(clusterProfiler)
> library(enrichplot)
>  
> data(geneList, package="DOSE")
> inputList <- list(rankedGenes1 = geneList, rankedGenes2 = geneList)
> 
> ## compareCluster-GSEA
> xx <- compareCluster(geneClusters=inputList, fun = "gseKEGG",
+              organism="hsa", keyType = "kegg",
+              eps = 0, pvalueCutoff = 0.05,
+              pAdjustMethod = "BH", minGSSize = 10, maxGSSize = 500)
> xx <- enrichplot::pairwise_termsim(xx) 
> 
> 
> 
> p <- dotplot(xx, font.size=8, showCategory=8, title =("GSEA results"), split=".sign") + facet_grid(.~.sign)
> print(p)
> 
>

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants