class "AsIs" is not valid for @'dataset' in an object of class "Mart"; is(value, "character")
1
0
Entering edit mode
@philip-lijnzaad-2499
Last seen 2.4 years ago
European Union

Given the following:

library(biomaRt)
mart <- useMart("ensembl")
list <- listDatasets(m)
dataset.name <- list[ grep("sapiens",list$dataset, ignore.case=TRUE), 'dataset' ]

list clearly shows a data.frame containing character strings, is.character( dataset.name) is TRUE, dataset.name == "hsapiens_gene_ensembl" is also TRUE, yet the following call:

set <- useDataset(dataset.name, mart=mart)

gives

Error in (function (cl, name, valueClass)  :
  assignment of an object of class "AsIs" is not valid for @'dataset' in an object of class "Mart"; is(value, "character") is not TRUE

but

set <- useDataset("hsapiens_gene_ensembl", mart=mart)

works fine. I consider this a bug, and (to the more casual end user), a very intractible one. If data.set is, for all intents and purposes, a character string, then useDataset really should (try to) coerce this argument to a chr before crashing. Or should I report this elsewehere? Cheers,

Philip

Oh and the details:

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

locale:
[1] C

attached base packages:
[1] stats     datasets  graphics  grDevices utils     methods   base     

other attached packages:
[1] biomaRt_2.30.0

loaded via a namespace (and not attached):
 [1] IRanges_2.6.1        parallel_3.3.0       DBI_0.5-1           
 [4] RCurl_1.95-4.8       memoise_1.0.0        Rcpp_0.12.8         
 [7] Biobase_2.34.0       AnnotationDbi_1.36.0 RSQLite_1.1         
[10] S4Vectors_0.10.3     BiocGenerics_0.20.0  digest_0.6.10       
[13] stats4_3.3.0         bitops_1.0-6         XML_3.98-1.5        
>

 

 

bug biomart • 1.4k views
ADD COMMENT
0
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 6 hours ago
EMBL Heidelberg

Thanks for reporting this.  I've patched it in the developmental version of the package.  At the same time I've also prevented multiple datasets being set in a particular mart object, which could cause problems when the user starts creating queries.  These changes should be available in biomaRt version 2.31.2

ADD COMMENT
0
Entering edit mode

brilliant, thanks!
 

ADD REPLY

Login before adding your answer.

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