ArchR icon indicating copy to clipboard operation
ArchR copied to clipboard

Error in eval(parse(text = genome)): object 'BSgenome.Mmusculus.UCSC.mm10' not found

Open yingyuan830 opened this issue 1 year ago • 8 comments

when I load the saved project and then use the addMotifAnnotations function, it shows this error :

Error in eval(parse(text = genome)): object 'BSgenome.Mmusculus.UCSC.mm10' not found Traceback:

  1. addMotifAnnotations(ArchRProj = proj, motifSet = "cisbp", name = "Motif")
  2. eval(parse(text = genome))
  3. eval(parse(text = genome))

Even though I run addArchRGenome("mm10",install=TRUE) ahead the function. Could you please help me ? Thanks!

yingyuan830 avatar Aug 09 '22 22:08 yingyuan830

Hi @yingyuan830! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
Before we help you, you must respond to the following questions unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Can you recapitulate your error using the tutorial code and dataset? If so, provide a reproducible example. 3. Did you post your log file? If not, add it now. 4. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

rcorces avatar Aug 09 '22 22:08 rcorces

That looks like a small bug in the logic of the code there. The solution would be to manually load the package associated with your genome prior to running:

library(BSgenome.Mmusculus.UCSC.mm10)

rcorces avatar Aug 10 '22 22:08 rcorces

I'm leaving this open to fix the logic in the code. The problem is that in many places, I removed the requirePackage() statement that loaded the genome automatically because we wanted to support custom genomes that lacked BSgenome objects. But in doing so, it is not longer guaranteed that the proper BSgenome package is loaded prior to the eval(parse()) statement. I think the solution is just to remove the eval(parse()) statement and let the validBSgenome() function do all of the work. https://github.com/GreenleafLab/ArchR/blob/f6c0388bd37023400794c9ae8562ad69e3ba9fd7/R/AnnotationPeaks.R#L494-L499

rcorces avatar Aug 11 '22 00:08 rcorces

This works, thank you !

yingyuan830 avatar Aug 11 '22 03:08 yingyuan830

Thanks for confirming. I'm going to leave this issue open so that we're reminded to fix this bug.

rcorces avatar Aug 11 '22 04:08 rcorces

Ran into this today :) it's not fun when analyzing a large data set! Although, agreed that it's a easy fix

romain-lopez avatar Nov 19 '22 19:11 romain-lopez