Hi guys,
the getBM function just dosen't work from my RStudio.
This is the code i used - directly from 'biomaRt users guide':
library("biomaRt")
library('Rcpp')
listMarts()
ensembl=useMart("ensembl")
listDatasets(ensembl) #check if hsapiens_gene_ensembl is there
ensembl = useDataset("hsapiens_gene_ensembl",mart=ensembl)
affyids=c("202763_at","209310_s_at","207500_at")
### HERE IS THE PROBLEM ###
getBM(attributes=c('affy_hg_u133_plus_2', 'entrezgene'),
filters = 'affy_hg_u133_plus_2',
values = affyids,
mart = ensembl)
I don't get any error or response. The Rstudio console just stuck in "thinking" mode for hours until i quit the session.
Any idea?
There's an error - the attribute for NCBI Gene ID is 'entrezgene_id', not 'entrezgene'. You can sometimes get weird things happening when you try to get data from a database on the internet, so it's usually reasonable to try a couple of times. Although you usually get an error if there is a problem. Anyway,
The bad news - I have tried your solution but Rtudio still got stuck.
The good news - I solved it!!
More problem details:
1) I couldn't update my Rcpp package to 1.0.7, it was 1.0.6 version. I also got once in a while the error: "function 'Rcpp_precious_remove' not provided by package 'Rcpp'".
2) Everytime i started Rstudio, this warning appeard:
"R graphics engine version 14 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed."
Solution details:
1) Uninstall & install Rstudio to newest version (4.1.0 --> 4.1.2)
2) make sure that current Rcpp version is 1.0.7
3) Add "useCache = FALSE" as the code below shows.
Code that works now:
library("biomaRt")
library('Rcpp')
listMarts()
ensembl=useMart("ensembl")
listDatasets(ensembl) #check if hsapiens_gene_ensembl is there
ensembl = useDataset("hsapiens_gene_ensembl",mart=ensembl)
affyids=c("202763_at","209310_s_at","207500_at")
X <- getBM(attributes=c('affy_hg_u133_plus_2', 'entrezgene_id'),
filters = 'affy_hg_u133_plus_2',
values = affyids,
mart = ensembl, useCache = FALSE)
# X is:
# affy_hg_u133_plus_2 entrezgene_id
# 1 202763_at 836
# 2 209310_s_at 837
# 3 207500_at 838
It's strange that the biomaRt cache is causing an issue without printing anything to the screen, but it seems clear that's where the problem lies if useCache = FALSE fixes things. Maybe there's something corrupted in the cache, in which case you can use biomartCacheClear() to delete whatever's there and start again. Hopefully then you won't need to use the cache = FALSE argument.
Hi James!
Thank you for respoding so fast.
More problem details:
1) I couldn't update my Rcpp package to 1.0.7, it was 1.0.6 version. I also got once in a while the error: "function 'Rcpp_precious_remove' not provided by package 'Rcpp'".
2) Everytime i started Rstudio, this warning appeard: "R graphics engine version 14 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed."
Solution details:
1) Uninstall & install Rstudio to newest version (4.1.0 --> 4.1.2)
2) make sure that current Rcpp version is 1.0.7
3) Add "useCache = FALSE" as the code below shows.
Code that works now:
Sessioninfo:
Thanks!!
Ariel
It's strange that the biomaRt cache is causing an issue without printing anything to the screen, but it seems clear that's where the problem lies if
useCache = FALSE
fixes things. Maybe there's something corrupted in the cache, in which case you can usebiomartCacheClear()
to delete whatever's there and start again. Hopefully then you won't need to use thecache = FALSE
argument.