Skip to content

Commit f77ffeb

Browse files
authored
Merge branch 'devel' into layer_stat_cor_plot_original_colors
2 parents 7c7acab + 26fe43e commit f77ffeb

40 files changed

+396
-386
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: spatialLIBD
22
Title: spatialLIBD: an R/Bioconductor package to visualize spatially-resolved
33
transcriptomics data
4-
Version: 1.19.5
5-
Date: 2024-12-16
4+
Version: 1.19.7
5+
Date: 2025-02-28
66
Authors@R:
77
c(
88
person("Leonardo", "Collado-Torres", role = c("aut", "cre"),

NEWS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# spatialLIBD 1.19.7
2+
3+
BUG FIXES
4+
5+
* Removed code that made the app very slow to load using `HDF5Array` objects.
6+
See
7+
<https://github.com/LieberInstitute/spatialLIBD/commit/b80d92c3271a6ad92859f79a3bc343f77bad9bf2>
8+
for details.
9+
* Fixed a bug on the Z-score calculation in `multi_gene_z_score()`. See
10+
<https://github.com/LieberInstitute/spatialLIBD/commit/2d17ea2c3d1b73b38fbd50503765052c8487b9b1>
11+
for details. Implemented by @Nick-Eagles.
12+
* Fix a bug in the documentation of `run_app()` for the example stitched data.
13+
* No longer point to Twitter, instead point to Bluesky. This is for the package
14+
main README file as well as the default app documentation files.
15+
116
# spatialLIBD 1.19.5
217

318
BUG FIXES

R/add10xVisiumAnalysis.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
#'
3030
#' ## Note that ?SpatialExperiment::read10xVisium doesn't include all the files
3131
#' ## we need to illustrate read10xVisiumWrapper().
32-
add10xVisiumAnalysis <- function(spe,
33-
visium_analysis) {
32+
add10xVisiumAnalysis <- function(
33+
spe,
34+
visium_analysis) {
3435
col_info <- colData(spe)
3536
barcode_present <- "barcode" %in% colnames(col_info)
3637
if (!barcode_present) {

R/add_images.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@
4343
#' ))
4444
#' }
4545
add_images <-
46-
function(spe,
47-
image_dir,
48-
image_pattern,
49-
image_id_current = "lowres",
50-
image_id = image_pattern,
51-
image_paths = locate_images(spe, image_dir, image_pattern)) {
46+
function(
47+
spe,
48+
image_dir,
49+
image_pattern,
50+
image_id_current = "lowres",
51+
image_id = image_pattern,
52+
image_paths = locate_images(spe, image_dir, image_pattern)) {
5253
stopifnot(length(names(image_paths)) > 0)
5354
stopifnot(all(names(image_paths) %in% unique(spe$sample_id)))
5455
stopifnot(!any(duplicated(names(image_paths))))

R/annotate_registered_clusters.R

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@
4848
#' ## More relaxed merging threshold
4949
#' annotate_registered_clusters(cor_stats_layer, cutoff_merge_ratio = 1)
5050
annotate_registered_clusters <-
51-
function(cor_stats_layer,
52-
confidence_threshold = 0.25,
53-
cutoff_merge_ratio = 0.25) {
51+
function(
52+
cor_stats_layer,
53+
confidence_threshold = 0.25,
54+
cutoff_merge_ratio = 0.25) {
5455
annotated <-
5556
apply(cor_stats_layer,
5657
1,
@@ -89,10 +90,11 @@ annotate_registered_clusters <-
8990
}
9091

9192
annotate_registered_cluster <-
92-
function(remaining,
93-
label = "",
94-
current = NULL,
95-
cutoff_merge_ratio = 0.25) {
93+
function(
94+
remaining,
95+
label = "",
96+
current = NULL,
97+
cutoff_merge_ratio = 0.25) {
9698
## Filter negative correlations
9799
remaining <- remaining[remaining > 0]
98100

R/app_server.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,6 @@ app_server <- function(input, output, session) {
146146
}
147147
})
148148

149-
# Set the max based on the assay
150-
observeEvent(input$assayname, {
151-
updateNumericInput(
152-
session,
153-
inputId = "minCount",
154-
value = 0,
155-
min = -1,
156-
max = max(assays(spe)[[input$assayname]]),
157-
step = 1
158-
)
159-
})
160-
161149
## Static plotting functions
162150
static_histology <- reactive({
163151
if (input$cluster == "ManualAnnotation") {

R/app_ui.R

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ app_ui <- function() {
140140
label = "Minimum count value",
141141
value = 0,
142142
min = -1,
143-
max = max(assays(spe)[[length(assayNames(spe))]]),
144143
step = 1
145144
),
146145
helpText(
@@ -307,16 +306,14 @@ app_ui <- function() {
307306
numericInput(
308307
"grid_nrow",
309308
label = "N rows",
310-
value = 1,
311-
min = 1,
312-
max = 3
309+
value = round(length(unique(spe$sample_id)) / 3 + 0.5),
310+
min = 1
313311
),
314312
numericInput(
315313
"grid_ncol",
316314
label = "N columns",
317315
value = 3,
318-
min = 1,
319-
max = 4
316+
min = 1
320317
),
321318
actionButton("grid_update", label = "Update grid plot"),
322319
downloadButton("downloadPlotHistologyGrid", "Download PDF"),
@@ -409,16 +406,14 @@ app_ui <- function() {
409406
numericInput(
410407
"gene_grid_nrow",
411408
label = "N rows",
412-
value = 1,
413-
min = 1,
414-
max = 3
409+
value = round(length(unique(spe$sample_id)) / 3 + 0.5),
410+
min = 1
415411
),
416412
numericInput(
417413
"gene_grid_ncol",
418414
label = "N columns",
419415
value = 3,
420-
min = 1,
421-
max = 4
416+
min = 1
422417
),
423418
actionButton("gene_grid_update", label = "Update grid plot"),
424419
downloadButton("downloadPlotGeneGrid", "Download PDF"),

R/check_sce.R

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,41 @@
2424
#' ## Check the object
2525
#' check_sce(sce_example)
2626
#' }
27-
check_sce <- function(sce,
28-
variables = c(
29-
"GraphBased",
30-
"ManualAnnotation",
31-
"Maynard",
32-
"Martinowich",
33-
paste0("SNN_k50_k", 4:28),
34-
"spatialLIBD",
35-
"cell_count",
36-
"sum_umi",
37-
"sum_gene",
38-
"expr_chrM",
39-
"expr_chrM_ratio",
40-
"SpatialDE_PCA",
41-
"SpatialDE_pool_PCA",
42-
"HVG_PCA",
43-
"pseudobulk_PCA",
44-
"markers_PCA",
45-
"SpatialDE_UMAP",
46-
"SpatialDE_pool_UMAP",
47-
"HVG_UMAP",
48-
"pseudobulk_UMAP",
49-
"markers_UMAP",
50-
"SpatialDE_PCA_spatial",
51-
"SpatialDE_pool_PCA_spatial",
52-
"HVG_PCA_spatial",
53-
"pseudobulk_PCA_spatial",
54-
"markers_PCA_spatial",
55-
"SpatialDE_UMAP_spatial",
56-
"SpatialDE_pool_UMAP_spatial",
57-
"HVG_UMAP_spatial",
58-
"pseudobulk_UMAP_spatial",
59-
"markers_UMAP_spatial"
60-
)) {
27+
check_sce <- function(
28+
sce,
29+
variables = c(
30+
"GraphBased",
31+
"ManualAnnotation",
32+
"Maynard",
33+
"Martinowich",
34+
paste0("SNN_k50_k", 4:28),
35+
"spatialLIBD",
36+
"cell_count",
37+
"sum_umi",
38+
"sum_gene",
39+
"expr_chrM",
40+
"expr_chrM_ratio",
41+
"SpatialDE_PCA",
42+
"SpatialDE_pool_PCA",
43+
"HVG_PCA",
44+
"pseudobulk_PCA",
45+
"markers_PCA",
46+
"SpatialDE_UMAP",
47+
"SpatialDE_pool_UMAP",
48+
"HVG_UMAP",
49+
"pseudobulk_UMAP",
50+
"markers_UMAP",
51+
"SpatialDE_PCA_spatial",
52+
"SpatialDE_pool_PCA_spatial",
53+
"HVG_PCA_spatial",
54+
"pseudobulk_PCA_spatial",
55+
"markers_PCA_spatial",
56+
"SpatialDE_UMAP_spatial",
57+
"SpatialDE_pool_UMAP_spatial",
58+
"HVG_UMAP_spatial",
59+
"pseudobulk_UMAP_spatial",
60+
"markers_UMAP_spatial"
61+
)) {
6162
## Should be a SingleCellExperiment object
6263
stopifnot(is(sce, "SingleCellExperiment"))
6364

R/check_spe.R

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
#' ## Check the object
2626
#' check_spe(spe)
2727
#' }
28-
check_spe <- function(spe,
29-
variables = c(
30-
"sum_umi",
31-
"sum_gene",
32-
"expr_chrM",
33-
"expr_chrM_ratio"
34-
)) {
28+
check_spe <- function(
29+
spe,
30+
variables = c(
31+
"sum_umi",
32+
"sum_gene",
33+
"expr_chrM",
34+
"expr_chrM_ratio"
35+
)) {
3536
## Should be a SpatialExperiment object
3637
stopifnot(is(spe, "SpatialExperiment"))
3738

R/fetch_data.R

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,30 +84,29 @@
8484
#' #> 172.28 MB
8585
#' }
8686
fetch_data <-
87-
function(
88-
type = c(
89-
"sce",
90-
"sce_layer",
91-
"modeling_results",
92-
"sce_example",
93-
"spe",
94-
"spatialDLPFC_Visium",
95-
"spatialDLPFC_Visium_example_subset",
96-
"spatialDLPFC_Visium_pseudobulk",
97-
"spatialDLPFC_Visium_modeling_results",
98-
"spatialDLPFC_Visium_SPG",
99-
"spatialDLPFC_snRNAseq",
100-
"Visium_SPG_AD_Visium_wholegenome_spe",
101-
"Visium_SPG_AD_Visium_targeted_spe",
102-
"Visium_SPG_AD_Visium_wholegenome_pseudobulk_spe",
103-
"Visium_SPG_AD_Visium_wholegenome_modeling_results",
104-
"visiumStitched_brain_spe",
105-
"visiumStitched_brain_spaceranger",
106-
"visiumStitched_brain_Fiji_out"
107-
),
108-
destdir = tempdir(),
109-
eh = ExperimentHub::ExperimentHub(),
110-
bfc = BiocFileCache::BiocFileCache()) {
87+
function(type = c(
88+
"sce",
89+
"sce_layer",
90+
"modeling_results",
91+
"sce_example",
92+
"spe",
93+
"spatialDLPFC_Visium",
94+
"spatialDLPFC_Visium_example_subset",
95+
"spatialDLPFC_Visium_pseudobulk",
96+
"spatialDLPFC_Visium_modeling_results",
97+
"spatialDLPFC_Visium_SPG",
98+
"spatialDLPFC_snRNAseq",
99+
"Visium_SPG_AD_Visium_wholegenome_spe",
100+
"Visium_SPG_AD_Visium_targeted_spe",
101+
"Visium_SPG_AD_Visium_wholegenome_pseudobulk_spe",
102+
"Visium_SPG_AD_Visium_wholegenome_modeling_results",
103+
"visiumStitched_brain_spe",
104+
"visiumStitched_brain_spaceranger",
105+
"visiumStitched_brain_Fiji_out"
106+
),
107+
destdir = tempdir(),
108+
eh = ExperimentHub::ExperimentHub(),
109+
bfc = BiocFileCache::BiocFileCache()) {
111110
## Some variables
112111
sce <-
113112
sce_layer <- modeling_results <- sce_sub <- spe <- NULL

0 commit comments

Comments
 (0)