Skip to content

Commit

Permalink
Deprecate z transform in transformAssay (microbiome#584)
Browse files Browse the repository at this point in the history
Signed-off-by: Daena Rys <[email protected]>
Co-authored-by: Tuomas Borman <[email protected]>
  • Loading branch information
Daenarys8 and TuomasBorman authored Jun 18, 2024
1 parent 8035003 commit c17fa9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 88 deletions.
50 changes: 6 additions & 44 deletions R/transformCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,8 @@
#'
#' \itemize{
#'
#' \item 'alr': Additive log ratio (alr) transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'chi.square': Chi square transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'clr': Centered log ratio (clr) transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'frequency': Frequency transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'hellinger': Hellinger transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'log': Logarithmic transformation, please refer to
#' \item 'alr', 'chi.square', 'clr', 'frequency', 'hellinger', 'log', 'normalize', 'pa', 'rank', 'rclr'
#' 'relabundance', 'rrank', 'standardize', 'total': please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'log10': log10 transformation can be used for reducing the skewness
Expand All @@ -82,34 +68,6 @@
#' \deqn{log2 = \log_{2} x}{%
#' log2 = log2(x)}
#' where \eqn{x} is a single value of data.
#'
#' \item 'normalize': Make margin sum of squares equal to one. Please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'pa': Transforms table to presence/absence table. Please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'rank': Rank transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'rclr': Robust clr transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'relabundance': Relative transformation (alias for 'total'), please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'rrank': Relative rank transformation, please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'standardize': Scale 'x' to zero mean and unit variance (alias for
#' 'z'), please refer to \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'total': Divide by margin total (alias for
#' 'relabundance'), please refer to
#' \code{\link[vegan:decostand]{decostand}} for details.
#'
#' \item 'z': Z transformation (alias for 'standardize'),
#' please refer to \code{\link[vegan:decostand]{decostand}} for details.
#'
#' }
#'
Expand Down Expand Up @@ -312,6 +270,10 @@ setMethod("transformAssay", signature = c(x = "SummarizedExperiment"),
MARGIN <- ifelse(MARGIN %in% c("samples", "columns", "col", 2), 2, 1)
# Adjust method if mia-specific alias was used
method <- ifelse(method == "relabundance", "total", method)

if (method == "z") {
.Deprecated(old="z", new="standardize")
}
method <- ifelse(method == "z", "standardize", method)

# If method is ALR, vegan drops one column/sample, because it is used
Expand Down
46 changes: 2 additions & 44 deletions man/transformAssay.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c17fa9f

Please sign in to comment.