diff --git a/R/normalize.R b/R/normalize.R index ff8c110dd..58d9cdafa 100644 --- a/R/normalize.R +++ b/R/normalize.R @@ -25,21 +25,21 @@ #' A. The standard method follows the standard protocol which can be adjusted #' using the provided parameters and follows the following order: \cr #' \itemize{ -#' \item{1. Data normalization for total library size and scaling by a custom +#' \item{1. Data normalization for total library size and scaling by a custom #' scale-factor.} #' \item{2. Log transformation of data.} #' \item{3. Z-scoring of data by genes and/or cells.} #' } -#' B. The normalization method as provided by the osmFISH paper is also +#' B. The normalization method as provided by the osmFISH paper is also #' implemented: \cr #' \itemize{ -#' \item{1. First normalize genes, for each gene divide the counts by the +#' \item{1. First normalize genes, for each gene divide the counts by the #' total gene count and multiply by the total number of genes.} -#' \item{2. Next normalize cells, for each cell divide the normalized gene -#' counts by the total counts per cell and multiply by the total number of +#' \item{2. Next normalize cells, for each cell divide the normalized gene +#' counts by the total counts per cell and multiply by the total number of #' cells.} #' } -#' C. The normalization method as provided by Lause/Kobak et al is also +#' C. The normalization method as provided by Lause/Kobak et al is also #' implemented: \cr #' \itemize{ #' \item{1. First calculate expected values based on Pearson correlations.} @@ -48,9 +48,9 @@ #' D. Quantile normalization across features #' \itemize{ #' \item{1. Rank feature expression} -#' \item{2. Define a common distribution by sorting expression values per +#' \item{2. Define a common distribution by sorting expression values per #' feature then finding the mean across all features per index} -#' \item{3. Apply common distribution to expression information by using +#' \item{3. Apply common distribution to expression information by using #' the ranks from step 1 as indices} #' } #' By default the latter two results will be saved in the Giotto slot for @@ -218,7 +218,7 @@ normalizeGiotto <- function( } else if (methods::is(mymatrix, "Matrix")) { mymatrix@x <- log(mymatrix@x + offset) / log(base) } else if (methods::is(mymatrix, "dbMatrix")) { - mymatrix[] <- dplyr::mutate(mymatrix[], x = x + offset) + mymatrix[] <- dplyr::mutate(mymatrix[], x = x + offset) # workaround for lack of @x slot mymatrix <- log(mymatrix) / log(base) } else {