Skip to content

Commit

Permalink
deprecate read10xVisium in favor of VisiumIO functions
Browse files Browse the repository at this point in the history
  • Loading branch information
CATALYST-project committed Jun 21, 2024
1 parent f742269 commit a996f8c
Show file tree
Hide file tree
Showing 26 changed files with 80 additions and 77 deletions.
2 changes: 1 addition & 1 deletion R/SpatialExperiment-colData.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' @return a \code{\link{SpatialExperiment}} object with updated \code{colData}
#'
#' @examples
#' example(read10xVisium)
#' example("SpatialExperiment-methods")
#'
#' # empty replacement retains sample identifiers
#' colData(spe) <- NULL
Expand Down
2 changes: 1 addition & 1 deletion R/SpatialExperiment-combine.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#' Dario Righelli
#'
#' @examples
#' example(read10xVisium, echo = FALSE)
#' example(SpatialExperiment)
#'
#' # merging with duplicated 'sample_id's
#' # will automatically assign unique identifiers
Expand Down
2 changes: 1 addition & 1 deletion R/SpatialExperiment-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#' @return Return value varies depending on method, as described below.
#'
#' @examples
#' example(read10xVisium)
#' example(SpatialExperiment)
#'
#' # spatialCoords returns a numeric matrix
#' head(spatialCoords(spe))
Expand Down
2 changes: 1 addition & 1 deletion R/SpatialExperiment-rotate-mirror.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#' @author Nicholas J. Eagles
#'
#' @examples
#' example(read10xVisium)
#' example(SpatialExperiment)
#'
#' # rotateCoords(), mirrorCoords(), rotateObject(), and mirrorObject() return a
#' # SpatialExperiment, potentially subsetted by sample.
Expand Down
22 changes: 14 additions & 8 deletions R/SpatialExperiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
#' To combine multiple samples within a single object, see
#' \code{\link{combine}}.
#'
#' For 10x Genomics Visium datasets, the function \code{\link{read10xVisium}}
#' can be used to load data and create a \code{SpatialExperiment} object
#' directly from Space Ranger output files.
#' For 10x Genomics Visium datasets, the \code{\link[VisiumIO]{TENxVisiumList}}
#' and \code{\link[VisiumIO]{import}} functions can be used to load data into
#' a \code{SpatialExperiment} object directly from Space Ranger output files.
#'
#' @seealso
#' \code{?"\link{SpatialExperiment-methods}"}, which includes:
Expand All @@ -111,8 +111,6 @@
#'
#' \code{\link{SpatialImage}}
#'
#' \code{\link{read10xVisium}}
#'
#' @author Dario Righelli and Helena L. Crowell
#'
#' @return A \code{SpatialExperiment} object.
Expand Down Expand Up @@ -156,11 +154,19 @@
#' sample_id = "foo"))
#'
#' #############################################################
#' # Example 2: Spot-based ST (10x Visium) using 'read10xVisium'
#' # Example 2: Spot-based ST (10x Visium) using 'VisiumIO'
#' #############################################################
#'
#' # see ?read10xVisium for details
#' example(read10xVisium)
#' library(VisiumIO)
#' dir <- list.dirs(system.file(
#' file.path("extdata", "10xVisium"),
#' package = "SpatialExperiment"),
#' recursive = FALSE, full.names = TRUE)
#' (spe <- import(TENxVisiumList(
#' sampleFolders = dir,
#' sample_ids = basename(dir),
#' processing = "raw",
#' images = "lowres")))
#'
#' ##############################
#' # Example 3: Molecule-based ST
Expand Down
2 changes: 1 addition & 1 deletion R/imgData-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#' with modified a \code{raster} matrix.
#'
#' @examples
#' example(read10xVisium)
#' example(SpatialExperiment)
#'
#' # 'SpatialImage' accession
#' (spi <- getImg(spe))
Expand Down
2 changes: 2 additions & 0 deletions R/read10xVisium.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ read10xVisium <- function(samples="",
images="lowres",
load=TRUE) {

.Deprecated("VisiumIO::TENxVisium(List)")

# check if DropletUtils is installed
if (!requireNamespace("DropletUtils", quietly = TRUE)) {
warning("DropletUtils package must be installed to use read10xVisium()")
Expand Down
2 changes: 1 addition & 1 deletion R/show.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @author Dario Righelli and Helena L. Crowell
#'
#' @examples
#' example(read10xVisium)
#' example(SpatialExperiment)
#' spe
NULL

Expand Down
2 changes: 1 addition & 1 deletion R/subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @return a \code{\link{SpatialExperiment}} object
#'
#' @examples
#' example(read10xVisium)
#' example(SpatialExperiment)
#'
#' dim(spe)
#'
Expand Down
4 changes: 2 additions & 2 deletions man/SpatialExperiment-colData.Rd

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

2 changes: 1 addition & 1 deletion man/SpatialExperiment-combine.Rd

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

12 changes: 6 additions & 6 deletions man/SpatialExperiment-methods.Rd

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

2 changes: 1 addition & 1 deletion man/SpatialExperiment-misc.Rd

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

2 changes: 1 addition & 1 deletion man/SpatialExperiment-rotate-mirror.Rd

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

2 changes: 1 addition & 1 deletion man/SpatialExperiment-subset.Rd

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

22 changes: 14 additions & 8 deletions man/SpatialExperiment.Rd

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

2 changes: 1 addition & 1 deletion man/imgData-methods.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test_SpatialExperiment-assays.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("molecules()/<- gets/sets assay(., 'molecules')", {
tmp <- spe
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_SpatialExperiment-cbind.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("duplicated sample_ids are made unique with a message", {
expect_message(new <- cbind(spe, spe))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_SpatialExperiment-colData.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("colData()<-NULL retains only sample_id", {
tmp <- spe
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_SpatialExperiment-methods.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("spatialData()", {
spd <- spatialData(spe)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_SpatialExperiment-rotate-mirror.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("rotateCoords, non-null sample_id", {
# Subset followed by identity rotation should be equivalent to simply
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_SpatialExperiment-subset.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("missing i/j retains all", {
expect_identical(spe, spe[, ])
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_SpatialExperiment.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("empty constructor", {
spe <- SpatialExperiment()
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_imgData-methods.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
example(read10xVisium, echo = FALSE)
example(SpatialExperiment, echo = FALSE)

test_that("getImg/imgRaster/Source w/o imgData return NULL", {
x <- spe
Expand Down
Loading

0 comments on commit a996f8c

Please sign in to comment.