diff --git a/NEWS.txt b/NEWS.txt index 1fab5db..476a8e6 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -41,6 +41,9 @@ DEPRECATED ARGUMENTS o `spatialCoordCols` argument deprecated for both getPairwise() and spicy(), replaced with `spatialCoords`. + o `Rs` argument deprecated for both getPairwise() and spicy(), replaced + with `r`. + * Deprecation warnings have been added to guide users to the new argument names. diff --git a/R/spicy.R b/R/spicy.R index 4b5f611..59feb53 100644 --- a/R/spicy.R +++ b/R/spicy.R @@ -10,7 +10,7 @@ #' @param imageID The name of the imageID column if using a SingleCellExperiment or SpatialExperiment. #' @param cellType The name of the cellType column if using a SingleCellExperiment or SpatialExperiment. #' @param spatialCoords The names of the spatialCoords column if using a SingleCellExperiment. -#' @param Rs A vector of the radii that the measures of association should be calculated over. +#' @param r A vector of the radii that the measures of association should be calculated over. #' @param sigma A numeric variable used for scaling when fitting inhomogenous L-curves. #' @param from vector of cell types which you would like to compare to the to vector. #' @param to vector of cell types which you would like to compare to the from vector. @@ -32,6 +32,7 @@ #' @param cellTypeCol \{DEPRECATED\} The name of the cellType column if using a SingleCellExperiment or SpatialExperiment. #' @param spatialCoordCols \{DEPRECATED\} The names of the spatialCoords column if using a SingleCellExperiment. #' @param nCores \{DEPRECATED\} Number of cores to use for parallel processing or a BiocParallel MulticoreParam or SerialParam object. +#' @param Rs \{DEPRECATED\} A vector of the radii that the measures of association should be calculated over. #' @param ... Other options #' @return Data frame of p-values. #' @export @@ -71,7 +72,7 @@ spicy <- function(cells, imageID = "imageID", cellType = "cellType", spatialCoords = c("x", "y"), - Rs = NULL, + r = NULL, sigma = NULL, from = NULL, to = NULL, @@ -91,6 +92,7 @@ spicy <- function(cells, cellTypeCol = cellType, spatialCoordCols = spatialCoords, nCores = cores, + Rs = r, ...) { user_args = as.list(match.call())[-1] @@ -172,7 +174,7 @@ spicy <- function(cells, if (is.null(alternateResult)) { pairwiseAssoc <- getPairwise(cells, - Rs = Rs, + r = r, sigma = sigma, from = from, to = to, @@ -417,7 +419,7 @@ cleanMEM <- function(mixed.lmer, BPPARAM) { #' The name of the imageID column if using a SingleCellExperiment or SpatialExperiment. #' @param cellType The name of the cellType column if using a SingleCellExperiment or SpatialExperiment. #' @param spatialCoords The names of the spatialCoords column if using a SingleCellExperiment. -#' @param Rs A vector of the radii that the measures of association should be calculated over. +#' @param r A vector of the radii that the measures of association should be calculated over. #' @param sigma A numeric variable used for scaling when fitting inhomogenous L-curves. #' @param from The 'from' cellType for generating the L curve. #' @param to The 'to' cellType for generating the L curve. @@ -432,6 +434,7 @@ cleanMEM <- function(mixed.lmer, BPPARAM) { #' @param cellTypeCol \{DEPRECATED\} The name of the cellType column if using a SingleCellExperiment or SpatialExperiment. #' @param spatialCoordCols \{DEPRECATED\} The names of the spatialCoords column if using a SingleCellExperiment. #' @param nCores \{DEPRECATED\} Number of cores to use for parallel processing or a BiocParallel MulticoreParam or SerialParam object. +#' @param Rs \{DEPRECATED\} A vector of the radii that the measures of association should be calculated over. #' calculation. #' @return Statistic from pairwise L-curve of a single image. #' @examples @@ -449,7 +452,7 @@ getPairwise <- function( imageID = "imageID", cellType = "cellType", spatialCoords = c("x", "y"), - Rs = NULL, + r = NULL, sigma = NULL, from = NULL, to = NULL, @@ -463,7 +466,8 @@ getPairwise <- function( imageIDCol = imageID, cellTypeCol = cellType, spatialCoordCols = spatialCoords, - nCores = cores + nCores = cores, + Rs = r ) { user_args = as.list(match.call())[-1] diff --git a/R/utilities.R b/R/utilities.R index ecdc446..5659c76 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -191,6 +191,7 @@ argumentChecks = function(function_name, user_vals) { handle_deprecated("spatialCoordCols", "spatialCoords", user_vals) handle_deprecated("nCores", "cores", user_vals) handle_deprecated("BPPARAM", "cores", user_vals) + handle_deprecated("Rs", "r", user_vals) # enforce mutually exclusive arguments check_exclusive = function(arg_set, user_vals) { @@ -204,6 +205,7 @@ argumentChecks = function(function_name, user_vals) { check_exclusive(c("imageIDCol", "imageID"), user_vals) check_exclusive(c("spatialCoordCols", "spatialCoords"), user_vals) check_exclusive(c("cores", "nCores", "BPPARAM"), user_vals) + check_exclusive(c("Rs", "r"), user_vals) # validity checks for cores/nCores/BPPARAM if ("nCores" %in% names(user_vals)) { diff --git a/man/getPairwise.Rd b/man/getPairwise.Rd index dbe23fe..9d440ff 100644 --- a/man/getPairwise.Rd +++ b/man/getPairwise.Rd @@ -9,7 +9,7 @@ getPairwise( imageID = "imageID", cellType = "cellType", spatialCoords = c("x", "y"), - Rs = NULL, + r = NULL, sigma = NULL, from = NULL, to = NULL, @@ -23,7 +23,8 @@ getPairwise( imageIDCol = imageID, cellTypeCol = cellType, spatialCoordCols = spatialCoords, - nCores = cores + nCores = cores, + Rs = r ) } \arguments{ @@ -37,7 +38,7 @@ cellType.} \item{spatialCoords}{The names of the spatialCoords column if using a SingleCellExperiment.} -\item{Rs}{A vector of the radii that the measures of association should be calculated over.} +\item{r}{A vector of the radii that the measures of association should be calculated over.} \item{sigma}{A numeric variable used for scaling when fitting inhomogenous L-curves.} @@ -65,7 +66,9 @@ cellType.} \item{spatialCoordCols}{\{DEPRECATED\} The names of the spatialCoords column if using a SingleCellExperiment.} -\item{nCores}{\{DEPRECATED\} Number of cores to use for parallel processing or a BiocParallel MulticoreParam or SerialParam object. +\item{nCores}{\{DEPRECATED\} Number of cores to use for parallel processing or a BiocParallel MulticoreParam or SerialParam object.} + +\item{Rs}{\{DEPRECATED\} A vector of the radii that the measures of association should be calculated over. calculation.} } \value{ diff --git a/man/spicy.Rd b/man/spicy.Rd index 067b123..b572e5e 100644 --- a/man/spicy.Rd +++ b/man/spicy.Rd @@ -16,7 +16,7 @@ spicy( imageID = "imageID", cellType = "cellType", spatialCoords = c("x", "y"), - Rs = NULL, + r = NULL, sigma = NULL, from = NULL, to = NULL, @@ -36,6 +36,7 @@ spicy( cellTypeCol = cellType, spatialCoordCols = spatialCoords, nCores = cores, + Rs = r, ... ) } @@ -57,7 +58,7 @@ mixed effects model as fixed effects.} \item{spatialCoords}{The names of the spatialCoords column if using a SingleCellExperiment.} -\item{Rs}{A vector of the radii that the measures of association should be calculated over.} +\item{r}{A vector of the radii that the measures of association should be calculated over.} \item{sigma}{A numeric variable used for scaling when fitting inhomogenous L-curves.} @@ -99,6 +100,8 @@ pair.} \item{nCores}{\{DEPRECATED\} Number of cores to use for parallel processing or a BiocParallel MulticoreParam or SerialParam object.} +\item{Rs}{\{DEPRECATED\} A vector of the radii that the measures of association should be calculated over.} + \item{...}{Other options} } \value{