ArchR icon indicating copy to clipboard operation
ArchR copied to clipboard

Bug in addBgdPeaks() function

Open CSBioAzim opened this issue 3 years ago • 3 comments

Hi,

I'm trying to compute motif deviation. I did peak calling, and everything went well. Unfortunatly, I get the following error when I try to add background peaks to my project object. I would be happy to get your comments on this. Thanks. `

projHeme5 <- addBgdPeaks(projHeme5) Identifying Background Peaks! Error in [[<-(*tmp*, name, value = c(752424L, 753188L, 753879L, 757093L, : 385655 elements in value to replace 385461 elements`

CSBioAzim avatar Jul 15 '20 21:07 CSBioAzim

Sorry for the delay, can you retry with the new release branch. I have now added 2 methods for background peaks (1) being with chromVAR and (2) that is designed by me to be more efficient and bulletproof. By default ArchR will defer to chromVAR (for now) and if encountering an error will switch to ArchR's method.

#New Release Branch
devtools::install_github("GreenleafLab/ArchR", ref="release_1.0.0", repos = BiocManager::repositories())

library(ArchR)
proj <- getTestProject()
bgd1 <- getBgdPeaks(proj, method = "chromVAR")
bgd2 <- getBgdPeaks(proj, method = "ArchR")

jgranja24 avatar Oct 27 '20 00:10 jgranja24

Closing this issue, feel free to reopen a new issue if this persists.

jgranja24 avatar Oct 28 '20 23:10 jgranja24

I was able to track down this bug. It's related to the current peakset, which in the above example is 385655 long, while the previous peakset was 385461 (in this example). Deleting the background peakset, and setting force = TRUE doesn't fix the issue. Instead, I manually deleted the background peakset .rds object in the ArchR project foler, and then ran addPeakSet again to fix the issue.

markphillippebworth avatar Jun 22 '21 19:06 markphillippebworth