Skip to content

Commit d1612ca

Browse files
committed
R CMD check notes on documentation links
1 parent 9146938 commit d1612ca

36 files changed

+72
-66
lines changed

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ importFrom(SingleCellExperiment,reducedDimNames)
274274
importFrom(SingleCellExperiment,reducedDims)
275275
importFrom(SpatialExperiment,"imgData<-")
276276
importFrom(SpatialExperiment,"spatialCoords<-")
277+
importFrom(SpatialExperiment,"spatialCoordsNames<-")
277278
importFrom(SpatialExperiment,SpatialExperiment)
278279
importFrom(SpatialExperiment,addImg)
279280
importFrom(SpatialExperiment,getImg)
@@ -293,6 +294,7 @@ importFrom(SummarizedExperiment,assayNames)
293294
importFrom(SummarizedExperiment,assays)
294295
importFrom(SummarizedExperiment,colData)
295296
importFrom(SummarizedExperiment,rowData)
297+
importFrom(data.table,":=")
296298
importFrom(data.table,as.data.table)
297299
importFrom(data.table,fread)
298300
importFrom(data.table,is.data.table)
@@ -399,4 +401,5 @@ importFrom(utils,getFromNamespace)
399401
importFrom(utils,head)
400402
importFrom(utils,packageVersion)
401403
importFrom(utils,read.csv)
404+
importFrom(utils,tail)
402405
importFrom(zeallot,"%<-%")

R/SFE-class.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' The SpatialFeatureExperiment class
22
#'
3-
#' This class inherits from the \code{\link{SpatialExperiment}} (SPE) class,
4-
#' which in turn inherits from \code{\link{SingleCellExperiment}} (SCE).
3+
#' This class inherits from the \code{\link[SpatialExperiment]{SpatialExperiment}} (SPE) class,
4+
#' which in turn inherits from \code{\link[SingleCellExperiment]{SingleCellExperiment}} (SCE).
55
#' \code{SpatialFeatureExperiment} stores geometries of spots or cells in
66
#' \code{sf} objects which form columns of a \code{DataFrame} which is in turn a
77
#' column of the \code{int_colData} \code{DataFrame} of the underlying SCE
@@ -72,10 +72,10 @@ setClass("SpatialFeatureExperiment", contains = "SpatialExperiment")
7272
#' \code{*Geometries} arguments have ordinary data frames, to identify the
7373
#' columns in the ordinary data frames that specify the spatial coordinates.
7474
#' If \code{colGeometries} is not specified, then this argument will behave as
75-
#' in \code{\link{SpatialExperiment}}, but \code{colGeometries} will be given
75+
#' in \code{\link[SpatialExperiment]{SpatialExperiment}}, but \code{colGeometries} will be given
7676
#' precedence if provided.
7777
#' @param spatialCoords A numeric matrix containing columns of spatial
78-
#' coordinates, as in \code{\link{SpatialExperiment}}. The coordinates are
78+
#' coordinates, as in \code{\link[SpatialExperiment]{SpatialExperiment}}. The coordinates are
7979
#' centroids of the entities represented by the columns of the gene count
8080
#' matrix. If \code{colGeometries} is also specified, then it will be given
8181
#' priority and a warning is issued. Otherwise, the \code{sf} representation
@@ -87,8 +87,8 @@ setClass("SpatialFeatureExperiment", contains = "SpatialExperiment")
8787
#' arguments. Ignored for geometries that are not POINT or MULTIPOINT.
8888
#' @param unit Unit the coordinates are in, either microns or pixels in full
8989
#' resolution image.
90-
#' @param ... Additional arguments passed to the \code{\link{SpatialExperiment}}
91-
#' and \code{\link{SingleCellExperiment}} constructors.
90+
#' @param ... Additional arguments passed to the \code{\link[SpatialExperiment]{SpatialExperiment}}
91+
#' and \code{\link[SingleCellExperiment]{SingleCellExperiment}} constructors.
9292
#' @return A SFE object. If neither \code{colGeometries} nor \code{spotDiameter}
9393
#' is specified, then a \code{colGeometry} called "centroids" will be made,
9494
#' which is essentially the spatial coordinates as sf POINTs. If

R/aggregate.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#' @importFrom data.table as.data.table
4343
#' @importFrom sf st_make_grid
4444
#' @importFrom rlang %||%
45+
#' @importFrom utils tail
4546
#' @concept Geometric operations
4647
#' @export
4748
aggregateTx <- function(file, df = NULL, by = NULL, sample_id = "sample01",
@@ -399,7 +400,7 @@ aggregateTxTech <- function(data_dir, df = NULL, by = NULL,
399400
#' @param rowGeometryName Which \code{rowGeometry} to spatially aggregate
400401
#' @param new_geometry_name Name to give to the new \code{colGeometry} in the
401402
#' output. Defaults to "bins".
402-
#' @param BPPARAM A \code{\link{BiocParallelParam}} object specifying parallel
403+
#' @param BPPARAM A \code{\link[BiocParallel]{BiocParallelParam}} object specifying parallel
403404
#' computing when aggregating data with functions other than sum and mean when
404405
#' aggregating cells. When aggregating transcript spots, this specifies
405406
#' parallel computing over genes. Defaults to \code{SerialParam()}.

R/featureData.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#' @param MARGIN Integer, 1 means rowGeometry, 2 means colGeometry, and 3 means
2121
#' annotGeometry. Defaults to 2, colGeometry.
2222
#' @param dimred Name of a dimension reduction, can be seen in
23-
#' \code{\link{reducedDimNames}}.
23+
#' \code{\link{[SingleCellExperiment]reducedDimNames}}.
2424
#' @concept Getters and setters
2525
#' @return A \code{DataFrame}.
2626
#' @seealso getParams
@@ -95,7 +95,7 @@ reducedDimFeatureData <- function(sfe, dimred) {
9595
#' \code{colGeometry} has precedence so this argument is ignored if
9696
#' \code{colGeometryName} is specified.
9797
#' @param reducedDimName Name of a dimension reduction, can be seen in
98-
#' \code{\link{reducedDimNames}}. \code{colGeometryName} and
98+
#' \code{\link[SingleCellExperiment]{reducedDimNames}}. \code{colGeometryName} and
9999
#' \code{annotGeometryName} have precedence over \code{reducedDimName}.
100100
#' @return A named list showing the parameters
101101
#' @concept Getters and setters

R/formatTxSpots.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ addSelectTx <- function(sfe, file, gene_select, sample_id = 1L,
265265
#' 3D geometries will always be constructed since there are no z-planes to
266266
#' speak of. This argument does not apply when `spatialCoordsNames` has length
267267
#' 2.
268-
#' @param BPPARAM \code{\link{BiocParallelParam}} object to specify
268+
#' @param BPPARAM \code{\link[BiocParallel]{BiocParallelParam}} object to specify
269269
#' multithreading to convert raw char in some parquet files to R objects. Not
270270
#' used otherwise.
271271
#' @param sample_id Which sample in the SFE object the transcript spots should

R/geometry_operation.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @param x An object of class \code{sf}, \code{sfc}, or \code{sfg}.
1212
#' @param y Another object of class \code{sf}, \code{sfc}, or \code{sfg}.
1313
#' @param pred A geometric binary predicate function, such as
14-
#' \code{\link{st_intersects}}. It should return an object of class
14+
#' \code{\link[sf]{st_intersects}}. It should return an object of class
1515
#' \code{sgbp}, for sparse predicates.
1616
#' @param yx Whether to do \code{pred(y, x)} instead of \code{pred(x, y)}. For
1717
#' symmetric predicates, the results should be the same. When x has a large
@@ -172,7 +172,7 @@ st_n_intersects <- function(x, y) st_n_pred(x, y, st_intersects)
172172
#' @param sample_id Which sample(s) to operate on. Can be "all" to indicate all
173173
#' samples.
174174
#' @param pred Predicate function to use, defaults to
175-
#' \code{\link{st_intersects}}.
175+
#' \code{\link[sf]{st_intersects}}.
176176
#' @return For \code{annotPred}, a logical vector of the same length as the
177177
#' number of columns in the sample(s) of interest, with barcodes (or
178178
#' corresponding column names of sfe) as names. For \code{annotNPred}, a
@@ -224,7 +224,7 @@ annotNPred <- function(sfe, colGeometryName = 1L, annotGeometryName = 1L,
224224
#'
225225
#' @inheritParams annotPred
226226
#' @param op A binary operation function for the geometries. Defaults to
227-
#' \code{\link{st_intersection}}.
227+
#' \code{\link[sf]{st_intersection}}.
228228
#' @return A \code{sf} data frame with \code{geometry} column containing the
229229
#' geometries and corresponding column names of sfe as row names. There is no
230230
#' guarantee that the returned geometries are valid or preserve the geometry
@@ -386,7 +386,7 @@ annotSummary <- function(sfe, colGeometryName = 1L, annotGeometryName = 1L,
386386
#' indicated in \code{y}, then the same geometry or bounding box is used to
387387
#' subset all samples specified in the \code{sample_id} argument.
388388
#' @param op A geometric operation function to crop the geometries in the SFE
389-
#' object. Only \code{\link{st_intersection}} and \code{\link{st_difference}}
389+
#' object. Only \code{\link[sf]{st_intersection}} and \code{\link[sf]{st_difference}}
390390
#' are allowed. If "intersection", then only things inside \code{y} is kept
391391
#' after cropping. If "difference", then only things outside \code{y} is kept.
392392
#' @param keep_whole Character vector, can be one or more of "col" and "annot"

R/graph_wrappers.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
#' \code{listw} is used in many methods that facilitate the spatial neighborhood
423423
#' graph in the \code{spdep}, \code{spatialreg}, and \code{adespatial}. The edge
424424
#' weights of the graph in the \code{listw} object are by default style W (see
425-
#' \code{\link{nb2listw}}) and the unweighted neighbor list is in the
425+
#' \code{\link[spdep]{nb2listw}}) and the unweighted neighbor list is in the
426426
#' \code{neighbours} field of the \code{listw} object.
427427
#'
428428
#' @inheritParams spdep::nb2listw
@@ -448,13 +448,13 @@
448448
#' \code{BiocNeighbors} are used. For "spdep", methods from the \code{spdep}
449449
#' package are used. The "bioc" option is more scalable to larger datasets and
450450
#' supports multithreading.
451-
#' @param BPPARAM A \code{\link{BiocParallelParam}} object for multithreading.
451+
#' @param BPPARAM A \code{\link[BiocParallel]{BiocParallelParam}} object for multithreading.
452452
#' Only used for k nearest neighbor and distance based neighbor with
453453
#' \code{nn_method = "bioc"}.
454-
#' @param BNPARAM A \code{\link{BiocNeighborParam}} object specifying the
454+
#' @param BNPARAM A \code{\link[BiocNeighbors]{BiocNeighborParam}} object specifying the
455455
#' algorithm to find k nearest neighbors and distance based neighbors with
456456
#' \code{nn_method = "bioc"}. For distance based neighbors, only
457-
#' \code{\link{KmknnParam}} and \code{\link{VptreeParam}} are applicable.
457+
#' \code{\link[BiocNeighbors]{KmknnParam}} and \code{\link[BiocNeighbors]{VptreeParam}} are applicable.
458458
#' @param alpha Only relevant when \code{dist_type = "dpd"}.
459459
#' @param dmax Only relevant when \code{dist_type = "dpd"}.
460460
#' @param ... Extra arguments passed to the \code{spdep} function stated in the

R/image.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ setMethod("NCOL", "AlignedSpatialImage", function(x) 1L)
1111
#' \code{SpatialFeatureExperiment} and the \code{Voyager} package work with
1212
#' images differently from \code{SpatialExperiment}. In SFE and
1313
#' \code{Voyager}'s, plotting functions for SFE objects, the images can be read
14-
#' with \code{\link{rast}} and represented as \code{SpatRaster}, so the image is
14+
#' with \code{\link[terra]{rast}} and represented as \code{SpatRaster}, so the image is
1515
#' not entirely loaded into memory unless necessary. Plotting will not load a
1616
#' large image into memory; rather the image will be downsampled and the
1717
#' downsampled version is plotted. A \code{SpatRasterImage} object (as of Bioc
1818
#' 3.19 or SFE version 1.6 and above) is a \code{SpatRaster} object but also
1919
#' inheriting from \code{VirtualSpatialImage} as required by
2020
#' \code{SpatialExperiment}.
2121
#'
22-
#' @param img A \code{\link{SpatRaster}} or \code{PackedSpatRaster} object.
22+
#' @param img A \code{\link[terra]{SpatRaster}} or \code{PackedSpatRaster} object.
2323
#' @param object A \code{SpatRasterImage} object.
2424
#' @return A \code{SpatRasterImage} object.
2525
#' @importClassesFrom SpatialExperiment VirtualSpatialImage
@@ -87,7 +87,7 @@ setMethod("showAsCell", "SpatRasterImage", function(object) {
8787
#' that can be read with \code{BioFormats}. The image is not loaded into memory,
8888
#' and when it is, the the \code{BioFormatsImage} object is converted into
8989
#' \code{\link{ExtImage}} because the loaded image is of a class that inherits
90-
#' from \code{\link{Image}}. The \code{\link{ExtImage}} class is a thin wrapper
90+
#' from \code{\link[EBImage]{Image}}. The \code{\link{ExtImage}} class is a thin wrapper
9191
#' inheriting from \code{VirtualSpatialImage} so it's compatible with
9292
#' \code{SpatialExperiment} from which SFE is derived. This class might
9393
#' drastically change as it matures, say to accommodate other formats supported
@@ -308,7 +308,7 @@ setReplaceMethod("transformation", "BioFormatsImage", function(x, value) {
308308

309309
#' Use the EBImage \code{Image} class in SFE objects
310310
#'
311-
#' This is a thin wrapper around the \code{\link{Image}} class in the
311+
#' This is a thin wrapper around the \code{\link[EBImage]{Image}} class in the
312312
#' \code{EBImage} package so it inherits from \code{VirtualSpatialImage} to be
313313
#' compatible with \code{SpatialExperiment} from which SFE inherits. An
314314
#' \code{ext} field is added to specify the spatial extent of the image in
@@ -701,7 +701,7 @@ setMethod("dim", "ExtImage", function(x) {
701701
#' Image setter
702702
#'
703703
#' Modify or replace images stored in a \code{SpatialExperiment} object. This is
704-
#' different from \code{\link{addImg}} which adds the image from files and can't
704+
#' different from \code{\link[SpatialExperiment]{addImg}} which adds the image from files and can't
705705
#' replace existing images, which is there to be consistent with
706706
#' \code{SpatialExperiment}. This setter here can replace existing images with
707707
#' another object that inherits from \code{VirtualSpatialImage}, including

R/read.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#' @importFrom rjson fromJSON
3939
#' @importFrom SummarizedExperiment rowData<-
4040
#' @importFrom utils read.csv
41+
#' @importFrom SpatialExperiment spatialCoordsNames<-
4142
#' @concept Read data into SFE
4243
#' @importFrom DropletUtils read10xCounts
4344
#' @note It is assumed that the images have not been cropped. Otherwise the
@@ -418,6 +419,7 @@ readVisiumHD <- function(data_dir, bin_size = c(2L, 8L, 16L),
418419
#' @importFrom sf st_is_empty st_drop_geometry
419420
#' @importFrom BiocParallel bplapply
420421
#' @importFrom utils head
422+
#' @importFrom data.table :=
421423
.filter_polygons <- function(polys, min_area,
422424
is_Xenium = FALSE, # indicate if input tech is Xenium or not
423425
BPPARAM = SerialParam()) {
@@ -651,7 +653,7 @@ readVisiumHD <- function(data_dir, bin_size = c(2L, 8L, 16L),
651653
#' The coordinates are in microns. Cell centroids are read into
652654
#' \code{\link{colGeometry}} "centroids", and cell segmentations are read into
653655
#' \code{colGeometry} "cellSeg". The image(s) (polyT, DAPI, and cell boundaries)
654-
#' are also read as \code{\link{SpatRaster}} objects so they are not loaded into
656+
#' are also read as \code{\link[terra]{SpatRaster}} objects so they are not loaded into
655657
#' memory unless necessary. Because the image's origin is the top left while the
656658
#' geometry's origin is bottom left, either the image or the geometry needs to
657659
#' be flipped. Because the image accompanying MERFISH datasets are usually very
@@ -688,11 +690,11 @@ readVisiumHD <- function(data_dir, bin_size = c(2L, 8L, 16L),
688690
#' @param use_cellpose Whether to read the parquet files from CellPose cell
689691
#' segmentation. If \code{FALSE}, cell segmentation will be read from the HDF5
690692
#' files. Note that reading HDF5 files for numerous FOVs is very slow.
691-
#' @param BPPARAM A \code{\link{BiocParallelParam}} object specifying parallel
693+
#' @param BPPARAM A \code{\link[BiocParallel]{BiocParallelParam}} object specifying parallel
692694
#' processing backend and number of threads to use for parallelizable tasks:
693695
#' \enumerate{ \item To load cell segmentation from HDF5 files from different
694696
#' fields of view (FOVs) with multiple cores. A progress bar can be configured
695-
#' in the \code{\link{BiocParallelParam}} object. When there are numerous
697+
#' in the \code{\link[BiocParallel]{BiocParallelParam}} object. When there are numerous
696698
#' FOVs, reading in the geometries can be time consuming, so we recommend
697699
#' using a server and larger number of threads. This argument is not used if
698700
#' \code{use_cellpose = TRUE} and the parquet file is present.

R/saveRDS.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Save SpatialFeatureExperiment as RDS file
22
#'
33
#' Saving SFE objects as RDS files is complicated by the \code{SpatRaster} class
4-
#' of the images. If present, the images need to be wrapped with the \code{\link{wrap}}
4+
#' of the images. If present, the images need to be wrapped with the \code{\link[terra]{wrap}}
55
#' function in \code{terra} before serializing the SFE object. Otherwise the
66
#' images will be invalid pointers when the RDS is reloaded. If the image does
77
#' not fit in memory and its file source is unknown, then it will be written to

0 commit comments

Comments
 (0)