Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed Oct 12, 2024
1 parent c0782f4 commit da8b4f4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions R/normalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.}
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit da8b4f4

Please sign in to comment.