GreenleafLab / ArchR

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

Constrained Gene Integration Error #1963

Closed jeerthik closed 1 year ago

jeerthik commented 1 year ago

Log File: ArchR-addGeneIntegrationMatrix-dcc6b48f59a-Date-2023-05-31_Time-04-15-42.log

I am running constrained integration with the ArchR tutorial hematopoiesis dataset. When adding the gene integration matrix using a groupList, which is a nested SimpleList, I get the following error:

ArchR logging to : ArchRLogs/ArchR-addGeneIntegrationMatrix-dcc6b48f59a-Date-2023-05-31_Time-04-15-42.log
If there is an issue, please report to github with logFile!
2023-05-31 04:15:42 : Running Seurat's Integration Stuart* et al 2019, 0.003 mins elapsed.
2023-05-31 04:15:43 : Checking ATAC Input, 0.007 mins elapsed.
2023-05-31 04:15:43 : Checking RNA Input, 0.016 mins elapsed.
2023-05-31 04:15:55 : Found 18601 overlapping gene names from gene scores and rna matrix!, 0.215 mins elapsed.
2023-05-31 04:15:55 : Creating Integration Blocks, 0.215 mins elapsed.
2023-05-31 04:15:55 : Prepping Interation Data, 0.219 mins elapsed.
2023-05-31 04:15:57 : Computing Integration in 2 Integration Blocks!, 0 mins elapsed.
Warning: 1 function calls resulted in an errorError in .safelapply(seq_along(blockList), function(i) { : 
Error Found Iteration 2 : 
    [1] "Error in as(x, \"matrix\")[, j, drop = drop] : subscript out of bounds\n"
    <subscriptOutOfBoundsError in as(x, "matrix")[, j, drop = drop]: subscript out of bounds>

This issue occurred with the tutorial hematopoiesis dataset. The commands I used were as follows:

groupList <- SimpleList(
    TNK = SimpleList(
        ATAC = projHeme2$cellNames[projHeme2$Clusters %in% clustTNK],
        RNA = rnaTNK
    ),
    NonTNK = SimpleList(
        ATAC = projHeme2$cellNames[projHeme2$Clusters %in% clustNonTNK],
        RNA = rnaNonTNK
    )    
)

projHeme2 <- addGeneIntegrationMatrix(
    ArchRProj = projHeme2, 
    useMatrix = "GeneScoreMatrix",
    matrixName = "GeneIntegrationMatrix",
    reducedDims = "IterativeLSI",
    seRNA = seRNA,
    addToArrow = FALSE, 
    groupList = groupList,
    groupRNA = "BioClassification",
    nameCell = "predictedCell_Co",
    nameGroup = "predictedGroup_Co",
    nameScore = "predictedScore_Co"
)

I expect the output to be the following, as according to the full tutorial.

## ArchR logging to : ArchRLogs/ArchR-addGeneIntegrationMatrix-f663618b2629-Date-2020-04-15_Time-10-12-35.log
## If there is an issue, please report to github with logFile!
## 2020-04-15 10:12:36 : Running Seurat’s Integration Stuart* et al 2019, 0.014 mins elapsed.
## 2020-04-15 10:12:36 : Checking ATAC Input, 0.027 mins elapsed.
## 2020-04-15 10:12:36 : Checking RNA Input, 0.027 mins elapsed.
## 2020-04-15 10:12:48 : Creating Integration Blocks, 0.218 mins elapsed.
## 2020-04-15 10:12:48 : Prepping Interation Data, 0.222 mins elapsed.
## 2020-04-15 10:12:49 : Computing Integration in 2 Integration Blocks!, 0 mins elapsed.
## 2020-04-15 10:15:24 : Completed Integration with RNA Matrix, 2.574 mins elapsed.
## ArchR logging successful to : ArchRLogs/ArchR-addGeneIntegrationMatrix-f663618b2629-Date-2020-04-15_Time-10-12-35.log

I am running ArchR on a Terra Bio Google Cloud server. ArchR on the server is the latest version. Please let me know what the issue may be. Thank you!

rcorces commented 1 year ago

Hi @jeerthik! 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.
It is worth noting that there are very few actual bugs in ArchR. If you are getting an error, it is probably something specific to your dataset, usage, or computational environment, all of which are extremely challenging to troubleshoot. As such, we require reproducible examples (preferably using the tutorial dataset) from users who want assistance. If you cannot reproduce your error, we will not be able to help. Before going through the work of making a reproducible example, search the previous Issues, Discussions, function definitions, or the ArchR manual and you will likely find the answers you are looking for. If your post does not contain a reproducible example, it is unlikely to receive a response.
In addition to a reproducible example, you must do the following things before we help you, 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. Did you post your log file? If not, add it now. 3.__ 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.