GreenleafLab / ArchR

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

`addGeneIntegrationMatrix` Error in slot(object = object, name = "features")[[layer]] <- features: more elements supplied than there are to replace Traceback: #2212

Open danli349 opened 1 month ago

danli349 commented 1 month ago

When run the tutorial in the document: https://www.archrproject.com/bookdown/cross-platform-linkage-of-scatac-seq-cells-with-scrna-seq-cells.html

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

How should I solve this error:

ArchR logging to : ArchRLogs/ArchR-addGeneIntegrationMatrix-3af203550d8-Date-2024-09-30_Time-11-49-57.128984.log
If there is an issue, please report to github with logFile!

2024-09-30 11:49:57.233178 : Running Seurat's Integration Stuart* et al 2019, 0.002 mins elapsed.

2024-09-30 11:49:57.449474 : Checking ATAC Input, 0.005 mins elapsed.

2024-09-30 11:49:58.36637 : Checking RNA Input, 0.021 mins elapsed.

2024-09-30 11:50:14.923285 : Found 18601 overlapping gene names from gene scores and rna matrix!, 0.297 mins elapsed.

2024-09-30 11:50:14.929036 : Creating Integration Blocks, 0.297 mins elapsed.

2024-09-30 11:50:15.271016 : Prepping Interation Data, 0.302 mins elapsed.

2024-09-30 11:50:16.786384 : Computing Integration in 1 Integration Blocks!, 0 mins elapsed.

2024-09-30 11:50:16.799628 : Block (1 of 1) : Computing Integration, 0 mins elapsed.

2024-09-30 11:50:21.25633 : Block (1 of 1) : Identifying Variable Genes, 0.075 mins elapsed.

2024-09-30 11:50:25.130431 : Block (1 of 1) : Getting GeneScoreMatrix, 0.139 mins elapsed.

2024-09-30 11:50:30.740624 : Block (1 of 1) : Imputing GeneScoreMatrix, 0.233 mins elapsed.

Getting ImputeWeights

Warning message:
“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
Traceback:

1. .safelapply(seq_along(blockList), function(i) {
 .     prefix <- sprintf("Block (%s of %s) :", i, length(blockList))
 .     .logDiffTime(sprintf("%s Computing Integration", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     blocki <- blockList[[i]]
 .     subProj@cellColData <- subProj@cellColData[blocki$ATAC, ]
 .     subProj@sampleColData <- subProj@sampleColData[unique(subProj$Sample), 
 .         , drop = FALSE]
 .     subRNA <- seuratRNA[, blocki$RNA]
 .     subRNA <- subRNA[rownames(subRNA) %in% geneDF$name, ]
 .     .logDiffTime(sprintf("%s Identifying Variable Genes", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     subRNA <- FindVariableFeatures(object = subRNA, nfeatures = nGenes, 
 .         verbose = FALSE)
 .     subRNA <- ScaleData(object = subRNA, verbose = FALSE)
 .     if (is.null(genesUse)) {
 .         genesUse <- VariableFeatures(object = subRNA)
 .     }
 .     .logDiffTime(sprintf("%s Getting GeneScoreMatrix", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     mat <- .getPartialMatrix(getArrowFiles(subProj), featureDF = geneDF[geneDF$name %in% 
 .         genesUse, ], threads = 1, cellNames = subProj$cellNames, 
 .         useMatrix = useMatrix, verbose = FALSE)
 .     rownames(mat) <- geneDF[geneDF$name %in% genesUse, "name"]
 .     .logThis(mat, paste0("GeneScoreMat-Block-", i), logFile = logFile)
 .     if (useImputation) {
 .         .logDiffTime(sprintf("%s Imputing GeneScoreMatrix", prefix), 
 .             tstart, verbose = verbose, logFile = logFile)
 .         imputeParams <- list()
 .         imputeParams$ArchRProj <- subProj
 .         imputeParams$randomSuffix <- TRUE
 .         imputeParams$reducedDims <- reducedDims
 .         imputeParams$dimsToUse <- dimsToUse
 .         imputeParams$scaleDims <- scaleDims
 .         imputeParams$corCutOff <- corCutOff
 .         imputeParams$threads <- 1
 .         imputeParams$logFile <- logFile
 .         subProj <- suppressMessages(do.call(addImputeWeights, 
 .             imputeParams))
 .         mat <- suppressMessages(imputeMatrix(mat = mat, imputeWeights = getImputeWeights(subProj), 
 .             verbose = FALSE, logFile = logFile))
 .         o <- suppressWarnings(file.remove(unlist(getImputeWeights(subProj)[[1]])))
 .         .logThis(mat, paste0("GeneScoreMat-Block-Impute-", i), 
 .             logFile = logFile)
 .     }
 .     mat <- log(mat + 1)
 .     seuratATAC <- Seurat::CreateSeuratObject(counts = mat[head(seq_len(nrow(mat)), 
 .         5), , drop = FALSE])
 .     seuratATAC[["GeneScore"]] <- Seurat::CreateAssayObject(counts = mat)
 .     rm(mat)
 .     DefaultAssay(seuratATAC) <- "GeneScore"
 .     seuratATAC <- Seurat::ScaleData(seuratATAC, verbose = FALSE)
 .     .logDiffTime(sprintf("%s Seurat FindTransferAnchors", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     transferAnchors <- .retryCatch({
 .         gc()
 .         Seurat::FindTransferAnchors(reference = subRNA, query = seuratATAC, 
 .             reduction = reduction, features = genesUse, verbose = FALSE, 
 .             ...)
 .     }, maxAttempts = 2, logFile = logFile)
 .     .logThis(paste0(utils::capture.output(transferAnchors), collapse = "\n"), 
 .         paste0("transferAnchors-", i), logFile = logFile)
 .     rDSub <- rD[colnames(seuratATAC), , drop = FALSE]
 .     .logThis(rDSub, paste0("rDSub-", i), logFile = logFile)
 .     transferParams$anchorset <- transferAnchors
 .     transferParams$weight.reduction <- CreateDimReducObject(embeddings = rDSub, 
 .         key = "LSI_", assay = DefaultAssay(seuratATAC))
 .     transferParams$verbose <- FALSE
 .     transferParams$dims <- seq_len(ncol(rDSub))
 .     .logDiffTime(sprintf("%s Seurat TransferData Cell Group Labels", 
 .         prefix), tstart, verbose = verbose, logFile = logFile)
 .     transferParams$refdata <- subRNA$Group
 .     rnaLabels <- do.call(Seurat::TransferData, transferParams)
 .     .logDiffTime(sprintf("%s Seurat TransferData Cell Names Labels", 
 .         prefix), tstart, verbose = verbose, logFile = logFile)
 .     transferParams$refdata <- colnames(subRNA)
 .     rnaLabels2 <- do.call(Seurat::TransferData, transferParams)[, 
 .         1]
 .     if (addToArrow) {
 .         .logDiffTime(sprintf("%s Seurat TransferData GeneMatrix", 
 .             prefix), tstart, verbose = verbose, logFile = logFile)
 .         transferParams$refdata <- GetAssayData(subRNA, assay = "RNA", 
 .             slot = "data")
 .         gc()
 .         matchedRNA <- do.call(Seurat::TransferData, transferParams)
 .         matchedRNA <- matchedRNA@data
 .     }
 .     matchDF <- DataFrame(cellNames = colnames(seuratATAC), predictionScore = rnaLabels$prediction.score.max, 
 .         predictedGroup = rnaLabels$predicted.id, predictedCell = rnaLabels2)
 .     rownames(matchDF) <- matchDF$cellNames
 .     .logDiffTime(sprintf("%s Saving TransferAnchors Joint CCA", 
 .         prefix), tstart, verbose = verbose, logFile = logFile)
 .     jointCCA <- DataFrame(transferAnchors@object.list[[1]]@reductions$cca@cell.embeddings)
 .     jointCCA$Assay <- ifelse(endsWith(rownames(jointCCA), "_reference"), 
 .         "RNA", "ATAC")
 .     jointCCA$Group <- NA
 .     jointCCA$Score <- NA
 .     jointCCA[paste0(colnames(subRNA), "_reference"), "Group"] <- subRNA$Group
 .     jointCCA[paste0(matchDF$cellNames, "_query"), "Group"] <- matchDF$predictedGroup
 .     jointCCA[paste0(matchDF$cellNames, "_query"), "Score"] <- matchDF$predictionScore
 .     .safeSaveRDS(object = jointCCA, file = file.path(outDir3, 
 .         paste0("Save-Block", i, "-JointCCA.rds")))
 .     rm(transferParams, transferAnchors)
 .     gc()
 .     if (addToArrow) {
 .         .logDiffTime(sprintf("%s Transferring Paired RNA to Temp File", 
 .             prefix), tstart, verbose = verbose, logFile = logFile)
 .         tmpFilei <- paste0(tmpFile, "-IntegrationBlock-", i, 
 .             ".h5")
 .         o <- h5createFile(tmpFilei)
 .         sampleNames <- getCellColData(subProj, "Sample")[matchDF$cellNames, 
 .             ]
 .         uniqueSamples <- unique(sampleNames)
 .         matchedRNA <- .safeSubset(mat = matchedRNA, subsetRows = paste0(featureDF$name), 
 .             subsetCols = matchDF$cellNames)
 .         for (z in seq_along(uniqueSamples)) {
 .             mat <- matchedRNA[, which(sampleNames == uniqueSamples[z]), 
 .                 drop = FALSE]
 .             Group <- uniqueSamples[z]
 .             o <- tryCatch({
 .                 h5delete(tmpFilei, paste0(Group))
 .             }, error = function(x) {
 .             })
 .             o <- h5createGroup(tmpFilei, paste0(Group))
 .             j <- Rle(findInterval(seq(mat@x) - 1, mat@p[-1]) + 
 .                 1)
 .             lengthRle <- length(j@lengths)
 .             lengthI <- length(mat@i)
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/i"), storage.mode = "integer", dims = c(lengthI, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/jLengths"), storage.mode = "integer", dims = c(lengthRle, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/jValues"), storage.mode = "integer", dims = c(lengthRle, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/x"), storage.mode = "double", dims = c(lengthI, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5write(obj = mat@i + 1, file = tmpFilei, 
 .                 name = paste0(Group, "/i")))
 .             o <- .suppressAll(h5write(obj = j@lengths, file = tmpFilei, 
 .                 name = paste0(Group, "/jLengths")))
 .             o <- .suppressAll(h5write(obj = j@values, file = tmpFilei, 
 .                 name = paste0(Group, "/jValues")))
 .             o <- .suppressAll(h5write(obj = mat@x, file = tmpFilei, 
 .                 name = paste0(Group, "/x")))
 .             o <- .suppressAll(h5write(obj = colnames(mat), file = tmpFilei, 
 .                 name = paste0(Group, "/cellNames")))
 .         }
 .         rm(matchedRNA, mat, j)
 .     }
 .     .logDiffTime(sprintf("%s Completed Integration", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     gc()
 .     matchDF$Block <- Rle(i)
 .     matchDF
 . }, threads = threads2) %>% Reduce("rbind", .)
2. Reduce("rbind", .)
3. .safelapply(seq_along(blockList), function(i) {
 .     prefix <- sprintf("Block (%s of %s) :", i, length(blockList))
 .     .logDiffTime(sprintf("%s Computing Integration", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     blocki <- blockList[[i]]
 .     subProj@cellColData <- subProj@cellColData[blocki$ATAC, ]
 .     subProj@sampleColData <- subProj@sampleColData[unique(subProj$Sample), 
 .         , drop = FALSE]
 .     subRNA <- seuratRNA[, blocki$RNA]
 .     subRNA <- subRNA[rownames(subRNA) %in% geneDF$name, ]
 .     .logDiffTime(sprintf("%s Identifying Variable Genes", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     subRNA <- FindVariableFeatures(object = subRNA, nfeatures = nGenes, 
 .         verbose = FALSE)
 .     subRNA <- ScaleData(object = subRNA, verbose = FALSE)
 .     if (is.null(genesUse)) {
 .         genesUse <- VariableFeatures(object = subRNA)
 .     }
 .     .logDiffTime(sprintf("%s Getting GeneScoreMatrix", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     mat <- .getPartialMatrix(getArrowFiles(subProj), featureDF = geneDF[geneDF$name %in% 
 .         genesUse, ], threads = 1, cellNames = subProj$cellNames, 
 .         useMatrix = useMatrix, verbose = FALSE)
 .     rownames(mat) <- geneDF[geneDF$name %in% genesUse, "name"]
 .     .logThis(mat, paste0("GeneScoreMat-Block-", i), logFile = logFile)
 .     if (useImputation) {
 .         .logDiffTime(sprintf("%s Imputing GeneScoreMatrix", prefix), 
 .             tstart, verbose = verbose, logFile = logFile)
 .         imputeParams <- list()
 .         imputeParams$ArchRProj <- subProj
 .         imputeParams$randomSuffix <- TRUE
 .         imputeParams$reducedDims <- reducedDims
 .         imputeParams$dimsToUse <- dimsToUse
 .         imputeParams$scaleDims <- scaleDims
 .         imputeParams$corCutOff <- corCutOff
 .         imputeParams$threads <- 1
 .         imputeParams$logFile <- logFile
 .         subProj <- suppressMessages(do.call(addImputeWeights, 
 .             imputeParams))
 .         mat <- suppressMessages(imputeMatrix(mat = mat, imputeWeights = getImputeWeights(subProj), 
 .             verbose = FALSE, logFile = logFile))
 .         o <- suppressWarnings(file.remove(unlist(getImputeWeights(subProj)[[1]])))
 .         .logThis(mat, paste0("GeneScoreMat-Block-Impute-", i), 
 .             logFile = logFile)
 .     }
 .     mat <- log(mat + 1)
 .     seuratATAC <- Seurat::CreateSeuratObject(counts = mat[head(seq_len(nrow(mat)), 
 .         5), , drop = FALSE])
 .     seuratATAC[["GeneScore"]] <- Seurat::CreateAssayObject(counts = mat)
 .     rm(mat)
 .     DefaultAssay(seuratATAC) <- "GeneScore"
 .     seuratATAC <- Seurat::ScaleData(seuratATAC, verbose = FALSE)
 .     .logDiffTime(sprintf("%s Seurat FindTransferAnchors", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     transferAnchors <- .retryCatch({
 .         gc()
 .         Seurat::FindTransferAnchors(reference = subRNA, query = seuratATAC, 
 .             reduction = reduction, features = genesUse, verbose = FALSE, 
 .             ...)
 .     }, maxAttempts = 2, logFile = logFile)
 .     .logThis(paste0(utils::capture.output(transferAnchors), collapse = "\n"), 
 .         paste0("transferAnchors-", i), logFile = logFile)
 .     rDSub <- rD[colnames(seuratATAC), , drop = FALSE]
 .     .logThis(rDSub, paste0("rDSub-", i), logFile = logFile)
 .     transferParams$anchorset <- transferAnchors
 .     transferParams$weight.reduction <- CreateDimReducObject(embeddings = rDSub, 
 .         key = "LSI_", assay = DefaultAssay(seuratATAC))
 .     transferParams$verbose <- FALSE
 .     transferParams$dims <- seq_len(ncol(rDSub))
 .     .logDiffTime(sprintf("%s Seurat TransferData Cell Group Labels", 
 .         prefix), tstart, verbose = verbose, logFile = logFile)
 .     transferParams$refdata <- subRNA$Group
 .     rnaLabels <- do.call(Seurat::TransferData, transferParams)
 .     .logDiffTime(sprintf("%s Seurat TransferData Cell Names Labels", 
 .         prefix), tstart, verbose = verbose, logFile = logFile)
 .     transferParams$refdata <- colnames(subRNA)
 .     rnaLabels2 <- do.call(Seurat::TransferData, transferParams)[, 
 .         1]
 .     if (addToArrow) {
 .         .logDiffTime(sprintf("%s Seurat TransferData GeneMatrix", 
 .             prefix), tstart, verbose = verbose, logFile = logFile)
 .         transferParams$refdata <- GetAssayData(subRNA, assay = "RNA", 
 .             slot = "data")
 .         gc()
 .         matchedRNA <- do.call(Seurat::TransferData, transferParams)
 .         matchedRNA <- matchedRNA@data
 .     }
 .     matchDF <- DataFrame(cellNames = colnames(seuratATAC), predictionScore = rnaLabels$prediction.score.max, 
 .         predictedGroup = rnaLabels$predicted.id, predictedCell = rnaLabels2)
 .     rownames(matchDF) <- matchDF$cellNames
 .     .logDiffTime(sprintf("%s Saving TransferAnchors Joint CCA", 
 .         prefix), tstart, verbose = verbose, logFile = logFile)
 .     jointCCA <- DataFrame(transferAnchors@object.list[[1]]@reductions$cca@cell.embeddings)
 .     jointCCA$Assay <- ifelse(endsWith(rownames(jointCCA), "_reference"), 
 .         "RNA", "ATAC")
 .     jointCCA$Group <- NA
 .     jointCCA$Score <- NA
 .     jointCCA[paste0(colnames(subRNA), "_reference"), "Group"] <- subRNA$Group
 .     jointCCA[paste0(matchDF$cellNames, "_query"), "Group"] <- matchDF$predictedGroup
 .     jointCCA[paste0(matchDF$cellNames, "_query"), "Score"] <- matchDF$predictionScore
 .     .safeSaveRDS(object = jointCCA, file = file.path(outDir3, 
 .         paste0("Save-Block", i, "-JointCCA.rds")))
 .     rm(transferParams, transferAnchors)
 .     gc()
 .     if (addToArrow) {
 .         .logDiffTime(sprintf("%s Transferring Paired RNA to Temp File", 
 .             prefix), tstart, verbose = verbose, logFile = logFile)
 .         tmpFilei <- paste0(tmpFile, "-IntegrationBlock-", i, 
 .             ".h5")
 .         o <- h5createFile(tmpFilei)
 .         sampleNames <- getCellColData(subProj, "Sample")[matchDF$cellNames, 
 .             ]
 .         uniqueSamples <- unique(sampleNames)
 .         matchedRNA <- .safeSubset(mat = matchedRNA, subsetRows = paste0(featureDF$name), 
 .             subsetCols = matchDF$cellNames)
 .         for (z in seq_along(uniqueSamples)) {
 .             mat <- matchedRNA[, which(sampleNames == uniqueSamples[z]), 
 .                 drop = FALSE]
 .             Group <- uniqueSamples[z]
 .             o <- tryCatch({
 .                 h5delete(tmpFilei, paste0(Group))
 .             }, error = function(x) {
 .             })
 .             o <- h5createGroup(tmpFilei, paste0(Group))
 .             j <- Rle(findInterval(seq(mat@x) - 1, mat@p[-1]) + 
 .                 1)
 .             lengthRle <- length(j@lengths)
 .             lengthI <- length(mat@i)
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/i"), storage.mode = "integer", dims = c(lengthI, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/jLengths"), storage.mode = "integer", dims = c(lengthRle, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/jValues"), storage.mode = "integer", dims = c(lengthRle, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5createDataset(tmpFilei, paste0(Group, 
 .                 "/x"), storage.mode = "double", dims = c(lengthI, 
 .                 1), level = 0))
 .             o <- .suppressAll(h5write(obj = mat@i + 1, file = tmpFilei, 
 .                 name = paste0(Group, "/i")))
 .             o <- .suppressAll(h5write(obj = j@lengths, file = tmpFilei, 
 .                 name = paste0(Group, "/jLengths")))
 .             o <- .suppressAll(h5write(obj = j@values, file = tmpFilei, 
 .                 name = paste0(Group, "/jValues")))
 .             o <- .suppressAll(h5write(obj = mat@x, file = tmpFilei, 
 .                 name = paste0(Group, "/x")))
 .             o <- .suppressAll(h5write(obj = colnames(mat), file = tmpFilei, 
 .                 name = paste0(Group, "/cellNames")))
 .         }
 .         rm(matchedRNA, mat, j)
 .     }
 .     .logDiffTime(sprintf("%s Completed Integration", prefix), 
 .         tstart, verbose = verbose, logFile = logFile)
 .     gc()
 .     matchDF$Block <- Rle(i)
 .     matchDF
 . }, threads = threads2)
4. mclapply(..., mc.cores = threads, mc.preschedule = preschedule)
5. lapply(X = X, FUN = FUN, ...)
6. FUN(X[[i]], ...)
7. Seurat::CreateSeuratObject(counts = mat[head(seq_len(nrow(mat)), 
 .     5), , drop = FALSE])
8. CreateSeuratObject.default(counts = mat[head(seq_len(nrow(mat)), 
 .     5), , drop = FALSE])
9. CreateAssay5Object(counts = counts, min.cells = min.cells, min.features = min.features, 
 .     ...)
10. .CreateStdAssay(counts = counts, min.cells = min.cells, min.features = min.features, 
  .     transpose = transpose, type = type, csum = csum, fsum = fsum, 
  .     ...)
11. .CreateStdAssay.list(counts = counts, min.cells = min.cells, 
  .     min.features = min.features, transpose = transpose, type = type, 
  .     csum = csum, fsum = fsum, ...)
12. `LayerData<-`(object = `*tmp*`, layer = layer, features = features[[layer]], 
  .     cells = cells[[layer]], transpose = transpose, value = counts[[layer]])
13. `LayerData<-.Assay5`(object = `*tmp*`, layer = layer, features = features[[layer]], 
  .     cells = cells[[layer]], transpose = transpose, value = counts[[layer]])
14. .handleSimpleError(function (cnd) 
  . {
  .     watcher$capture_plot_and_output()
  .     cnd <- sanitize_call(cnd)
  .     watcher$push(cnd)
  .     switch(on_error, continue = invokeRestart("eval_continue"), 
  .         stop = invokeRestart("eval_stop"), error = invokeRestart("eval_error", 
  .             cnd))
  . }, "more elements supplied than there are to replace", base::quote(slot(object = object, 
  .     name = "features")[[layer]] <- features))

Thanks a lot

rcorces commented 1 month ago

Hi @danli349! Thanks for using ArchR! Lately, it has been very challenging for me to keep up with maintenance of this package and all of my other responsibilities as a PI. I have not been responding to issue posts and I have not been pushing updates to the software. We are actively searching to hire a computational biologist to continue to develop and maintain ArchR and related tools. If you know someone who might be a good fit, please let us know! In the meantime, your issue will likely go without a reply. Most issues with ArchR right not relate to compatibility. Try reverting to R 4.1 and Bioconductor 3.15. Newer versions of Seurat and Matrix also are causing issues. Sorry for not being able to provide active support for this package at this time.

danli349 commented 4 weeks ago

@rcorces Thanks a lot for helping, can you please let me know which Seurat and Matrix versions should I use?

danli349 commented 4 weeks ago

@rcorces I solved this problem by changing the version of Seurat package:

remove.packages("SeuratObject")
packageurl <- "http://cran.r-project.org/src/contrib/Archive/SeuratObject/SeuratObject_4.1.3.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

remove.packages("Seurat")
packageurl <- "http://cran.r-project.org/src/contrib/Archive/Seurat/Seurat_4.3.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Thanks a lot

alekseybelikov commented 3 weeks ago

@rcorces I solved this problem by changing the version of Seurat package:

remove.packages("SeuratObject")
packageurl <- "http://cran.r-project.org/src/contrib/Archive/SeuratObject/SeuratObject_4.1.3.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

remove.packages("Seurat")
packageurl <- "http://cran.r-project.org/src/contrib/Archive/Seurat/Seurat_4.3.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Thanks a lot

Solved for me too, thanks!

Qian-Feng22 commented 3 weeks ago

ArchR Gene Integration Process

Code Execution

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

ArchR logging to : ArchRLogs/ArchR-addGeneIntegrationMatrix-4bf73914b78f-Date-2024-10-19_Time-12-09-13.353955.log
If there is an issue, please report to github with logFile!
2024-10-19 12:09:13.473208 : Running Seurat's Integration Stuart* et al 2019, 0.002 mins elapsed.
2024-10-19 12:09:13.745389 : Checking ATAC Input, 0.007 mins elapsed.
2024-10-19 12:09:14.673089 : Checking RNA Input, 0.022 mins elapsed.
2024-10-19 12:09:19.392725 : Found 18706 overlapping gene names from gene scores and rna matrix!, 0.101 mins elapsed.
2024-10-19 12:09:19.396339 : Creating Integration Blocks, 0.101 mins elapsed.
2024-10-19 12:09:19.421006 : Prepping Interation Data, 0.101 mins elapsed.
2024-10-19 12:09:20.119927 : Computing Integration in 1 Integration Blocks!, 0 mins elapsed.
2024-10-19 12:09:20.132852 : Block (1 of 1) : Computing Integration, 0 mins elapsed.
2024-10-19 12:09:20.979738 : Block (1 of 1) : Identifying Variable Genes, 0.014 mins elapsed.
2024-10-19 12:09:23.12459 : Block (1 of 1) : Getting GeneScoreMatrix, 0.05 mins elapsed.
2024-10-19 12:09:34.256679 : Block (1 of 1) : Imputing GeneScoreMatrix, 0.236 mins elapsed.
Getting ImputeWeights
2024-10-19 12:10:09.657839 : Block (1 of 1) : Seurat FindTransferAnchors, 0.826 mins elapsed.
<simpleError in dimnames(x) <- dn: length of 'dimnames' [1] not equal to array extent>
Error in .retryCatch({ : 

Moments ago I have faced the same problems in the issue. I have use the same solution to change the Seurat package and run through with Seurat V4 with my RNA data. But when I run the addGeneIntegrationMatrix part, new error came. How to solve this?

xiubert commented 5 days ago

@rcorces I solved this problem by changing the version of Seurat package:

remove.packages("SeuratObject")
packageurl <- "http://cran.r-project.org/src/contrib/Archive/SeuratObject/SeuratObject_4.1.3.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

remove.packages("Seurat")
packageurl <- "http://cran.r-project.org/src/contrib/Archive/Seurat/Seurat_4.3.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Thanks a lot

Solved for me too, thanks!

same. Thank you kindly for sharing @danli349