Skip to content

Commit cffa06f

Browse files
authored
address r-universe reports (v.99.40 -> .41) (#230)
* fix URL: and BugReports: * fix R CMD check warnings * in vignette, call spatialdataR::transform() explicitly * v0.99.41
1 parent 9d08d86 commit cffa06f

9 files changed

Lines changed: 43 additions & 19 deletions

File tree

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: spatialdataR
22
Title: Representation of Python's spatialdata in R
33
Depends: R (>= 4.6)
4-
Version: 0.99.40
4+
Version: 0.99.41
55
Description: R interface to Python/scverse's 'spatialdata' framework for
66
unified spatial omics data handling. Adheres to OME-NGFF standards,
77
providing lazy, on-disk representations for multiscale images and
@@ -64,6 +64,6 @@ biocViews:
6464
License: Artistic-2.0
6565
Encoding: UTF-8
6666
VignetteBuilder: knitr
67-
URL: https://helenalc.github.io/SpatialData/, https://github.com/HelenaLC/SpatialData
68-
BugReports: https://github.com/HelenaLC/SpatialData/issues
67+
BugReports: https://github.com/HelenaLC/spatialdataR/issues
68+
URL: https://helenalc.github.io/spatialdataR, https://github.com/HelenaLC/spatialdataR
6969
Config/roxygen2/version: 8.0.0

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ importFrom(graph,graph.par)
190190
importFrom(graph,graphAM)
191191
importFrom(graph,nodeData)
192192
importFrom(graph,nodes)
193+
importFrom(methods,"slot<-")
193194
importFrom(methods,as)
194195
importFrom(methods,callNextMethod)
195196
importFrom(methods,is)
@@ -199,6 +200,7 @@ importFrom(methods,setClassUnion)
199200
importFrom(methods,setMethod)
200201
importFrom(methods,setOldClass)
201202
importFrom(methods,setReplaceMethod)
203+
importFrom(methods,slot)
202204
importFrom(rlang,"!!")
203205
importFrom(rlang,.data)
204206
importFrom(rlang,call2)

R/SpatialData.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#' @param x,object \code{SpatialData} object.
3030
#' @param i,j character string, scalar or vector of indices
3131
#' specifying the element to extract from a given layer.
32+
#' @param k scalar index specifying which scale to use;
33+
#' \code{Inf} to use lowest available resolution.
3234
#' @param drop ignored.
3335
#' @param name character string for extraction (see \code{?base::`$`}).
3436
#' @param value (list of) element(s) with layer-compliant object(s),

R/methods.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#' @exportMethod $
1212
#' @rdname SpatialData
13+
#' @importFrom methods slot
1314
setMethod("$", "SpatialData", \(x, name) slot(x, name))
1415

1516
#' @exportMethod $<-
@@ -24,8 +25,9 @@ setMethod("[[", c("SpatialData", "numeric"), \(x, i, ...) {
2425
callNextMethod(x, i)
2526
})
2627

27-
#' @rdname SpatialData
2828
#' @export
29+
#' @rdname SpatialData
30+
#' @importFrom methods slot
2931
setMethod("[[", c("SpatialData", "character"), \(x, i, ...) slot(x, i))
3032

3133
# data/meta ----
@@ -151,8 +153,9 @@ setMethod("layer", c("SpatialData", "ANY"), \(x, i) stop(.invalid_i))
151153

152154
# element ----
153155

154-
#' @rdname SpatialData
155156
#' @export
157+
#' @rdname SpatialData
158+
#' @importFrom methods slot
156159
setMethod("element", c("SpatialData", "character"),
157160
\(x, i) slot(x, layer(x, i))[[i]])
158161

@@ -260,6 +263,7 @@ for (e in one) eval(.set(e), parent.env(environment()))
260263
#' @exportMethod images<- labels<- points<- shapes<- tables<-
261264
NULL
262265

266+
#' @importFrom methods slot slot<-
263267
f <- \(l) setReplaceMethod(l,
264268
c("SpatialData", getSlots("SpatialData")[[l]]),
265269
\(x, value) {
@@ -357,6 +361,7 @@ typ <- c(
357361
shape="SpatialDataShape",
358362
table="SingleCellExperiment")
359363

364+
#' @importFrom methods slot
360365
f <- \(e) setReplaceMethod(e,
361366
c("SpatialData", "character", typ[[e]]),
362367
\(x, i, value) {
@@ -406,6 +411,7 @@ for (e in one) eval(f(e), parent.env(environment()))
406411
#' @exportMethod image<- label<- point<- shape<- table<-
407412
NULL
408413

414+
#' @importFrom methods slot
409415
f <- \(e) setReplaceMethod(e,
410416
c("SpatialData", "ANY", "NULL"),
411417
\(x, i, ..., value) {

R/utils.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
return(x)
3232
}
3333

34+
#' @importFrom methods slot<-
3435
.sync_tables_sdattrs <- \(x, old, new) {
3536
if (!length(ts <- tables(x))) return(x)
3637
for (i in seq_along(ts)) {
@@ -73,6 +74,7 @@
7374
return(x)
7475
}
7576

77+
#' @importFrom methods slot<-
7678
.sync_tables_on_drop <- \(x) {
7779
if (!length(ts <- tables(x))) return(x)
7880
all_nms <- unlist(colnames(x)[.ls])

R/validity.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ setValidity2("SpatialData", .validateSpatialData)
192192
return(msg)
193193
}
194194
.validateAttrsLabel <- \(x) {
195-
x <- label(sd)
196195
msg <- c()
197196
za <- meta(x)
198197
msg <- .validateAttrs_multiscales(za, msg)

inst/NEWS

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
changes in version 0.99.41
2+
3+
- fix vignette to call 'spatialdataR::transform()' explicitly
4+
- address R CMD check warnings re: undocumented arguments, undefined functions
5+
16
changes in version 0.99.40
27

38
- validty & setters now assure that each layer is a completely named list
@@ -27,9 +32,12 @@ changes in version 0.99.36
2732

2833
changes in version 0.99.35
2934

30-
- class renaming
3135
- bug fix: 'centroids,shape' was previously
3236
returning vertex coordinates for polygons
37+
- class renaming:
38+
sdArray/Frame > SpatialDataArray/Frame,
39+
Image/LabelArray > SpatialDataImage/Label,
40+
Shape/PointFrame > SpatialDataShape/Point
3341

3442
changes in version 0.99.34
3543

man/SpatialData.Rd

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

vignettes/SpatialData.Rmd

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ output:
88
toc_depth: 2
99
toc_float: true
1010
vignette: |
11-
%\VignetteIndexEntry{Introduction to spatialdataR}
11+
%\VignetteIndexEntry{spatialdataR}
1212
%\VignetteEngine{knitr::rmarkdown}
1313
%\VignetteEncoding{UTF-8}
1414
bibliography: "refs.bib"
@@ -28,23 +28,25 @@ knitr::opts_chunk$set(cache=FALSE, message=FALSE, warning=FALSE)
2828

2929
## Introduction
3030

31-
The `r BiocStyle::Biocpkg("spatialdataR")` package provides an R interface to the
32-
[SpatialData](https://spatialdata.scverse.org) framework, a unified ecosystem
33-
for handling spatial omics data. Developed as part of the
34-
[scverse](https://scverse.org) project [@Virshup2023-scverse], `SpatialData` aims to solve the
35-
challenges of integrating diverse spatial datasets—including imaging, spatial
36-
transcriptomics, and proteomics—by employing the
31+
The `r BiocStyle::Biocpkg("spatialdataR")` package provides an R interface to
32+
Python's [spatialdata](https://spatialdata.scverse.org) framework for unified
33+
handling of spatial omics data, including tabular annotations, vector- and
34+
raster-based components. Developed as part of the [scverse](https://scverse.org)
35+
project [@Virshup2023-scverse], `spatialdata` aims to solve the challenges of
36+
integrating diverse spatial datasets -- including -- by employing the
3737
[OME-NGFF (Next Generation File Format)](https://ngff.openmicroscopy.org)
3838
standard [@Marconato2025-SpatialData].
3939

40-
The Python implementation and core specifications can be found at the
41-
[official SpatialData website](https://spatialdata.scverse.org).
40+
The Python implementation and core specifications are found at the
41+
[official `spatialdata` website](https://spatialdata.scverse.org).
4242

4343
## Representation
4444

4545
The core data structure is the `SpatialData` class, which organizes data
4646
into 5 coordinated **layers: images, labels, points, shapes, and tables**.
47-
Each layer is stored as a list of layer-specific objects that carry associated `SpatialDataAttr` (`@meta` slot), which encode `spatialdata`-specific zarr attributes (*.zattr* for Zarr v2, and *zarr.json* for Zarr v3)
47+
Each layer is stored as a list of layer-specific objects that carry associated
48+
`SpatialDataAttr` (`@meta` slot), which encode `spatialdata`-specific
49+
Zarr attributes (*.zattr* for Zarr v2, and *zarr.json* for Zarr v3).
4850
Together, these layers provide a unified representation of spatial omics data,
4951
combining raster, vector, and tabular data within a single coherent framework.
5052

@@ -240,7 +242,7 @@ in the correct order (e.g., `scale()` then `translation()`).
240242
a <- label(sd)
241243
242244
# project into 'global'
243-
b <- transform(a, "scale")
245+
b <- spatialdataR::transform(a, "scale")
244246
245247
# compare XY extents
246248
do.call(rbind, c(a=extent(a), b=extent(b)))
@@ -338,7 +340,7 @@ across objects via `make.names()`, appending a suffix to the element names of
338340
subsequent objects. Alternatively, names could be customize before combining.
339341

340342
```{r combine}
341-
sp <- combine(sd, sd)
343+
sp <- combine(list(foo=sd, bar=sd))
342344
cbind(
343345
original=lengths(colnames(sd)),
344346
combined=lengths(colnames(sp)))

0 commit comments

Comments
 (0)