diff --git a/DESCRIPTION b/DESCRIPTION index d6e6d6c..9eba89c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,7 +5,7 @@ Date: 2024-11-08 Authors@R: c( person("Michael", "Totty", ,"mictott@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9292-8556")), - person("Stephanie", "Hicks", ,email = "shicks19@jhu.edu", role = c("aut"), + person("Stephanie", "Hicks", ,email = "shicks19@jhu.edu", role = c("aut"), comment = c(ORCID = "0000-0002-7858-0231")), person("Boyi", "Guo", ,email = "boyi.guo.work@gmail.com", role = c("aut"), comment = c(ORCID = "0000-0003-2950-2349"))) diff --git a/NEWS.md b/NEWS.md index 47510d1..492d5fb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,9 +13,6 @@ - **Parallelization**: Added a `workers` argument for parallel processing using `BiocParallel` in both `localOutlier` and `localVariance` functions. This allows for faster computation, particularly on larger datasets. -- **`neighborhood` Argument**: Introduced a new `neighborhood` parameter to the `localOutlier` function to support neighborhoods beyond spatial coordinates. Users can now specify alternative neighborhood matrices, such as reduced dimensions from PCA or UMAP, enabling local outlier detection in non-spatial datasets such as snRNA-seq. - - ### Deprecations - **`plotQC` Function Deprecated**: The `plotQC` function is now deprecated. While it remains available for backward compatibility, users are encouraged to transition to `plotQCmetrics`. Calling `plotQC` will display a warning, reminding users of the deprecation. diff --git a/R/localOutliers.R b/R/localOutliers.R index b72b23c..30016ad 100644 --- a/R/localOutliers.R +++ b/R/localOutliers.R @@ -14,7 +14,6 @@ #' @param log Logical indicating whether to log1p transform the features #' (default is TRUE) #' @param cutoff Cutoff for outlier detection (default is 3) -#' @param neighborhood Matrix of spatial coordinates for neighborhood calculation #' @param workers Number of workers for parallel processing (default is 1) #' #' @return SpatialExperiment or SingleCellExperiment object with updated colData containing outputs @@ -51,15 +50,13 @@ #' spe <- localOutliers(spe, #' metric = "sum", #' direction = "lower", -#' log = TRUE, -#' neighborhood = spatialCoords(spe) +#' log = TRUE #' ) #' localOutliers <- function( spe, metric = "detected", direction = "lower", n_neighbors = 36, samples = "sample_id", - log = TRUE, cutoff = 3, neighborhood = spatialCoords(spe_subset), - workers=1) { + log = TRUE, cutoff = 3, workers=1) { # ===== Validity checks ===== # Check if 'spe' is a valid object with required components @@ -109,7 +106,7 @@ localOutliers <- function( columnData <- colData(spe_subset) # Find nearest neighbors - dnn <- BiocNeighbors::findKNN(neighborhood, + dnn <- BiocNeighbors::findKNN(spatialCoords(spe_subset), k = n_neighbors, warn.ties = FALSE, BPPARAM = BiocParallel::MulticoreParam(workers=workers))$index