diff --git a/R/mock_rnaseq.R b/R/mock_rnaseq.R index 89ae03eeb62324a8decaf6e18454dfc60842f3ab..ce4374445f9a4e905e7341a59b0cc4bb834db0fb 100644 --- a/R/mock_rnaseq.R +++ b/R/mock_rnaseq.R @@ -80,7 +80,7 @@ get_messages_sequencing_depth <- function(scaling_factors, threshold_cov_var = 1 warning_too_low_mu_ij_row <- function(mu_ij_matrix, threshold = 1 ){ n_too_low_row <- length(which(detect_row_matx_bellow_threshold(mu_ij_matrix, threshold))) if (n_too_low_row > 0){ - msg <- paste("INFO:", n_too_low_row, "genes have all(mu_ij) < 1, indicating very low counts. Consider removing them for future analysis using prepareData2fit with row_cnt_threshold = 10. To detect them, try increasing sequencing depth.\n", + msg <- paste("INFO:", n_too_low_row, "genes have all(mu_ij) < 1, indicating very low counts. Consider removing them for future analysis using prepareData2fit with row_threshold = 10. To detect them in future experiment, try increasing sequencing depth.\n", sep = " ") message(msg) } diff --git a/R/prepare_data2fit.R b/R/prepare_data2fit.R index 03d1f1f27b48f0c6657cf9f5ba8d49b5cab0d41e..e10e1fdd821ace2ec6ee518f75249d35ffe809ed 100644 --- a/R/prepare_data2fit.R +++ b/R/prepare_data2fit.R @@ -147,7 +147,7 @@ prepareData2fit <- function(countMatrix, metadata, response_name = "kij", if (row_threshold > 0){ message(paste("INFO: filtering", response_name, "<", row_threshold, sep = " " )) idx <- detect_row_matx_bellow_threshold(countMatrix, threshold = row_threshold) - message(paste(length(idx), "genes removed from data.", sep = " ")) + message(paste(length(which(idx)), "genes removed from data.", sep = " ")) countMatrix <- countMatrix[ !idx , ] } diff --git a/R/utils.R b/R/utils.R index 7e2bb8f55c728571122d0713e2a0fa1dfa2f90e9..ae4ac4ea8d2e51d6b708d17f97124dfd6df907fe 100644 --- a/R/utils.R +++ b/R/utils.R @@ -54,7 +54,7 @@ first_non_null_index <- function(lst) { #' @return A logical vector indicating rows below the threshold #' @export detect_row_matx_bellow_threshold <- function(matrix, threshold) { - apply(matrix, 1, function(row) all(row < threshold)) + apply(matrix, 1, function(row) all(row < threshold)) }