Git Product home page Git Product logo

Comments (4)

guidohooiveld avatar guidohooiveld commented on August 16, 2024

Does it work with the example code (since your code as such is not reproducible)? What is your sessionInfo()?

> library(clusterProfiler)
> data(gcSample)
> xx <- compareCluster(gcSample, fun=enrichKEGG,
+                      organism="hsa", pvalueCutoff=0.05)
> xx
#
# Result of Comparing 8 gene clusters 
#
#.. @fun         enrichKEGG 
#.. @geneClusters       List of 8
 $ X1: chr [1:216] "4597" "7111" "5266" "2175" ...
 $ X2: chr [1:805] "23450" "5160" "7126" "26118" ...
 $ X3: chr [1:392] "894" "7057" "22906" "3339" ...
 $ X4: chr [1:838] "5573" "7453" "5245" "23450" ...
 $ X5: chr [1:929] "5982" "7318" "6352" "2101" ...
 $ X6: chr [1:585] "5337" "9295" "4035" "811" ...
 $ X7: chr [1:582] "2621" "2665" "5690" "3608" ...
 $ X8: chr [1:237] "2665" "4735" "1327" "3192" ...
#...Result      'data.frame':   76 obs. of  12 variables:
 $ Cluster    : Factor w/ 8 levels "X1","X2","X3",..: 2 2 2 3 3 3 4 4 4 4 ...
 $ category   : chr  "Human Diseases" "Human Diseases" "Cellular Processes" "Environmental Information Processing" ...
 $ subcategory: chr  "Infectious disease: viral" "Immune disease" "Cell growth and death" "Signaling molecules and interaction" ...
 $ ID         : chr  "hsa05169" "hsa05340" "hsa04110" "hsa04512" ...
 $ Description: chr  "Epstein-Barr virus infection" "Primary immunodeficiency" "Cell cycle" "ECM-receptor interaction" ...
 $ GeneRatio  : chr  "23/406" "8/406" "18/406" "9/193" ...
 $ BgRatio    : chr  "202/8662" "38/8662" "157/8662" "89/8662" ...
 $ pvalue     : num  6.83e-05 3.07e-04 3.83e-04 1.53e-04 3.29e-04 ...
 $ p.adjust   : num  0.0214 0.0399 0.0399 0.0362 0.0362 ...
 $ qvalue     : num  0.0199 0.0372 0.0372 0.0335 0.0335 ...
 $ geneID     : chr  "4067/3383/7128/1869/890/1871/578/864/637/9641/6891/355/9134/5971/916/956/6850/7187/3551/919/4734/958/6772" "100/6891/3932/973/916/925/958/64421" "991/1869/890/1871/701/990/10926/9088/8317/9700/9134/1029/2810/699/11200/23594/8555/4173" "7057/3339/1299/3695/1101/3679/3910/3696/3693" ...
 $ Count      : int  23 8 18 9 17 19 17 10 22 19 ...
#.. number of enriched terms found for each gene cluster:
#..   X1: 0 
#..   X2: 3 
#..   X3: 3 
#..   X4: 22 
#..   X5: 10 
#..   X6: 1 
#..   X7: 17 
#..   X8: 20 
#
#...Citation
T Wu, E Hu, S Xu, M Chen, P Guo, Z Dai, T Feng, L Zhou, 
W Tang, L Zhan, X Fu, S Liu, X Bo, and G Yu. 
clusterProfiler 4.0: A universal enrichment tool for interpreting omics data. 
The Innovation. 2021, 2(3):100141 

>

from clusterprofiler.

gongxin8888 avatar gongxin8888 commented on August 16, 2024

from clusterprofiler.

guidohooiveld avatar guidohooiveld commented on August 16, 2024

Happy to hear you got it somehow working, but to show for the record/archive that compareCluster also works with the generic function enricher:

> library(clusterProfiler)
> 
> ## load some example data
> data(gcSample)
> 
> ## manually download KEGG data; to be used as input for TERM2GENE and TERM2NAME
> kegg.data <- download_KEGG(species="hsa", keggType = "KEGG", keyType = "kegg")
Reading KEGG annotation online: "https://rest.kegg.jp/link/hsa/pathway"...
Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/hsa"...
> gene.sets <- kegg.data$KEGGPATHID2EXTID; colnames(gene.sets) <- c("PathwayID","GeneID")
> set.names <- kegg.data$KEGGPATHID2NAME; colnames(set.names) <- c("PathwayID","Description")
> 
> ## run compareCluster with generic function enricher
> yy <- compareCluster(geneClusters = gcSample,
+                      fun = "enricher",
+                      minGSSize = 10,
+                      maxGSSize = 500,
+                      pvalueCutoff = 1,
+                      pAdjustMethod = "BH",
+                      TERM2GENE = gene.sets[, c("PathwayID","GeneID") ], #proper order columns
+                      TERM2NAME = set.names[, c("PathwayID","Description") ]
+                      )
> 
> ## check
> yy
#
# Result of Comparing 8 gene clusters 
#
#.. @fun         enricher 
#.. @geneClusters       List of 8
 $ X1: chr [1:216] "4597" "7111" "5266" "2175" ...
 $ X2: chr [1:805] "23450" "5160" "7126" "26118" ...
 $ X3: chr [1:392] "894" "7057" "22906" "3339" ...
 $ X4: chr [1:838] "5573" "7453" "5245" "23450" ...
 $ X5: chr [1:929] "5982" "7318" "6352" "2101" ...
 $ X6: chr [1:585] "5337" "9295" "4035" "811" ...
 $ X7: chr [1:582] "2621" "2665" "5690" "3608" ...
 $ X8: chr [1:237] "2665" "4735" "1327" "3192" ...
#...Result      'data.frame':   226 obs. of  10 variables:
 $ Cluster    : Factor w/ 8 levels "X1","X2","X3",..: 1 1 1 2 2 2 2 2 2 2 ...
 $ ID         : chr  "hsa04061" "hsa05146" "hsa04060" "hsa05169" ...
 $ Description: chr  "Viral protein interaction with cytokine and cytokine receptor" "Amoebiasis" "Cytokine-cytokine receptor interaction" "Epstein-Barr virus infection" ...
 $ GeneRatio  : chr  "6/103" "6/103" "10/103" "23/406" ...
 $ BgRatio    : chr  "100/8661" "102/8661" "297/8661" "202/8661" ...
 $ pvalue     : num  1.18e-03 1.31e-03 2.72e-03 6.84e-05 3.08e-04 ...
 $ p.adjust   : num  0.1283 0.1283 0.1778 0.0214 0.04 ...
 $ qvalue     : num  0.1206 0.1206 0.1671 0.0199 0.0373 ...
 $ geneID     : chr  "6364/3559/2921/8793/3576/6374" "7850/2921/6317/3576/1281/22798" "7850/653/6364/3559/3595/2921/8793/10663/3576/6374" "4067/3383/7128/1869/890/1871/578/864/637/9641/6891/355/9134/5971/916/956/6850/7187/3551/919/4734/958/6772" ...
 $ Count      : int  6 6 10 23 8 18 22 13 12 14 ...
#.. number of enriched terms found for each gene cluster:
#..   X1: 3 
#..   X2: 20 
#..   X3: 5 
#..   X4: 76 
#..   X5: 48 
#..   X6: 4 
#..   X7: 36 
#..   X8: 34 
#
#...Citation
T Wu, E Hu, S Xu, M Chen, P Guo, Z Dai, T Feng, L Zhou, 
W Tang, L Zhan, X Fu, S Liu, X Bo, and G Yu. 
clusterProfiler 4.0: A universal enrichment tool for interpreting omics data. 
The Innovation. 2021, 2(3):100141 

> 

from clusterprofiler.

gongxin8888 avatar gongxin8888 commented on August 16, 2024

from clusterprofiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.