Error log when I use biomaRt getBM
2
0
Entering edit mode
niyamurry • 0
@user-24682
Last seen 7 months ago

I have some problems when I use biomaRt. My R version is 4.0.3 and my biomaRt is up to date.

My problem is I can’t use the function “getBM” in all of the ways. The error log is "Error in loadNamespace(name) : there is no package called ‘withr’ ”, which I can’t found the package “withr” to support this function.

I have tried many codes to align gene profile with my data, but all failed. The error code was always shown "Error in loadNamespace(name) : there is no package called ‘withr’ ”. And I am wondering what should I do to solve this problem.

This is one of the codes I have tried, still an error.

 values <- c('WBGene00166185', 'WBGene00007063')
attr1 <- c('ensembl_gene_id', 'external_gene_name', 'coding')
x <- getBM(attributes = attr1, mart = ensembl, bmHeader = TRUE,
filters = 'ensembl_gene_id', values = values)


biomaRt annotationTools • 268 views
0
Entering edit mode
@wolfgang-huber-3550
Last seen 6 weeks ago
EMBL European Molecular Biology Laborat…

Try the installation instructions, in particular, run

if(!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("biomaRt")


0
Entering edit mode
Mike Smith ★ 5.1k
@mike-smith
Last seen 33 minutes ago
EMBL Heidelberg / de.NBI

I'm not exactly sure how this error message is related to using getBM(), as biomaRt doesn't use the withr package directly. It's presumably a dependency of a dependency.

I'd suggest reinstalling the withr package via:

BiocManager::install('withr')


Then try you call to getBM() again.

Missing this package could be symptomatic of some wider problem in your R library. I'd suggest also running the following code which should check you've got appropriate versions of all installed packages. I would follow any instructions it recommends to "create a valid installation"

BiocManager::valid()