Contents

suppressPackageStartupMessages({
  library(magrittr)
  library(factoextra)
  library(rsvd)
  library(grid)
  library(SummarizedExperiment)
  library(GenomicSignatures)
})

source('~/data2/Genomic_Super_Signature/refinebio/methods/4_Hierarchical_Clustering_func.R')
library(RColorBrewer)
n <- 60
qual_col_pals <- brewer.pal.info[brewer.pal.info$category == 'qual',]
col_vector <- unlist(mapply(brewer.pal, qual_col_pals$maxcolors, rownames(qual_col_pals)))

1 Preparation

Hierarchical clustering 677 refine.bio datasets with negative control and training data subset of TCGA-COAD.

1.1 Load refine.bio datasets

allZ <- readRDS("~/data2/PCAGenomicSignatureLibrary/refinebioRseq/canonicalPathways/allZ.rds")

1.2 Load control dataset

Select only PC1s from 10 synthetic datasets (10 neg).

bs_dir <- "~/data2/Genomic_Super_Signature/refinebio/bootstrap/data"
neg <- readRDS(file.path(bs_dir, "bootstrap_PCs_rowNorm_Neg.rds"))
data <- lapply(neg, function(x) x$rotation) %>% Reduce(cbind,.) %>% t

## Select only PC1s and PC2s
numOfTopPCs <- 20
numOfDataset <- 10
ind <- c()
for (i in 1:numOfDataset) {new_ind = c(1)+numOfTopPCs*(i-1); ind = c(ind, new_ind)}
control_dat <- data[ind,]   # 10 PCs x 11,553 genes

1.3 Load TCGA-COAD dataset

load("~/data2/GenomicSuperSignature/data/TCGA_COAD_rseq.rda")
TCGA_COAD_rseq <- EnrichmentBrowser::idMap(TCGA_COAD_rseq, 
                                          org = "hsa", 
                                          from = "ENTREZID", 
                                          to = "SYMBOL")
## 
## Excluded 5 from.IDs without a corresponding to.ID
## Mapped from.IDs have been added to the rowData column ENTREZID
count <- assay(TCGA_COAD_rseq) %>% as.matrix %>% rmNaInf
count <- log2(count + 1)

## Split TCGA-COAD dataset into two, training and testing.
set.seed(123)
ind <- sample(1:ncol(count), size = 100, replace = FALSE)
coad_training <- count[,-ind]
coad_test <- count[,ind]

## For now, I just subset `allZ` with `cg`. But for later, I need to test when to 
## subset data with common genes. 
cg <- intersect(rownames(allZ), rownames(coad_training))   
allZ <- allZ[cg,]

## PCA on TCGA-COAD training dataset
coad_training <- coad_training[rownames(coad_training) %in% cg,,drop=FALSE]
pca_res <- prcomp(t(coad_training))
coad_loading <- pca_res$rotation[,1:20]
colnames(coad_loading) <- paste0("TCGA-COAD.PC", 1:20)

1.4 Combine all training datasets

all <- cbind(allZ, coad_loading) %>% cbind(., t(control_dat[,cg])) %>% t   # 13,570 PCs x 7,802 genes

2 Hierarchical Clustering

2.1 Calculate distance

res.dist <- factoextra::get_dist(all, method = "spearman")
res.hclust <- stats::hclust(res.dist, method = "ward.D")

2.2 Find the minimum cluster number

I manually searched the minimum number of cluster that separates all 10 PC1s from negative control.

# k_range <- c(round(nrow(all)/4,0), round(nrow(all)/3,0), round(nrow(all)/2,0))
k_range <- seq.int(4934,4942,1)
for (i in k_range) {
    res.hcut <- factoextra::hcut(res.dist, k = i, hc_funct = "hclust", 
                                 hc_method = "ward.D", hc_metric = "spearman")
    eval <- evaluateCluster(res.hcut, controlType = "Neg", heatmap = TRUE)
    print(eval)
}

3 Build avgLoading

k <- 4935
res.hcut <- factoextra::hcut(res.dist, k = k, hc_funct = "hclust", hc_method = "ward.D", hc_metric = "spearman")

source('~/data2/GenomicSuperSignature/R/buildAvgLoading_temp.R')
PCclusters <- buildAvgLoading(t(all), clustering = FALSE, cluster = res.hcut$cluster, iter.max = 100)

4 Validation

4.1 Multiple TCGA datasets

# load validation datasets
load("~/data2/GenomicSuperSignature/data/TCGA_validationDatasets.rda")
dataset = TCGA_validationDatasets

# color setup
colfunc <- colorRampPalette(c("white", "red"))
n <- 20
col <- colfunc(n)[c(1,2,n)]

val_all <- validate(dataset[2:5], PCclusters$avgLoading)  # remove COAD from validation
## Warning in if (class(model) %in% c("PCAGenomicSignatures",
## "PLIERGenomicSignatures")) {: the condition has length > 1 and only the first
## element will be used
cutoff <- 0.7
k <- sapply(colnames(val_all), function(x) {sum(val_all[,x] > cutoff) != 0})
validated_ind <- which(k=="TRUE")
heatmapTable(val_all[, names(k)[validated_ind], drop=FALSE], 
             column_title = paste0("PCAmodel (cutoff ", cutoff, ")"), 
             # breaks = c(0, 0.3, 0.6),
             colors = col)

4.1.1 GSEA

PCcluster_263 has very strong correlation with TCGA-BRCA dataset. Check whether this avgLoading vector has BRCA-specific signature. (GSEA/GSEA_on_avgLoading.Rmd)

4.2 TCGA-COAD test dataset

val_test <- validate(coad_test, PCclusters$avgLoading)
## Warning in if (class(model) %in% c("PCAGenomicSignatures",
## "PLIERGenomicSignatures")) {: the condition has length > 1 and only the first
## element will be used
## Warning in if (class(dataset) == "ExpressionSet") {: the condition has length >
## 1 and only the first element will be used
## Warning in if (class(dataset) %in% c("SummarizedExperiment",
## "RangedSummarizedExperiment")) {: the condition has length > 1 and only the
## first element will be used
## Warning in if (class(dataset) == "matrix") {: the condition has length > 1 and
## only the first element will be used

cutoff <- 0.66
k = sapply(colnames(val_test), function(x) {sum(val_test[,x] > cutoff) != 0})
validated_ind2 <- which(k=="TRUE")
heatmapTable(val_test[, names(k)[validated_ind2], drop=FALSE], 
             column_title = paste0("PCAmodel (cutoff ", cutoff, ")"), 
             # breaks = c(0, 0.3, 0.6),
             colors = col)

sapply(validated_ind2, function(x) {which(PCclusters$cluster == x) %>% names})
## $`Cl4935_504 (15/14)`
##  [1] "ERP091820.PC3" "SRP026537.PC3" "SRP096016.PC1" "SRP096016.PC3"
##  [5] "SRP109549.PC2" "SRP109672.PC2" "SRP110148.PC1" "SRP116273.PC3"
##  [9] "SRP126485.PC6" "SRP128036.PC6" "SRP151763.PC2" "SRP154478.PC2"
## [13] "SRP169609.PC3" "SRP179613.PC8" "TCGA-COAD.PC3"
## 
## $`Cl4935_917 (9/9)`
## [1] "SRP010181.PC4"  "SRP026042.PC7"  "SRP065317.PC2"  "SRP072492.PC9" 
## [5] "SRP078156.PC14" "SRP106011.PC7"  "SRP123604.PC1"  "SRP148497.PC3" 
## [9] "SRP172499.PC9" 
## 
## $`Cl4935_920 (7/7)`
## [1] "SRP010181.PC7"  "SRP069159.PC1"  "SRP074739.PC8"  "SRP116952.PC1" 
## [5] "SRP129004.PC15" "SRP179648.PC1"  "TCGA-COAD.PC8" 
## 
## $`Cl4935_1229 (7/7)`
## [1] "SRP029880.PC2"  "SRP057793.PC8"  "SRP103099.PC17" "SRP106011.PC12"
## [5] "SRP107025.PC7"  "SRP158730.PC4"  "TCGA-COAD.PC2" 
## 
## $`Cl4935_1230 (5/5)`
## [1] "SRP029880.PC5" "SRP087576.PC9" "SRP111343.PC9" "SRP133891.PC7"
## [5] "TCGA-COAD.PC5"

4.3 GSEA

ind <- validated_ind2[4]
al <- PCclusters$avgLoading[, ind]

names(al) <- AnnotationDbi::mapIds(org.Hs.eg.db, keys=names(al), column='ENTREZID', keytype='SYMBOL')
## 'select()' returned 1:many mapping between keys and columns
al <- sort(al, decreasing = TRUE)

## Formating
geneList <- al
gene <- names(geneList)[abs(geneList) > mean(abs(geneList))]
keyword <- "colon"

4.3.1 WikiPathways analysis

library(clusterProfiler)
## clusterProfiler v3.17.0  For help: https://guangchuangyu.github.io/software/clusterProfiler
## 
## If you use clusterProfiler in published research, please cite:
## Guangchuang Yu, Li-Gen Wang, Yanyan Han, Qing-Yu He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology. 2012, 16(5):284-287.
## 
## Attaching package: 'clusterProfiler'
## The following object is masked from 'package:AnnotationDbi':
## 
##     select
## The following object is masked from 'package:DelayedArray':
## 
##     simplify
## The following object is masked from 'package:IRanges':
## 
##     slice
## The following object is masked from 'package:S4Vectors':
## 
##     rename
## The following object is masked from 'package:stats':
## 
##     filter
wpgmtfile <- "~/data2/Genomic_Super_Signature/GSEA/data/wikipathways-20200510-gmt-Homo_sapiens.gmt"
wp2gene <- read.gmt(wpgmtfile)   # 26,412 x 5
wp2gene <- wp2gene %>% tidyr::separate(term, c("name","version","wpid","org"), "%") 
# cg <- intersect(wp2gene$gene, gene)
# wp2gene <- wp2gene[which(wp2gene$gene %in% cg),]
wpid2gene <- wp2gene %>% dplyr::select(wpid, gene) #TERM2GENE
wpid2name <- wp2gene %>% dplyr::select(wpid, name) #TERM2NAME

ewp <- enricher(gene, TERM2GENE = wpid2gene, TERM2NAME = wpid2name)
head(ewp, 20)
##            ID
## WP477   WP477
## WP4022 WP4022
## WP4172 WP4172
## WP4462 WP4462
## WP1539 WP1539
## WP98     WP98
## WP474   WP474
## WP4808 WP4808
## WP4018 WP4018
## WP3932 WP3932
## WP3937 WP3937
## WP3678 WP3678
## WP2865 WP2865
## WP236   WP236
## WP2877 WP2877
## WP3413 WP3413
## WP4331 WP4331
## WP4787 WP4787
## WP3929 WP3929
## WP2203 WP2203
##                                                                   Description
## WP477                                          Cytoplasmic Ribosomal Proteins
## WP4022                                                  Pyrimidine metabolism
## WP4172                                             PI3K-Akt Signaling Pathway
## WP4462     Platelet-mediated interactions with vascular and circulating cells
## WP1539                                                           Angiogenesis
## WP98                                   Prostaglandin Synthesis and Regulation
## WP474                                               Endochondral Ossification
## WP4808                     Endochondral Ossification with Skeletal Dysplasias
## WP4018                            Pathways in clear cell renal cell carcinoma
## WP3932                         Focal Adhesion-PI3K-Akt-mTOR-signaling pathway
## WP3937                                Microglia Pathogen Phagocytosis Pathway
## WP3678 Amplification and Expansion of Oncogenic Pathways as Metastatic Traits
## WP2865                                      IL1 and megakaryocytes in obesity
## WP236                                                            Adipogenesis
## WP2877                                             Vitamin D Receptor Pathway
## WP3413              NOTCH1 regulation of human endothelial cell calcification
## WP4331                                           Neovascularisation processes
## WP4787                                             Osteoblast differentiation
## WP3929                                            Chemokine signaling pathway
## WP2203                  Thymic Stromal LymphoPoietin (TSLP) Signaling Pathway
##        GeneRatio  BgRatio       pvalue     p.adjust       qvalue
## WP477    76/1773  91/7368 3.030160e-33 1.518110e-30 1.317322e-30
## WP4022   42/1773  87/7368 6.835373e-07 1.712261e-04 1.485794e-04
## WP4172  117/1773 345/7368 1.507671e-05 2.517810e-03 2.184800e-03
## WP4462   12/1773  17/7368 6.535666e-05 6.276954e-03 5.446753e-03
## WP1539   15/1773  24/7368 6.763841e-05 6.276954e-03 5.446753e-03
## WP98     23/1773  45/7368 7.517310e-05 6.276954e-03 5.446753e-03
## WP474    29/1773  65/7368 2.116880e-04 1.325696e-02 1.150357e-02
## WP4808   29/1773  65/7368 2.116880e-04 1.325696e-02 1.150357e-02
## WP4018   36/1773  87/7368 2.493304e-04 1.387939e-02 1.204368e-02
## WP3932  101/1773 309/7368 2.811222e-04 1.408422e-02 1.222142e-02
## WP3937   20/1773  40/7368 3.222479e-04 1.467693e-02 1.273573e-02
## WP3678   11/1773  17/7368 4.314503e-04 1.801305e-02 1.563061e-02
## WP2865   14/1773  25/7368 5.930637e-04 2.285576e-02 1.983282e-02
## WP236    48/1773 131/7368 7.835283e-04 2.720574e-02 2.360746e-02
## WP2877   64/1773 186/7368 8.318818e-04 2.720574e-02 2.360746e-02
## WP3413   11/1773  18/7368 8.688460e-04 2.720574e-02 2.360746e-02
## WP4331   18/1773  37/7368 9.659606e-04 2.846743e-02 2.470227e-02
## WP4787   44/1773 120/7368 1.252053e-03 3.484882e-02 3.023965e-02
## WP3929   57/1773 165/7368 1.406127e-03 3.707734e-02 3.217342e-02
## WP2203   21/1773  47/7368 1.504516e-03 3.768812e-02 3.270342e-02
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 geneID
## WP477                                                                                                                                                                                                                                   6133/6161/6152/3921/6230/6199/6146/6124/6129/6171/6232/6233/6224/6125/6154/6229/6165/6155/6160/4736/6202/6189/6203/6147/6201/7311/6135/6235/23521/6175/6164/6191/9045/6143/11224/6122/6205/6156/6228/6206/6210/2197/6207/6208/6168/6142/6136/6159/6130/6158/9349/6169/6134/6194/6157/6167/6141/6222/6176/6193/6188/6173/6170/6187/6137/6223/6234/6132/6231/6204/6209/6181/25873/6227/6192/6217
## WP4022                                                                                                                                                                                                                                                                                                                                                                                                 1806/129607/5167/978/50484/953/1890/7378/25885/5436/1723/5426/79077/548644/7083/23649/661/6241/5439/4832/51082/64425/55718/5427/246721/5437/5434/1841/5441/10622/4833/30833/790/5424/5438/4831/51728/9533/30834/54963/4830/5425
## WP4172 3479/3791/284/2263/2247/7060/5294/1902/2690/80310/284217/3690/5156/5105/6446/4915/10000/2252/7010/3908/4254/59345/54331/3676/3575/7424/7148/56034/3574/3685/1946/118788/1287/7058/3672/3559/55970/596/9180/2791/3678/1436/4193/2335/23533/1311/10018/3717/10161/3371/2149/6696/23239/3680/7057/3480/9586/3845/3910/10681/2321/2788/3815/3716/1278/3569/3909/7097/1293/5295/5290/7099/1435/2260/3693/3560/23035/5529/5562/3563/5293/6655/3566/8503/7249/2997/5605/1019/6199/5228/10110/54541/1945/6794/11140/1978/117145/7422/3696/672/3265/64223/92579/3326/2324/10319/6194/9170/148327/1299/4609/28227/1942/1944/898/2264/1297
## WP4462                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     6403/6401/7412/6347/7042/3383/7043/6352/6404/3553/7097/7099
## WP1539                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       3791/284/2263/2247/5156/7010/4086/7077/4318/3091/7078/2321/5290/5335/7422
## WP98                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   5733/3248/5740/3290/1910/5732/301/10257/5734/4286/5742/5321/306/5730/5468/5743/1906/309/1909/6277/3291/6662/873
## WP474                                                                                                                                                                                                                                                                                                                                                                                                                                                                               3479/2247/2690/4921/2737/5167/11096/4208/85477/7042/4318/50515/9510/4256/6696/7078/3480/249/1300/2260/860/6772/55553/54407/5327/7422/6662/176/3549
## WP4808                                                                                                                                                                                                                                                                                                                                                                                                                                                                              3479/2247/2690/4921/2737/5167/11096/4208/85477/7042/4318/50515/9510/4256/6696/7078/3480/249/1300/2260/860/6772/55553/54407/5327/7422/6662/176/3549
## WP4018                                                                                                                                                                                                                                                                                                                                                                                                                                          3791/5156/10993/6935/3101/3759/7042/7043/3091/79365/9771/229/197257/2321/5236/32/5352/26227/2026/7249/84335/5211/7167/2023/230/6513/2597/3099/7422/2194/226/64798/6472/5723/64223/2821
## WP3932                                                                                      3479/3791/284/2263/2247/7060/5294/1902/2690/80310/284217/3690/5156/10000/2252/7010/3908/4254/59345/54331/3676/3575/7424/7148/56034/3685/1946/2034/7058/3559/55970/9180/2791/3678/6515/1436/4193/2308/2335/1281/23533/1311/3689/3717/3091/10161/3371/2149/6696/23239/3680/1290/7057/3480/9586/3845/3683/3910/2321/2788/3815/3716/1278/3909/5295/5290/1435/2260/3693/3560/23035/5529/5562/3563/5293/3566/7249/84335/2997/5605/6199/5228/54541/1945/6794/6513/11140/1978/7422/3696/3265/64223/3326/2324/10319/6194/9170/148327/1942/1944/2264
## WP3937                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           5294/1536/3055/3684/712/3071/4688/653361/2207/54210/3689/5336/4067/7409/5295/5290/7305/5293/8503/7410
## WP3678                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          7412/5294/10631/2034/3371/7852/182/7472/4851/7422/6932
## WP2865                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         3554/7941/7096/6347/7077/114548/4318/3383/3606/2149/3553/7097/5290/3654
## WP236                                                                                                                                                                                                                                                                                                                                                                               3479/5740/1675/3977/7291/355/5105/8204/2908/4208/3572/6695/4692/2034/6424/650/2624/196/2308/56603/25937/1879/3091/9021/81029/6095/4205/3399/8321/1959/5054/5468/3569/10499/7025/6772/9663/183/1874/1050/1855/2971/10555/6927/64900/57761/3159/1869
## WP2877                                                                                                                                                                                                                                                                                                 6546/3118/3662/8204/3117/4345/3400/11096/8600/1946/3684/1030/7077/6304/7042/10125/929/25928/2308/5734/3123/7056/9314/5588/54210/219855/50486/3091/240/604/7292/5243/6696/7078/639/490/4084/3488/1305/3397/3394/7168/4600/1031/9926/2050/6277/2539/1050/4041/27035/215/997/6927/1594/4609/29923/1555/6273/1045/898/1469/5653/768
## WP3413                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1902/3672/2702/4256/249/182/55553/5327/4851/7422/3714
## WP4331                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           3791/284/6387/4254/4086/7042/4318/7043/4093/94/3091/7852/3815/5966/182/2050/4851/2324
## WP4787                                                                                                                                                                                                                                                                                                                                                                                                    2263/2247/5294/2252/2737/5579/4086/650/4093/5588/8322/23533/659/4853/81029/8321/5583/5587/5468/2736/4089/4040/23462/182/5295/5290/6608/2260/860/6772/7482/5293/5597/8503/5603/7472/4851/4041/6662/3714/54361/55502/3549/2264
## WP3929                                                                                                                                                                                                                                                                                                                        6366/6356/6387/5294/2770/10000/111/5579/3627/59345/54331/4283/10563/3055/1230/55970/2791/653361/6373/6352/23533/6351/10663/3717/2268/9844/10235/1235/6374/3845/3702/4067/7454/4792/10681/7409/7852/2788/7074/1794/6367/5908/9547/5295/5290/196883/6772/1236/6093/5293/6655/6348/8503/4793/7410/5331/3265
## WP2203                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         6356/3575/3055/6775/695/3559/3717/2534/7292/4067/4792/3716/3569/5290/6772/7006/5605/1154/1978/6194/4609
##        Count
## WP477     76
## WP4022    42
## WP4172   117
## WP4462    12
## WP1539    15
## WP98      23
## WP474     29
## WP4808    29
## WP4018    36
## WP3932   101
## WP3937    20
## WP3678    11
## WP2865    14
## WP236     48
## WP2877    64
## WP3413    11
## WP4331    18
## WP4787    44
## WP3929    57
## WP2203    21

ewp2 <- GSEA(geneList, TERM2GENE = wpid2gene, TERM2NAME = wpid2name, verbose = FALSE)
## Warning in fgseaMultilevel(...): For some pathways, in reality P-values are less
## than 1e-10. You can set the `eps` argument to zero for better estimation.
head(ewp2, 20)
##            ID                                              Description setSize
## WP3929 WP3929                              Chemokine signaling pathway     129
## WP477   WP477                           Cytoplasmic Ribosomal Proteins      84
## WP3932 WP3932           Focal Adhesion-PI3K-Akt-mTOR-signaling pathway     228
## WP2806 WP2806                                  Human Complement System      57
## WP411   WP411                                          mRNA Processing     102
## WP111   WP111 Electron Transport Chain (OXPHOS system in mitochondria)      70
## WP2328 WP2328                                      Allograft Rejection      58
## WP4172 WP4172                               PI3K-Akt Signaling Pathway     238
## WP3945 WP3945                                    TYROBP Causal Network      43
## WP306   WP306                                           Focal Adhesion     163
## WP455   WP455                            GPCRs, Class A Rhodopsin-like      52
## WP4217 WP4217                              Ebola Virus Pathway on Host     113
## WP558   WP558                      Complement and Coagulation Cascades      38
## WP466   WP466                                          DNA Replication      41
## WP3624 WP3624                                            Lung fibrosis      38
## WP2446 WP2446                            Retinoblastoma Gene in Cancer      82
## WP4324 WP4324     Mitochondrial complex I assembly model OXPHOS system      42
## WP4752 WP4752                                     Base Excision Repair      31
## WP51     WP51                         Regulation of Actin Cytoskeleton     113
## WP536   WP536                   Calcium Regulation in the Cardiac Cell      92
##        enrichmentScore       NES       pvalue     p.adjust      qvalues rank
## WP3929       0.5691580  2.290169 1.000000e-10 2.240000e-08 1.473684e-08 1666
## WP477       -0.7857452 -3.456323 1.000000e-10 2.240000e-08 1.473684e-08 1396
## WP3932       0.4680163  2.011272 2.406867e-09 3.594255e-07 2.364641e-07 1931
## WP2806       0.6711309  2.408298 4.327572e-09 4.678014e-07 3.077641e-07 1278
## WP411       -0.5087736 -2.318953 5.404250e-09 4.678014e-07 3.077641e-07 2920
## WP111       -0.5708530 -2.423665 6.265197e-09 4.678014e-07 3.077641e-07 2408
## WP2328       0.6543328  2.346704 8.872675e-09 5.678512e-07 3.735863e-07 1557
## WP4172       0.4453665  1.922164 2.404898e-08 1.346743e-06 8.860149e-07 1432
## WP3945       0.6738867  2.278527 4.777749e-08 2.246252e-06 1.477798e-06 1969
## WP306        0.4867679  2.026910 5.013956e-08 2.246252e-06 1.477798e-06 1931
## WP455        0.6423867  2.263623 1.273196e-07 5.185378e-06 3.411433e-06  941
## WP4217       0.5159880  2.030160 2.102196e-07 7.848200e-06 5.163290e-06 2380
## WP558        0.6864286  2.258437 4.826653e-07 1.663339e-05 1.094302e-05 1324
## WP466       -0.6162289 -2.304597 5.587738e-07 1.788076e-05 1.176366e-05 2292
## WP3624       0.6823485  2.245013 6.844290e-07 2.044161e-05 1.344843e-05 1728
## WP2446      -0.4951026 -2.163077 7.638195e-07 2.138695e-05 1.407036e-05 2292
## WP4324      -0.6027653 -2.273887 1.396027e-06 3.676548e-05 2.418781e-05 2408
## WP4752      -0.6542986 -2.302415 1.477184e-06 3.676548e-05 2.418781e-05 2286
## WP51         0.4924437  1.937524 2.307772e-06 5.441483e-05 3.579923e-05 1728
## WP536        0.5142591  1.976145 4.604293e-06 1.031362e-04 6.785274e-05 1917
##                          leading_edge
## WP3929 tags=47%, list=21%, signal=38%
## WP477  tags=90%, list=18%, signal=75%
## WP3932 tags=43%, list=25%, signal=33%
## WP2806 tags=54%, list=16%, signal=46%
## WP411  tags=68%, list=37%, signal=43%
## WP111  tags=67%, list=31%, signal=47%
## WP2328 tags=57%, list=20%, signal=46%
## WP4172 tags=35%, list=18%, signal=29%
## WP3945 tags=72%, list=25%, signal=54%
## WP306  tags=45%, list=25%, signal=34%
## WP455  tags=54%, list=12%, signal=48%
## WP4217 tags=58%, list=31%, signal=41%
## WP558  tags=61%, list=17%, signal=51%
## WP466  tags=71%, list=29%, signal=50%
## WP3624 tags=71%, list=22%, signal=56%
## WP2446 tags=56%, list=29%, signal=40%
## WP4324 tags=76%, list=31%, signal=53%
## WP4752 tags=77%, list=29%, signal=55%
## WP51   tags=42%, list=22%, signal=33%
## WP536  tags=42%, list=25%, signal=32%
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 core_enrichment
## WP3929                                                                                                                                                                                            6366/6356/6387/5294/2770/10000/111/5579/3627/59345/54331/4283/10563/3055/1230/55970/2791/653361/6373/6352/23533/6351/10663/3717/2268/9844/10235/1235/6374/3845/3702/4067/7454/4792/10681/7409/7852/2788/7074/1794/6367/5908/9547/5295/5290/196883/6772/1236/6093/5293/6655/6348/8503/10451/9475/6774/8976/5567/6773/1398/5291
## WP477                                                                                                                            6133/6161/6152/3921/6230/6199/6146/6124/6129/6171/6232/6233/6224/6125/6154/6229/6165/6155/6160/4736/6202/6189/6203/6147/6201/7311/6135/6235/23521/6175/6164/6191/9045/6143/11224/6122/6205/6156/6228/6206/6210/2197/6207/6208/6168/6142/6136/6159/6130/6158/9349/6169/6134/6194/6157/6167/6141/6222/6176/6193/6188/6173/6170/6187/6137/6223/6234/6132/6231/6204/6209/6181/25873/6227/6192/6217
## WP3932 3479/3791/284/2263/2247/7060/5294/1902/2690/80310/284217/3690/5156/10000/2252/7010/3908/4254/59345/54331/3676/3575/7424/7148/56034/3685/1946/2034/7058/3559/55970/9180/2791/3678/6515/1436/4193/2308/2335/1281/23533/1311/3689/3717/3091/10161/3371/2149/6696/23239/3680/1290/7057/3480/9586/3845/3683/3910/2321/2788/3815/3716/1278/3909/5295/5290/1435/2260/3693/3560/23035/5529/5562/3563/5293/3566/3687/3688/22801/1026/5291/5159/2261/1943/6517/5154/51552/1385/51719/23216/1282/5516/7450/3695/3643/5594/3667/5728
## WP2806                                                                                                                                                                                                                                                                                                                                                                      730/6403/6401/2162/3075/718/1675/715/3690/1634/710/3426/6402/719/629/5627/3383/728/3689/2214/2769/6404/6696/2357/7057/22918/7454/716/7097/1604/5621
## WP411                                                                                                                                            1660/10907/10978/10482/3188/5094/10946/6428/22916/3187/6421/3191/8449/1653/6427/9343/3183/11218/84844/10992/84991/4904/6426/9410/9785/3184/6634/8683/10262/6629/4670/9128/1477/5725/3181/6829/9129/6431/27316/11338/1478/7307/8106/1479/23450/6432/2521/3178/6627/56339/4841/83443/6625/6632/51692/6637/10921/10898/6635/6628/24148/29894/6633/6626/57819/8175/3276/6636/51690
## WP111                                                                                                                                                                                                                                                                            4710/4718/4711/1345/4714/7381/4712/6834/10063/1350/4709/4706/4705/4722/4707/1351/9377/4715/9481/27089/29796/292/4708/1337/9016/4697/4723/4695/1329/1340/4716/7388/4694/1327/4713/4731/10975/1349/4717/4702/4728/4696/4725/4726/374291/4701/293
## WP2328                                                                                                                                                                                                                                                                                                                                                      730/6366/120892/6387/3118/718/5156/355/3117/3113/3122/4283/10563/3111/942/3127/712/3115/3119/3559/6373/3123/3112/5243/7431/3109/3553/1604/6772/55825/3108/3135/7040
## WP4172                                                                             3479/3791/284/2263/2247/7060/5294/1902/2690/80310/284217/3690/5156/5105/6446/4915/10000/2252/7010/3908/4254/59345/54331/3676/3575/7424/7148/56034/3574/3685/1946/118788/1287/7058/3672/3559/55970/596/9180/2791/3678/1436/4193/2335/23533/1311/10018/3717/10161/3371/2149/6696/23239/3680/7057/3480/9586/3845/3910/10681/2321/2788/3815/3716/1278/3569/3909/7097/1293/5295/5290/7099/1435/2260/3693/3560/23035/5529/5562/3563/5293/6655/3566
## WP3945                                                                                                                                                                                                                                                                                                                                                             1806/718/8832/5341/3587/3684/4094/3071/4688/10257/3606/3059/54518/3689/920/51411/3142/6696/6039/951/10019/654346/10184/7305/3687/864/714/5996/7046/3597/9056
## WP306                                                                                                                                          3479/3791/7060/4638/80310/284217/3690/5156/10000/3908/5579/3676/7424/7148/56034/3685/3055/7058/3672/596/3678/4660/330/2335/1311/2268/64098/858/3371/2534/6696/10398/3680/1290/7057/7414/3480/3910/2321/7409/4659/1278/3909/5908/5295/5290/857/394/3693/6093/5293/8503/10451/9475/3688/2318/22801/824/1398/1793/5291/5159/2316/329/5154/55742/10627/5906/1282/7450/3695/5594/5728
## WP455                                                                                                                                                                                                                                                                                                                                                                                5733/9934/150/5028/2359/1234/53829/5724/1910/1240/1230/5732/6751/719/23432/5031/8111/3269/5734/9002/8477/10161/2149/9034/140/187/1235/2357
## WP4217                                                                                                                                                                               10462/3118/3690/30835/3117/3120/3676/3113/3122/3111/3685/3127/84868/3672/3115/85477/3119/684/3678/2934/3123/3112/558/858/9021/23586/3480/3109/7074/5966/5295/5290/7099/857/6772/5293/2060/3108/11314/8503/3135/10461/3688/2318/5610/3665/5291/2316/29110/5868/388/5594/3836/3384/8826/1508/3134/998/2033/3133/4864/3105/708/3106/6868/3673
## WP558                                                                                                                                                                                                                                                                                                                                                                                                                 730/3075/718/1675/715/2153/710/3426/712/719/629/7035/5627/7056/1191/728/2149/5054/716/1604/5327/5265/3998
## WP466                                                                                                                                                                                                                                                                                                                                                                      5985/1017/6118/4175/5422/5558/4173/5111/5001/6119/5983/10926/5426/4171/5984/4998/23649/7311/4172/4176/5982/990/5427/5424/55388/8318/23594/5425/81620
## WP3624                                                                                                                                                                                                                                                                                                                                                                                 3479/26585/2247/6356/2252/6347/4092/4318/6352/6351/2920/4313/3162/6696/2006/3553/6498/3569/10144/5265/1832/1906/6348/5328/7040/4502/5154
## WP2446                                                                                                                                                                                                                                                                                        5985/1017/6118/1786/5591/4175/3146/6502/5422/4173/5111/1870/595/7272/5931/3148/6119/1871/1019/5983/1111/5603/10733/5426/5984/4998/7153/4172/3925/983/6241/4176/5427/890/24137/9133/2189/993/6839/994/891/4609/8318/81620/1869/898
## WP4324                                                                                                                                                                                                                                                                                                                                                  4710/4718/4711/51300/4714/4712/25915/28976/4709/4706/4705/4722/4707/4715/29078/4708/51295/4723/4695/4716/4694/4713/4731/4717/4702/51079/4696/4725/91942/4726/54539/4701
## WP4752                                                                                                                                                                                                                                                                                                                                                                                           55247/10038/3146/7374/23583/5423/5111/27301/3980/252969/27343/4968/7515/11284/5426/328/2237/5427/3978/4595/4350/5424/5425/4913
## WP51                                                                                                                                                                                                                                                                             2263/2247/4638/5294/5156/2252/22808/5962/3672/55970/929/4628/2934/2335/23533/1073/5305/2149/7414/324/79837/3845/7454/4478/7409/4659/9459/5295/5290/2260/10672/55740/6093/5293/6655/5597/8503/5289/9475/10787/624/1398/1793/5291/5159/2261/5154
## WP536                                                                                                                                                                                                                                                                                                                       5350/6546/5577/2770/2697/111/5579/3709/59345/54331/2775/10052/55970/2791/2702/3708/5997/5588/2776/490/8490/5583/5587/2706/10681/2788/196883/481/309/817/2707/5567/775/5576/5581/2771/5996/5573/2701

4.3.2 Disease Analysis

library(DOSE)
## DOSE v3.15.0  For help: https://guangchuangyu.github.io/software/DOSE
## 
## If you use DOSE in published research, please cite:
## Guangchuang Yu, Li-Gen Wang, Guang-Rong Yan, Qing-Yu He. DOSE: an R/Bioconductor package for Disease Ontology Semantic and Enrichment analysis. Bioinformatics 2015, 31(4):608-609
x <- enrichDO(gene          = gene,
              ont           = "DO",
              pvalueCutoff  = 0.01,
              pAdjustMethod = "BH",
              universe      = names(geneList),
              minGSSize     = 5,
              maxGSSize     = 500,
              qvalueCutoff  = 0.01,
              readable      = FALSE)
head(x, 10)
##                        ID                     Description GeneRatio  BgRatio
## DOID:114         DOID:114                   heart disease  173/1830 304/4338
## DOID:7148       DOID:7148            rheumatoid arthritis  200/1830 366/4338
## DOID:850         DOID:850                    lung disease  179/1830 323/4338
## DOID:10763     DOID:10763                    hypertension  185/1830 337/4338
## DOID:0050161 DOID:0050161 lower respiratory tract disease  182/1830 331/4338
## DOID:3342       DOID:3342       bone inflammation disease  259/1830 495/4338
## DOID:1579       DOID:1579      respiratory system disease  195/1830 359/4338
## DOID:848         DOID:848                       arthritis  246/1830 470/4338
## DOID:3213       DOID:3213           demyelinating disease   72/1830 113/4338
## DOID:10591     DOID:10591                   pre-eclampsia   99/1830 166/4338
##                    pvalue     p.adjust       qvalue
## DOID:114     6.074201e-08 6.037756e-05 4.731483e-05
## DOID:7148    3.618737e-07 1.294940e-04 1.014779e-04
## DOID:850     4.501114e-07 1.294940e-04 1.014779e-04
## DOID:10763   6.864262e-07 1.294940e-04 1.014779e-04
## DOID:0050161 7.368376e-07 1.294940e-04 1.014779e-04
## DOID:3342    8.954877e-07 1.294940e-04 1.014779e-04
## DOID:1579    9.119296e-07 1.294940e-04 1.014779e-04
## DOID:848     1.710989e-06 2.125904e-04 1.665963e-04
## DOID:3213    2.449745e-06 2.705607e-04 2.120247e-04
## DOID:10591   2.962386e-06 2.944612e-04 2.307543e-04
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        geneID
## DOID:114                                                                                                                                                                                                                                                                                                                                                                                                                                                                               3479/3791/5350/6403/2247/5446/3554/7941/948/7412/1674/2690/3075/10203/718/6649/2697/3690/29126/7098/1234/2153/7079/355/5167/19/10060/1113/3627/4629/3709/6402/6347/1536/9332/8600/7122/1910/2200/3574/3953/3572/6775/1030/126/3115/8850/3119/2628/650/3559/929/7035/4318/4306/2308/3383/8654/4772/3123/2212/7056/2335/3606/1281/4256/8743/10663/3600/1756/11167/1471/3557/3091/1363/341/6404/240/3371/6444/4015/6909/348/4313/1573/2215/659/2281/7292/3162/6696/3624/10398/4026/4205/187/1829/2052/7078/2776/2627/7057/7414/3480/5069/5054/5468/3910/2006/3553/7852/5236/3815/1843/7273/7168/217/3569/182/7097/7099/6772/241/8912/27086/953/1906/90/1909/10267/3987/5562/10068/4881/9388/6285/1116/3135/51330/9518/6647/7753/183/4723/2064/3767/55636/8862/84033/6513/9093/3784/23082/3757/2678/7422/1050/682/2101/64220/11093/6901/6927/3329/6597/25902/1159/332/949/1594/95/6262/152
## DOID:7148                                                                                                                                                                                                                                                                                                                3479/6366/6403/6401/6356/3554/64581/6387/7412/9423/5294/1902/1901/3075/3957/10203/6362/2213/7177/5915/29126/27074/862/7098/1234/912/4481/355/57419/5783/2908/8633/5320/1113/3627/3709/26353/11096/6347/5788/3676/6586/3575/8600/10563/3574/3953/3685/1230/942/3684/6775/2034/84868/5732/10673/3672/3119/114548/301/8828/10855/3559/4261/596/929/6288/1436/4193/4318/50856/3383/3604/4772/6352/2934/3123/2212/117289/4286/1191/2335/5742/64135/3606/5321/3820/54210/1311/8743/1803/728/1520/2289/10018/3600/3689/3717/11167/2214/1513/1471/57630/3557/3091/914/920/240/348/4313/10512/2215/5243/22861/3162/9034/6696/3624/7431/1235/7078/639/2357/7057/3937/3109/5583/5054/4792/5468/3603/3553/4217/10/7852/54/2683/6367/5966/3569/182/10859/7097/219699/7099/5743/3398/6583/5327/5265/3560/1906/10746/4482/847/1903/26191/23118/5293/3566/9966/6348/3108/1116/3135/6416/51330/9518/6647/3654/1723/2064/2023/7515/50943/51561/59307/3291/9641/4795/3661/7422/55835/5916/682/4041/176/471/63875/8718/3329/4350/64772/5347/2821/332/4609/6573/8771/9047
## DOID:850                                                                                                                                                                                                                                                                                                                                                                                                                                         3479/6366/3791/26585/27299/2247/1545/9353/6356/6387/10875/948/7412/4638/5294/6362/6649/3690/29126/1439/1234/7291/4481/355/3001/4321/6446/2252/2908/5320/3627/925/6347/3676/4283/7424/3587/3574/80332/3953/3572/3055/8809/5144/942/3684/4094/59341/11213/3779/3119/301/719/30061/596/196/4688/1179/653361/6373/929/7035/8091/4318/2308/3383/4628/6352/3123/2212/7056/2294/5742/64135/3606/1281/54210/10630/10663/3043/728/6648/1520/3620/3689/1513/1471/3557/3091/3429/358/6404/3371/2149/2534/348/4313/2215/659/22861/3162/6696/57016/6678/2052/7078/2627/6374/7100/8321/3702/3683/3488/5054/4316/4792/5468/3603/2006/2321/3553/10/7852/7498/1475/23462/7049/6367/3569/7097/7099/5048/5743/1435/3659/857/6772/5327/5265/4837/1906/90/4482/3303/847/5293/2730/3658/3566/6348/1116/6590/7249/6647/183/5228/4968/2064/7515/50943/11315/3784/3291/4582/1364/7422/3589/3315/682/990/1181/81930/6469/2065/3329/1159/1755/8771/5266
## DOID:10763                                                                                                                                                                                                                                                                                                                                                                                                           3479/3791/284/6546/150/26585/6403/2247/6401/6387/7941/948/5740/7412/3778/2690/3075/10203/718/6649/3690/366/72/1234/2153/3290/355/1634/6446/5167/290/6999/2908/19/7010/1113/3627/3426/6402/7857/5950/6347/1462/8600/5168/7424/1910/3953/3572/6338/5144/4086/4069/7077/10673/2028/3779/8942/650/7035/4318/4306/3383/7043/5997/8654/154091/5592/3123/7056/1191/5742/3606/94/1803/972/140803/6648/3600/3620/221935/1471/3557/3091/9021/3371/6909/348/4313/1573/659/2878/1734/5243/3162/130399/92/3624/4973/4205/187/94031/8876/2052/490/3480/633/5069/8490/6581/84666/10580/3488/5054/5468/3603/114897/2321/3553/64167/10/5654/3397/55328/7498/23462/7049/217/5292/3569/51752/9459/7097/5295/7099/5743/1435/481/857/3398/5327/5265/1906/4128/4012/1909/10267/3303/6093/6518/847/4881/6285/3135/2068/9518/6647/183/5228/6541/7515/9138/8862/6550/6510/2678/3163/3291/4795/7422/328/3315/1312/4041/11093/7020/27035/11132/2879/5652/11200/2030/3177/1942/65266
## DOID:0050161                                                                                                                                                                                                                                                                                                                                                                                                                       3479/6366/3791/26585/27299/2247/1545/9353/6356/6387/10875/948/7412/4638/5294/6362/6649/3690/29126/1439/1234/7291/4481/355/3001/4321/6446/2252/2908/5320/3627/925/6347/3676/4283/7424/3587/3574/80332/3953/3572/3055/6338/8809/5144/942/3684/4094/59341/11213/3779/3119/301/719/30061/596/196/4688/1179/653361/6373/929/7035/8091/4318/2308/3383/4628/6352/3123/2212/7056/2294/5742/64135/3606/1281/54210/10630/10663/3043/728/6648/1520/3620/3689/1513/1471/3557/3091/3429/358/6404/3371/2149/2534/348/4313/2215/659/22861/3162/6696/57016/6678/2052/7078/2627/6374/7100/8321/3702/3683/3488/5054/4316/4792/5468/3603/2006/2321/3553/10/7852/7498/1475/23462/7049/6367/644/3569/7097/7099/5048/5743/1435/3659/857/6772/5327/5265/4837/1906/90/4482/3303/847/5293/2730/3658/3566/6285/6348/1116/6590/7249/6647/183/5228/4968/2064/7515/50943/11315/3784/3291/4582/1364/7422/3589/3315/682/990/1181/81930/6469/2065/3329/1159/1755/8771/5266
## DOID:3342    54829/3479/6366/6403/2247/6401/6356/3554/64581/6387/5740/7412/9423/5294/1902/2690/1901/3075/3957/10203/6362/2213/7177/5915/29126/27074/862/7098/1234/912/7079/4481/355/57419/4921/5783/2908/1948/3117/8633/5320/1113/3627/3709/26353/8792/7130/11096/6347/5788/3676/10418/6586/3575/8600/10563/3574/3953/3685/1230/942/3684/4094/6775/2034/84868/7077/5732/10673/3672/3115/3119/114548/301/8828/10855/650/3559/4261/596/929/963/6288/1436/4193/4318/50856/3383/3604/4772/5734/6352/2934/3123/2212/117289/4286/23213/1191/2335/5742/64135/3606/5321/3820/54210/1311/6351/8743/1803/728/6648/1520/2289/10018/3600/3689/3717/11167/2214/1513/1471/57630/3557/3091/914/5730/920/126014/240/348/4313/10512/2215/1836/4853/1734/5243/22861/3162/9034/6696/3624/7431/1235/6678/7078/639/3680/7100/25939/2357/7057/3937/3109/5583/919/5054/567/4792/5468/3603/3553/4217/64167/10/5654/249/7852/54/2683/5873/7049/6367/81792/5966/3569/182/51752/10859/9547/7097/219699/7099/5743/1435/3398/6583/5327/5265/953/3560/1906/4128/10746/1236/7006/4482/847/1903/26191/23118/5293/3566/9966/6348/3108/1116/3135/6416/6590/51330/9518/6647/3654/7167/1723/2064/2023/7515/2050/50943/51561/8751/6513/59307/6282/3291/9641/4795/3661/4851/7422/3589/55835/5916/1999/682/1186/4041/6662/176/471/63875/8718/3329/4350/4072/25824/64772/5347/2821/332/57761/4488/4609/6573/8771/9047
## DOID:1579                                                                                                                                                                                                                                                                                                                                                    3479/6366/3791/26585/27299/6403/2247/1545/9353/6356/6387/10875/948/7412/4638/5294/6362/6649/1675/3690/29126/1439/7098/1234/7291/4481/355/3001/4321/6446/2252/2908/5320/3627/925/6347/3676/4283/7424/3587/3574/80332/3953/3572/3055/6338/8809/5144/942/3684/4094/59341/11213/3779/3119/114548/301/719/3559/30061/596/196/4688/1179/653361/6373/929/7035/8091/4318/2308/3383/4628/6352/3123/2212/7056/2294/5742/64135/3606/1281/54210/10630/1803/10663/3043/728/6648/1520/3620/3689/1513/1471/3557/3091/3429/358/6404/3371/2149/2534/348/4313/2215/659/22861/3162/6696/57016/6678/2052/7078/4583/2627/6374/7100/8321/3702/3683/3488/5054/4316/4792/5468/3603/2006/2321/3553/10/7852/7498/10071/1475/23462/7049/6367/644/3569/7097/7099/5048/5743/1435/3659/857/6772/5327/5265/4837/1906/90/4482/3303/6093/847/5293/2730/3658/3566/6285/6348/1116/3135/6590/7249/6647/183/5228/4968/2064/7515/50943/11315/51561/3784/3291/4582/1364/7422/3589/3315/682/990/1181/27035/81930/6469/2065/3329/1159/1755/8771/5016/5266
## DOID:848                                                                        54829/3479/6366/6403/2247/6401/6356/3554/64581/6387/7412/9423/5294/1902/2690/1901/3075/3957/10203/6362/2213/7177/5915/29126/27074/862/7098/1234/912/7079/4481/355/57419/4921/5783/2908/1948/3117/8633/5320/1113/3627/3709/26353/8792/7130/11096/6347/5788/3676/10418/6586/3575/8600/10563/3574/3953/3685/1230/942/3684/4094/6775/2034/84868/7077/5732/10673/3672/3115/3119/114548/301/8828/10855/650/3559/4261/596/929/963/6288/1436/4193/4318/50856/3383/3604/4772/5734/6352/2934/3123/2212/117289/4286/23213/1191/2335/5742/64135/3606/5321/3820/54210/1311/8743/1803/728/6648/1520/2289/10018/3600/3689/3717/11167/2214/1513/1471/57630/3557/3091/914/5730/920/126014/240/348/4313/10512/2215/1836/4853/1734/5243/22861/3162/9034/6696/3624/7431/1235/7078/639/3680/2357/7057/3937/3109/5583/919/5054/567/4792/5468/3603/3553/4217/10/5654/7852/54/2683/5873/7049/6367/81792/5966/3569/182/10859/9547/7097/219699/7099/5743/3398/6583/5327/5265/953/3560/1906/4128/10746/1236/7006/4482/847/1903/26191/23118/5293/3566/9966/6348/3108/1116/3135/6416/51330/9518/6647/3654/7167/1723/2064/2023/7515/2050/50943/51561/8751/6513/59307/6282/3291/9641/4795/3661/4851/7422/55835/5916/1999/682/4041/6662/176/471/63875/8718/3329/4350/4072/25824/64772/5347/2821/332/57761/4609/6573/8771/9047
## DOID:3213                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          730/6387/2213/718/1675/2672/1234/355/4321/2908/3117/6505/3627/6347/5788/3676/3122/3575/3953/1230/3127/3672/3115/6507/3119/3559/4261/929/4318/3383/6352/3123/2212/2/1879/330/64135/3606/558/4599/3620/3689/2214/3557/3429/920/6404/348/2215/3162/5054/3553/3394/3569/3659/5327/953/1236/847/3566/6285/6334/1116/3135/183/2597/3925/6469/3028/1594/1045/5653
## DOID:10591                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              3479/3791/284/6403/6401/7412/3075/6649/366/72/2153/355/1634/5167/6999/7010/3627/3426/6402/5950/6347/1462/8600/5168/7424/3953/3572/10673/7035/4318/3383/7043/7056/1191/5742/3606/972/6648/3600/3620/1471/3091/9021/348/4313/2878/3162/130399/92/3624/4973/187/94031/2052/633/5069/6581/3488/5054/5468/3603/2321/64167/10/5654/7498/3569/7097/7099/5743/1435/1906/4012/1909/847/6285/3135/2068/9518/6647/183/5228/7515/8862/6550/6510/3163/3291/7422/328/3315/1312/11093/7020/27035/2879/2030/3177/1942
##              Count
## DOID:114       173
## DOID:7148      200
## DOID:850       179
## DOID:10763     185
## DOID:0050161   182
## DOID:3342      259
## DOID:1579      195
## DOID:848       246
## DOID:3213       72
## DOID:10591      99
x[order(x$Count, decreasing = TRUE),][1:20, 1:5]
##                        ID                                     Description
## DOID:3342       DOID:3342                       bone inflammation disease
## DOID:848         DOID:848                                       arthritis
## DOID:7148       DOID:7148                            rheumatoid arthritis
## DOID:1579       DOID:1579                      respiratory system disease
## DOID:10763     DOID:10763                                    hypertension
## DOID:0050161 DOID:0050161                 lower respiratory tract disease
## DOID:850         DOID:850                                    lung disease
## DOID:114         DOID:114                                   heart disease
## DOID:0050155 DOID:0050155                          sensory system disease
## DOID:1492       DOID:1492                          eye and adnexa disease
## DOID:5614       DOID:5614                                     eye disease
## DOID:2349       DOID:2349                                arteriosclerosis
## DOID:2348       DOID:2348         arteriosclerotic cardiovascular disease
## DOID:1936       DOID:1936                                 atherosclerosis
## DOID:3393       DOID:3393                         coronary artery disease
## DOID:5679       DOID:5679                                 retinal disease
## DOID:2320       DOID:2320                        obstructive lung disease
## DOID:5844       DOID:5844                           myocardial infarction
## DOID:10591     DOID:10591                                   pre-eclampsia
## DOID:526         DOID:526 Human immunodeficiency virus infectious disease
##              GeneRatio  BgRatio       pvalue
## DOID:3342     259/1830 495/4338 8.954877e-07
## DOID:848      246/1830 470/4338 1.710989e-06
## DOID:7148     200/1830 366/4338 3.618737e-07
## DOID:1579     195/1830 359/4338 9.119296e-07
## DOID:10763    185/1830 337/4338 6.864262e-07
## DOID:0050161  182/1830 331/4338 7.368376e-07
## DOID:850      179/1830 323/4338 4.501114e-07
## DOID:114      173/1830 304/4338 6.074201e-08
## DOID:0050155  173/1830 333/4338 1.183664e-04
## DOID:1492     161/1830 301/4338 2.798109e-05
## DOID:5614     159/1830 295/4338 1.807118e-05
## DOID:2349     130/1830 237/4338 3.657440e-05
## DOID:2348     127/1830 233/4338 6.662611e-05
## DOID:1936     126/1830 232/4338 8.845695e-05
## DOID:3393     119/1830 211/4338 1.432555e-05
## DOID:5679     113/1830 205/4338 9.066874e-05
## DOID:2320     105/1830 192/4338 2.421247e-04
## DOID:5844     100/1830 169/4338 4.326947e-06
## DOID:10591     99/1830 166/4338 2.962386e-06
## DOID:526       75/1830 126/4338 5.243684e-05