YuLab-SMU / clusterProfiler

:bar_chart: A universal enrichment tool for interpreting omics data
https://yulab-smu.top/biomedical-knowledge-mining-book/
967 stars 246 forks source link

ont = "BP" in enricher () function #686

Open enriquepola1996 opened 2 months ago

enriquepola1996 commented 2 months ago

Hello dear developers,

I am using clusterProfiler to perform a GO analysis for an organism where I am providing my own table of GO terms and my list of genes, however, I am wondering if it is possible to set the parameter ont = "BP" or ont = "CC ". I am running my analysis this way:

enrichment_result1 <- enricher(gene = proteins_up$V1, pvalueCutoff = 0.05, pAdjustMethod = "BH",
                                         universe = matriz_cuentas$V1, minGSSize = 10, maxGSSize = 500,
                                         qvalueCutoff = 0.2, TERM2GENE = go_final, TERM2NAME = term2name)

I greatly appreciated the support.

guidohooiveld commented 2 months ago

No, if you use the generic function enricher it will use the GO-to-gene mapping as defined in the provided TERM2GENE file (in your case this is go_final). If you would like to restrict your analysis to BP only, you will have to filter go_final before 'feeding' it to enricher.

See for example my posts here: https://github.com/YuLab-SMU/clusterProfiler/issues/678#issuecomment-2027468095 (part from section #### B) combined analysis), or here: https://github.com/YuLab-SMU/clusterProfiler/issues/588#issuecomment-1600657391 (part from section ## limit analysis to only GO-BP categories).