From c07abb842b7891cfc4510c2282dbee7d103269f2 Mon Sep 17 00:00:00 2001 From: HelenaLC Date: Mon, 6 Apr 2026 11:05:10 +0200 Subject: [PATCH 1/3] fix typo --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 14317366..85239e41 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Title: Representation of Python's SpatialData in R Depends: R (>= 4.5) Version: 0.99.25 Description: Interface to Python's 'SpatialData', currently including: - reticulate-based use of 'spatialdata-io' for reading of manufracturer + reticulate-based use of 'spatialdata-io' for reading of manufacturer data and writing to .zarr, on-disk representation of images/labels as 'ZarrArray's ('Rarr') and shapes/points as 'arrow' objects, and method drafts for visualization and coordinate system handling. From b42b94717f0bb39556aae4fe8024b80e07d6822f Mon Sep 17 00:00:00 2001 From: HelenaLC Date: Mon, 6 Apr 2026 11:05:22 +0200 Subject: [PATCH 2/3] rmv duplicated SetMethod's --- R/AllGenerics.R | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/R/AllGenerics.R b/R/AllGenerics.R index 3a18d600..c92b0aa0 100644 --- a/R/AllGenerics.R +++ b/R/AllGenerics.R @@ -22,18 +22,6 @@ setGeneric("shapeNames", \(x, ...) standardGeneric("shapeNames")) setGeneric("pointNames", \(x, ...) standardGeneric("pointNames")) setGeneric("tableNames", \(x, ...) standardGeneric("tableNames")) -setMethod("images", "SpatialData", \(x) x$images) -setMethod("labels", "SpatialData", \(x) x$labels) -setMethod("shapes", "SpatialData", \(x) x$shapes) -setMethod("points", "SpatialData", \(x) x$points) -setMethod("tables", "SpatialData", \(x) x$tables) - -setMethod("imageNames", "SpatialData", \(x) names(images(x))) -setMethod("labelNames", "SpatialData", \(x) names(labels(x))) -setMethod("shapeNames", "SpatialData", \(x) names(shapes(x))) -setMethod("pointNames", "SpatialData", \(x) names(points(x))) -setMethod("tableNames", "SpatialData", \(x) names(tables(x))) - # set one ----- setGeneric("image<-", \(x, i, ..., value) standardGeneric("image<-")) From 0000232dac171009f391f63fb753c9e8aff0522f Mon Sep 17 00:00:00 2001 From: HelenaLC Date: Mon, 6 Apr 2026 11:05:39 +0200 Subject: [PATCH 3/3] implement copi suggestions --- R/ShapeFrame.R | 2 +- R/coord_utils.R | 2 +- R/read.R | 2 +- R/validity.R | 4 ++-- man/trans.Rd | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/R/ShapeFrame.R b/R/ShapeFrame.R index 7e8bdb55..ca88b8bf 100644 --- a/R/ShapeFrame.R +++ b/R/ShapeFrame.R @@ -82,7 +82,7 @@ setMethod("[", c("ShapeFrame", "missing", "missing"), #' @export setMethod("[", c("ShapeFrame", "numeric", "numeric"), \(x, i, j, ...) { i <- seq_len(nrow(x))[i] - j <- seq_len(nrow(x))[j] + j <- seq_len(ncol(x))[j] x@data <- x@data[i, j] return(x) }) diff --git a/R/coord_utils.R b/R/coord_utils.R index d2b587f8..83451fc4 100644 --- a/R/coord_utils.R +++ b/R/coord_utils.R @@ -247,7 +247,7 @@ setMethod("rmvCT", "Zattrs", \(x, i) { } nan <- setdiff(i, nms) if (length(nan)) stop( - "couln't find 'coordTrans' of name(s) ", + "couldn't find 'coordTrans' of name(s) ", paste(dQuote(nan), collapse=",")) i <- match(i, nms) # protect against dropping identity diff --git a/R/read.R b/R/read.R index 95be1117..f415960e 100644 --- a/R/read.R +++ b/R/read.R @@ -211,7 +211,7 @@ readSpatialData <- function(x, if (is.numeric(opt) && opt > (. <- length(j))) stop("'", i, "=", opt, "', but only ", ., " elements found") if (is.character(opt) && length(. <- setdiff(opt, basename(j)))) - stop("couln't find ", i, " of name", .) + stop("couldn't find ", i, " of name", .) j <- j[opt] } f <- get(paste0("read", toupper(substr(i, 1, 1)), substr(i, 2, nchar(i)-1))) diff --git a/R/validity.R b/R/validity.R index 5da54752..75287b9f 100644 --- a/R/validity.R +++ b/R/validity.R @@ -38,9 +38,9 @@ .validateImageArray <- function(object) { msg <- c() if (ni <- length(images(object))) { - for (i in seq_along(ni)) { + for (i in seq_len(ni)) { ai <- as.array(aperm(data(image(object,1))/255, perm=c(3,2,1))) - for (j in dim(ai)[3]) { + for (j in seq_len(dim(ai)[3])) { if (!all(vapply(ai[,,j], is.numeric, logical(1)))) { msg <- c(msg, paste0("Image ", i, " channel ", j, " not numeric")) } diff --git a/man/trans.Rd b/man/trans.Rd index 7bc36c57..deeb1e0c 100644 --- a/man/trans.Rd +++ b/man/trans.Rd @@ -5,7 +5,7 @@ \alias{scale} \alias{rotate} \alias{translation} -\alias{scale,ImageArray,numeric-method} +\alias{scale,sdArray,numeric-method} \alias{scale,PointFrame,numeric-method} \alias{rotate,PointFrame,numeric-method} \alias{translation,PointFrame,numeric-method} @@ -14,7 +14,7 @@ \alias{translation,ShapeFrame,numeric-method} \title{Transformations} \usage{ -\S4method{scale}{ImageArray,numeric}(x, j, t, ...) +\S4method{scale}{sdArray,numeric}(x, j, t, ...) \S4method{scale}{PointFrame,numeric}(x, t, ...)