I'm trying to run scran::quickCluster on an scRNA expression matrix (the class of the matrix is data frame). Code inside the quickCluster function returns the following error:
> scuttle::normalizeCounts(scRNA_matrix, librarySizeFactors(scRNA_matrix)) Error in .local(x, ...) : size factors should be positive
Running some checks on my matrix shows all its values are finite and positive:
> any(sapply(scRNA_matrix, is.infinite))  FALSE > sum(scRNA_matrix < 0)  0
However, running some checks on the result of librarySizeFactors(scRNA_matrix) shows some values are infinite:
> lsf <- librarySizeFactors(scRNA_matrix) > any(lsf, is.infinite)  TRUE > sum(lsf < 0)  0
I assume this is what's causing the error, but I don't understand how to prevent it. Why might librarySizeFactors return non-finite values? If the solution is to remove certain samples from the dataset, where should I start looking? I can't easily share a reprex but the dataset I'm using is Pancreas from Tabula Sapiens, transposed (cell barcodes in rows, genes in columns) and contains mostly 0s.
Thank you in advance! (And apologies that these are likely very amateur questions, I'm extremely new to working with single cell RNA data, as this is actually an intermediary step in a project based on DNA methylation data.)