Hello,
I used ClusterProfiler with the function enrichGO, for human and exported the GO terms with the genes included in each term.
I searched Amigo afterwards to generate a list and realized that there are genes that are not included in these GO terms.
I provide an example:
Output file of ClusterProfiler for GO:0019058 "viral life cycle", includes genes like CD81, LGALS9, VAPB. When I check Amigo for the GO term, these genes are not included in Homo sapiens. I also checked for aliases, but couldnt find them again.
library(matrixStats)
library(reshape2)
library(Rcpp)
library(r2excel)
library("org.Hs.eg.db")
library(ReactomePA)
library("clusterProfiler")
library("DOSE")
library("org.Mm.eg.db")
library(ggplot2)
library(grid)
library(gridExtra)
library(biomaRt)
expression_data <- t(read.delim("All present genes.txt",check.names = FALSE))
universe <- row.names(expression_data)
#read in the gene sets to be tested. Gene sets are in column. Column name is gene set name.
cluster_genes_original <- read.delim("example.txt", stringsAsFactor = FALSE, na.strings = "", check.names = FALSE, header = T)
orga_type = "human"
human = useMart("ensembl", dataset = "hsapiens_gene_ensembl")
mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl")
if(orga_type == "mouse"){
universe_mouse_human = getLDS(attributes = c("mgi_symbol"), filters = "mgi_symbol", values = universe, mart = mouse, attributesL = c("hgnc_symbol"), martL = human, uniqueRows=T)
universe_mouse_human <- universe_mouse_human[,2]
universe_Entrez_mouse = bitr(universe, fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Mm.eg.db")
universe_Entrez_mouse = unlist(universe_Entrez_mouse[2],use.names = FALSE)
universe_Entrez_mouse_human = bitr(universe_mouse_human, fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Hs.eg.db")
universe_Entrez_mouse_human = unlist(universe_Entrez_mouse_human[2],use.names = FALSE)
}else{
universe_Entrez = bitr(universe, fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Hs.eg.db")
universe_Entrez = unlist(universe_Entrez[2],use.names = FALSE)
}
#
list_of_entrez <- list()
for(id in 1:ncol(cluster_genes_original)){
list_of_genes <- list(cluster_genes_original[,id])
list_of_genes <- list(list_of_genes)
entrez_de = bitr(unlist(list_of_genes), fromType="SYMBOL", toType="ENTREZID", OrgDb="org.Hs.eg.db")
module_entrez <- unlist(entrez_de[2],use.names = FALSE)
list_of_entrez[[colnames(cluster_genes_original)[id]]] <- module_entrez
}
ck <- compareCluster(geneCluster = list_of_entrez, fun = "enrichGO",
OrgDb='org.Hs.eg.db',
pvalueCutoff = 0.05,
pAdjustMethod = "fdr",
ont = "BP",
universe = universe_Entrez,
qvalueCutoff = 0.05,
readable = TRUE
)
# export txt file containing all enriched GO terms
ck_DF <- as.data.frame(ck)
write.table(ck_DF, "ck_example.txt", sep="\t")
Thanks a lot!!