Skip to content

Commit 7129148

Browse files
committed
r cmd checking
1 parent dd43acd commit 7129148

File tree

12 files changed

+32
-21
lines changed

12 files changed

+32
-21
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Imports:
4545
Rarr,
4646
rlang,
4747
reticulate,
48+
scales,
4849
sfarrow,
4950
S4Vectors,
5051
SingleCellExperiment,

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ importFrom(grDevices,colorRampPalette)
7070
importFrom(grDevices,rainbow)
7171
importFrom(grDevices,rgb)
7272
importFrom(methods,as)
73+
importFrom(methods,initialize)
7374
importFrom(methods,is)
7475
importFrom(methods,slot)
7576
importFrom(rlang,.data)
77+
importFrom(scales,alpha)
7678
importFrom(sfarrow,read_sf_dataset)
7779
importFrom(utils,.DollarNames)
7880
importFrom(utils,unzip)

R/class.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#' For \code{Shape/PointFrame}s, an \code{arrow} Table or derivative.
1515
#' @param zattrs \code{Zattrs} objects; used to represent .zattrs.
1616
#' @param metadata (option) list of free-form extra data.
17+
#' @param x \code{SpatialData} object.
1718
#'
1819
#' @return \code{SpatialData}
1920
#'
@@ -32,7 +33,7 @@
3233
#' @importFrom S7 new_class new_generic method class_list check_is_S7
3334
#' @importFrom SingleCellExperiment int_metadata
3435
#' @importFrom SummarizedExperiment colData
35-
#' @importFrom methods is
36+
#' @importFrom methods is initialize
3637
#' @export
3738
SpatialData <- new_class("SpatialData",
3839
properties=list(

R/data.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
#' # bucket for zipped .zarr archives for various platforms
2121
#' Sys.setenv(AWS_REGION="us-east-1")
2222
#' if (requireNamespace("paws")) sd_osn_list()
23-
#'
23+
#'
24+
#' \donttest{
2425
#' # retrieve dataset & ingest
2526
#' (sd <- sd_osn_load("merfish"))
27+
#' }
2628
NULL
2729

2830
.require <- \(x) if (!requireNamespace(x, quietly=TRUE))
@@ -137,6 +139,10 @@ sd_osn_load <- \(patt,
137139
readSpatialData(dir(td, full.names=TRUE))
138140
}
139141

142+
#' @name spatialdata-io
143+
#' @title Writing .zarr
144+
#'
145+
#' @description
140146
#' Use Python's 'spatialdata-io' to transform manufacturer
141147
#' output to .zarr with specific folder structure.
142148
#'
@@ -186,7 +192,7 @@ sd_make <- \(platform, srcdir, dest, env) {
186192
}
187193
}
188194

189-
#' @rdname sd_data
195+
#' @rdname spatialdata-io
190196
#' @export
191197
sdio_list <- \(env) {
192198
.require("basilisk")

R/plot-label.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#' specifies which \code{labels} to plot.
77
#' @param c character vector of colors to use;
88
#' if NULL (default), using \code{rainbow()}.
9+
#' @param alpha scalar numeric; controls opacity.
910
#' @param k resolution; if NULL (default), picking
1011
#' best for given \code{w}idth and \code{h}eight.
1112
#' @param w,h render width and height in pixel.
@@ -22,10 +23,11 @@
2223
#' sd_plot() + sd_plot_label(sd, c=c("lavender", "blue"))
2324
#'
2425
#' @importFrom methods as
26+
#' @importFrom scales alpha
2527
#' @importFrom DelayedArray realize
2628
#' @importFrom grDevices rgb rainbow colorRampPalette
2729
#' @export
28-
sd_plot_label <- \(x, i=1, c=NULL, k=NULL, w=800, h=800) {
30+
sd_plot_label <- \(x, i=1, c=NULL, alpha=1, k=NULL, w=800, h=800) {
2931
la <- x@labels[[i]]
3032
if (is.null(k))
3133
k <- .guess_scale(la, w, h)
@@ -38,13 +40,10 @@ sd_plot_label <- \(x, i=1, c=NULL, k=NULL, w=800, h=800) {
3840
} else if (n > length(c)) {
3941
c <- colorRampPalette(c)(n)
4042
}
43+
c <- scales::alpha(c, alpha)
4144
a <- matrix(c(NA, c)[b], nrow(a), ncol(a))
42-
w <- c(0, dim(ia)[3])
43-
h <- c(0, dim(ia)[2])
44-
# lgd <- if (!is.null(pal)) list(
45-
# guides(col=guide_legend(override.aes=list(alpha=1, size=2))),
46-
# scale_color_identity(NULL, guide="legend", labels=names(pal)),
47-
# geom_point(aes(col=.data$foo), data.frame(foo=pal), x=0, y=0, alpha=0))
45+
w <- c(0, dim(la)[2])
46+
h <- c(0, dim(la)[1])
4847
list(
4948
scale_x_continuous(limits=w), scale_y_reverse(limits=rev(h)),
5049
annotation_raster(a, w[2],w[1], h[1],h[2], interpolate=FALSE))

R/plot.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#' @name sd_plot
22
#' @title Plotting `SpatialData`
3-
#'
4-
#' @aliases sd_plot sd_plot_image
53
#'
64
#' @return \code{ggplot}
75
#'

R/read.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ NULL
4141
return(ps)
4242
}
4343

44-
#' @noRd
4544
.validate_multiscales_datasets_path <- \(md) {
4645
ms <- md$multiscales
4746
if (!is.null(ms)) {

man/SpatialData.Rd

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

man/sd_data.Rd

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

man/sd_plot.Rd

Lines changed: 0 additions & 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)