Entering edit mode
Hi all,
I'm seeing the following error when using the getGene() function in the biomaRt package. Can anyone please help?
> library(biomaRt)
> example(getGene)
getGen> if(interactive()){
getGen+
getGen+ mart = useMart("ensembl", dataset="hsapiens_gene_ensembl")
getGen+
getGen+ #example using affy id
getGen+
getGen+ g = getGene( id = "1939_at", type = "affy_hg_u95av2", mart = mart)
getGen+ show(g)
getGen+
getGen+ #example using Entrez Gene id
getGen+
getGen+ g = getGene( id = "100", type = "entrezgene", mart = mart)
getGen+ show(g)
getGen+ }
Error in martCheck(mart, "ensembl") :
This function only works when used with the ensembl BioMart.
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] biomaRt_2.26.1
loaded via a namespace (and not attached):
[1] IRanges_2.4.4 tools_3.2.2 parallel_3.2.2
[4] DBI_0.3.1 RCurl_1.95-4.7 Biobase_2.30.0
[7] AnnotationDbi_1.32.0 RSQLite_1.0.0 S4Vectors_0.8.3
[10] BiocGenerics_0.16.1 stats4_3.2.2 bitops_1.0-6
[13] XML_3.98-1.3

Hi Thomas,
I've tried both your suggestions, but I still get the same error. Does this solution work for you? Can you replicate my error?
Thanks!