Skip to content

Commit 50af22b

Browse files
committed
revert all fixed for github action
1 parent a979e88 commit 50af22b

8 files changed

Lines changed: 113 additions & 86 deletions

File tree

.github/workflows/rworkflows.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,28 @@ jobs:
2727
r: auto
2828
cont: ghcr.io/bioconductor/bioconductor_docker:devel
2929
rspm: ~
30+
- os: macOS-latest
31+
bioc: release
32+
r: auto
33+
cont: ~
34+
rspm: ~
35+
- os: windows-latest
36+
bioc: release
37+
r: auto
38+
cont: ~
39+
rspm: ~
3040
steps:
31-
- name: Install vignette dependencies
32-
if: runner.os == 'Linux'
41+
- uses: grimbough/bioc-actions/setup-bioc@v1
42+
if: runner.os != 'Linux'
43+
with:
44+
bioc-version: ${{ matrix.config.bioc }}
45+
- name: Install vignette annotation dependencies
46+
if: runner.os != 'Linux'
3347
shell: Rscript {0}
3448
run: |
3549
options(repos = BiocManager::repositories())
3650
BiocManager::install(
37-
c(
38-
"org.Hs.eg.db", "AnnotationDbi", "BiocStyle", "BiocVersion",
39-
"h5mread", "tidyprint", "here", "scrapper"
40-
),
51+
c("org.Hs.eg.db", "AnnotationDbi", "BiocStyle", "BiocVersion"),
4152
ask = FALSE,
4253
update = FALSE
4354
)
@@ -48,7 +59,7 @@ jobs:
4859
as_cran: ${{ true }}
4960
run_vignettes: ${{ true }}
5061
run_lintr: ${{ false }}
51-
has_testthat: ${{ false }}
62+
has_testthat: ${{ true }}
5263
run_covr: ${{ true }}
5364
run_pkgdown: ${{ true }}
5465
has_runit: ${{ false }}
@@ -59,7 +70,7 @@ jobs:
5970
runner_os: ${{ runner.os }}
6071
run_telemetry: ${{ false }}
6172
force_install: ${{ true }}
62-
cache_version: cache-v8-bioc-devel
73+
cache_version: cache-v7-orgdb
6374
docker_registry: ghcr.io
6475

6576
docker-build-and-push:

DESCRIPTION

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ Suggests:
7373
cellNexus,
7474
org.Hs.eg.db,
7575
AnnotationDbi,
76-
h5mread,
77-
tidyprint,
78-
scrapper
76+
tidyprint
7977
VignetteBuilder: knitr
8078
Remotes:
8179
MangiolaLaboratory/cellNexus

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ COPY --chown=rstudio:rstudio . /home/rstudio/
66

77
RUN Rscript -e "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager'); BiocManager::install(version = 'devel', ask = FALSE)"
88

9-
RUN Rscript -e "if (!requireNamespace('remotes', quietly = TRUE)) install.packages('remotes'); options(repos = BiocManager::repositories()); BiocManager::install(c('scater', 'nnSVG', 'BiocStyle', 'BiocVersion', 'org.Hs.eg.db', 'AnnotationDbi', 'h5mread', 'tidyprint', 'here', 'scrapper'), ask = FALSE); remotes::install_github('MangiolaLaboratory/cellNexus', build_vignettes = FALSE, upgrade = 'never')"
9+
RUN Rscript -e "if (!requireNamespace('remotes', quietly = TRUE)) install.packages('remotes'); options(repos = BiocManager::repositories()); BiocManager::install(c('scater', 'nnSVG', 'BiocStyle', 'BiocVersion', 'org.Hs.eg.db', 'AnnotationDbi'), ask = FALSE); remotes::install_github('MangiolaLaboratory/cellNexus', build_vignettes = FALSE, upgrade = 'never')"
1010

11-
RUN Rscript -e "options(repos = BiocManager::repositories()); devtools::install('.', dependencies = TRUE, build_vignettes = FALSE, upgrade = FALSE)"
11+
RUN Rscript -e "options(repos = BiocManager::repositories()); devtools::install('.', dependencies = TRUE, build_vignettes = TRUE, upgrade = FALSE)"

vignettes/Introduction.Rmd

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
title: "Introduction to Spatial omic analyses"
33
author:
44
- Stefano Mangiola, South Australian immunoGENomics Cancer Institute^[<mangiola.stefano@adelaide.edu.au>], Walter and Eliza Hall Institute^[<mangiola.s at wehi.edu.au>]
5-
output: rmarkdown::html_vignette
5+
output:
6+
rmarkdown::html_document:
7+
toc: true
8+
toc_float: true
9+
toc_depth: 3
610
# bibliography: "`r file.path(system.file(package='tidySpatialWorkshop', 'bibliography'), 'bibliography.bib')`"
711
vignette: >
812
%\VignetteIndexEntry{Introduction to Spatial omic analyses}
@@ -33,7 +37,8 @@ knitr::opts_chunk$set(echo = TRUE, cache = FALSE)
3337
## Workshop partner: Physalia
3438

3539
```{r, echo=FALSE, out.width="700px"}
36-
knitr::include_graphics(system.file("images/physalia-min.png", package = "tidySpatialWorkshop"))
40+
library(here)
41+
knitr::include_graphics(here("inst/images/physalia-min.png"))
3742
```
3843

3944
## Workshop goals and objectives

vignettes/Session_1_sequencing_assays.Rmd

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ title: "Sequencing assays"
33
author:
44
- Stefano Mangiola, South Australian immunoGENomics Cancer Institute^[<mangiola.stefano@adelaide.edu.au>], Walter and Eliza Hall Institute^[<mangiola.s at wehi.edu.au>]
55
- Luciano Martellotto, BD Biosciences
6-
output: rmarkdown::html_vignette
6+
output:
7+
rmarkdown::html_document:
8+
toc: true
9+
toc_float: true
10+
toc_depth: 3
711
# bibliography: "`r file.path(system.file(package='tidySpatialWorkshop', 'vignettes'), 'tidyomics.bib')`"
812
vignette: >
913
%\VignetteIndexEntry{Sequencing assays}
@@ -51,7 +55,9 @@ An alternative method, known as **combinatorial FISH** (fluorescence in situ hyb
5155

5256

5357
```{r, echo=FALSE, out.width="700px"}
54-
knitr::include_graphics(system.file("images/three_technologies.png", package = "tidySpatialWorkshop"))
58+
library(here)
59+
60+
knitr::include_graphics(here("inst/images/three_technologies.png"))
5561
```
5662

5763
### Visium
@@ -67,7 +73,9 @@ In practice, Visium CytAssist has found widespread use across many fields. Cance
6773

6874

6975
```{r, echo=FALSE, out.width="700px"}
70-
knitr::include_graphics(system.file("images/visium.png", package = "tidySpatialWorkshop"))
76+
library(here)
77+
78+
knitr::include_graphics(here("inst/images/visium.png"))
7179
```
7280

7381
### Visum HD
@@ -79,7 +87,9 @@ As with the standard Visium workflow, fresh-frozen or FFPE tissue sections are f
7987

8088

8189
```{r, echo=FALSE, out.width="700px"}
82-
knitr::include_graphics(system.file("images/visiumhd.png", package = "tidySpatialWorkshop"))
90+
library(here)
91+
92+
knitr::include_graphics(here("inst/images/visiumhd.png"))
8393
```
8494
### STOmics
8595

@@ -90,7 +100,9 @@ Once a freshly frozen or paraformaldehyde-fixed tissue section has been mounted
90100
The sheer density of the DNB pattern—over 25 000 spots per 100 µm² in the highest-resolution formats—means that STOmics can detect transcripts at nearly subcellular scale, revealing fine-grained differences in gene activity within single cells or across tiny tissue niches. At the same time, chip formats up to 174 cm² in area allow researchers to profile entire organs or large tissue biopsies in one run, without stitching together multiple fields of view. In practice, developmental biologists have used this platform to survey gene expression across whole zebrafish embryos, while tumour biologists have mapped the spatial organisation of immune infiltrates in large cancer resections. By marrying nanometre-scale resolution with slide-wide coverage, BGI’s STOmics empowers scientists to explore biological landscapes from the level of subcellular compartments all the way up to entire tissue architectures.
91101

92102
```{r, echo=FALSE, out.width="700px"}
93-
knitr::include_graphics(system.file("images/stomics.png", package = "tidySpatialWorkshop"))
103+
library(here)
104+
105+
knitr::include_graphics(here("inst/images/stomics.png"))
94106
```
95107

96108

@@ -143,7 +155,9 @@ The `SpatialExperiment` package provides a robust framework for handling spatial
143155
Righelli et al. doi: [10.1093/bioinformatics/btac299](https://academic.oup.com/bioinformatics/article/38/11/3128/6575443?login=false)
144156

145157
```{r, echo=FALSE, out.width="700px"}
146-
knitr::include_graphics(system.file("images/spatialExperimentClass.png", package = "tidySpatialWorkshop"))
158+
library(here)
159+
160+
knitr::include_graphics(here("inst/images/spatialExperimentClass.png"))
147161
```
148162

149163
```{r, eval=FALSE}
@@ -203,28 +217,17 @@ library(ExperimentHub)
203217
# https://support.bioconductor.org/p/9161859/#9161863
204218
setClassUnion("ExpData", c("matrix", "SpatialExperiment"))
205219
206-
spatial_data <- tryCatch({
207-
ExperimentHub::ExperimentHub() |>
208-
spatialLIBD::fetch_data(eh = _, type = "spe")
209-
}, error = function(e) {
210-
message("ExperimentHub failed, using Zenodo fallback: ", conditionMessage(e))
211-
options(timeout = max(300, getOption("timeout")))
212-
tmp <- tempfile(fileext = ".rds")
213-
utils::download.file(
214-
"https://zenodo.org/records/11233385/files/tidySpatialWorkshop2024_spatial_data.rds",
215-
destfile = tmp,
216-
mode = "wb"
217-
)
218-
readRDS(tmp)
219-
})
220+
spatial_data <-
221+
ExperimentHub::ExperimentHub() |>
222+
spatialLIBD::fetch_data( eh = _, type = "spe")
220223
221224
names(libd_layer_colors) = gsub("ayer", "", names(libd_layer_colors))
222225
223226
# Clear the reductions
224-
reducedDims(spatial_data) = NULL
227+
reducedDims(spatial_data) = NULL
225228
226229
# Select only 3 samples
227-
spatial_data = spatial_data[, spatial_data$sample_id %in% c("151673", "151675", "151676")]
230+
spatial_data = spatial_data[,spatial_data$sample_id %in% c("151673", "151675", "151676")]
228231
229232
# Display the object
230233
spatial_data
@@ -795,7 +798,7 @@ Overview of the algorithm
795798

796799
[Material source](https://bioconductor.org/packages/release/bioc/vignettes/Banksy/inst/doc/multi-sample.html)
797800

798-
```{r, eval=FALSE, message=FALSE, warning=FALSE}
801+
```{r, eval=TRUE, message=FALSE, warning=FALSE}
799802
library(Banksy)
800803
801804
# scale the counts, without log transformation
@@ -806,7 +809,7 @@ spatial_data = spatial_data |> logNormCounts(log=FALSE, name = "normcounts")
806809

807810
The Banksy documentation, suggest the use of `Seurat` for the detection of highly variable genes.
808811

809-
```{r, eval=FALSE, message=FALSE, warning=FALSE}
812+
```{r, message=FALSE, warning=FALSE}
810813
library(Seurat)
811814
812815
# Convert to list
@@ -832,7 +835,7 @@ rowData(spatial_data[head(hvgs),])[,c("gene_id", "gene_name")]
832835

833836
We now split the data by sample, to compute the neighbourhood matrices.
834837

835-
```{r, eval=FALSE, message=FALSE, warning=FALSE}
838+
```{r, message=FALSE, warning=FALSE}
836839
# Convert to list
837840
spatial_data_list <- lapply(unique(spatial_data$sample_id), function(x)
838841
spatial_data[
@@ -857,7 +860,7 @@ Here, we perform PCA using the BANKSY algorithm on the joint dataset. The group
857860
Note: this step takes long time
858861
:::
859862

860-
```{r, eval=FALSE, message=FALSE, warning=FALSE}
863+
```{r, eval=TRUE, message=FALSE, warning=FALSE}
861864
spe_joint <- runBanksyPCA( # Run PCA on the Banskly matrix
862865
spe_joint,
863866
lambda = 0.2, # spatial weighting parameter. Larger values (e.g. 0.8) incorporate more spatial neighborhood
@@ -868,7 +871,7 @@ spe_joint <- runBanksyPCA( # Run PCA on the Banskly matrix
868871

869872
Once the dimensional reduction is complete, we cluster the spots across all samples and use `connectClusters` to visually compare these new BANKSY clusters against manual annotations.
870873

871-
```{r, eval=FALSE, message=FALSE, warning=FALSE}
874+
```{r, eval=TRUE, message=FALSE, warning=FALSE}
872875
spe_joint <- clusterBanksy( # clustering on the principal components computed on the BANKSY matrix
873876
spe_joint,
874877
lambda = 0.2, # spatial weighting parameter. Larger values (e.g. 0.8) incorporate more spatial neighborhood
@@ -884,7 +887,7 @@ As an optional step, we smooth the cluster labels for each sample independently,
884887

885888
From SpiceMix paper [Chidester et al., 2023](https://www.nature.com/articles/s41588-022-01256-z)
886889

887-
```{r, eval=FALSE, message=FALSE, warning=FALSE}
890+
```{r, eval=TRUE, message=FALSE, warning=FALSE}
888891
spatial_data_list <- lapply(
889892
unique(spe_joint$sample_id),
890893
function(x)
@@ -903,7 +906,7 @@ names(spatial_data_list) <- paste0("sample_", unique(spe_joint$sample_id))
903906

904907
The raw and smoothed cluster labels are stored in the `colData` slot of each `SingleCellExperiment` or `SpatialExperiment` object.
905908

906-
```{r, eval=FALSE}
909+
```{r, eval=TRUE}
907910
cluster_metadata =
908911
colData(spatial_data_list$sample_151673)[, c("clust_M0_lam0.2_k50_res0.7", "clust_M0_lam0.2_k50_res0.7_smooth")]
909912
@@ -915,13 +918,13 @@ Using cluster comparison metrics like the adjusted Rand index (ARI) we evaluate
915918

916919
The Adjusted Rand Index (ARI) is a measure of the similarity between two data clusterings. Measures degree of overlapping between two partitions.
917920

918-
```{r, eval=FALSE}
921+
```{r, eval=TRUE}
919922
compareClusters(spatial_data_list$sample_151673, func = 'ARI')
920923
```
921924

922925
We calculate the ARI for each sample to assess the consistency and accuracy of our clustering across different samples.
923926

924-
```{r, eval=FALSE}
927+
```{r, eval=TRUE}
925928
ari <- sapply(spatial_data_list, function(x) as.numeric(tail(compareClusters(x, func = "ARI")[, 1], n = 1)))
926929
ari
927930
```
@@ -930,7 +933,7 @@ Visualising Clusters and Annotations on Spatial Coordinates: We utilise the ggsp
930933

931934
When using **knitr** (including vignettes), only the **last** ggplot produced in a code chunk is written out by default. If you need several figures from the same narrative block, split them into separate chunks below or wrap each ggplot in `print()`.
932935

933-
```{r multi-sample-spatial-smoothed, eval=FALSE, fig.width=6, fig.height=6}
936+
```{r multi-sample-spatial-smoothed, eval=TRUE, fig.width=6, fig.height=6}
934937
# Use scater:::.get_palette('tableau10medium')
935938
library(cowplot)
936939
@@ -949,7 +952,7 @@ ggspavis::plotCoords(
949952
labs(title = "BANKSY clusters (smoothed)")
950953
```
951954

952-
```{r multi-sample-spatial-raw, eval=FALSE, fig.width=6, fig.height=6}
955+
```{r multi-sample-spatial-raw, eval=TRUE, fig.width=6, fig.height=6}
953956
ggspavis::plotCoords(
954957
do.call(cbind, spatial_data_list),
955958
annotate = sprintf("%s", "clust_M0_lam0.2_k50_res0.7"),
@@ -960,7 +963,7 @@ ggspavis::plotCoords(
960963
labs(title = "BANKSY clusters")
961964
```
962965

963-
```{r multi-sample-spatial-libd, eval=FALSE, fig.width=6, fig.height=6}
966+
```{r multi-sample-spatial-libd, eval=TRUE, fig.width=6, fig.height=6}
964967
ggspavis::plotCoords(
965968
spatial_data,
966969
annotate = "spatialLIBD",

0 commit comments

Comments
 (0)