From 203cf1984948133c28b949b5f78fdb393cb66bdd Mon Sep 17 00:00:00 2001 From: Peter Hickey Date: Tue, 7 Oct 2025 12:51:31 +1100 Subject: [PATCH 1/2] Update hca-bone-marrow.Rmd - Note that MNN-corected values may vary across systems due to the randomized SVD - Make `cluster.choice` robust to these differences - This was verified on Ubuntu (x86_64) and macOS (aarch64) --- inst/book/hca-bone-marrow.Rmd | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/inst/book/hca-bone-marrow.Rmd b/inst/book/hca-bone-marrow.Rmd index a607dce..2c9f52d 100644 --- a/inst/book/hca-bone-marrow.Rmd +++ b/inst/book/hca-bone-marrow.Rmd @@ -106,7 +106,7 @@ for (i in colnames(blocked.stats)) { ## Data integration -Here we use multiple cores, randomized SVD and approximate nearest-neighbor detection to speed up this step. +Here we use multiple cores, randomized SVD^[The randomized SVD may give slightly different results on different systems, so the MNN-corrected values may themselves vary across systems.] and approximate nearest-neighbor detection to speed up this step. ```{r integration} library(batchelor) @@ -189,15 +189,22 @@ markers.bone <- findMarkers(sce.bone, block = sce.bone$Donor, direction = 'up', lfc = 1, BPPARAM=bpp) ``` -We visualize the top markers for a randomly chosen cluster using a heatmap in Figure \@ref(fig:unref-hca-bone-heatmap). +We visualize the top markers for a randomly chosen cluster^[The exact cluster chosen varies across systems due to the MNN-corrected values themselves varying across systems.] using a heatmap in Figure \@ref(fig:unref-hca-bone-heatmap). The presence of upregulated genes like _LYZ_, _S100A8_ and _VCAN_ is consistent with a monocyte identity for this cluster. ```{r, echo=FALSE} -cluster.choice <- "2" +# NOTE: The exact cluster varies across systems due to the MNN-corrected values +# themselves varying across systems. This bit of code aims to pick the +# cluster with the intended 'monocyte' identity. +cluster.choice <- which.max( + tapply( + colMeans(logcounts(sce.bone)[c("LYZ", "VCAN", "S100A8", "CTSS"), ]), + colLabels(sce.bone), + median)) ``` ```{r unref-hca-bone-heatmap, fig.cap=sprintf("Heatmap of log~2~-fold changes for the top marker genes (rows) of cluster %s compared to all other clusters (columns).", cluster.choice)} -top.markers <- markers.bone[["2"]] +top.markers <- markers.bone[[cluster.choice]] best <- top.markers[top.markers$Top <= 10,] lfcs <- getMarkerEffects(best) From b9b6b6113487391f1d5283d4ab5aa05eb0b4ff4f Mon Sep 17 00:00:00 2001 From: Peter Hickey Date: Fri, 10 Oct 2025 15:48:26 +1100 Subject: [PATCH 2/2] Version bump --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 05bac31..631f387 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: OSCA.workflows Title: OSCA Workflows -Version: 1.17.2 -Date: 2025-09-29 +Version: 1.17.3 +Date: 2025-10-10 Authors@R: c( person('Robert', 'Amezquita', role = 'aut'), person('Aaron', 'Lun', role = 'aut', email="infinite.monkeys.with.keyboards@gmail.com"),