Getting error
0
0
Entering edit mode
beslinail • 0
@d4a633b9
Last seen 9 months ago
Turkey

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( )
enrichplot clusterProfiler org.Hs.eg.db • 4.0k views
ADD COMMENT
0
Entering edit mode

unable to find an inherited method for function ‘upsetplot’ for signature ‘"NULL"’

: 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

ADD REPLY
0
Entering edit mode

go_enrich <- enrichGO(gene = genes,

  • universe = names(gene_list),
  • OrgDb = organism,
  • keyType = 'ENSEMBL',
  • readable = T,
  • ont = "BP",
  • pvalueCutoff = 0.05,
  • qvalueCutoff = 0.10)

--> No gene can be mapped.... --> Expected input gene ID: ENSG00000087510,ENSG00000213145,ENSG00000064199,ENSG00000104998,ENSG00000153208,ENSG00000196074 --> return NULL...

What shoul I do?

ADD REPLY
0
Entering edit mode

check the output of head( names(gene_list) ), and confirm that these are indeed human Ensembl IDs. The enrichGO notification states that this is not case!

ADD REPLY
0
Entering edit mode

Error in unique.default(gene) : unique() applies only to vectors i got this error. why is that?

ADD REPLY
1
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

This is my console

go_enrich <- enrichGO(gene = genes,

  • universe = names(gene_list1),
  • OrgDb = organism,
  • keyType = 'ENSEMBL',
  • readable = T,
  • ont = "BP",
  • pvalueCutoff = 0.05,
  • qvalueCutoff = 0.10) Error in unique.default(gene) : unique() applies only to vectors
ADD REPLY
0
Entering edit mode

head( names(gene_list) ) [1] "ENSG00000147256" "ENSG00000174460" "ENSG00000223914" "ENSG00000260943" [5] "ENSG00000176495" "ENSG00000198261" go_enrich <- enrichGO(gene = genes,

  • universe = names(gene_list),
  • OrgDb = organism,
  • keyType = 'ENSEMBL',
  • readable = T,
  • ont = "BP",
  • pvalueCutoff = 0.05,
  • qvalueCutoff = 0.10) Error in unique.default(gene) : unique() applies only to vectors
ADD REPLY
1
Entering edit mode

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 object gene 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 the class() and str() 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!

ADD REPLY
0
Entering edit mode

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.

upsetplot(go_enrich) Error in [.data.frame(d, , 2) : undefined columns selected barplot(go_enrich,

  • drop = TRUE,
  • showCategory = 10,
  • title = "GO Biological Pathways",
  • font.size = 8) Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : replacement has length zero In addition: Warning message: In rep(yes, length.out = len) : 'x' is NULL so the result will be NULL dotplot(go_enrich) Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : replacement has length zero In addition: Warning message: In rep(yes, length.out = len) : 'x' is NULL so the result will be NULL
ADD REPLY
0
Entering edit mode

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.

upsetplot(go_enrich) Error in [.data.frame(d, , 2) : undefined columns selected barplot(go_enrich,

  • drop = TRUE,
  • showCategory = 10,
  • title = "GO Biological Pathways",
  • font.size = 8) Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : replacement has length zero In addition: Warning message: In rep(yes, length.out = len) : 'x' is NULL so the result will be NULL dotplot(go_enrich) Error in ans[ypos] <- rep(yes, length.out = len)[ypos] : replacement has length zero In addition: Warning message: In rep(yes, length.out = len) : 'x' is NULL so the result will be NULL
ADD REPLY
1
Entering edit mode

Check your data genes ( No gene can be mapped) and genelist, and check your enrichment result. If you can provide the data, I can test it for you.

ADD REPLY
0
Entering edit mode

emapplot(gse1, showCategory = 10) Error in has_pairsim(x) : Term similarity matrix not available. Please use pairwise_termsim function to deal with the results of enrichment analysis.

ADD REPLY
2
Entering edit mode

"Please use pairwise_termsim function to deal with the results of enrichment analysis" .

gse1 <- pairwise_termsim(gse1)
ADD REPLY

Login before adding your answer.

Traffic: 670 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6