Skip to content

Commit 0a5952b

Browse files
authored
Merge pull request #9 from HelenaLC/update_data
update vignette, using new spatialdata.data methods
2 parents 9fd1260 + fe1675d commit 0a5952b

File tree

4 files changed

+17
-34
lines changed

4 files changed

+17
-34
lines changed

R/plotLabel.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
#'
3232
#' # coloring by 'colData'
3333
#' n <- length(unique(t$id))
34-
#' pal <- hcl.colors(n, "Spectral")
35-
#' p + plotLabel(x, i, "id", pal=pal)
34+
#' # TODO: did a small fix to color scheme below, will fix example later
35+
#' # pal <- hcl.colors(n, "Spectral")
36+
#' pal_d <- hcl.colors(10, "Spectral")
37+
#' p + plotLabel(x, i, "id", pal=pal_d)
3638
#'
3739
#' # coloring by 'assay' data
3840
#' p + plotLabel(x, i, "channel_1_sum")

man/plotLabel.Rd

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

tests/testthat/test-plotImage.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ test_that(".check_cl", {
5656
})
5757

5858
dir.create(td <- tempfile())
59-
pa <- unzip_spd_demo(zipname="steinbock_io.zip", dest=td, source="biocOSN")
60-
x <- readSpatialData(pa, images=1, labels=FALSE, points=FALSE, shapes=FALSE, tables=FALSE)
59+
(x <- SpatialData.data::MulticancerSteinbock())
6160
a <- data(image(x)[seq_len(3), seq_len(100), seq_len(100)], 1)
6261

6362
test_that(".get_img_dt", {

vignettes/SpatialData.plot.Rmd

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,7 @@ In this example data, we do not have a `label` for the `shape` polygons.
167167
Such labels could be morphological regions annotated by pathologists.
168168

169169
```{r merfish-read}
170-
dir.create(td <- tempfile())
171-
pa <- unzip_spd_demo(
172-
zipname="merfish.zarr.zip",
173-
dest=td, source="biocOSN")
174-
(x <- readSpatialData(pa, anndataR=FALSE))
170+
(x <- MouseBrainMERFISH())
175171
```
176172

177173
There are only `r length(SpatialData::shape(x, "cells"))` cells, but
@@ -206,11 +202,7 @@ plotSpatialData() + plotImage(x) + bb | plotSpatialData() + plotImage(y)
206202
Mouse intestine, 1GB; 4 image resolutions and 3 shapes at 2, 8, and 16 $\mu$m.
207203

208204
```{r visiumhd-read}
209-
dir.create(td <- tempfile())
210-
pa <- unzip_spd_demo(
211-
zipname="visium_hd_3.0.0_io.zip",
212-
dest=td, source="biocOSN")
213-
(x <- readSpatialData(pa, images=4, shapes=3, tables=FALSE))
205+
(x <- MouseIntestineVisHD())
214206
```
215207

216208
```{r visiumhd-plot}
@@ -225,11 +217,7 @@ plotSpatialData() + plotImage(x) + bb | plotSpatialData() + plotImage(y)
225217
Colorectal carcinoma, 25 MB; no shapes, no points.
226218

227219
```{r mibitof-read}
228-
dir.create(td <- tempfile())
229-
pa <- unzip_spd_demo(
230-
zipname="mibitof.zip",
231-
dest=td, source="biocOSN")
232-
(x <- readSpatialData(pa, anndataR=FALSE))
220+
(x <- ColorectalCarcinomaMIBITOF())
233221
```
234222

235223
```{r mibitof-plot, fig.width=10, fig.height=3}
@@ -245,11 +233,7 @@ wrap_plots(nrow=1, lapply(seq(3), \(.)
245233
Small lung adenocarcinoma, 250 MB; 1 image, 2 labels, 2 tables.
246234

247235
```{r mcmicro-read}
248-
dir.create(td <- tempfile())
249-
pa <- unzip_spd_demo(
250-
zipname="mcmicro_io.zip",
251-
dest=td, source="biocOSN")
252-
(x <- readSpatialData(pa, anndataR=FALSE))
236+
x <- LungAdenocarcinomaMCMICRO()
253237
```
254238

255239
Getting channel names for the image:
@@ -272,11 +256,7 @@ plotSpatialData() + plotImage(x,
272256
4 different cancers (SCCHN, BCC, NSCLC, CRC), 820 MB; 14 images, 14 labels, 1 table.
273257

274258
```{r steinbock-read}
275-
dir.create(td <- tempfile())
276-
pa <- unzip_spd_demo(
277-
zipname="steinbock_io.zip",
278-
dest=td, source="biocOSN")
279-
x <- readSpatialData(pa, anndataR=FALSE)
259+
x <- MulticancerSteinbock()
280260
```
281261

282262
### channels
@@ -294,9 +274,9 @@ plotSpatialData() + plotImage(x,
294274
i <- image(x, "Patient3_003_image")
295275
image(x, "crop") <- i[, 200:400, 200:400]
296276
lapply(list(c(0.2, 1), c(0, 0.8), c(0, 1.2)), \(.) {
297-
plotSpatialData() + plotImage(x,
298-
i="crop",
299-
ch=c(6, 22, 39),
277+
plotSpatialData() + plotImage(x,
278+
i="crop",
279+
ch=c(6, 22, 39),
300280
cl=list(1, 1, .),
301281
c=c("blue", "cyan", "yellow")) +
302282
ggtitle(sprintf("[%s, %s]", .[1], .[2]))

0 commit comments

Comments
 (0)