Question: 'biomaRt expected a character string of length 1' error with getBM and reseq mrna filer
0
gravatar for laurenz.holcik
4 weeks ago by
laurenz.holcik0 wrote:

Hi all,

I am currently trying to convert the Illumina Human Methylation 450k annotation from the provided RefSeq IDs to ensembl gene IDs (if anybody has done this before and could give the the files that would be perfect!). So when I use biomaRt to get the ensembl IDs of the ~20000 mRNA RefSeq IDs I always get the error:

Error in getBM(attributes = c("refseq_mrna", "ensembl_gene_id"), filters = "refseq_mrna",  : 
   The query to the BioMart webservice returned an invalid result: biomaRt expected a character string of length 1.

This doesn't occur immediately but after about 50% of the query. I have tried to change the mart to

mart = mart <- useMart(biomart = "ENSEMBL_MART_ENSEMBL", 
                   dataset = "hsapiens_gene_ensembl", 
                   host = 'www.ensembl.org',
                   ensemblRedirect = FALSE)

as I read this helped for others but it did nothing for me. Is there an argument to give to getBM to just ignore this and go on with the next value? It does not matter if I don't get all of the IDs.

My query is:

bm = getBM(attributes=c('refseq_mrna', 'ensembl_gene_id'), 
  filters = 'refseq_mrna', 
  values = rsnm, 
  mart = mart)

    > head(rsnm)
[1] "NM_006521"    "NM_001166660" "NM_181303"    "NM_018977"    "NM_000117"    "NM_002547"

SessionInfo:

 > sessionInfo('biomaRt')
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS/LAPACK: /opt/intel/compilers_and_libraries_2019.2.187/linux/mkl/lib/intel64_lin/libmkl_rt.so

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=de_AT.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=de_AT.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=de_AT.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=de_AT.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
character(0)

other attached packages:
[1] biomaRt_2.40.0
biomart • 144 views
ADD COMMENTlink modified 4 weeks ago by Mike Smith3.7k • written 4 weeks ago by laurenz.holcik0
Answer: 'biomaRt expected a character string of length 1' error with getBM and reseq mrn
3
gravatar for Mike Smith
4 weeks ago by
Mike Smith3.7k
EMBL Heidelberg / de.NBI
Mike Smith3.7k wrote:

It might be that the main Ensembl site is being a bit slow today. You can try querying one of the mirror sites e.g.

mart <- useEnsembl(biomart = "ensembl", 
                   dataset = "hsapiens_gene_ensembl", 
                   mirror = "useast")

Values for the mirror argument are: useast, uswest, asia.

ADD COMMENTlink written 4 weeks ago by Mike Smith3.7k

Solved it, thank you!

ADD REPLYlink written 4 weeks ago by laurenz.holcik0

Thank you! I ran into the same problem, and using a mirror solved it.

ADD REPLYlink written 4 weeks ago by matt.dufort10
Please log in to add an answer.

Help
Access

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