Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: normalize generics #239

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ export(my_arowMeans)
export(my_growMeans)
export(my_rowMeans)
export(nnDT_to_kNN)
export(norm_lib)
export(norm_log)
export(norm_osmfish)
export(norm_pearson)
export(norm_quantile)
export(normalize)
export(objHistory)
export(ometif_metadata)
export(ometif_to_tif)
Expand Down
33 changes: 33 additions & 0 deletions R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,38 @@ setGeneric(
function(x, ...) standardGeneric("overlapToMatrix")
)

# expression value normalization
#' @title Normalize an object
#' @name normalize
#' @description Generics for normalizing an object containing measured values.
#' `normalize()` is intended as the central API for accessing
#' normalization workflows. Specific methods should be defined for it to
#' help with pre or post processing specific to a matrix class type.
#' The other generics are specific normalization generics made available for
#' other packages to attach methods, which may differ depending on the input
#' matrix. No methods for normalization are exported from GiottoClass.
#' @param object,x a data object
#' @param ... additional arguments, for use in specific methods
#' @returns An object of the same class containing the normalized data
#' @export normalize
setGeneric("normalize", function(object, ...) standardGeneric("normalize"))
#' @rdname normalize
#' @export norm_lib
setGeneric("norm_lib", function(x, ...) standardGeneric("norm_lib"))
#' @rdname normalize
#' @export norm_log
setGeneric("norm_log", function(x, ...) standardGeneric("norm_log"))
#' @rdname normalize
#' @export norm_quantile
setGeneric("norm_quantile", function(x, ...) standardGeneric("norm_quantile"))
#' @rdname normalize
#' @export norm_pearson
setGeneric("norm_pearson", function(x, ...) standardGeneric("norm_pearson"))
#' @rdname normalize
#' @export norm_osmfish
setGeneric("norm_osmfish", function(x, ...) standardGeneric("norm_osmfish"))


# Methods and documentations found in methods-spatShift.R
setGeneric("spatShift", function(x, ...) standardGeneric("spatShift"))
setGeneric("affine", function(x, y, ...) standardGeneric("affine"))
Expand All @@ -90,6 +122,7 @@ setGeneric("XY<-", function(x, ..., value) standardGeneric("XY<-"))
setGeneric("overlaps", function(x, ...) standardGeneric("overlaps"))



# Giotto subnesting ####
# All methods and documentations found in methods-nesting.R

Expand Down
40 changes: 40 additions & 0 deletions man/normalize.Rd

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

Loading