Error retrieving ensembl gene id using biomaRt...
2
0
Entering edit mode
bas_work ▴ 30
@bas_work-22458
Last seen 5 days ago
Netherlands

I have a list of gene symbols for which I want to retrieve the Ensembl Gene ID. I have a dataframe (df_biomrt_tmp) containing a column with the symbols and after running

df_biomrt_tmp-> getBM(attributes = c("hgnc_symbol", "ensembl_gene_id"), 
    filters = "hgnc_symbol", 
    values = df_biomrt_tmp$hgnc_symbol, mart = ensembl)

it throws the following error: Error in getBM(attributes = c("hgnc_symbol", "ensembl_gene_id"), filters = "hgnc_symbol", : target of assignment expands to non-language object

The question is: why? I have run the same test with a number of Ensembl Gene IDs to retrieve HGNC symbols and that works flawless. I suspect it is BioMart that is acting up, but any clarification is more than welcome.

biomaRt • 221 views
ADD COMMENT
1
Entering edit mode
Mike Smith ★ 6.5k
@mike-smith
Last seen 1 day ago
EMBL Heidelberg

I think you have the assignment operator (<-) the wrong way round. It should be df_biomrt_tmp <- getBM(...

ADD COMMENT
0
Entering edit mode

Or that. ;-D

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 11 hours ago
United States

I can't reproduce.

> library(biomaRt)
Warning message:
package 'biomaRt' was built under R version 4.3.2 
> library(org.Hs.eg.db)
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: BiocGenerics

> symb <- keys(org.Hs.eg.db, "SYMBOL")[sample(1:10000, 75)]
> symb
 [1] "COPG1"     "GSTM1"    
 [3] "MTHFS"     "IFITM3"   
 [5] "ESPL1"     "KCNE1"    
 [7] "KARS1"     "ZSCAN12"  
 [9] "CD24P1"    "S100A3"   
[11] "PRB3"      "MPL"      
[13] "CDK1"      "ASNS"     
[15] "TMPRSS11D" "IFI27"    
[17] "MMP7"      "PPP3CA"   
[19] "ARHGAP44"  "KCNC3"    
[21] "AP1S2"     "KCNA4"    
[23] "GATD3"     "NPM1P19"  
[25] "ATP2B2"    "BUD31"    
[27] "TRNI"      "RAB10"    
[29] "EXOC5"     "CYP3A7"   
[31] "ELF2"      "MBL2"     
[33] "CST7"      "CLDN14"   
[35] "MMP1"      "AOAH"     
[37] "CCNG1"     "CACNA1F"  
[39] "ZNF443"    "CTNNA1"   
[41] "ECH1"      "TRGVA"    
[43] "BTF3"      "FAM30A"   
[45] "OR1E1"     "CLNS1A"   
[47] "TTF1"      "FKBP1B"   
[49] "STBD1"     "IK"       
[51] "KRT18P1"   "CRIP1"    
[53] "NELL2"     "RPS6KB1"  
[55] "CASP8"     "TOMM34"   
[57] "PIM1"      "CBX4"     
[59] "PRSS8"     "CRISP2"   
[61] "RASA2"     "ZNF227"   
[63] "POLR3A"    "GOLGA3"   
[65] "RPL41P2"   "H4C8"     
[67] "HGS"       "NELFB"    
[69] "FZD3"      "NOS2"     
[71] "DCTN1"     "PTCH1"    
[73] "SGTA"      "SLC7A11"  
[75] "RPS4X"    
> mart <- useEnsembl("ensembl","hsapiens_gene_ensembl")

> z <- getBM(c("hgnc_symbol","ensembl_gene_id"), "hgnc_symbol", symb, mart)

You might consider providing the symbols you used. Or maybe just try again, which is often all it takes.

Login before adding your answer.

Traffic: 554 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