Question: BiomaRt returns 0 obs
gravatar for edelman
3 months ago by
edelman0 wrote:

I have been running some code in R to make a data frame with my ENST IDs and corresponding gene symbols. I have used the following code before but I have been unable to generate this table recently. The problem is that getBM returns 0 observations. Any help would be appreciated. Perhaps known issues with getBM? 


mart<- useDataset("hsapiens_gene_ensembl", useMart('ensembl'))


  = "ensembl_gene_id", attributes = c("ensembl_gene_id",
  "external_gene_name", "description"), values = genes, mart = mart)

My code, which does not produce any errors, runs and returns an empty object 0 observations with 2 columns. Genes is a list of ENST IDs. 




ADD COMMENTlink modified 3 months ago by James W. MacDonald48k • written 3 months ago by edelman0

I'm using R version "Feather Spray" v. 3.5.1. Also doesn't work on previous major release. 

ADD REPLYlink modified 3 months ago • written 3 months ago by edelman0
gravatar for James W. MacDonald
3 months ago by
United States
James W. MacDonald48k wrote:

You will have to show some reproducible code that shows the problem.

> library(biomaRt)
> library(

> ensids <- head(keys(, "ENSEMBL"))
> ensids
[1] "ENSG00000121410" "ENSG00000175899" "ENSG00000256069" "ENSG00000171428"
[5] "ENSG00000156006" "ENSG00000196136"
> mart <- useMart("ensembl","hsapiens_gene_ensembl")
> getBM(c("ensembl_gene_id","external_gene_name","hgnc_symbol","description"), "ensembl_gene_id", ensids, mart)
  ensembl_gene_id external_gene_name hgnc_symbol
1 ENSG00000121410               A1BG        A1BG
2 ENSG00000156006               NAT2        NAT2
3 ENSG00000171428               NAT1        NAT1
4 ENSG00000175899                A2M         A2M
5 ENSG00000196136           SERPINA3    SERPINA3
6 ENSG00000256069              A2MP1       A2MP1
1             alpha-1-B glycoprotein [Source:HGNC Symbol;Acc:HGNC:5]
2           N-acetyltransferase 2 [Source:HGNC Symbol;Acc:HGNC:7646]
3           N-acetyltransferase 1 [Source:HGNC Symbol;Acc:HGNC:7645]
4              alpha-2-macroglobulin [Source:HGNC Symbol;Acc:HGNC:7]
5          serpin family A member 3 [Source:HGNC Symbol;Acc:HGNC:16]
6 alpha-2-macroglobulin pseudogene 1 [Source:HGNC Symbol;Acc:HGNC:8]

You do state that the genes object is a list of ENST IDs. If I were to infer that by ENST ID you mean Ensembl transcript IDs, then you need to use ensembl_transcript_id rather than ensembl_gene_id.

ADD COMMENTlink written 3 months ago by James W. MacDonald48k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 365 users visited in the last hour