Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions R/plotLabel.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
#'
#' # coloring by 'colData'
#' n <- length(unique(t$id))
#' pal <- hcl.colors(n, "Spectral")
#' p + plotLabel(x, i, "id", pal=pal)
#' # TODO: did a small fix to color scheme below, will fix example later
#' # pal <- hcl.colors(n, "Spectral")
#' pal_d <- hcl.colors(10, "Spectral")
#' p + plotLabel(x, i, "id", pal=pal_d)
#'
#' # coloring by 'assay' data
#' p + plotLabel(x, i, "channel_1_sum")
Expand Down
6 changes: 4 additions & 2 deletions man/plotLabel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions tests/testthat/test-plotImage.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ test_that(".check_cl", {
})

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

test_that(".get_img_dt", {
Expand Down
36 changes: 8 additions & 28 deletions vignettes/SpatialData.plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ In this example data, we do not have a `label` for the `shape` polygons.
Such labels could be morphological regions annotated by pathologists.

```{r merfish-read}
dir.create(td <- tempfile())
pa <- unzip_spd_demo(
zipname="merfish.zarr.zip",
dest=td, source="biocOSN")
(x <- readSpatialData(pa, anndataR=FALSE))
(x <- MouseBrainMERFISH())
```

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

```{r visiumhd-read}
dir.create(td <- tempfile())
pa <- unzip_spd_demo(
zipname="visium_hd_3.0.0_io.zip",
dest=td, source="biocOSN")
(x <- readSpatialData(pa, images=4, shapes=3, tables=FALSE))
(x <- MouseIntestineVisHD())
```

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

```{r mibitof-read}
dir.create(td <- tempfile())
pa <- unzip_spd_demo(
zipname="mibitof.zip",
dest=td, source="biocOSN")
(x <- readSpatialData(pa, anndataR=FALSE))
(x <- ColorectalCarcinomaMIBITOF())
```

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

```{r mcmicro-read}
dir.create(td <- tempfile())
pa <- unzip_spd_demo(
zipname="mcmicro_io.zip",
dest=td, source="biocOSN")
(x <- readSpatialData(pa, anndataR=FALSE))
x <- LungAdenocarcinomaMCMICRO()
```

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

```{r steinbock-read}
dir.create(td <- tempfile())
pa <- unzip_spd_demo(
zipname="steinbock_io.zip",
dest=td, source="biocOSN")
x <- readSpatialData(pa, anndataR=FALSE)
x <- MulticancerSteinbock()
```

### channels
Expand All @@ -294,9 +274,9 @@ plotSpatialData() + plotImage(x,
i <- image(x, "Patient3_003_image")
image(x, "crop") <- i[, 200:400, 200:400]
lapply(list(c(0.2, 1), c(0, 0.8), c(0, 1.2)), \(.) {
plotSpatialData() + plotImage(x,
i="crop",
ch=c(6, 22, 39),
plotSpatialData() + plotImage(x,
i="crop",
ch=c(6, 22, 39),
cl=list(1, 1, .),
c=c("blue", "cyan", "yellow")) +
ggtitle(sprintf("[%s, %s]", .[1], .[2]))
Expand Down