Hello. I have 6 datasets looking at how a treatment affects lung, liver and kidney endothelial cell proteomic expression at 4 and 24 hrs. When I run enrichGO across each of the 3 4 hr datasets for instance, each contains 5 of the same GO Biological Processes. The same goes for the 3 24 hr datasets (with different top 5 GO BPs). Now, I'm trying to use the compareCluster function to produce a comprehensive dotplot that compares the protein ratios and p-values of these top 5 GO Biological Processes across the three 4 hr datasets (then 24 hr). However, when I run my function (below), none of those GO BPs are in any of the clusters, and thus are not plotted, I'm unsure why.
library(org.Mm.eg.db)
library(DOSE)
library(enrichplot)
library(clusterProfiler)
upLists<-list(Lung.upgenes.4,Liver.upgenes.4,Kidney.upgenes.4)
ids<-list("Lung", "Liver", "Kidney")
uni <- list(Lung.bkgdgenes.4.df, Liver.bkgdgenes.4.df, Kidney.bkgdgenes.4.df)
MultiGO_BP0 <- function(upLists, ids, uni) #Function for creating multi-GO dotplots across datasets
{
`upGenesList <- list()`
`for(i in 1:length(ids))`
{
`upGenesList[[i]] <- as.vector(upLists [[i]])`
}
names(upGenesList) <- ids
tissueCompare <- compareCluster(geneCluster = upGenesList, fun = "enrichGO", universe = uni, ont = "BP", OrgDb = org.Mm.eg.db, readable = TRUE, pvalueCutoff = 0.05) #Analyzing clusters
dplot<- dotplot(tissueCompare, showCategory = c("response to bacterium", "defense response to other organism", "response to cytokine", "innate immune response", "cellular response to cytokine stimulus")) #top 5 GO BPs of interest
return(dplot2)
}`
multi_go_plots<-MultiGO_BP0(upLists,ids, uni) #Calling the function
Error in $<-.data.frame(*tmp*, "Cluster", value = NA_integer_) : replacement has 1 row, data has 0 #Error message
sessionInfo()
R version 4.1.0 (2021-05-18) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 10.16
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8