GreenleafLab / ArchR

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

Error while addDoubletScores #1021

Closed bill0919 closed 3 years ago

bill0919 commented 3 years ago

An error occurred when I used addDoubletScores . doubScores <- addDoubletScores( input = ArrowFiles, k = 10, knnMethod = "UMAP", LSIMethod = 1 ) The error message is as follows. Skip this step and create the project successfully. But Inferring the doublets is essential for subsequent downstream analysis. So I want to know how to solve it. Thanks.

ArchR logging to : ArchRLogs/ArchR-addDoubletScores-8d4b21a35524-Date-2021-09-08_Time-00-27-06.log
If there is an issue, please report to github with logFile!
2021-09-08 00:27:06 : Batch Execution w/ safelapply!, 0 mins elapsed.
2021-09-08 00:27:06 : h_d60 (1 of 4) :  Computing Doublet Statistics, 0 mins elapsed.
Warning: The following arguments are not used: row.names
Error in (function (x)  : attempt to apply non-function
h_d60 (1 of 4) : UMAP Projection R^2 = 0.92484
2021-09-08 00:27:48 : h_d120 (2 of 4) :  Computing Doublet Statistics, 0.701 mins elapsed.
Warning: The following arguments are not used: row.names
h_d120 (2 of 4) : UMAP Projection R^2 = 0.5877
h_d120 (2 of 4) : Correlation of UMAP Projection is below 0.9 (normally this is ~0.99)
This means there is little heterogeneity in your sample and thus doubletCalling is inaccurate.
force = FALSE, thus returning -1 doubletScores and doubletEnrichments!
Set force = TRUE if you want to continue (not recommended).
2021-09-08 00:28:23 : h_d15 (3 of 4) :  Computing Doublet Statistics, 1.278 mins elapsed.
Warning in irlba::irlba(mat, nDimensions, nDimensions) :
  You're computing too large a percentage of total singular values, use a standard svd instead.
Warning: The following arguments are not used: row.names

************************************************************
2021-09-08 00:28:28 : ERROR Found in FindClusters for
LogFile = ArchRLogs/ArchR-addDoubletScores-8d4b21a35524-Date-2021-09-08_Time-00-27-06.log

<simpleError in sample.int(length(x), size, replace, prob): invalid first argument>

************************************************************

************************************************************
2021-09-08 00:28:28 : ERROR Found in runClusters for
LogFile = ArchRLogs/ArchR-addDoubletScores-8d4b21a35524-Date-2021-09-08_Time-00-27-06.log

<simpleError in .logError(e, fn = "FindClusters", info = "", errorList = errorList,     logFile = logFile): Exiting See Error Above>

************************************************************

************************************************************
2021-09-08 00:28:28 : ERROR Found in .LSICluster for
LogFile = ArchRLogs/ArchR-addDoubletScores-8d4b21a35524-Date-2021-09-08_Time-00-27-06.log

<simpleError in .logError(e, fn = "runClusters", info = "", errorList = errorList,     logFile = logFile): Exiting See Error Above>

************************************************************

************************************************************
2021-09-08 00:28:28 : ERROR Found in addIterativeLSI for h_d15 (3 of 4) :
LogFile = ArchRLogs/ArchR-addDoubletScores-8d4b21a35524-Date-2021-09-08_Time-00-27-06.log

<simpleError: $ operator is invalid for atomic vectors>

************************************************************

Error in .logError(e, fn = "addIterativeLSI", info = prefix, errorList = list(ArrowFile = ArrowFile),  :
  Exiting See Error Above
In addition: Warning messages:
1: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> = "none")` instead.
2: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> = "none")` instead.
rcorces commented 3 years ago

Please attach a log file.

bill0919 commented 3 years ago

Please attach a log file.

ArchR-addDoubletScores-8d4b21a35524-Date-2021-09-08_Time-00-27-06.log

Attached is my ArchRLogs.

rcorces commented 3 years ago

what version of Seurat are you running?

bill0919 commented 3 years ago

what version of Seurat are you running? 4.0.3

rcorces commented 3 years ago

Can you confirm if you are able to run the tutorial code on the provided tutorial data on your system? Is this problem specific to your dataset or is it specific to your environment?

bill0919 commented 3 years ago

Can you confirm if you are able to run the tutorial code on the provided tutorial data on your system? Is this problem specific to your dataset or is it specific to your environment?

It doesn't work either.

ArchR-addDoubletScores-35bb64eb598d-Date-2021-09-11_Time-22-44-02.log

ArchR logging to : ArchRLogs/ArchR-addDoubletScores-35bb64eb598d-Date-2021-09-11_Time-22-44-02.log If there is an issue, please report to github with logFile! 2021-09-11 22:44:02 : Batch Execution w/ safelapply!, 0 mins elapsed. 2021-09-11 22:44:02 : scATAC_BMMC_R1 (1 of 3) : Computing Doublet Statistics, 0 mins elapsed. Warning: The following arguments are not used: row.names scATAC_BMMC_R1 (1 of 3) : UMAP Projection R^2 = 0.98718 2021-09-11 22:45:49 : scATAC_CD34_BMMC_R1 (2 of 3) : Computing Doublet Statistics, 1.776 mins elapsed. Warning: The following arguments are not used: row.names scATAC_CD34_BMMC_R1 (2 of 3) : UMAP Projection R^2 = 0.98583 2021-09-11 22:47:07 : scATAC_PBMC_R1 (3 of 3) : Computing Doublet Statistics, 3.085 mins elapsed. Warning: The following arguments are not used: row.names scATAC_PBMC_R1 (3 of 3) : UMAP Projection R^2 = 0.97502 ArchR logging successful to : ArchRLogs/ArchR-addDoubletScores-35bb64eb598d-Date-2021-09-11_Time-22-44-02.log Warning messages: 1: guides(<scale> = FALSE) is deprecated. Please use guides(<scale> = "none") instead. 2: guides(<scale> = FALSE) is deprecated. Please use guides(<scale> = "none") instead. 3: guides(<scale> = FALSE) is deprecated. Please use guides(<scale> = "none") instead.

rcorces commented 3 years ago

Can you show the first few lines of the output when you type data.frame into R? I want to know what this looks like on your system:

> data.frame
function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, 
    fix.empty.names = TRUE, stringsAsFactors = default.stringsAsFactors()) 
{
    data.row.names <- if (check.rows && is.null(row.names)) 
bill0919 commented 3 years ago

Can you show the first few lines of the output when you type data.frame into R? I want to know what this looks like on your system:

> data.frame
function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, 
    fix.empty.names = TRUE, stringsAsFactors = default.stringsAsFactors()) 
{
    data.row.names <- if (check.rows && is.null(row.names)) 

Yeah, of course.

function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, fix.empty.names = TRUE, stringsAsFactors = FALSE) { data.row.names <- if (check.rows && is.null(row.names)) function(current, new, i) { if (is.character(current)) new <- as.character(new) if (is.character(new)) current <- as.character(current) if (anyDuplicated(new)) return(current) if (is.null(current)) return(new) if (all(current == new) || all(current == "")) return(new) stop(gettextf("mismatch of row names in arguments of 'data.frame', item %d", i), domain = NA) } else function(current, new, i) { if (is.null(current)) { if (anyDuplicated(new)) { warning(gettextf("some row.names duplicated: %s --> row.names NOT used", paste(which(duplicated(new)), collapse = ",")), domain = NA) current } else new } else current } object <- as.list(substitute(list(...)))[-1L] mirn <- missing(row.names) mrn <- is.null(row.names) x <- list(...) n <- length(x) if (n < 1L) { if (!mrn) { if (is.object(row.names) || !is.integer(row.names)) row.names <- as.character(row.names) if (anyNA(row.names)) stop("row names contain missing values") if (anyDuplicated(row.names)) stop(gettextf("duplicate row.names: %s", paste(unique(row.names[duplicated(row.names)]), collapse = ", ")), domain = NA) } else row.names <- integer() return(structure(list(), names = character(), row.names = row.names, class = "data.frame")) } vnames <- names(x) if (length(vnames) != n) vnames <- character(n) no.vn <- !nzchar(vnames) vlist <- vnames <- as.list(vnames) nrows <- ncols <- integer(n) for (i in seq_len(n)) { xi <- if (is.character(x[[i]]) || is.list(x[[i]])) as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) else as.data.frame(x[[i]], optional = TRUE) nrows[i] <- .row_names_info(xi) ncols[i] <- length(xi) namesi <- names(xi) if (ncols[i] > 1L) { if (length(namesi) == 0L) namesi <- seq_len(ncols[i]) vnames[[i]] <- if (no.vn[i]) namesi else paste(vnames[[i]], namesi, sep = ".") } else if (length(namesi)) { vnames[[i]] <- namesi } else if (fix.empty.names && no.vn[[i]]) { tmpname <- deparse(object[[i]], nlines = 1L)[1L] if (startsWith(tmpname, "I(") && endsWith(tmpname, ")")) { ntmpn <- nchar(tmpname, "c") tmpname <- substr(tmpname, 3L, ntmpn - 1L) } vnames[[i]] <- tmpname } if (mirn && nrows[i] > 0L) { rowsi <- attr(xi, "row.names") if (any(nzchar(rowsi))) row.names <- data.row.names(row.names, rowsi, i) } nrows[i] <- abs(nrows[i]) vlist[[i]] <- xi } nr <- max(nrows) for (i in seq_len(n)[nrows < nr]) { xi <- vlist[[i]] if (nrows[i] > 0L && (nr%%nrows[i] == 0L)) { xi <- unclass(xi) fixed <- TRUE for (j in seq_along(xi)) { xi1 <- xi[[j]] if (is.vector(xi1) || is.factor(xi1)) xi[[j]] <- rep(xi1, length.out = nr) else if (is.character(xi1) && inherits(xi1, "AsIs")) xi[[j]] <- structure(rep(xi1, length.out = nr), class = class(xi1)) else if (inherits(xi1, "Date") || inherits(xi1, "POSIXct")) xi[[j]] <- rep(xi1, length.out = nr) else { fixed <- FALSE break } } if (fixed) { vlist[[i]] <- xi next } } stop(gettextf("arguments imply differing number of rows: %s", paste(unique(nrows), collapse = ", ")), domain = NA) } value <- unlist(vlist, recursive = FALSE, use.names = FALSE) vnames <- as.character(unlist(vnames[ncols > 0L])) if (fix.empty.names && any(noname <- !nzchar(vnames))) vnames[noname] <- paste0("Var.", seq_along(vnames))[noname] if (check.names) { if (fix.empty.names) vnames <- make.names(vnames, unique = TRUE) else { nz <- nzchar(vnames) vnames[nz] <- make.names(vnames[nz], unique = TRUE) } } names(value) <- vnames if (!mrn) { if (length(row.names) == 1L && nr != 1L) { if (is.character(row.names)) row.names <- match(row.names, vnames, 0L) if (length(row.names) != 1L || row.names < 1L || row.names > length(vnames)) stop("'row.names' should specify one of the variables") i <- row.names row.names <- value[[i]] value <- value[-i] } else if (!is.null(row.names) && length(row.names) != nr) stop("row names supplied are of the wrong length") } else if (!is.null(row.names) && length(row.names) != nr) { warning("row names were found from a short variable and have been discarded") row.names <- NULL } class(value) <- "data.frame" if (is.null(row.names)) attr(value, "row.names") <- .set_row_names(nr) else { if (is.object(row.names) || !is.integer(row.names)) row.names <- as.character(row.names) if (anyNA(row.names)) stop("row names contain missing values") if (anyDuplicated(row.names)) stop(gettextf("duplicate row.names: %s", paste(unique(row.names[duplicated(row.names)]), collapse = ", ")), domain = NA) row.names(value) <- row.names } value } <bytecode: 0x564eec271a10>

rcorces commented 3 years ago

I dont have any ideas for what is going on. Its something specific to your environment but I've never seen this behavior and I dont understand what it could be.

The log file that you attached shows that the function completed, presumably successfully.

rcorces commented 3 years ago

closing due to inactivity. feel free to comment again here if you require further help.

chen-zhan commented 2 years ago

hello, I meet the same question when i run addDoubletScores. would be greatly appreciated if there were some suggestions ArchR-addDoubletScores-166c2ec18b6-Date-2022-10-10_Time-22-23-25.log

rcorces commented 2 years ago

@chen-zhan - your error is coming from Seurat's FindClusters() function but its very hard for me to know why. Minimally, I would need: 1) A traceback() showing the origination of the error. 2) Do you get this error with the tutorial code and dataset?

chen-zhan commented 2 years ago

@chen-zhan - your error is coming from Seurat's FindClusters() function but its very hard for me to know why. Minimally, I would need:

  1. A traceback() showing the origination of the error.
  2. Do you get this error with the tutorial code and dataset?

Thanks for your reply so quickly. I had not meet this error with the tutorial code and dataset. And there could be run success with another dataset. So i think the reason maybe is low quality of this sample. traceback.txt

rcorces commented 2 years ago

So i think the reason maybe is low quality of this sample

@chen-zhan - that could be. I could imagine that might cause problems.

libell1 commented 1 year ago

Hello,

I am having the same error in FindClusters. I did not get this error when using the tutorial data.

The log file is attached: ArchR-addDoubletScores-c1934c39a6fa-Date-2022-11-02_Time-15-19-48.log

Thanks!

qdong2023 commented 10 months ago

Hello @rcorces,

I encountered the same error when running addDoubletScores. Two samples of 10 couldn't successfully run. I found these two samples have fewer cells (<50 cells) than the others, so I am curious if that caused the failed run. Is it possible to exclude these two samples when running addDoubletScores and then combine them with the other filtered samples? Thanks!