Entering edit mode
I am getting thats kind of error Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘upsetplot’ for signature ‘"NULL"’. Why 's that? This code what I am trying to run is getting the enrichment results by Over-Representation Analysis with ClusterProfiler.
organism = "org.Hs.eg.db"
#BiocManager::install(organism, character.only = TRUE)
library(organism, character.only = TRUE)
# reading in input from deseq2
df = read.csv("PT_vs_STN_DNM2.overexp.csv", header=TRUE)
# we want the log2 fold change
original_gene_list <- df$log2FoldChange
# name the vector
names(original_gene_list) <- df$X
# omit any NA values
gene_list<-na.omit(original_gene_list)
# sort the list in decreasing order (required for clusterProfiler)
gene_list = sort(gene_list, decreasing = TRUE)
# Exctract significant results (padj < 0.05)
sig_genes_df = subset(df, padj < 0.05)
# From significant results, we want to filter on log2fold change
genes <- sig_genes_df$log2FoldChange
# Name the vector
names(genes) <- sig_genes_df$X
# omit NA values
genes <- na.omit(genes)
# filter on min log2fold change (log2FoldChange > 2)
genes <- names(genes)[abs(genes) > 2]
go_enrich <- enrichGO(gene = genes,
universe = names(gene_list),
OrgDb = organism,
keyType = 'ENSEMBL',
readable = T,
ont = "BP",
pvalueCutoff = 0.05,
qvalueCutoff = 0.10)
#BiocManager::install("enrichplot")
library(enrichplot)
memory.limit(size=56000)
upsetplot(go_enrich)
# include your problematic code here with any corresponding output
# please also include the results of running the following in an R session
sessionInfo( )
: I am pretty sure your go_enrich object is empty, are you sure you have any ontology that is significant ? Please show us the output of go_enrich
--> No gene can be mapped.... --> Expected input gene ID: ENSG00000087510,ENSG00000213145,ENSG00000064199,ENSG00000104998,ENSG00000153208,ENSG00000196074 --> return NULL...
What shoul I do?
check the output of
head( names(gene_list) )
, and confirm that these are indeed human Ensembl IDs. TheenrichGO
notification states that this is not case!Error in unique.default(gene) : unique() applies only to vectors i got this error. why is that?
You provided a consequent number of code lines but if every code produces an error it is almost impossible to help you. Please give us the first code line that produces an error in the code you provided and the following error.
This is my console
The limited information you give on the type and structure of your inputs doesn't make it easy for us to give you some help... The
Error in unique.default(gene) : unique() applies only to vectors
suggests that your objectgene
is not a character vector, but (based on your code) likely a matrix.I would strongly advise you to check the help page for
enrichGO()
. Just type?enrichGO
. If you do so, you would see:gene: a vector of entrez gene id
. Moreover, some example code is available, which you could run, and by doing so you should also be able to compare theclass()
andstr()
of objects (vectors, matrix, ...) that are used in the example with those of the objects you generated. I guess it will then be very easy to get your analysis running!Thank you so much for the feedback. I am moving step by step. I got some output. But I have a problem with the plots as follows in the script of the console.
Thank you so much for the feedback. I am moving step by step. I got some output. But I have a problem with the plots as follows in the script of the console.
Check your data
genes
( No gene can be mapped) andgenelist
, and check your enrichment result. If you can provide the data, I can test it for you."Please use pairwise_termsim function to deal with the results of enrichment analysis" .