Skip to content

Commit

Permalink
Merge pull request #140 from lmweber/DropletUtils_dependencies
Browse files Browse the repository at this point in the history
Move DropletUtils to Suggests to reduce dependencies
  • Loading branch information
drighelli authored Sep 2, 2023
2 parents 538b9b5 + 027c934 commit bb81804
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: SpatialExperiment
Version: 1.11.1
Version: 1.11.2
Title: S4 Class for Spatially Resolved -omics Data
Description: Defines an S4 class for storing data from spatial -omics experiments.
The class extends SingleCellExperiment to
Expand Down Expand Up @@ -41,14 +41,14 @@ Imports:
utils,
S4Vectors,
SummarizedExperiment,
DropletUtils,
BiocGenerics,
BiocFileCache
Suggests:
knitr,
rmarkdown,
testthat,
BiocStyle,
BumpyMatrix
BumpyMatrix,
DropletUtils
VignetteBuilder: knitr
RoxygenNote: 7.2.3
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ exportMethods(spatialDataNames)
importClassesFrom(S4Vectors,Annotated)
importFrom(BiocGenerics,cbind)
importFrom(BiocGenerics,rbind)
importFrom(DropletUtils,read10xCounts)
importFrom(S4Vectors,DataFrame)
importFrom(S4Vectors,coolcat)
importFrom(S4Vectors,isEmpty)
Expand Down
10 changes: 7 additions & 3 deletions R/read10xVisium.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' ignored if \code{!is.null(names(samples))}
#' @param type character string specifying
#' the type of format to read count data from
#' (see \code{\link{read10xCounts}})
#' (see \code{read10xCounts})
#' @param data character string specifying whether to read in
#' filtered (spots mapped to tissue) or raw data (all spots).
#' @param images character vector specifying which images to include.
Expand Down Expand Up @@ -81,7 +81,6 @@
#' imgData(spe)
#'
#' @importFrom rjson fromJSON
#' @importFrom DropletUtils read10xCounts
#' @importFrom methods as
#' @importFrom S4Vectors DataFrame
#' @importFrom SummarizedExperiment assays rowData
Expand All @@ -93,6 +92,11 @@ read10xVisium <- function(samples="",
images="lowres",
load=TRUE) {

# check if DropletUtils is installed
if (!requireNamespace("DropletUtils", quietly = TRUE)) {
warning("DropletUtils package must be installed to use read10xVisium()")
}

# check validity of input arguments
type <- match.arg(type)
data <- match.arg(data)
Expand Down Expand Up @@ -160,7 +164,7 @@ read10xVisium <- function(samples="",
# read spatial coordinates
spel <- lapply(seq_along(counts), function(i) {
# read count data as 'SingleCellExperiment'
sce <- read10xCounts(
sce <- DropletUtils::read10xCounts(
samples=counts[i],
sample.names=sids[i],
col.names=TRUE)
Expand Down
3 changes: 3 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
changes in version 1.11.2 (2023-09-01)
+ move DropletUtils package to Suggests

changes in version 1.11.1 (2023-08-21)
+ add methods to rotate/mirror spatial coordinates and objects

Expand Down
2 changes: 1 addition & 1 deletion man/read10xVisium.Rd

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

0 comments on commit bb81804

Please sign in to comment.