Yes, you are correct. It works now, thank you so much!
Hello,
In trying to re-run my pathway analysis with a DEG set annotated with gene symbols. I have encountered this error while wanting to retrieve Entrez IDs for clusterProfiler. This is a new error, as I have worked with the same script before.
up.genes.entrez <- clusterProfiler::bitr(up.genes,fromType = "SYMBOL",toType = "ENTREZID",OrgDb = org.Hs.eg.db)
Error in .testForValidKeys(x, keys, keytype, fks) :
None of the keys entered are valid keys for 'SYMBOL'. Please use the keys method to see a listing of valid arguments.
I can not figure out why keytype SYMBOL are not recognized as valid gene symbols anymore. I have tried reinstalling or updating the packages and I would be most grateful for additional suggestions.
2 answers
up.genes should be a vector of gene IDs whereas in your case, up.genes is a tibble with one column.
You should select the column of geneIDs and not the tibble :
up.genes.entrez <- clusterProfiler::bitr(up.genes$Symbol,fromType = "SYMBOL",toType = "ENTREZID",OrgDb = org.Hs.eg.db)
up.genes.entrez
SYMBOL ENTREZID
1 CCL3L3 414062
2 F13A1 2162
3 ANGPTL4 51129
4 THBD 7056
5 SYN2 6854
6 CXCL3 2921
I extract the list of genes from my DEG data set:
head(DEG)
A tibble: 6 × 8
Gene Id` baseMean log2FoldChange lfcSE stat pvalue padj Symbol
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
1 6373 67.7 -2.32 0.310 -7.50 6.28e-14 1.69e-12 CXCL11
up.genes <- DEG[DEG$log2FoldChange > 1 & DEG$padj < 0.05, 8] head(up.genes)
A tibble: 6 × 1
Symbol
<chr>
1 CCL3L3
2 F13A1
3 ANGPTL4
4 THBD
5 SYN2
6 CXCL3
There after, with clusterProfiler::bitr(), I would have another column with EntrezID that clusterProfiler::enrichGO() will want in order to do the pathway analysis. Before it worked for several analysis, and now that I am using it again I get this error.
Thank you!
Log in to answer this question.
Can you look at your
dbfile? Sometimes symbol is hgnc_symbol.Please share a reproducible example, we need to know what is
up.genes