enrichplot
enrichplot copied to clipboard
emapplot 'x' must be an array of at least two dimensions
Hello,
I am trying to use emapplot and get the following error:
emapplot(GO_CC_down) + labs(title="Enrichment map for GO CC down") + theme(plot.title=element_text(hjust=0.5,size=15,face="bold"))
Error in rowSums(data[, cols]) :
'x' must be an array of at least two dimensions
Here is the object:
> GO_CC_down
#
# Result of Comparing 5 gene clusters
#
#.. @fun enrichGO
#.. @geneClusters List of 5
$ conc_0.1uM : chr(0)
$ conc_1uM : chr "RNVU1-29"
$ conc_10uM : chr(0)
$ conc_100uM : chr [1:56] "HECW1" "PDK2" "MRC2" "VCAN" ...
$ conc_1000uM: chr [1:21] "NKAIN4" "SLC2A9" "CDH6" "CEP70" ...
#...Result 'data.frame': 3 obs. of 13 variables:
$ Cluster : Factor w/ 5 levels "conc_0.1uM","conc_1uM",..: 4 4 4
$ ID : chr "GO:0016323" "GO:0009925" "GO:0045178"
$ Description : chr "basolateral plasma membrane" "basal plasma membrane" "basal part of cell"
$ GeneRatio : chr "5/46" "5/46" "5/46"
$ BgRatio : chr "264/19960" "298/19960" "317/19960"
$ RichFactor : num 0.0189 0.0168 0.0158
$ FoldEnrichment: num 8.22 7.28 6.84
$ zScore : num 5.67 5.25 5.04
$ pvalue : num 0.000343 0.000596 0.000787
$ p.adjust : num 0.0268 0.0268 0.0268
$ qvalue : num 0.0226 0.0226 0.0226
$ geneID : chr "ABCC3/SLC2A9/SLC7A7/AQP3/SLCO2A1" "ABCC3/SLC2A9/SLC7A7/AQP3/SLCO2A1" "ABCC3/SLC2A9/SLC7A7/AQP3/SLCO2A1"
$ Count : int 5 5 5
#.. number of enriched terms found for each gene cluster:
#.. conc_0.1uM: 0
#.. conc_1uM: 0
#.. conc_10uM: 0
#.. conc_100uM: 3
#.. conc_1000uM: 0
Could you help me understand why I am getting this error?
Thank you, Asma
Using the included example data your code is working for me; be sure to also explicitly load the library(ggplot2)!
Also not that most of your clusters are empty! Thus no enriched terms.
>
> ## just to be sure; install GitHub version of enrichplot
> ## since some issues with emapplot were recently fixed
>
> BiocManager::install(c('YuLab-SMU/enrichplot'), force=TRUE)
> # <<snip>>
>
> library(clusterProfiler)
> library(enrichplot)
> library(org.Hs.eg.db)
>
> data(gcSample)
>
> all_genes_GO_MF <- compareCluster(geneCluster = gcSample,
+ fun = enrichGO,
+ ont = "MF",
+ OrgDb ="org.Hs.eg.db",
+ pAdjustMethod = "BH",
+ keyType = "ENTREZID",
+ pvalueCutoff = 0.05,
+ qvalueCutoff = 0.05,
+ minGSSize = 10,
+ maxGSSize = 500,
+ readable=TRUE)
>
> all_genes_GO_MF_sim <- pairwise_termsim(all_genes_GO_MF)
>
> all_genes_GO_MF
#
# Result of Comparing 8 gene clusters
#
#.. @fun enrichGO
#.. @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': 108 obs. of 13 variables:
$ Cluster : Factor w/ 8 levels "X1","X2","X3",..: 1 1 1 1 1 1 1 1 1 1 ...
$ ID : chr "GO:0003680" "GO:1901681" "GO:1902282" "GO:0140375" ...
$ Description : chr "minor groove of adenine-thymine-rich DNA binding" "sulfur compound binding" "voltage-gated potassium channel activity involved in ventricular cardiac muscle cell action potential repolarization" "immune receptor activity" ...
$ GeneRatio : chr "3/204" "11/204" "3/204" "8/204" ...
$ BgRatio : chr "10/18737" "277/18737" "12/18737" "154/18737" ...
$ RichFactor : num 0.3 0.0397 0.25 0.0519 0.0598 ...
$ FoldEnrichment: num 27.55 3.65 22.96 4.77 5.5 ...
$ zScore : num 8.81 4.66 7.98 4.93 5.12 ...
$ pvalue : num 0.000144 0.000237 0.00026 0.000289 0.000295 ...
$ p.adjust : num 0.0278 0.0278 0.0278 0.0278 0.0278 ...
$ qvalue : num 0.0254 0.0254 0.0254 0.0254 0.0254 ...
$ geneID : chr "PAX6/HMGA1/HAND2" "ENPP1/KNG1/COLQ/H1-1/APLP1/NRTN/NRP2/CXCL8/POSTN/PLA2G2D/PNPLA3" "KCNH2/KCND3/KCNE5" "IL1R2/GPR17/IL2RA/FCER2/IL12RB2/NCR3/CXCR6/GFRA3" ...
$ Count : int 3 11 3 8 7 10 3 6 8 3 ...
#.. number of enriched terms found for each gene cluster:
#.. X1: 10
#.. X2: 1
#.. X3: 0
#.. X4: 11
#.. X5: 7
#.. X6: 0
#.. X7: 40
#.. X8: 39
#
#...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
>
>
> library(ggplot2)
>
> emapplot(all_genes_GO_MF_sim, pie="Count", size_edge = 1.5, showCategory = 4) +
+ labs(title="Enrichment map for GO MF text") +
+ theme( plot.title=element_text(hjust=0.5, size=15, face="bold") )
Coordinate system already present. Adding new coordinate system, which will
replace the existing one.
>