From 19ffacc83c7c2aa0eab2ce8a6428aa4306122705 Mon Sep 17 00:00:00 2001 From: Biomiha Date: Thu, 14 Dec 2023 15:15:34 +0000 Subject: [PATCH 1/3] Update alra.R Correct bug in 'matrix' class error handling. --- alra.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alra.R b/alra.R index 5c432b9..5e63839 100644 --- a/alra.R +++ b/alra.R @@ -205,7 +205,7 @@ alra.low.memory <- function( A_norm, k=0,q=10, quantile.prob = 0.001, use.mkl = # A_norm_rank15_cor <- result.completed[[3]] # The actual adjusted, completed matrix cat(sprintf("Read matrix with %d cells and %d genes\n", nrow(A_norm), ncol(A_norm))) - if (class(A_norm) != 'matrix') { + if(!("matrix" %in% class(as.matrix(t(logcounts(T53_sce)))))) { stop(sprintf("A_norm is of class %s, but it should be of class matrix. Did you forget to run as.matrix()?",class(A_norm))) } From a3a9ac04a505b282bef4bc5f5b654f91b2c43065 Mon Sep 17 00:00:00 2001 From: Biomiha Date: Thu, 14 Dec 2023 15:29:17 +0000 Subject: [PATCH 2/3] Update alra.R A_norm --- alra.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alra.R b/alra.R index 5e63839..5cd47cf 100644 --- a/alra.R +++ b/alra.R @@ -205,7 +205,7 @@ alra.low.memory <- function( A_norm, k=0,q=10, quantile.prob = 0.001, use.mkl = # A_norm_rank15_cor <- result.completed[[3]] # The actual adjusted, completed matrix cat(sprintf("Read matrix with %d cells and %d genes\n", nrow(A_norm), ncol(A_norm))) - if(!("matrix" %in% class(as.matrix(t(logcounts(T53_sce)))))) { + if(!("matrix" %in% class(as.matrix(A_norm)))) { stop(sprintf("A_norm is of class %s, but it should be of class matrix. Did you forget to run as.matrix()?",class(A_norm))) } From 41fed4f1afcbd8951bc05d5247639c503847dbc8 Mon Sep 17 00:00:00 2001 From: Biomiha Date: Thu, 14 Dec 2023 15:30:06 +0000 Subject: [PATCH 3/3] Update alra.R --- alra.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alra.R b/alra.R index 5cd47cf..6f2eb68 100644 --- a/alra.R +++ b/alra.R @@ -205,7 +205,7 @@ alra.low.memory <- function( A_norm, k=0,q=10, quantile.prob = 0.001, use.mkl = # A_norm_rank15_cor <- result.completed[[3]] # The actual adjusted, completed matrix cat(sprintf("Read matrix with %d cells and %d genes\n", nrow(A_norm), ncol(A_norm))) - if(!("matrix" %in% class(as.matrix(A_norm)))) { + if(!("matrix" %in% class(A_norm))) { stop(sprintf("A_norm is of class %s, but it should be of class matrix. Did you forget to run as.matrix()?",class(A_norm))) }