diff --git a/R/plotLabel.R b/R/plotLabel.R index d9c61fc..5493100 100644 --- a/R/plotLabel.R +++ b/R/plotLabel.R @@ -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") diff --git a/man/plotLabel.Rd b/man/plotLabel.Rd index cb5c012..db7a1ea 100644 --- a/man/plotLabel.Rd +++ b/man/plotLabel.Rd @@ -55,8 +55,10 @@ table(x) <- t # 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") diff --git a/tests/testthat/test-plotImage.R b/tests/testthat/test-plotImage.R index a20e67c..e27b039 100644 --- a/tests/testthat/test-plotImage.R +++ b/tests/testthat/test-plotImage.R @@ -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", { diff --git a/vignettes/SpatialData.plot.Rmd b/vignettes/SpatialData.plot.Rmd index 0631df1..b85f20d 100644 --- a/vignettes/SpatialData.plot.Rmd +++ b/vignettes/SpatialData.plot.Rmd @@ -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 @@ -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} @@ -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} @@ -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: @@ -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 @@ -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]))