GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
384 stars 137 forks source link

addGeneIntegrationMatrix error #556

Closed dataMaster-Kris closed 2 years ago

dataMaster-Kris commented 3 years ago

I am running ArchR (v1.0.1, date: 2020-11-23, development version that I installed in January) and Seurat (v3.2.3). I am trying to do unconstrained integration but getting the following error.

Error in .safelapply(seq_along(blockList), function(i) { : 
Error Found Iteration 1 : 
        [1] "Error in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]), i, value = 1) : \n  subscript out of bounds\n"
        <simpleError in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]), i, value = 1): subscript out of bounds>
Error Found Iteration 2 : 
        [1] "Error in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]), i, value = 1) : \n  subscript out of bounds\n"
        <simpleError in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]), i, value = 1): subscript out of bounds>
Error Found Iteration 3 : 
        [1] "Error in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]), i, value = 1) : \n  subscript out of bounds\n"
        <simpleError in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]), i, value = 1): subscript out of bounds>
Error Found Iteration 4 : 
        [1] "Error in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]), i, value = 1) : \n  subscript out of bounds\n"
        <simpleError in `[<-`(`*tmp*`, which(reference.ids == possible.ids[i]
Calls: addGeneIntegrationMatrix -> %>% -> Reduce -> .safelapply
In addition: Warning message:
In mclapply(..., mc.cores = threads, mc.preschedule = preschedule) :
  5 function calls resulted in an error
Execution halted 

Based on the suggestions in this issue, I tried changing the number of threads but the issue didn't resolve. Any suggestions? I have attached the ArchR log file.

ArchR-addGeneIntegrationMatrix-9f4a41d7fe79-Date-2021-02-26_Time-22-29-00.log

dataMaster-Kris commented 3 years ago

I figured it out. The error was due to the row names in the metadata slot of the Seurat object not being in the same order as the column names in the count matrix.

rcorces commented 3 years ago

@jgranja24 - Maybe we should add a specific check for this to catch this error in a more elegant way?

dataMaster-Kris commented 3 years ago

I wan't very thorough in checking what was causing the error. It may also have been that the meta data slot of my Seurat object didn't have rownames at all. Thought I'd let you know.

LMBei3353 commented 2 months ago

Hello, I have encountered the same error. How did you solve it at last