GreenleafLab / ArchR

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

Error in addGeneIntegrationMatrix() with tutorial data #2040

Closed dgagler closed 11 months ago

dgagler commented 11 months ago

Hi,

I'm having issues integrating scRNA and ArchR data running addGeneIntegrationMatrix(). I've been struggling with running this step with my own data for the last week and after much failed troubleshooting finally decided today to go back to the tutorial data and I am still running into issues (albeit different errors than I was having with my own data--we'll cross that bridge when we get back to it). I just tried updating to Seurat v5 in an attempt to resolve these issues but it doesn't seem to have helped anything...and I fear it may have complicated things further.

To be clear, I installed the tutorial ATAC data, created an ArchR project from the arrows, ran iterativeLSI, harmony, added clusters, added UMAP, downloaded the tutorial seRNA object, and finally ran addGeneIntegrationMatrix(). At this point, an issue seems to come up with imputing the GeneScoreMatrix.

Any help will be much appreciated. I hope I've followed posting etiquette adequately--apologies if not.

Attach your log file ArchR-addGeneIntegrationMatrix-b84c4b0c5c91-Date-2023-10-30_Time-14-28-04.log

My code and the error:

projHeme1 <- addGeneIntegrationMatrix(
    ArchRProj = projHeme1, 
    useMatrix = "GeneScoreMatrix",
    matrixName = "GeneIntegrationMatrix",
    reducedDims = "IterativeLSI",
    seRNA = seRNA,
    addToArrow = FALSE,
    groupRNA = "BioClassification",
    nameCell = "predictedCell_Un",
    nameGroup = "predictedGroup_Un",
    nameScore = "predictedScore_Un"
)

ArchR logging to : ArchRLogs/ArchR-addGeneIntegrationMatrix-b84c4b0c5c91-Date-2023-10-30_Time-14-28-04.log
If there is an issue, please report to github with logFile!
2023-10-30 14:28:04 : Running Seurat's Integration Stuart* et al 2019, 0.001 mins elapsed.
2023-10-30 14:28:04 : Checking ATAC Input, 0.004 mins elapsed.
2023-10-30 14:28:04 : Checking RNA Input, 0.007 mins elapsed.
2023-10-30 14:28:10 : Found 18601 overlapping gene names from gene scores and rna matrix!, 0.11 mins elapsed.
2023-10-30 14:28:10 : Creating Integration Blocks, 0.11 mins elapsed.
2023-10-30 14:28:10 : Prepping Interation Data, 0.114 mins elapsed.
2023-10-30 14:28:11 : Computing Integration in 1 Integration Blocks!, 0 mins elapsed.
2023-10-30 14:28:11 : Block (1 of 1) : Computing Integration, 0 mins elapsed.
2023-10-30 14:28:12 : Block (1 of 1) : Identifying Variable Genes, 0.025 mins elapsed.
2023-10-30 14:28:14 : Block (1 of 1) : Getting GeneScoreMatrix, 0.055 mins elapsed.
2023-10-30 14:28:18 : Block (1 of 1) : Imputing GeneScoreMatrix, 0.127 mins elapsed.
Getting ImputeWeights
Warning: Data is of class dgeMatrix. Coercing to dgCMatrix.
Error in slot(object = object, name = "features")[[layer]] <- features : 
  more elements supplied than there are to replace
rcorces commented 11 months ago

Hi @dgagler! 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.

Zepeng-Mu commented 11 months ago

Maybe you can check this from an earlier issue: https://github.com/GreenleafLab/ArchR/issues/1999#issuecomment-1761987935? I'm not sure if this would be helpful.

dgagler commented 11 months ago

Hey, thanks for taking a shot here. Your comment is a bit overwhelming but I think I understood it sufficiently. To see if my GeneScoreMatrix was an array I used the following and, as you can see, my matrix is not an array.

mat <- getMatrixFromProject(
  ArchRProj = projHeme1,
  useMatrix = "GeneScoreMatrix",
  useSeqnames = NULL,
  verbose = TRUE,
  binarize = FALSE,
  logFile = createLogFile("getMatrixFromProject")
)

typeof(colnames(mat[1:3,1:3]))
class(colnames(mat[1:3,1:3]))
[1] "character"
[1] "character"

The case remains open...

dgagler commented 11 months ago

Hi. This specific error was resolved by reverting to Seurat v4.3 and restarting my PC. New error (original error I encountered with my own data) persists. I'm opening a new issue so as to hone in on the issue specifically. Apologies for excess.