From fb1115a7d910e365570da81639e332d3baca7527 Mon Sep 17 00:00:00 2001 From: Matt Shirley Date: Wed, 30 Mar 2022 09:58:30 -0400 Subject: [PATCH] Don't don't coerce data.frame to vector when length(columns) == 1 This is another fix for #24 --- pisces/R/make_expression_matrix.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pisces/R/make_expression_matrix.R b/pisces/R/make_expression_matrix.R index abfb26f..06d5c84 100755 --- a/pisces/R/make_expression_matrix.R +++ b/pisces/R/make_expression_matrix.R @@ -150,8 +150,8 @@ rescaleTPM <- function(mat, columns = colnames(mat), rows = 1:nrow(mat), precisi tpm.scale.factors <- 1e+06/sums.before.norm scaled_df <- mat scaled_df[rows, columns] <- data.frame(mapply("*", scaled_df[rows, - columns], tpm.scale.factors)) - scaled_df[, columns] <- round(scaled_df[, columns], precision) + columns, drop=F], tpm.scale.factors)) + scaled_df[, columns] <- round(scaled_df[, columns, drop=F], precision) return(scaled_df) }