Skip to content

Commit 80353da

Browse files
committed
Get rid of R CMD check errors and warnings
1 parent e9b946a commit 80353da

22 files changed

+98
-49
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Imports:
4646
zeallot
4747
License: Artistic-2.0
4848
Encoding: UTF-8
49-
RoxygenNote: 7.3.2
49+
RoxygenNote: 7.3.3
5050
Collate:
5151
'AllGenerics.R'
5252
'utils.R'
@@ -98,6 +98,7 @@ Suggests:
9898
sparseMatrixStats,
9999
testthat (>= 3.0.0),
100100
tidyr,
101+
VisiumIO,
101102
Voyager (>= 1.7.2),
102103
withr,
103104
xml2

R/aggregate.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#' be loaded into memory. \code{\link[arrow]{open_dataset}} is used to open a
3333
#' link to the data and then transcript spots of one gene is loaded into
3434
#' memory at a time.
35-
#' @param pregressbar Logical, whether to show progress bar. This argument is
35+
#' @param progressbar Logical, whether to show progress bar. This argument is
3636
#' only used when \code{save_memory = TRUE} because otherwise the
3737
#' \code{progressbar} argument can be specified in \code{BPPARAM}.
3838
#' @param .orig_nrows Only used internally in the SFE method of \code{aggregate}

R/coerce.R

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,17 @@
111111
#' @aliases toSpatialFeatureExperiment
112112
#' @concept SpatialFeatureExperiment class
113113
#' @examples
114-
#' library(SpatialExperiment)
115-
#' example(read10xVisium)
114+
#' library(VisiumIO)
115+
#' # From examples of TENxVisium()
116+
#' sample_dir <- system.file(
117+
#' file.path("extdata", "10xVisium", "section1"),
118+
#' package = "VisiumIO"
119+
#' )
120+
#' ## using spacerangerOut folder
121+
#' tv <- TENxVisium(
122+
#' spacerangerOut = sample_dir, processing = "raw", images = "lowres"
123+
#' )
124+
#' spe <- import(tv)
116125
#' # There can't be duplicate barcodes
117126
#' colnames(spe) <- make.unique(colnames(spe), sep = "-")
118127
#' rownames(spatialCoords(spe)) <- colnames(spe)

R/dimGeometries.R

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,17 @@ txSpots <- function(x, sample_id = 1L, withDimnames = TRUE) {
617617
#' @concept Geometric operations
618618
#' @export
619619
#' @examples
620-
#' library(SpatialExperiment)
621-
#' example(read10xVisium)
620+
#' library(VisiumIO)
621+
#' # From examples of TENxVisium()
622+
#' sample_dir <- system.file(
623+
#' file.path("extdata", "10xVisium", "section1"),
624+
#' package = "VisiumIO"
625+
#' )
626+
#' ## using spacerangerOut folder
627+
#' tv <- TENxVisium(
628+
#' spacerangerOut = sample_dir, processing = "raw", images = "lowres"
629+
#' )
630+
#' spe <- import(tv)
622631
#' # There can't be suplicate barcodes
623632
#' colnames(spe) <- make.unique(colnames(spe), sep = "-")
624633
#' rownames(spatialCoords(spe)) <- colnames(spe)

R/graph_wrappers.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@
483483
#' @concept Spatial neighborhood graph
484484
#' @export
485485
#' @name findSpatialNeighbors
486+
#' @aliases findSpatialNeighbors,SpatialFeatureExperiment-method
486487
#' @examples
487488
#' library(SFEData)
488489
#' sfe <- McKellarMuscleData(dataset = "small")

R/read.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#' unit. If using microns, then spacing between spots in pixels will be used
2323
#' to convert the coordinates into microns, as the spacing is known to be 100
2424
#' microns. This is used to plot scale bar.
25-
#' @param load Deprecated. Not used, kept for backward compatibility for now.
2625
#' @param flip Whether to flip the geometries or the images, because in
2726
#' \code{sf} and \code{terra}, the geometries use the Cartesian coordinates
2827
#' greater y coordinates going up, while in images, greater y values go down.
@@ -53,8 +52,7 @@
5352
#' list.files(samples[1])
5453
#' list.files(file.path(samples[1], "spatial"))
5554
#' (sfe <- read10xVisiumSFE(dirs = samples, sample_id = sample_ids,
56-
#' type = "sparse", data = "filtered",
57-
#' load = FALSE
55+
#' type = "sparse", data = "filtered"
5856
#' ))
5957
#'
6058
read10xVisiumSFE <- function(samples = deprecated(),

R/saveRDS.R

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,17 @@ setMethod("saveRDS", "SpatialFeatureExperiment",
3030
warning("This object contains out of memory data that may
3131
break when the RDS file is moved.")
3232
}
33-
if (!nrow(imgData(object)))
34-
base::saveRDS(object, file = file, ascii = ascii,
35-
version = version, compress = compress,
36-
refhook = refhook)
37-
else {
33+
if (nrow(imgData(object))) {
3834
for (i in seq_len(nrow(imgData(object)))) {
3935
img <- int_metadata(object)$imgData$data[[i]]
4036
if (inherits(img, "SpatRasterImage"))
4137
img <- new("PackedRasterImage", wrap(img))
4238
int_metadata(object)$imgData$data[[i]] <- img
4339
}
44-
base::saveRDS(object, file = file, ascii = ascii,
45-
version = version, compress = compress,
46-
refhook = refhook)
4740
}
41+
base::saveRDS(object, file = file, ascii = ascii,
42+
version = version, compress = compress,
43+
refhook = refhook)
4844
})
4945
# From terra
5046
setMethod("readRDS", signature(file="character"),

R/tissue_boundary.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#'
5757
#' @param sfe An SFE object with images
5858
#' @param sample_id Sample id(s) whose tissue boundaries are to be found.
59+
#' @param image_id ID of image to use to get boundary.
5960
#' @param image_type Character, either "brightfield" or "fluorescent"
6061
#' @param channel Channel to use for tissue segmentation. If \code{NULL} use
6162
#' average of all channels.
@@ -124,6 +125,8 @@ getTissueBoundaryImg <- function(sfe, sample_id = NULL, image_id = NULL,
124125
#'
125126
#' @inheritParams getTissueBoundaryImg
126127
#' @inheritParams sf::st_concave_hull
128+
#' @param colGeometryName Name of the \code{colGeometry} to use to infer the
129+
#' concave hull.
127130
#' @return A \code{sf} data frame with columns \code{sample_id} and
128131
#' \code{geometry}.
129132
#' @export

man/SpatialFeatureExperiment-coercion.Rd

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/addVisiumSpotPoly.Rd

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)