diff --git a/articles/misc.html b/articles/misc.html index fd5f47a..843efd4 100644 --- a/articles/misc.html +++ b/articles/misc.html @@ -79,7 +79,7 @@

Leonardo Health
lcolladotor@gmail.com -

18 October 2024

+

24 October 2024

Source: vignettes/misc.Rmd
misc.Rmd
@@ -102,7 +102,7 @@

Load data
 ## Grab SpatialExperiment with normalized counts
 spe <- fetch_data(type = "visiumStitched_brain_spe")
-#> 2024-10-18 14:29:29.554226 loading file /github/home/.cache/R/BiocFileCache/25739445980_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
+#> 2024-10-24 20:17:16.494094 loading file /github/home/.cache/R/BiocFileCache/760d7e2c6_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
 
 ## Check that spe does contain the "logcounts" assay
 assayNames(spe)
@@ -205,7 +205,7 @@ 

Merging overlapping spotsFALSE. Note that the function can be quite memory-intensive and time-consuming.

+spe_merged <- merge_overlapping(spe)

diff --git a/articles/visiumStitched.html b/articles/visiumStitched.html index 4e0b0b0..632a991 100644 --- a/articles/visiumStitched.html +++ b/articles/visiumStitched.html @@ -79,7 +79,7 @@

Leonardo Health
lcolladotor@gmail.com -

18 October 2024

+

24 October 2024

Source: vignettes/visiumStitched.Rmd
visiumStitched.Rmd
@@ -179,7 +179,7 @@

Preparing Experiment Informationtemp <- unzip(spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"), exdir = sr_dir ) -#> 2024-10-18 14:29:56.102909 loading file /github/home/.cache/R/BiocFileCache/2573560f3ca_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1 +#> 2024-10-24 20:17:42.34181 loading file /github/home/.cache/R/BiocFileCache/7603a007f35_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1 sample_info$spaceranger_dir <- file.path( sr_dir, sample_info$capture_area, "outs", "spatial" ) @@ -187,9 +187,9 @@

Preparing Experiment Information## Sample_info with paths to SpaceRanger output directories sample_info #> group capture_area spaceranger_dir -#> 1 Br2719 V13B23-283_A1 /tmp/RtmpUiBP6j/V13B23-283_A1/outs/spatial -#> 2 Br2719 V13B23-283_C1 /tmp/RtmpUiBP6j/V13B23-283_C1/outs/spatial -#> 3 Br2719 V13B23-283_D1 /tmp/RtmpUiBP6j/V13B23-283_D1/outs/spatial +#> 1 Br2719 V13B23-283_A1 /tmp/RtmpV5W4lk/V13B23-283_A1/outs/spatial +#> 2 Br2719 V13B23-283_C1 /tmp/RtmpV5W4lk/V13B23-283_C1/outs/spatial +#> 3 Br2719 V13B23-283_D1 /tmp/RtmpV5W4lk/V13B23-283_D1/outs/spatial

Preparing Inputs to Fiji @@ -218,9 +218,9 @@

Preparing Inputs to Fiji#> # A tibble: 3 × 5 #> group capture_area spaceranger_dir intra_group_scalar group_hires_scalef #> <chr> <chr> <chr> <dbl> <dbl> -#> 1 Br2719 V13B23-283_A1 /tmp/RtmpUiBP6j/V1… 1.00 0.0825 -#> 2 Br2719 V13B23-283_C1 /tmp/RtmpUiBP6j/V1… 1.00 0.0825 -#> 3 Br2719 V13B23-283_D1 /tmp/RtmpUiBP6j/V1… 1 0.0825

+#> 1 Br2719 V13B23-283_A1 /tmp/RtmpV5W4lk/V1… 1.00 0.0825 +#> 2 Br2719 V13B23-283_C1 /tmp/RtmpV5W4lk/V1… 1.00 0.0825 +#> 3 Br2719 V13B23-283_D1 /tmp/RtmpV5W4lk/V1… 1 0.0825

Building a SpatialExperiment @@ -248,7 +248,7 @@

Creating Group-Level Samples
 fiji_dir <- tempdir()
 temp <- unzip(fetch_data("visiumStitched_brain_Fiji_out"), exdir = fiji_dir)
-#> 2024-10-18 14:30:09.710556 loading file /github/home/.cache/R/BiocFileCache/257305c881d_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1
+#> 2024-10-24 20:17:55.9535 loading file /github/home/.cache/R/BiocFileCache/76048672d76_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1
 sample_info$fiji_xml_path <- temp[grep("xml$", temp)]
 sample_info$fiji_image_path <- temp[grep("png$", temp)]

We now have every column present in sample_info that @@ -259,9 +259,9 @@

Creating Group-Level Samples#> # A tibble: 3 × 7 #> group capture_area spaceranger_dir intra_group_scalar group_hires_scalef #> <chr> <chr> <chr> <dbl> <dbl> -#> 1 Br2719 V13B23-283_A1 /tmp/RtmpUiBP6j/V1… 1.00 0.0825 -#> 2 Br2719 V13B23-283_C1 /tmp/RtmpUiBP6j/V1… 1.00 0.0825 -#> 3 Br2719 V13B23-283_D1 /tmp/RtmpUiBP6j/V1… 1 0.0825 +#> 1 Br2719 V13B23-283_A1 /tmp/RtmpV5W4lk/V1… 1.00 0.0825 +#> 2 Br2719 V13B23-283_C1 /tmp/RtmpV5W4lk/V1… 1.00 0.0825 +#> 3 Br2719 V13B23-283_D1 /tmp/RtmpV5W4lk/V1… 1 0.0825 #> # ℹ 2 more variables: fiji_xml_path <chr>, fiji_image_path <chr>

Before building the SpatialExperiment, the idea is to create a directory structure very similar to Spaceranger’s @@ -284,10 +284,10 @@

Creating Group-Level Samples## the standard directory structure from SpaceRanger (10x Genomics) spe_input_dir <- tempdir() prep_fiji_coords(sample_info, out_dir = spe_input_dir) -#> [1] "/tmp/RtmpUiBP6j/Br2719/tissue_positions.csv" +#> [1] "/tmp/RtmpV5W4lk/Br2719/tissue_positions.csv" prep_fiji_image(sample_info, out_dir = spe_input_dir) -#> [1] "/tmp/RtmpUiBP6j/Br2719/tissue_lowres_image.png" -#> [2] "/tmp/RtmpUiBP6j/Br2719/scalefactors_json.json" +#> [1] "/tmp/RtmpV5W4lk/Br2719/tissue_lowres_image.png" +#> [2] "/tmp/RtmpV5W4lk/Br2719/scalefactors_json.json"

Constructing the Object @@ -331,11 +331,11 @@

Constructing the Object calc_error_metrics = TRUE ) #> Building SpatialExperiment using capture area as sample ID -#> 2024-10-18 14:30:12.935657 SpatialExperiment::read10xVisium: reading basic data from SpaceRanger -#> 2024-10-18 14:30:20.043195 read10xVisiumAnalysis: reading analysis output from SpaceRanger -#> 2024-10-18 14:30:20.517176 add10xVisiumAnalysis: adding analysis output from SpaceRanger -#> 2024-10-18 14:30:20.913173 rtracklayer::import: reading the reference GTF file -#> 2024-10-18 14:30:52.528338 adding gene information to the SPE object +#> 2024-10-24 20:17:59.027873 SpatialExperiment::read10xVisium: reading basic data from SpaceRanger +#> 2024-10-24 20:18:05.856143 read10xVisiumAnalysis: reading analysis output from SpaceRanger +#> 2024-10-24 20:18:06.240782 add10xVisiumAnalysis: adding analysis output from SpaceRanger +#> 2024-10-24 20:18:06.590185 rtracklayer::import: reading the reference GTF file +#> 2024-10-24 20:18:37.255172 adding gene information to the SPE object #> Warning: Gene IDs did not match. This typically happens when you are not using #> the same GTF file as the one that was used by SpaceRanger. For example, one #> file uses GENCODE IDs and the other one ENSEMBL IDs. read10xVisiumWrapper() @@ -343,7 +343,7 @@

Constructing the Object#> Warning: Dropping 2226 out of 38606 genes for which we don't have information #> on the reference GTF file. This typically happens when you are not using the #> same GTF file as the one that was used by SpaceRanger. -#> 2024-10-18 14:30:52.762759 adding information used by spatialLIBD +#> 2024-10-24 20:18:37.485096 adding information used by spatialLIBD #> Overwriting imgData(spe) with merged images (one per group) #> Adding array coordinates with error metrics and adding overlap info @@ -506,7 +506,7 @@

Error metricscolData(spe) |> as_tibble() |> ggplot(mapping = aes(x = 0, y = euclidean_error)) + - geom_boxplot()

+ geom_boxplot()

The other metric, spe$shared_neighbors, measures the fraction of original neighbors (from a same capture area) that are @@ -517,7 +517,7 @@

Error metricscolData(spe) |> as_tibble() |> ggplot(mapping = aes(x = 0, y = shared_neighbors)) + - geom_boxplot() + geom_boxplot()

In theory, error as measured through these metrics could have a very slight impact on the quality of clustering results downstream. We @@ -546,7 +546,7 @@

Downstream applications
 ## Grab SpatialExperiment with normalized counts
 spe_norm <- fetch_data(type = "visiumStitched_brain_spe")
-#> 2024-10-18 14:32:09.120713 loading file /github/home/.cache/R/BiocFileCache/25739445980_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
+#> 2024-10-24 20:19:53.190345 loading file /github/home/.cache/R/BiocFileCache/760d7e2c6_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
 assayNames(spe_norm)
 #> [1] "counts"    "logcounts"
 
@@ -704,7 +704,7 @@ 

Reproducibility#> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz UTC -#> date 2024-10-18 +#> date 2024-10-24 #> pandoc 3.4 @ /usr/bin/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────── @@ -714,7 +714,7 @@

Reproducibility#> AnnotationHub 3.13.3 2024-08-19 [1] Bioconductor 3.20 (R 4.4.1) #> attempt 0.3.1 2020-05-03 [1] RSPM (R 4.4.0) #> backports 1.5.0 2024-05-23 [1] RSPM (R 4.4.0) -#> beachmat 2.21.6 2024-09-05 [1] Bioconductor 3.20 (R 4.4.1) +#> beachmat 2.21.8 2024-10-21 [1] Bioconductor 3.20 (R 4.4.1) #> beeswarm 0.4.0 2021-06-01 [1] RSPM (R 4.4.0) #> benchmarkme 1.0.8 2022-06-12 [1] RSPM (R 4.4.0) #> benchmarkmeData 1.0.4 2020-04-23 [1] RSPM (R 4.4.0) @@ -725,7 +725,7 @@

Reproducibility#> BiocGenerics * 0.51.3 2024-10-02 [1] Bioconductor 3.20 (R 4.4.1) #> BiocIO 1.15.2 2024-08-23 [1] Bioconductor 3.20 (R 4.4.1) #> BiocManager 1.30.25 2024-08-28 [2] CRAN (R 4.4.1) -#> BiocNeighbors 1.99.2 2024-10-07 [1] Bioconductor 3.20 (R 4.4.1) +#> BiocNeighbors 1.99.3 2024-10-21 [1] Bioconductor 3.20 (R 4.4.1) #> BiocParallel 1.39.0 2024-05-01 [1] Bioconductor 3.20 (R 4.4.0) #> BiocSingular 1.21.4 2024-09-22 [1] Bioconductor 3.20 (R 4.4.1) #> BiocStyle * 2.33.1 2024-06-12 [1] Bioconductor 3.20 (R 4.4.0) @@ -759,7 +759,7 @@

Reproducibility#> dqrng 0.4.1 2024-05-28 [1] RSPM (R 4.4.0) #> DropletUtils 1.25.2 2024-07-23 [1] Bioconductor 3.20 (R 4.4.1) #> DT 0.33 2024-04-04 [1] RSPM (R 4.4.0) -#> edgeR 4.3.19 2024-10-11 [1] Bioconductor 3.20 (R 4.4.1) +#> edgeR 4.3.20 2024-10-21 [1] Bioconductor 3.20 (R 4.4.1) #> evaluate 1.0.1 2024-10-10 [2] RSPM (R 4.4.0) #> ExperimentHub 2.13.1 2024-07-31 [1] Bioconductor 3.20 (R 4.4.1) #> fansi 1.0.6 2023-12-08 [2] RSPM (R 4.4.0) @@ -788,7 +788,7 @@

Reproducibility#> htmlwidgets 1.6.4 2023-12-06 [2] RSPM (R 4.4.0) #> httpuv 1.6.15 2024-03-26 [2] RSPM (R 4.4.0) #> httr 1.4.7 2023-08-15 [1] RSPM (R 4.4.0) -#> igraph 2.0.3 2024-03-13 [1] RSPM (R 4.4.0) +#> igraph 2.1.1 2024-10-19 [1] RSPM (R 4.4.0) #> imager 1.0.2 2024-05-13 [1] RSPM (R 4.4.0) #> IRanges * 2.39.2 2024-07-17 [1] Bioconductor 3.20 (R 4.4.1) #> irlba 2.3.5.1 2022-10-03 [1] RSPM (R 4.4.0) @@ -809,8 +809,8 @@

Reproducibility#> magick 2.8.5 2024-09-20 [1] RSPM (R 4.4.0) #> magrittr 2.0.3 2022-03-30 [2] RSPM (R 4.4.0) #> maps 3.4.2 2023-12-15 [1] RSPM (R 4.4.0) -#> Matrix 1.7-0 2024-04-26 [3] CRAN (R 4.4.1) -#> MatrixGenerics * 1.17.0 2024-05-01 [1] Bioconductor 3.20 (R 4.4.0) +#> Matrix 1.7-1 2024-10-18 [3] RSPM (R 4.4.0) +#> MatrixGenerics * 1.17.1 2024-10-23 [1] Bioconductor 3.20 (R 4.4.1) #> matrixStats * 1.4.1 2024-09-08 [1] RSPM (R 4.4.0) #> memoise 2.0.1 2021-11-26 [2] RSPM (R 4.4.0) #> mime 0.12 2021-09-28 [2] RSPM (R 4.4.0) @@ -819,7 +819,7 @@

Reproducibility#> pillar 1.9.0 2023-03-22 [2] RSPM (R 4.4.0) #> pkgcond 0.1.1 2021-04-28 [1] RSPM (R 4.4.0) #> pkgconfig 2.0.3 2019-09-22 [2] RSPM (R 4.4.0) -#> pkgdown 2.1.1.9000 2024-10-18 [1] Github (r-lib/pkgdown@8d9cba1) +#> pkgdown 2.1.1.9000 2024-10-24 [1] Github (r-lib/pkgdown@8d9cba1) #> plotly 4.10.4 2024-01-13 [1] RSPM (R 4.4.0) #> plyr 1.8.9 2023-10-02 [1] RSPM (R 4.4.0) #> png 0.1-8 2022-11-29 [1] RSPM (R 4.4.0) @@ -861,10 +861,10 @@

Reproducibility#> shinyWidgets 0.8.7 2024-09-23 [1] RSPM (R 4.4.0) #> SingleCellExperiment * 1.27.2 2024-05-24 [1] Bioconductor 3.20 (R 4.4.0) #> spam 2.11-0 2024-10-03 [1] RSPM (R 4.4.0) -#> SparseArray 1.5.44 2024-10-06 [1] Bioconductor 3.20 (R 4.4.1) +#> SparseArray 1.5.45 2024-10-21 [1] Bioconductor 3.20 (R 4.4.1) #> sparseMatrixStats 1.17.2 2024-06-12 [1] Bioconductor 3.20 (R 4.4.0) #> SpatialExperiment * 1.15.1 2024-06-20 [1] Bioconductor 3.20 (R 4.4.0) -#> spatialLIBD * 1.17.8 2024-10-16 [1] Github (LieberInstitute/spatialLIBD@c82c789) +#> spatialLIBD * 1.17.10 2024-10-24 [1] Github (LieberInstitute/spatialLIBD@05e7886) #> statmod 1.5.0 2023-01-06 [1] RSPM (R 4.4.0) #> stringi 1.8.4 2024-05-06 [2] RSPM (R 4.4.0) #> stringr 1.5.1 2023-11-14 [2] RSPM (R 4.4.0) @@ -883,7 +883,7 @@

Reproducibility#> vipor 0.4.7 2023-12-18 [1] RSPM (R 4.4.0) #> viridis 0.6.5 2024-01-29 [1] RSPM (R 4.4.0) #> viridisLite 0.4.2 2023-05-02 [1] RSPM (R 4.4.0) -#> visiumStitched * 0.99.12 2024-10-18 [1] Bioconductor +#> visiumStitched * 0.99.12 2024-10-24 [1] Bioconductor #> vroom 1.6.5 2023-12-05 [1] RSPM (R 4.4.0) #> withr 3.0.1 2024-07-31 [2] RSPM (R 4.4.0) #> xfun 0.48 2024-10-03 [2] RSPM (R 4.4.0) @@ -892,7 +892,7 @@

Reproducibility#> xtable 1.8-4 2019-04-21 [2] RSPM (R 4.4.0) #> XVector 0.45.0 2024-05-01 [1] Bioconductor 3.20 (R 4.4.0) #> yaml 2.3.10 2024-07-26 [2] RSPM (R 4.4.0) -#> zlibbioc 1.51.1 2024-06-05 [1] Bioconductor 3.20 (R 4.4.0) +#> zlibbioc 1.51.2 2024-10-21 [1] Bioconductor 3.20 (R 4.4.1) #> #> [1] /__w/_temp/Library #> [2] /usr/local/lib/R/site-library diff --git a/pkgdown.yml b/pkgdown.yml index 3f8eab6..6e021fc 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,4 +4,4 @@ pkgdown_sha: 8d9cba19fe597bba170f8d4c99f351491ab4f4d1 articles: misc: misc.html visiumStitched: visiumStitched.html -last_built: 2024-10-18T14:27Z +last_built: 2024-10-24T20:14Z diff --git a/reference/add_array_coords.html b/reference/add_array_coords.html index 9c72273..46d50e1 100644 --- a/reference/add_array_coords.html +++ b/reference/add_array_coords.html @@ -129,54 +129,47 @@

Examples
if (!exists("spe")) {
     spe <- spatialLIBD::fetch_data(type = "visiumStitched_brain_spe")
 }
-#> 2024-10-18 14:27:36.458561 loading file /github/home/.cache/R/BiocFileCache/25739445980_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
+#> 2024-10-24 20:15:01.365432 loading file /github/home/.cache/R/BiocFileCache/760d7e2c6_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
 
 ########################################################################
 #   Prepare sample_info
 ########################################################################
 
-sample_info_path = file.path(tempdir(), "sample_info.rds")
-if (file.exists(sample_info_path)) {
-    sample_info <- readRDS(sample_info_path)
-} else {
-    sample_info <- dplyr::tibble(
-        group = "Br2719",
-        capture_area = c("V13B23-283_A1", "V13B23-283_C1", "V13B23-283_D1")
-    )
-    #   Add 'spaceranger_dir' column
-    sr_dir <- tempdir()
-    temp <- unzip(
-        spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"),
-        exdir = sr_dir
-    )
-    sample_info$spaceranger_dir <- file.path(
-        sr_dir, sample_info$capture_area, "outs", "spatial"
-    )
+sample_info <- dplyr::tibble(
+    group = "Br2719",
+    capture_area = c("V13B23-283_A1", "V13B23-283_C1", "V13B23-283_D1")
+)
+#   Add 'spaceranger_dir' column
+sr_dir <- tempdir()
+temp <- unzip(
+    spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"),
+    exdir = sr_dir
+)
+#> 2024-10-24 20:15:06.235759 loading file /github/home/.cache/R/BiocFileCache/7603a007f35_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1
+sample_info$spaceranger_dir <- file.path(
+    sr_dir, sample_info$capture_area, "outs", "spatial"
+)
 
-    #   Add Fiji-output-related columns
-    fiji_dir <- tempdir()
-    temp <- unzip(
-        spatialLIBD::fetch_data("visiumStitched_brain_Fiji_out"),
-        exdir = fiji_dir
-    )
-    sample_info$fiji_xml_path <- temp[grep("xml$", temp)]
-    sample_info$fiji_image_path <- temp[grep("png$", temp)]
+#   Add Fiji-output-related columns
+fiji_dir <- tempdir()
+temp <- unzip(
+    spatialLIBD::fetch_data("visiumStitched_brain_Fiji_out"),
+    exdir = fiji_dir
+)
+#> 2024-10-24 20:15:08.648643 loading file /github/home/.cache/R/BiocFileCache/76048672d76_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1
+sample_info$fiji_xml_path <- temp[grep("xml$", temp)]
+sample_info$fiji_image_path <- temp[grep("png$", temp)]
 
-    ## Re-size images and add more information to the sample_info
-    sample_info <- rescale_fiji_inputs(sample_info, out_dir = tempdir())
-
-    saveRDS(sample_info, sample_info_path)
-}
-#> 2024-10-18 14:27:41.321195 loading file /github/home/.cache/R/BiocFileCache/2573560f3ca_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1
-#> 2024-10-18 14:27:43.621069 loading file /github/home/.cache/R/BiocFileCache/257305c881d_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1
+## Re-size images and add more information to the sample_info
+sample_info <- rescale_fiji_inputs(sample_info, out_dir = tempdir())
 
 ## Preparing Fiji coordinates and images for build_SpatialExperiment()
 spe_input_dir <- tempdir()
 prep_fiji_coords(sample_info, out_dir = spe_input_dir)
-#> [1] "/tmp/RtmppTuXYz/Br2719/tissue_positions.csv"
+#> [1] "/tmp/RtmpphIhEc/Br2719/tissue_positions.csv"
 prep_fiji_image(sample_info, out_dir = spe_input_dir)
-#> [1] "/tmp/RtmppTuXYz/Br2719/tissue_lowres_image.png"
-#> [2] "/tmp/RtmppTuXYz/Br2719/scalefactors_json.json" 
+#> [1] "/tmp/RtmpphIhEc/Br2719/tissue_lowres_image.png"
+#> [2] "/tmp/RtmpphIhEc/Br2719/scalefactors_json.json" 
 
 ########################################################################
 #   Add array coordinates
diff --git a/reference/add_overlap_info.html b/reference/add_overlap_info.html
index f681d4d..ef42a08 100644
--- a/reference/add_overlap_info.html
+++ b/reference/add_overlap_info.html
@@ -97,7 +97,7 @@ 

Examples
if (!exists("spe")) {
     spe <- spatialLIBD::fetch_data(type = "visiumStitched_brain_spe")
 }
-#> 2024-10-18 14:27:56.973583 loading file /github/home/.cache/R/BiocFileCache/25739445980_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
+#> 2024-10-24 20:15:21.971441 loading file /github/home/.cache/R/BiocFileCache/760d7e2c6_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
 
 #    Find the mean of the 'sum_umi' metric by capture area to understand
 #    which capture areas will be excluded in regions of overlap
diff --git a/reference/as.Seurat.html b/reference/as.Seurat.html
index 03f27ed..517d520 100644
--- a/reference/as.Seurat.html
+++ b/reference/as.Seurat.html
@@ -105,7 +105,7 @@ 

Examplesspe_unstitched <- spatialLIBD::fetch_data( type = "spatialDLPFC_Visium_example_subset" )[seq(100), seq(100)] -#> 2024-10-18 14:28:01.274002 loading file /github/home/.cache/R/BiocFileCache/e1457e2cf2a_spatialDLPFC_spe_subset_example.rds%3Fdl%3D1 +#> 2024-10-24 20:15:26.263044 loading file /github/home/.cache/R/BiocFileCache/131c3e5993ec_spatialDLPFC_spe_subset_example.rds%3Fdl%3D1 ## Make the column names unique colnames(spe_unstitched) <- spatialLIBD::add_key(spe_unstitched)$key @@ -139,7 +139,7 @@

Examplesif (!exists("spe")) { spe <- spatialLIBD::fetch_data(type = "visiumStitched_brain_spe") } -#> 2024-10-18 14:28:07.148939 loading file /github/home/.cache/R/BiocFileCache/25739445980_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1 +#> 2024-10-24 20:15:32.352409 loading file /github/home/.cache/R/BiocFileCache/760d7e2c6_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1 seur_stitched <- as.Seurat(spe[seq(100), seq(100)]) #> Running 'as.Seurat(spe)'... #> Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from PC to PC_ diff --git a/reference/build_SpatialExperiment.html b/reference/build_SpatialExperiment.html index 89d36f6..5ba27c0 100644 --- a/reference/build_SpatialExperiment.html +++ b/reference/build_SpatialExperiment.html @@ -148,46 +148,41 @@

Examples# Prepare sample_info ######################################################################## -sample_info_path = file.path(tempdir(), "sample_info.rds") -if (file.exists(sample_info_path)) { - sample_info <- readRDS(sample_info_path) -} else { - sample_info <- dplyr::tibble( - group = "Br2719", - capture_area = c("V13B23-283_A1", "V13B23-283_C1", "V13B23-283_D1") - ) - # Add 'spaceranger_dir' column - sr_dir <- tempdir() - temp <- unzip( - spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"), - exdir = sr_dir - ) - sample_info$spaceranger_dir <- file.path( - sr_dir, sample_info$capture_area, "outs", "spatial" - ) - - # Add Fiji-output-related columns - fiji_dir <- tempdir() - temp <- unzip( - spatialLIBD::fetch_data("visiumStitched_brain_Fiji_out"), - exdir = fiji_dir - ) - sample_info$fiji_xml_path <- temp[grep("xml$", temp)] - sample_info$fiji_image_path <- temp[grep("png$", temp)] +sample_info <- dplyr::tibble( + group = "Br2719", + capture_area = c("V13B23-283_A1", "V13B23-283_C1", "V13B23-283_D1") +) +# Add 'spaceranger_dir' column +sr_dir <- tempdir() +temp <- unzip( + spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"), + exdir = sr_dir +) +#> 2024-10-24 20:15:35.672125 loading file /github/home/.cache/R/BiocFileCache/7603a007f35_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1 +sample_info$spaceranger_dir <- file.path( + sr_dir, sample_info$capture_area, "outs", "spatial" +) - ## Re-size images and add more information to the sample_info - sample_info <- rescale_fiji_inputs(sample_info, out_dir = tempdir()) +# Add Fiji-output-related columns +fiji_dir <- tempdir() +temp <- unzip( + spatialLIBD::fetch_data("visiumStitched_brain_Fiji_out"), + exdir = fiji_dir +) +#> 2024-10-24 20:15:38.221787 loading file /github/home/.cache/R/BiocFileCache/76048672d76_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1 +sample_info$fiji_xml_path <- temp[grep("xml$", temp)] +sample_info$fiji_image_path <- temp[grep("png$", temp)] - saveRDS(sample_info, sample_info_path) -} +## Re-size images and add more information to the sample_info +sample_info <- rescale_fiji_inputs(sample_info, out_dir = tempdir()) ## Preparing Fiji coordinates and images for build_SpatialExperiment() spe_input_dir <- tempdir() prep_fiji_coords(sample_info, out_dir = spe_input_dir) -#> [1] "/tmp/RtmppTuXYz/Br2719/tissue_positions.csv" +#> [1] "/tmp/RtmpphIhEc/Br2719/tissue_positions.csv" prep_fiji_image(sample_info, out_dir = spe_input_dir) -#> [1] "/tmp/RtmppTuXYz/Br2719/tissue_lowres_image.png" -#> [2] "/tmp/RtmppTuXYz/Br2719/scalefactors_json.json" +#> [1] "/tmp/RtmpphIhEc/Br2719/tissue_lowres_image.png" +#> [2] "/tmp/RtmpphIhEc/Br2719/scalefactors_json.json" ######################################################################## # Build the SpatialExperiment @@ -213,14 +208,14 @@

Examples coords_dir = spe_input_dir, reference_gtf = gtf_cache ) #> Building SpatialExperiment using capture area as sample ID -#> 2024-10-18 14:28:10.819786 SpatialExperiment::read10xVisium: reading basic data from SpaceRanger -#> 2024-10-18 14:28:17.832969 read10xVisiumAnalysis: reading analysis output from SpaceRanger -#> 2024-10-18 14:28:18.145846 add10xVisiumAnalysis: adding analysis output from SpaceRanger -#> 2024-10-18 14:28:18.447235 rtracklayer::import: reading the reference GTF file -#> 2024-10-18 14:28:48.016788 adding gene information to the SPE object +#> 2024-10-24 20:15:47.126858 SpatialExperiment::read10xVisium: reading basic data from SpaceRanger +#> 2024-10-24 20:15:53.129575 read10xVisiumAnalysis: reading analysis output from SpaceRanger +#> 2024-10-24 20:15:53.448283 add10xVisiumAnalysis: adding analysis output from SpaceRanger +#> 2024-10-24 20:15:53.750296 rtracklayer::import: reading the reference GTF file +#> 2024-10-24 20:16:22.091238 adding gene information to the SPE object #> Warning: Gene IDs did not match. This typically happens when you are not using the same GTF file as the one that was used by SpaceRanger. For example, one file uses GENCODE IDs and the other one ENSEMBL IDs. read10xVisiumWrapper() will try to convert them to ENSEMBL IDs. #> Warning: Dropping 2226 out of 38606 genes for which we don't have information on the reference GTF file. This typically happens when you are not using the same GTF file as the one that was used by SpaceRanger. -#> 2024-10-18 14:28:48.243393 adding information used by spatialLIBD +#> 2024-10-24 20:16:22.530429 adding information used by spatialLIBD #> Overwriting imgData(spe) with merged images (one per group) #> Adding array coordinates and overlap info diff --git a/reference/merge_overlapping.html b/reference/merge_overlapping.html index 2a15d6b..aef89d4 100644 --- a/reference/merge_overlapping.html +++ b/reference/merge_overlapping.html @@ -86,7 +86,7 @@

Examples
if (!exists("spe")) {
     spe <- spatialLIBD::fetch_data(type = "visiumStitched_brain_spe")
 }
-#> 2024-10-18 14:28:52.408461 loading file /github/home/.cache/R/BiocFileCache/25739445980_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
+#> 2024-10-24 20:16:27.531784 loading file /github/home/.cache/R/BiocFileCache/760d7e2c6_visiumStitched_brain_spe.rds%3Frlkey%3Dnq6a82u23xuu9hohr86oodwdi%26dl%3D1
 
 #   Group colData by group and array coordinates
 grouped_coldata = colData(spe) |>
diff --git a/reference/prep_fiji.html b/reference/prep_fiji.html
index e18aef4..fa74bb9 100644
--- a/reference/prep_fiji.html
+++ b/reference/prep_fiji.html
@@ -123,38 +123,33 @@ 

Author<

Examples

-
sample_info_path = file.path(tempdir(), "sample_info.rds")
-if (file.exists(sample_info_path)) {
-    sample_info <- readRDS(sample_info_path)
-} else {
-    sample_info <- dplyr::tibble(
-        group = "Br2719",
-        capture_area = c("V13B23-283_A1", "V13B23-283_C1", "V13B23-283_D1")
-    )
-    #   Add 'spaceranger_dir' column
-    sr_dir <- tempdir()
-    temp <- unzip(
-        spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"),
-        exdir = sr_dir
-    )
-    sample_info$spaceranger_dir <- file.path(
-        sr_dir, sample_info$capture_area, "outs", "spatial"
-    )
-
-    #   Add Fiji-output-related columns
-    fiji_dir <- tempdir()
-    temp <- unzip(
-        spatialLIBD::fetch_data("visiumStitched_brain_Fiji_out"),
-        exdir = fiji_dir
-    )
-    sample_info$fiji_xml_path <- temp[grep("xml$", temp)]
-    sample_info$fiji_image_path <- temp[grep("png$", temp)]
+    
sample_info <- dplyr::tibble(
+    group = "Br2719",
+    capture_area = c("V13B23-283_A1", "V13B23-283_C1", "V13B23-283_D1")
+)
+#   Add 'spaceranger_dir' column
+sr_dir <- tempdir()
+temp <- unzip(
+    spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"),
+    exdir = sr_dir
+)
+#> 2024-10-24 20:16:39.11547 loading file /github/home/.cache/R/BiocFileCache/7603a007f35_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1
+sample_info$spaceranger_dir <- file.path(
+    sr_dir, sample_info$capture_area, "outs", "spatial"
+)
 
-    ## Re-size images and add more information to the sample_info
-    sample_info <- rescale_fiji_inputs(sample_info, out_dir = tempdir())
+#   Add Fiji-output-related columns
+fiji_dir <- tempdir()
+temp <- unzip(
+    spatialLIBD::fetch_data("visiumStitched_brain_Fiji_out"),
+    exdir = fiji_dir
+)
+#> 2024-10-24 20:16:41.501629 loading file /github/home/.cache/R/BiocFileCache/76048672d76_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1
+sample_info$fiji_xml_path <- temp[grep("xml$", temp)]
+sample_info$fiji_image_path <- temp[grep("png$", temp)]
 
-    saveRDS(sample_info, sample_info_path)
-}
+## Re-size images and add more information to the sample_info
+sample_info <- rescale_fiji_inputs(sample_info, out_dir = tempdir())
 
 spe_input_dir <- tempdir()
 out_paths_image <- prep_fiji_image(
@@ -214,8 +209,8 @@ 

Examples # 'prep_fiji_image' produced an image and scalefactors out_paths_image -#> [1] "/tmp/RtmppTuXYz/Br2719/tissue_lowres_image.png" -#> [2] "/tmp/RtmppTuXYz/Br2719/scalefactors_json.json" +#> [1] "/tmp/RtmpphIhEc/Br2719/tissue_lowres_image.png" +#> [2] "/tmp/RtmpphIhEc/Br2719/scalefactors_json.json" # 'prep_fiji_coords' produced a file of spatial coordinates for the # stitched Br2719 diff --git a/reference/rescale_fiji_inputs.html b/reference/rescale_fiji_inputs.html index bf2d84f..23dc6de 100644 --- a/reference/rescale_fiji_inputs.html +++ b/reference/rescale_fiji_inputs.html @@ -140,7 +140,7 @@

Examples spatialLIBD::fetch_data("visiumStitched_brain_spaceranger"), exdir = sr_dir ) -#> 2024-10-18 14:29:08.020056 loading file /github/home/.cache/R/BiocFileCache/2573560f3ca_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1 +#> 2024-10-24 20:16:55.189005 loading file /github/home/.cache/R/BiocFileCache/7603a007f35_visiumStitched_brain_spaceranger.zip%3Frlkey%3Dbdgjc6mgy1ierdad6h6v5g29c%26dl%3D1 sample_info$spaceranger_dir <- file.path( sr_dir, sample_info$capture_area, "outs", "spatial" ) @@ -151,7 +151,7 @@

Examples spatialLIBD::fetch_data("visiumStitched_brain_Fiji_out"), exdir = fiji_dir ) -#> 2024-10-18 14:29:10.552356 loading file /github/home/.cache/R/BiocFileCache/257305c881d_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1 +#> 2024-10-24 20:16:57.70092 loading file /github/home/.cache/R/BiocFileCache/76048672d76_visiumStitched_brain_fiji_out.zip%3Frlkey%3Dptwal8f5zxakzejwd0oqw0lhj%26dl%3D1 sample_info$fiji_xml_path <- temp[grep("xml$", temp)] sample_info$fiji_image_path <- temp[grep("png$", temp)] @@ -184,15 +184,14 @@

Examples#> [11] "V13B23-283_C1.png" #> [12] "V13B23-283_D1" #> [13] "V13B23-283_D1.png" -#> [14] "bslib-055181530015cbb2d59664d57848f4cd" +#> [14] "bslib-5ff8f344b905f9ef2a33199151429212" #> [15] "downlit" -#> [16] "file311f105977a1" -#> [17] "file311f10ed7cca" -#> [18] "file311f233522c9" -#> [19] "file311f3e05378d" -#> [20] "file311f587b9d39" -#> [21] "file311f6e0910d" -#> [22] "sample_info.rds" +#> [16] "file363713b563ec" +#> [17] "file36373384864b" +#> [18] "file36373a2556b5" +#> [19] "file36374b3b5235" +#> [20] "file363755368c23" +#> [21] "file36377985d4b"