Skip to content

Commit cd7aeb2

Browse files
HelenaLCBisaloo
andauthored
SpatialData -> spatialdataR (#29)
Co-authored-by: Hugo Gruson <git@hugogruson.fr>
1 parent 9324e77 commit cd7aeb2

17 files changed

Lines changed: 37 additions & 54 deletions

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: SpatialData.plot
22
Title: SpatialData visualization
3-
Depends: R (>= 4.6), SpatialData
3+
Depends: R (>= 4.6), spatialdataR
44
Version: 0.99.6
5-
Description: Visualization suit for 'SpatialData' (R). Current functionality
5+
Description: Visualization suit for 'spatialdataR'. Current functionality
66
includes handling of multiscale 'images', visualizing 'labels', 'points',
77
and 'shapes'. For the latter, POINT, POLYGON, and MULTIPOLYGON geometries
88
are supported. For all but 'images', there is support to pass information
@@ -49,7 +49,7 @@ Suggests:
4949
testthat,
5050
vdiffr
5151
Remotes:
52-
HelenaLC/SpatialData,
52+
HelenaLC/spatialdataR,
5353
HelenaLC/SpatialData.data
5454
biocViews:
5555
Spatial,

NAMESPACE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ exportMethods(plotImage)
55
exportMethods(plotLabel)
66
exportMethods(plotPoint)
77
exportMethods(plotShape)
8-
import(SpatialData)
8+
import(spatialdataR)
99
importFrom(DelayedArray,realize)
1010
importFrom(MatrixGenerics,rowQuantiles)
1111
importFrom(S4Vectors,metadata)
1212
importFrom(SingleCellExperiment,colData)
1313
importFrom(SingleCellExperiment,int_colData)
1414
importFrom(SingleCellExperiment,int_metadata)
15-
importFrom(SpatialData,channels)
16-
importFrom(SpatialData,data_type)
17-
importFrom(SpatialData,transform)
1815
importFrom(ggforce,geom_circle)
1916
importFrom(ggplot2,aes)
2017
importFrom(ggplot2,annotation_raster)
@@ -49,4 +46,7 @@ importFrom(sf,st_as_sf)
4946
importFrom(sf,st_buffer)
5047
importFrom(sf,st_coordinates)
5148
importFrom(sf,st_geometry_type)
49+
importFrom(spatialdataR,channels)
50+
importFrom(spatialdataR,data_type)
51+
importFrom(spatialdataR,transform)
5252
importFrom(utils,tail)

R/data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
#'
99
#' @examples
1010
#' x <- file.path("extdata", "blobs.zarr")
11-
#' x <- system.file(x, package="SpatialData")
11+
#' x <- system.file(x, package="spatialdataR")
1212
#' (x <- readSpatialData(x))
1313
NULL

R/plotFrame.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#'
1111
#' @examples
1212
#' x <- file.path("extdata", "blobs.zarr")
13-
#' x <- system.file(x, package="SpatialData")
13+
#' x <- system.file(x, package="spatialdataR")
1414
#' x <- readSpatialData(x)
1515
#'
1616
#' # shapes
@@ -36,7 +36,7 @@ NULL
3636

3737
#' @importFrom sf st_as_sf st_coordinates st_geometry_type st_buffer
3838
#' @importFrom ggplot2 aes theme scale_type geom_sf coord_sf
39-
#' @importFrom SpatialData transform
39+
#' @importFrom spatialdataR transform
4040
#' @importFrom ggforce geom_circle
4141
#' @importFrom methods is
4242
#' @importFrom utils tail
@@ -93,14 +93,14 @@ NULL
9393
setMethod("plotShape", "SpatialData", \(x, i=1, j=1, assay=1, ...) {
9494
if (is.numeric(i)) i <- shapeNames(x)[i]
9595
y <- shape(x, i)
96-
y <- SpatialData::transform(y, j)
96+
y <- spatialdataR::transform(y, j)
9797
.plot(x, y, assay=assay, i=i, ...)
9898
})
9999
#' @export
100100
#' @rdname plotFrame
101101
setMethod("plotPoint", "SpatialData", \(x, i=1, j=1, ...) {
102102
if (is.numeric(i)) i <- pointNames(x)[i]
103103
y <- point(x, i)
104-
y <- SpatialData::transform(y, j)
104+
y <- spatialdataR::transform(y, j)
105105
.plot(x, y, i=i, ...)
106106
})

R/plotImage.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#'
2424
#' @examples
2525
#' x <- file.path("extdata", "blobs.zarr")
26-
#' x <- system.file(x, package="SpatialData")
26+
#' x <- system.file(x, package="spatialdataR")
2727
#' x <- readSpatialData(x, tables=FALSE)
2828
#'
2929
#' ms <- lapply(seq(3), \(.)
@@ -39,7 +39,7 @@
3939
#' cl <- rep(list(c(0, 1/3)), 3)
4040
#' plotSpatialData() + plotImage(x, k=1, c=cmy, cl=cl)
4141
#'
42-
#' @import SpatialData
42+
#' @import spatialdataR
4343
NULL
4444

4545
.check_cl <- \(cl, d) {
@@ -139,7 +139,7 @@ NULL
139139
}
140140

141141
# check if channels are indices or channel names
142-
#' @importFrom SpatialData channels
142+
#' @importFrom spatialdataR channels
143143
#' @noRd
144144
.ch_idx <- \(x, ch) {
145145
if (is.null(ch)) return(1)
@@ -158,15 +158,15 @@ NULL
158158

159159
#' @importFrom methods as
160160
#' @importFrom DelayedArray realize
161-
#' @importFrom SpatialData data_type
161+
#' @importFrom spatialdataR data_type
162162
.df_i <- \(x, k=NULL, ch=NULL, c=NULL, cl=NULL) {
163163
a <- .get_multiscale_data(x, k)
164164
a <- a[.ch_idx(x, ch),,,drop=FALSE]
165165
a <- .norm_ia(a, data_type(x))
166166
a <- .prep_ia(a, c, cl)
167167
}
168168

169-
#' @importFrom SpatialData transform
169+
#' @importFrom spatialdataR transform
170170
.get_wh <- \(x) {
171171
wh <- metadata(x)$wh
172172
if (!is.null(wh)) {

R/plotLabel.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' @param nan character string; color for missing values (hidden by default).
1919
#'
2020
#' @examples
21-
#' x <- system.file("extdata", "blobs.zarr", package="SpatialData")
21+
#' x <- system.file("extdata", "blobs.zarr", package="spatialdataR")
2222
#' x <- readSpatialData(x)
2323
#'
2424
#' i <- "blobs_labels"
@@ -75,7 +75,7 @@ setMethod("plotLabel", "SpatialData", \(x, i=1, j=1, k=NULL, c=NULL,
7575
t <- table(x, hasTable(x, i, name=TRUE))
7676
ik <- .instance_key(t)
7777
# TODO: search ik in both internal and regular colData for now
78-
# thus perhaps update, SpatialData::valTable instead
78+
# thus perhaps update, spatialdataR::valTable instead
7979
# idx <- match(df$z, int_colData(t)[[ik]])
8080
if(ik %in% names(int_colData(t))){
8181
coldata <- int_colData(t)[[ik]]

inst/tests/testthat.R

Lines changed: 0 additions & 17 deletions
This file was deleted.

man/blobs.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plotFrame.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plotImage.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)