Coder Social home page Coder Social logo

lieberinstitute / spatiallibd Goto Github PK

View Code? Open in Web Editor NEW
76.0 20.0 16.0 224.19 MB

Code for the spatialLIBD R/Bioconductor package and shiny app

Home Page: http://LieberInstitute.github.io/spatialLIBD/

R 52.40% HTML 47.39% CSS 0.20% Rez 0.01%
rstats shiny spatial-transcriptomics 10xgenomics bioconductor golem visium spatialexperiment spatiallibd

spatiallibd's Introduction

spatialLIBD

Lifecycle: stable Bioc release status Bioc devel status Bioc downloads rank Bioc support Bioc last commit Bioc dependencies Codecov test coverage R build status GitHub issues GitHub pulls DOI

Welcome to the spatialLIBD project! It is composed of:

The web application allows you to browse the LIBD human dorsolateral pre-frontal cortex (DLPFC) spatial transcriptomics data generated with the 10x Genomics Visium platform. Through the R/Bioconductor package you can also download the data as well as visualize your own datasets using this web application. Please check the manuscript or bioRxiv pre-print for more details about this project.

If you tweet about this website, the data or the R package please use the #spatialLIBD hashtag. You can find previous tweets that way as shown here. Thank you! Tweet #spatialLIBD

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Study design

As a quick overview, the data presented here is from portion of the DLPFC that spans six neuronal layers plus white matter (A) for a total of three subjects with two pairs of spatially adjacent replicates (B). Each dissection of DLPFC was designed to span all six layers plus white matter (C). Using this web application you can explore the expression of known genes such as SNAP25 (D, a neuronal gene), MOBP (E, an oligodendrocyte gene), and known layer markers from mouse studies such as PCP4 (F, a known layer 5 marker gene).

This web application was built such that we could annotate the spots to layers as you can see under the spot-level data tab. Once we annotated each spot to a layer, we compressed the information by a pseudo-bulking approach into layer-level data. We then analyzed the expression through a set of models whose results you can also explore through this web application. Finally, you can upload your own gene sets of interest as well as layer enrichment statistics and compare them with our LIBD Human DLPFC Visium dataset.

If you are interested in running this web application locally, you can do so thanks to the spatialLIBD R/Bioconductor package that powers this web application as shown below.

## Run this web application locally
spatialLIBD::run_app()

## You will have more control about the length of the
## session and memory usage.

## You could also use this function to visualize your
## own data given some requirements described
## in detail in the package vignette documentation
## at http://research.libd.org/spatialLIBD/.

Shiny website mirrors

  • Main shiny application website (note that the link must have a trailing slash / for it to work)
  • Shinyapps This version has less RAM memory but is typically deployed using the latest version of spatialLIBD.

Introductory material

If you prefer to watch a video overview of the HumanPilot project, check the following journal club presentation of the main results.

<iframe width="560" height="315" src="https://www.youtube.com/embed/qloLbG5-IPM?si=1gO1fujrgSXPfa6F" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-external="1"> </iframe>

You might also be interested in the explainer video and companion blog post as well as the original Feb 29, 2020 blog post from when we first made this project public.

<iframe width="560" height="315" src="https://www.youtube.com/embed/HGioWKuI3ek?si=X-tqtZtcPSV-3uMt" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-external="1"> </iframe>

R/Bioconductor package

The spatialLIBD package contains functions for:

  • Accessing the spatial transcriptomics data from the LIBD Human Pilot project (code on GitHub) generated with the Visium platform from 10x Genomics. The data is retrieved from Bioconductor’s ExperimentHub.
  • Visualizing the spot-level spatial gene expression data and clusters.
  • Inspecting the data interactively either on your computer or through spatial.libd.org/spatialLIBD/.

For more details, please check the documentation website or the Bioconductor package landing page here.

Installation instructions

Get the latest stable R release from CRAN. Then install spatialLIBD from Bioconductor using the following code:

if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
}

BiocManager::install("spatialLIBD")

If you want to use the development version of spatialLIBD, you will need to use the R version corresponding to the current Bioconductor-devel branch as described in more detail on the Bioconductor website. Then you can install spatialLIBD from GitHub using the following command.

BiocManager::install("LieberInstitute/spatialLIBD")

Access the data

Through the spatialLIBD package you can access the processed data in it’s final R format. However, we also provide a table of links so you can download the raw data we received from 10x Genomics.

Processed data

Using spatialLIBD you can access the Human DLPFC spatial transcriptomics data from the 10x Genomics Visium platform. For example, this is the code you can use to access the layer-level data. For more details, check the help file for fetch_data().

## Load the package
library("spatialLIBD")

## Download the spot-level data
spe <- fetch_data(type = "spe")

## This is a SpatialExperiment object
spe
#> class: SpatialExperiment 
#> dim: 33538 47681 
#> metadata(0):
#> assays(2): counts logcounts
#> rownames(33538): ENSG00000243485 ENSG00000237613 ... ENSG00000277475
#>   ENSG00000268674
#> rowData names(9): source type ... gene_search is_top_hvg
#> colnames(47681): AAACAACGAATAGTTC-1 AAACAAGTATCTCCCA-1 ...
#>   TTGTTTCCATACAACT-1 TTGTTTGTGTAAATTC-1
#> colData names(69): sample_id Cluster ... array_row array_col
#> reducedDimNames(6): PCA TSNE_perplexity50 ... TSNE_perplexity80
#>   UMAP_neighbors15
#> mainExpName: NULL
#> altExpNames(0):
#> spatialCoords names(2) : pxl_col_in_fullres pxl_row_in_fullres
#> imgData names(4): sample_id image_id data scaleFactor
## Note the memory size
lobstr::obj_size(spe)
#> 2.04 GB
## Remake the logo image with histology information
vis_clus(
    spe = spe,
    clustervar = "spatialLIBD",
    sampleid = "151673",
    colors = libd_layer_colors,
    ... = " DLPFC Human Brain Layers\nMade with research.libd.org/spatialLIBD/"
)

Raw data

You can access all the raw data through Globus (jhpce#HumanPilot10x). Furthermore, below you can find the links to the raw data we received from 10x Genomics.

SampleID h5_filtered h5_raw image_full image_hi image_lo loupe HTML_report
151507 AWS AWS AWS AWS AWS AWS GitHub
151508 AWS AWS AWS AWS AWS AWS GitHub
151509 AWS AWS AWS AWS AWS AWS GitHub
151510 AWS AWS AWS AWS AWS AWS GitHub
151669 AWS AWS AWS AWS AWS AWS GitHub
151670 AWS AWS AWS AWS AWS AWS GitHub
151671 AWS AWS AWS AWS AWS AWS GitHub
151672 AWS AWS AWS AWS AWS AWS GitHub
151673 AWS AWS AWS AWS AWS AWS GitHub
151674 AWS AWS AWS AWS AWS AWS GitHub
151675 AWS AWS AWS AWS AWS AWS GitHub
151676 AWS AWS AWS AWS AWS AWS GitHub

Citation

Below is the citation output from using citation('spatialLIBD') in R. Please run this yourself to check for any updates on how to cite spatialLIBD.

print(citation("spatialLIBD"), bibtex = TRUE)
#> To cite package 'spatialLIBD' in publications use:
#> 
#>   Pardo B, Spangler A, Weber LM, Hicks SC, Jaffe AE, Martinowich K,
#>   Maynard KR, Collado-Torres L (2022). "spatialLIBD: an R/Bioconductor
#>   package to visualize spatially-resolved transcriptomics data." _BMC
#>   Genomics_. doi:10.1186/s12864-022-08601-w
#>   <https://doi.org/10.1186/s12864-022-08601-w>,
#>   <https://doi.org/10.1186/s12864-022-08601-w>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {spatialLIBD: an R/Bioconductor package to visualize spatially-resolved transcriptomics data},
#>     author = {Brenda Pardo and Abby Spangler and Lukas M. Weber and Stephanie C. Hicks and Andrew E. Jaffe and Keri Martinowich and Kristen R. Maynard and Leonardo Collado-Torres},
#>     year = {2022},
#>     journal = {BMC Genomics},
#>     doi = {10.1186/s12864-022-08601-w},
#>     url = {https://doi.org/10.1186/s12864-022-08601-w},
#>   }
#> 
#>   Maynard KR, Collado-Torres L, Weber LM, Uytingco C, Barry BK,
#>   Williams SR, II JLC, Tran MN, Besich Z, Tippani M, Chew J, Yin Y,
#>   Kleinman JE, Hyde TM, Rao N, Hicks SC, Martinowich K, Jaffe AE
#>   (2021). "Transcriptome-scale spatial gene expression in the human
#>   dorsolateral prefrontal cortex." _Nature Neuroscience_.
#>   doi:10.1038/s41593-020-00787-0
#>   <https://doi.org/10.1038/s41593-020-00787-0>,
#>   <https://www.nature.com/articles/s41593-020-00787-0>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {Transcriptome-scale spatial gene expression in the human dorsolateral prefrontal cortex},
#>     author = {Kristen R. Maynard and Leonardo Collado-Torres and Lukas M. Weber and Cedric Uytingco and Brianna K. Barry and Stephen R. Williams and Joseph L. Catallini II and Matthew N. Tran and Zachary Besich and Madhavi Tippani and Jennifer Chew and Yifeng Yin and Joel E. Kleinman and Thomas M. Hyde and Nikhil Rao and Stephanie C. Hicks and Keri Martinowich and Andrew E. Jaffe},
#>     year = {2021},
#>     journal = {Nature Neuroscience},
#>     doi = {10.1038/s41593-020-00787-0},
#>     url = {https://www.nature.com/articles/s41593-020-00787-0},
#>   }
#> 
#>   Huuki-Myers LA, Spangler A, Eagles NJ, Montgomergy KD, Kwon SH, Guo
#>   B, Grant-Peters M, Divecha HR, Tippani M, Sriworarat C, Nguyen AB,
#>   Ravichandran P, Tran MN, Seyedian A, Consortium P, Hyde TM, Kleinman
#>   JE, Battle A, Page SC, Ryten M, Hicks SC, Martinowich K,
#>   Collado-Torres L, Maynard KR (2024). "A data-driven single-cell and
#>   spatial transcriptomic map of the human prefrontal cortex."
#>   _Science_. doi:10.1126/science.adh1938
#>   <https://doi.org/10.1126/science.adh1938>,
#>   <https://doi.org/10.1126/science.adh1938>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {A data-driven single-cell and spatial transcriptomic map of the human prefrontal cortex},
#>     author = {Louise A. Huuki-Myers and Abby Spangler and Nicholas J. Eagles and Kelsey D. Montgomergy and Sang Ho Kwon and Boyi Guo and Melissa Grant-Peters and Heena R. Divecha and Madhavi Tippani and Chaichontat Sriworarat and Annie B. Nguyen and Prashanthi Ravichandran and Matthew N. Tran and Arta Seyedian and PsychENCODE Consortium and Thomas M. Hyde and Joel E. Kleinman and Alexis Battle and Stephanie C. Page and Mina Ryten and Stephanie C. Hicks and Keri Martinowich and Leonardo Collado-Torres and Kristen R. Maynard},
#>     year = {2024},
#>     journal = {Science},
#>     doi = {10.1126/science.adh1938},
#>     url = {https://doi.org/10.1126/science.adh1938},
#>   }
#> 
#>   Kwon SH, Parthiban S, Tippani M, Divecha HR, Eagles NJ, Lobana JS,
#>   Williams SR, Mark M, Bharadwaj RA, Kleinman JE, Hyde TM, Page SC,
#>   Hicks SC, Martinowich K, Maynard KR, Collado-Torres L (2023).
#>   "Influence of Alzheimer’s disease related neuropathology on local
#>   microenvironment gene expression in the human inferior temporal
#>   cortex." _GEN Biotechnology_. doi:10.1089/genbio.2023.0019
#>   <https://doi.org/10.1089/genbio.2023.0019>,
#>   <https://doi.org/10.1089/genbio.2023.0019>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {Influence of Alzheimer’s disease related neuropathology on local microenvironment gene expression in the human inferior temporal cortex},
#>     author = {Sang Ho Kwon and Sowmya Parthiban and Madhavi Tippani and Heena R. Divecha and Nicholas J. Eagles and Jashandeep S. Lobana and Stephen R. Williams and Michelle Mark and Rahul A. Bharadwaj and Joel E. Kleinman and Thomas M. Hyde and Stephanie C. Page and Stephanie C. Hicks and Keri Martinowich and Kristen R. Maynard and Leonardo Collado-Torres},
#>     year = {2023},
#>     journal = {GEN Biotechnology},
#>     doi = {10.1089/genbio.2023.0019},
#>     url = {https://doi.org/10.1089/genbio.2023.0019},
#>   }

Please note that the spatialLIBD was only made possible thanks to many other R and bioinformatics software authors, which are cited either in the vignettes and/or the paper(s) describing this package.

Code of Conduct

Please note that the spatialLIBD project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Development tools

For more details, check the dev directory.

This package was developed using biocthis.

<script type='text/javascript' id='clustrmaps' src='//cdn.clustrmaps.com/map_v2.js?cl=ffffff&w=300&t=n&d=FRs8oQ9HVpMg6QLJJKAExpF8seGfPVlH-YOnwqUE8Hg'></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-QKT3SV9EFL"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-QKT3SV9EFL'); </script>

spatiallibd's People

Contributors

abspangler13 avatar bpardo99 avatar hpages avatar jwokaty avatar lahuuki avatar lcolladotor avatar lmweber avatar nick-eagles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spatiallibd's Issues

[Feature Request] Enable Biocparallel-based execution of registration_wrapper steps

Related to issue #48 , the runtime for duplicateCorrelation can be on the order of 10+ hours for especially large datasets with dozens of samples and dozens of clusters. Splitting out this process to support a Biocparallel-compatible implementation, if possible, would make spatial registration using gold-standard, but atlas-complexity datasets (e.g. Allen Atlas whole mouse brain and human brain datasets preprinted in 2023) much more tractable.

Spot diameter enhancements

It'd be nice if we:

(a) made the point diameter use the actual spot diameter info from SpaceRanger See https://github.com/LieberInstitute/HumanPilot/blob/master/10X/151507/scalefactors_json.json for example where we have the fullres diameter, and when taking into account the scaling factor, we should get the right say lowres diameter.

(b) update the plotly code such that the interactive plots allow you to Zoom in and rescale the spot diameters. This seems to be quite tricky based on threads like https://stackoverflow.com/questions/53217404/specifying-marker-size-in-data-unit-for-plotly, https://community.plotly.com/t/point-size-based-on-zoom/6788/2 and https://pretagteam.com/question/plotly-bubble-map-resize-markers-on-zoom.

library(spatialLIBD)

Hi,
when I want to "library(spatialLIBD)", It occurs the message:
Error: package or namespace load failed for ‘spatialLIBD’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘matrixStats’ 0.57.0 is already loaded, but >= 0.60.0 is required
but I have reinstall the matrixStats packages
could you please help me?

Thanks
Best

Color Blending for NA values in `vis_clus`

If I understand correctly, the color blending for NA values are not implemented in vis_clus yet.

scale_fill_manual(values = colors) +

Referencing to vis_gene, I think the implementation for vis_clus should be fairly easy, by adding na.value = "#CCCCCC40" to scale_fill_manual function

Implement a check_spe() function

Hi Brenda,

We need to implement a new function check_spe() similar to check_sce(). I think that we can copy the code, then remove anything check_spe() doesn't need that the older function needed.

It'll be good to check what else might be missing that we have in the spe object at https://github.com/LieberInstitute/spatialDLPFC/blob/main/analysis/03_try_shiny.R that might be missing from say the example spe object (called ve_test below) that we can create with the data in the SpatialExperiment package.

## Use the appropriate one from below:
# library("spatialLIBD")
# devtools::load_all()

dir <- system.file(file.path("extdata", "10xVisium"), 
                    package = "SpatialExperiment")
   
sample_ids <- c("section1", "section2")
samples <- file.path(dir, sample_ids)
(ve_test <- read10xVisium(samples, sample_ids, type="sparse", data="raw", 
                    images = c("lowres"), load = TRUE))

## Beyond SpatialExperiment for spatialLIBD
ve_test$key <- paste0(ve_test$Barcode, '-', ve_test$sample_id)
rowData(ve_test)$gene_search <- paste0(rownames(ve_test), "; ", rowData(ve_test)$symbol)

Once we have this function, we can update run_app() to use it internally.

Something we need to decide is whether to expect any names in reducedDim(spe). I think that run_app() will not work without any reducedDim() info, so it might be good to add this requirement in check_spe() OR we might have to consider making run_app() and all the shiny code more flexible.

Let's keep talking about this! ^^

Best,
Leo

Add an `n` argument to `layer_stat_cor()`.

Adding an n argument to layer_stat_cor() would help make the correlation matrices with a subset of the genes, like the top n layer marker genes from the enrichment model. This is related to #33. Otherwise you kind of have to hack the current function.

Duplicated colnames in count matrix

Hi,

I have been trying to access the raw data provided in the spatialLIBD package. So far, I have used:

# as specified in the vignette 
sce <- fetch_data(type = 'sce')

counts <- counts(sce)
barcodes <- as.data.frame(sce@colData[,c("barcode","sample_name","imagerow","imagecol")])

I wish to extract all counts associated with one sample (as defined by sample name). However, there seems to be a mismatch between counts colnames and barcodes.

dim(counts) # dim = 33538 47681
length(colnames(counts)) != length(unique(colnames(counts)))

Because of this, it seems that the following does not work:

# as an example, I will use sample name 151507
barcodes <- barcodes[which(barcodes$sample_name == 151507),c("imagecol","imagerow")]

counts <- counts[, colnames(counts) %in% rownames(barcodes)]

I end up having many duplicated barcodes and not knowing which barcode belongs to which sample.

My question is how to access raw count values for each sample?

Thank you for your help.

Cannot plot annotations/discrete variables

Hi, when running the shiny app I try to set my own annotations as default but the original data's annotations (clusters 1-12 and layers 1-6) still show in the cluster static. I tried loading them again as a separate discrete value and select that in my app but the original annotations are also plotted instead.

full R session information.

Session info ───────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.1.0 (2021-05-18)
 os       Ubuntu 20.04.2 LTS          
 system   x86_64, linux-gnu           
 ui       X11                         
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Etc/UTC                     
 date     2021-07-07Packages ───────────────────────────────────────────────────────────────────
 package                * version  date       lib source        
 AnnotationDbi            1.54.1   2021-06-08 [1] Bioconductor  
 AnnotationHub            3.0.1    2021-06-20 [1] Bioconductor  
 assertthat               0.2.1    2019-03-21 [1] CRAN (R 4.1.0)
 attempt                  0.3.1    2020-05-03 [1] CRAN (R 4.1.0)
 beachmat                 2.8.0    2021-05-19 [1] Bioconductor  
 beeswarm                 0.4.0    2021-06-01 [1] CRAN (R 4.1.0)
 benchmarkme              1.0.7    2021-03-21 [1] CRAN (R 4.1.0)
 benchmarkmeData          1.0.4    2020-04-23 [1] CRAN (R 4.1.0)
 Biobase                * 2.52.0   2021-05-19 [1] Bioconductor  
 BiocFileCache          * 2.0.0    2021-05-19 [1] Bioconductor  
 BiocGenerics           * 0.38.0   2021-05-19 [1] Bioconductor  
 BiocIO                   1.2.0    2021-05-19 [1] Bioconductor  
 BiocManager            * 1.30.16  2021-06-15 [1] CRAN (R 4.1.0)
 BiocNeighbors            1.10.0   2021-05-19 [1] Bioconductor  
 BiocParallel             1.26.0   2021-05-19 [1] Bioconductor  
 BiocSingular             1.8.1    2021-06-08 [1] Bioconductor  
 BiocVersion              3.13.1   2021-03-19 [1] Bioconductor  
 Biostrings               2.60.1   2021-06-06 [1] Bioconductor  
 bit                      4.0.4    2020-08-04 [1] CRAN (R 4.1.0)
 bit64                    4.0.5    2020-08-30 [1] CRAN (R 4.1.0)
 bitops                   1.0-7    2021-04-24 [1] CRAN (R 4.1.0)
 blob                     1.2.1    2020-01-20 [1] CRAN (R 4.1.0)
 bslib                    0.2.5.1  2021-05-18 [1] CRAN (R 4.1.0)
 cachem                   1.0.5    2021-05-15 [1] CRAN (R 4.1.0)
 cli                      2.5.0    2021-04-26 [1] CRAN (R 4.1.0)
 codetools                0.2-18   2020-11-04 [1] CRAN (R 4.1.0)
 colorspace               2.0-1    2021-05-04 [1] CRAN (R 4.1.0)
 config                   0.3.1    2020-12-17 [1] CRAN (R 4.1.0)
 cowplot                  1.1.1    2020-12-30 [1] CRAN (R 4.1.0)
 crayon                   1.4.1    2021-02-08 [1] CRAN (R 4.1.0)
 curl                     4.3.1    2021-04-30 [1] CRAN (R 4.1.0)
 data.table               1.14.0   2021-02-21 [1] CRAN (R 4.1.0)
 DBI                      1.1.1    2021-01-15 [1] CRAN (R 4.1.0)
 dbplyr                 * 2.1.1    2021-04-06 [1] CRAN (R 4.1.0)
 DelayedArray             0.18.0   2021-05-19 [1] Bioconductor  
 DelayedMatrixStats       1.14.0   2021-05-19 [1] Bioconductor  
 desc                     1.3.0    2021-03-05 [1] CRAN (R 4.1.0)
 digest                   0.6.27   2020-10-24 [1] CRAN (R 4.1.0)
 dockerfiler              0.1.3    2019-03-19 [1] CRAN (R 4.1.0)
 doParallel               1.0.16   2020-10-16 [1] CRAN (R 4.1.0)
 dotCall64                1.0-1    2021-02-11 [1] CRAN (R 4.1.0)
 dplyr                    1.0.7    2021-06-18 [1] CRAN (R 4.1.0)
 dqrng                    0.3.0    2021-05-01 [1] CRAN (R 4.1.0)
 DropletUtils             1.12.1   2021-06-01 [1] Bioconductor  
 DT                       0.18     2021-04-14 [1] CRAN (R 4.1.0)
 edgeR                    3.34.0   2021-05-19 [1] Bioconductor  
 ellipsis                 0.3.2    2021-04-29 [1] CRAN (R 4.1.0)
 ExperimentHub            2.0.0    2021-05-19 [1] Bioconductor  
 fansi                    0.5.0    2021-05-25 [1] CRAN (R 4.1.0)
 fastmap                  1.1.0    2021-01-25 [1] CRAN (R 4.1.0)
 fields                   12.3     2021-05-17 [1] CRAN (R 4.1.0)
 filelock                 1.0.2    2018-10-05 [1] CRAN (R 4.1.0)
 foreach                  1.5.1    2020-10-15 [1] CRAN (R 4.1.0)
 fs                       1.5.0    2020-07-31 [1] CRAN (R 4.1.0)
 generics                 0.1.0    2020-10-31 [1] CRAN (R 4.1.0)
 GenomeInfoDb           * 1.28.0   2021-05-19 [1] Bioconductor  
 GenomeInfoDbData         1.2.6    2021-05-19 [1] Bioconductor  
 GenomicAlignments        1.28.0   2021-05-19 [1] Bioconductor  
 GenomicRanges          * 1.44.0   2021-05-19 [1] Bioconductor  
 ggbeeswarm               0.6.0    2017-08-07 [1] CRAN (R 4.1.0)
 ggplot2                  3.3.4    2021-06-16 [1] CRAN (R 4.1.0)
 glue                     1.4.2    2020-08-27 [1] CRAN (R 4.1.0)
 golem                    0.3.1    2021-04-17 [1] CRAN (R 4.1.0)
 gridExtra                2.3      2017-09-09 [1] CRAN (R 4.1.0)
 gtable                   0.3.0    2019-03-25 [1] CRAN (R 4.1.0)
 HDF5Array                1.20.0   2021-05-19 [1] Bioconductor  
 htmltools                0.5.1.1  2021-01-22 [1] CRAN (R 4.1.0)
 htmlwidgets              1.5.3    2020-12-10 [1] CRAN (R 4.1.0)
 httpuv                   1.6.1    2021-05-07 [1] CRAN (R 4.1.0)
 httr                     1.4.2    2020-07-20 [1] CRAN (R 4.1.0)
 interactiveDisplayBase   1.30.0   2021-05-19 [1] Bioconductor  
 IRanges                * 2.26.0   2021-05-19 [1] Bioconductor  
 irlba                    2.3.3    2019-02-05 [1] CRAN (R 4.1.0)
 iterators                1.0.13   2020-10-15 [1] CRAN (R 4.1.0)
 jquerylib                0.1.4    2021-04-26 [1] CRAN (R 4.1.0)
 jsonlite                 1.7.2    2020-12-09 [1] CRAN (R 4.1.0)
 KEGGREST                 1.32.0   2021-05-19 [1] Bioconductor  
 knitr                    1.33     2021-04-24 [1] CRAN (R 4.1.0)
 later                    1.2.0    2021-04-23 [1] CRAN (R 4.1.0)
 lattice                  0.20-44  2021-05-02 [1] CRAN (R 4.1.0)
 lazyeval                 0.2.2    2019-03-15 [1] CRAN (R 4.1.0)
 lifecycle                1.0.0    2021-02-15 [1] CRAN (R 4.1.0)
 limma                    3.48.0   2021-05-19 [1] Bioconductor  
 locfit                   1.5-9.4  2020-03-25 [1] CRAN (R 4.1.0)
 magick                   2.7.2    2021-05-02 [1] CRAN (R 4.1.0)
 magrittr                 2.0.1    2020-11-17 [1] CRAN (R 4.1.0)
 maps                     3.3.0    2018-04-03 [1] CRAN (R 4.1.0)
 markdown                 1.1      2019-08-07 [1] CRAN (R 4.1.0)
 Matrix                 * 1.3-3    2021-05-04 [1] CRAN (R 4.1.0)
 MatrixGenerics         * 1.4.0    2021-05-19 [1] Bioconductor  
 matrixStats            * 0.59.0   2021-06-01 [1] CRAN (R 4.1.0)
 memoise                  2.0.0    2021-01-26 [1] CRAN (R 4.1.0)
 mime                     0.10     2021-02-13 [1] CRAN (R 4.1.0)
 munsell                  0.5.0    2018-06-12 [1] CRAN (R 4.1.0)
 pillar                   1.6.1    2021-05-16 [1] CRAN (R 4.1.0)
 pkgconfig                2.0.3    2019-09-22 [1] CRAN (R 4.1.0)
 pkgload                  1.2.1    2021-04-06 [1] CRAN (R 4.1.0)
 plotly                   4.9.4.1  2021-06-18 [1] CRAN (R 4.1.0)
 png                      0.1-7    2013-12-03 [1] CRAN (R 4.1.0)
 Polychrome               1.2.6    2020-11-11 [1] CRAN (R 4.1.0)
 promises                 1.2.0.1  2021-02-11 [1] CRAN (R 4.1.0)
 pryr                   * 0.1.4    2018-02-18 [1] CRAN (R 4.1.0)
 purrr                    0.3.4    2020-04-17 [1] CRAN (R 4.1.0)
 R.methodsS3              1.8.1    2020-08-26 [1] CRAN (R 4.1.0)
 R.oo                     1.24.0   2020-08-26 [1] CRAN (R 4.1.0)
 R.utils                  2.10.1   2020-08-26 [1] CRAN (R 4.1.0)
 R6                       2.5.0    2020-10-28 [1] CRAN (R 4.1.0)
 rappdirs                 0.3.3    2021-01-31 [1] CRAN (R 4.1.0)
 RColorBrewer             1.1-2    2014-12-07 [1] CRAN (R 4.1.0)
 Rcpp                     1.0.6    2021-01-15 [1] CRAN (R 4.1.0)
 RCurl                    1.98-1.3 2021-03-16 [1] CRAN (R 4.1.0)
 remotes                  2.4.0    2021-06-02 [1] CRAN (R 4.1.0)
 restfulr                 0.0.13   2017-08-06 [1] CRAN (R 4.1.0)
 rhdf5                    2.36.0   2021-05-19 [1] Bioconductor  
 rhdf5filters             1.4.0    2021-05-19 [1] Bioconductor  
 Rhdf5lib                 1.14.1   2021-06-08 [1] Bioconductor  
 rjson                    0.2.20   2018-06-08 [1] CRAN (R 4.1.0)
 rlang                    0.4.11   2021-04-30 [1] CRAN (R 4.1.0)
 roxygen2                 7.1.1    2020-06-27 [1] CRAN (R 4.1.0)
 rprojroot                2.0.2    2020-11-15 [1] CRAN (R 4.1.0)
 Rsamtools                2.8.0    2021-05-19 [1] Bioconductor  
 rsconnect              * 0.8.18   2021-05-24 [1] CRAN (R 4.1.0)
 RSQLite                  2.2.7    2021-04-22 [1] CRAN (R 4.1.0)
 rstudioapi               0.13     2020-11-12 [1] CRAN (R 4.1.0)
 rsvd                     1.0.5    2021-04-16 [1] CRAN (R 4.1.0)
 rtracklayer            * 1.52.0   2021-05-19 [1] Bioconductor  
 S4Vectors              * 0.30.0   2021-05-19 [1] Bioconductor  
 sass                     0.4.0    2021-05-12 [1] CRAN (R 4.1.0)
 ScaledMatrix             1.0.0    2021-05-19 [1] Bioconductor  
 scales                   1.1.1    2020-05-11 [1] CRAN (R 4.1.0)
 scater                   1.20.1   2021-06-15 [1] Bioconductor  
 scatterplot3d            0.3-41   2018-03-14 [1] CRAN (R 4.1.0)
 scuttle                  1.2.0    2021-05-19 [1] Bioconductor  
 sessioninfo              1.1.1    2018-11-05 [1] CRAN (R 4.1.0)
 shiny                  * 1.6.0    2021-01-25 [1] CRAN (R 4.1.0)
 shinyWidgets             0.6.0    2021-03-15 [1] CRAN (R 4.1.0)
 SingleCellExperiment   * 1.14.1   2021-05-21 [1] Bioconductor  
 spam                     2.6-0    2020-12-14 [1] CRAN (R 4.1.0)
 sparseMatrixStats        1.4.0    2021-05-19 [1] Bioconductor  
 SpatialExperiment      * 1.2.1    2021-06-10 [1] Bioconductor  
 spatialLIBD            * 1.4.0    2021-05-20 [1] Bioconductor  
 stringi                  1.6.1    2021-05-10 [1] CRAN (R 4.1.0)
 stringr                  1.4.0    2019-02-10 [1] CRAN (R 4.1.0)
 SummarizedExperiment   * 1.22.0   2021-05-19 [1] Bioconductor  
 testthat                 3.0.3    2021-06-16 [1] CRAN (R 4.1.0)
 tibble                   3.1.2    2021-05-16 [1] CRAN (R 4.1.0)
 tidyr                    1.1.3    2021-03-03 [1] CRAN (R 4.1.0)
 tidyselect               1.1.1    2021-04-30 [1] CRAN (R 4.1.0)
 usethis                  2.0.1    2021-02-10 [1] CRAN (R 4.1.0)
 utf8                     1.2.1    2021-03-12 [1] CRAN (R 4.1.0)
 vctrs                    0.3.8    2021-04-29 [1] CRAN (R 4.1.0)
 vipor                    0.4.5    2017-03-22 [1] CRAN (R 4.1.0)
 viridis                  0.6.1    2021-05-11 [1] CRAN (R 4.1.0)
 viridisLite              0.4.0    2021-04-13 [1] CRAN (R 4.1.0)
 withr                    2.4.2    2021-04-18 [1] CRAN (R 4.1.0)
 xfun                     0.24     2021-06-15 [1] CRAN (R 4.1.0)
 XML                      3.99-0.6 2021-03-16 [1] CRAN (R 4.1.0)
 xml2                     1.3.2    2020-04-23 [1] CRAN (R 4.1.0)
 xtable                   1.8-4    2019-04-21 [1] CRAN (R 4.1.0)
 XVector                  0.32.0   2021-05-19 [1] Bioconductor  
 yaml                     2.2.1    2020-02-01 [1] CRAN (R 4.1.0)
 zlibbioc                 1.38.0   2021-05-19 [1] Bioconductor  

[1] /opt/R/4.1.0/lib/R/library

The output of sessioninfo::session_info() includes relevant GitHub installation information and other details that are missed by sessionInfo().

Plotly zoom: histology background image is not zoomed

I've tried to get the histology background image to work with plotly's zoom functionality but I haven't gotten it to work. Here's some R code I played with:

## sce is loaded in global.R
## sce_image_clus() is defined in global.R
p <- sce_image_clus(sce, '151507', clustervar = 'Cluster10X', spatial = FALSE)

pen <- png::readPNG('data/151507/tissue_lowres_image.png')
layout(ggplotly(p, width = 600, height = 600), images = list(list(
    source = raster2uri(as.raster(pen)),
    xref = "paper", 
    yref = "paper", 
    x = 0, y = 0, 
    sizex = 1, sizey = 1, 
    xanchor = "left", yanchor = "bottom",
    opacity = 1, layer = 'below',
    sizing = 'stretch'
)))


layout(ggplotly(p, width = 600, height = 600), images = list(list(
    source = raster2uri(as.raster(pen)),
    xref = "imagerow", 
    yref = "imagecol", 
    x = 0, y = 0, 
    sizex = 1, sizey = 1, 
    opacity = 1, layer = 'below',
    xanchor = "left", yanchor = "bottom",
    sizing = 'stretch'
)))


layout(ggplotly(p, width = 600, height = 600), images = list(list(
    source = raster2uri(as.raster(pen)),
    xref = 'x', 
    yref = 'y', 
    x = 'imagerow', y = 'imagecol', 
    sizex = 600, sizey = 600, 
    opacity = 1, layer = 'below',
    xanchor = "left", yanchor = "bottom",
    sizing = 'stretch'
)))

Related links:

problem with read10xVisiumWrapper function

Unable to run read10xVisiumWrapper function without specifying reference_gtf argument.

Context

The error we get is this:
Screen Shot 2022-04-08 at 1 36 27 PM

R session information

options(width = 120)
R Under development (unstable) (2021-11-06 r81149)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS:   /jhpce/shared/jhpce/core/conda/miniconda3-4.6.14/envs/svnR-devel/R/devel/lib64/R/lib/libRblas.so
LAPACK: /jhpce/shared/jhpce/core/conda/miniconda3-4.6.14/envs/svnR-devel/R/devel/lib64/R/lib/libRlapack.so
locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats4    stats     graphics  grDevices datasets  utils     methods
[8] base
other attached packages:
 [1] sessioninfo_1.2.2           lobstr_1.1.1
 [3] rtracklayer_1.55.4          spatialLIBD_1.7.12
 [5] SpatialExperiment_1.5.3     SingleCellExperiment_1.17.2
 [7] SummarizedExperiment_1.25.3 Biobase_2.55.1
 [9] GenomicRanges_1.47.6        GenomeInfoDb_1.31.7
[11] IRanges_2.29.1              S4Vectors_0.33.17
[13] BiocGenerics_0.41.2         MatrixGenerics_1.7.0
[15] matrixStats_0.61.0          here_1.0.1
loaded via a namespace (and not attached):
  [1] spam_2.8-0                    AnnotationHub_3.3.9
  [3] BiocFileCache_2.3.4           lazyeval_0.2.2
  [5] Polychrome_1.3.1              BiocParallel_1.29.20
  [7] scater_1.23.6                 usethis_2.1.5
  [9] ggplot2_3.3.5                 benchmarkme_1.0.7
 [11] digest_0.6.29                 foreach_1.5.2
 [13] htmltools_0.5.2               viridis_0.6.2
 [15] magick_2.7.3                  fansi_1.0.3
 [17] magrittr_2.0.3                memoise_2.0.1
 [19] ScaledMatrix_1.3.0            config_0.3.1
 [21] doParallel_1.0.17             limma_3.51.6
 [23] Biostrings_2.63.3             R.utils_2.11.0
 [25] colorspace_2.0-3              ggrepel_0.9.1
 [27] blob_1.2.2                    rappdirs_0.3.3
 [29] xfun_0.30                     dplyr_1.0.8
 [31] crayon_1.5.1                  RCurl_1.98-1.6
 [33] jsonlite_1.8.0                roxygen2_7.1.2
 [35] iterators_1.0.14              glue_1.6.2
 [37] gtable_0.3.0                  zlibbioc_1.41.0
 [39] XVector_0.35.0                DelayedArray_0.21.2
 [41] BiocSingular_1.11.0           DropletUtils_1.15.2
 [43] Rhdf5lib_1.17.3               maps_3.4.0
 [45] HDF5Array_1.23.2              scales_1.1.1
 [47] DBI_1.1.2                     edgeR_3.37.1
 [49] Rcpp_1.0.8.3                  viridisLite_0.4.0
 [51] xtable_1.8-4                  dqrng_0.3.0
 [53] rsvd_1.0.5                    bit_4.0.4
 [55] dotCall64_1.0-1               DT_0.22
 [57] htmlwidgets_1.5.4             httr_1.4.2
 [59] RColorBrewer_1.1-3            ellipsis_0.3.2
 [61] XML_3.99-0.9                  pkgconfig_2.0.3
 [63] R.methodsS3_1.8.1             scuttle_1.5.1
 [65] sass_0.4.1                    dbplyr_2.1.1
 [67] locfit_1.5-9.5                utf8_1.2.2
 [69] tidyselect_1.1.2              rlang_1.0.2
 [71] later_1.3.0                   AnnotationDbi_1.57.1
 [73] munsell_0.5.0                 BiocVersion_3.15.2
 [75] tools_4.2.0                   cachem_1.0.6
 [77] cli_3.2.0                     generics_0.1.2
 [79] RSQLite_2.2.12                ExperimentHub_2.3.5
 [81] stringr_1.4.0                 fastmap_1.1.0
 [83] yaml_2.3.5                    knitr_1.38
 [85] bit64_4.0.5                   fs_1.5.2
 [87] purrr_0.3.4                   KEGGREST_1.35.0
 [89] sparseMatrixStats_1.7.0       mime_0.12
 [91] R.oo_1.24.0                   xml2_1.3.3
 [93] rstudioapi_0.13               brio_1.1.3
 [95] compiler_4.2.0                beeswarm_0.4.0
 [97] plotly_4.10.0                 filelock_1.0.2
 [99] curl_4.3.2                    png_0.1-7
[101] interactiveDisplayBase_1.33.0 testthat_3.1.3
[103] tibble_3.1.6                  bslib_0.3.1
[105] stringi_1.7.6                 desc_1.4.1
[107] fields_13.3                   lattice_0.20-45
[109] Matrix_1.4-1                  vctrs_0.4.0
[111] pillar_1.7.0                  lifecycle_1.0.1
[113] rhdf5filters_1.7.0            BiocManager_1.30.16
[115] jquerylib_0.1.4               BiocNeighbors_1.13.0
[117] irlba_2.3.5                   data.table_1.14.2
[119] cowplot_1.1.1                 bitops_1.0-7
[121] httpuv_1.6.5                  BiocIO_1.5.0
[123] R6_2.5.1                      promises_1.2.0.1
[125] gridExtra_2.3                 vipor_0.4.5
[127] codetools_0.2-18              benchmarkmeData_1.0.4
[129] assertthat_0.2.1              pkgload_1.2.4
[131] golem_0.3.2                   rhdf5_2.39.6
[133] rprojroot_2.0.3               rjson_0.2.21
[135] shinyWidgets_0.6.4            withr_2.5.0
[137] GenomicAlignments_1.31.2      Rsamtools_2.11.0
[139] GenomeInfoDbData_1.2.7        parallel_4.2.0
[141] grid_4.2.0                    beachmat_2.11.0
[143] tidyr_1.2.0                   attempt_0.3.1
[145] DelayedMatrixStats_1.17.0     scatterplot3d_0.3-41
[147] shiny_1.7.1                   ggbeeswarm_0.6.0
[149] restfulr_0.0.13

Explain clusters at the spot and layer-level

We still need to explain what the cluster labels mean at the spot-level, that is, where they came from. Similarly for the layer-level clusters that you can use to color the sample-level data in the PCA, TSNE, UMAP plots.

Error when using shiny 1.7.1

I am getting the following error when running spatialLIBD with the latest version of shiny package 1.7.1:

Screen Shot 2021-11-16 at 14 29 57

I get this error with the following standard example from the spatialLIBD documentation:

spe <- fetch_data("spe")
run_app(spe)

It works fine with the older version of shiny 1.6.0, which I found as a suggestion when googling the error message. I'm not sure why this fixes it though.

Just pasting this issue here for now so we don't lose it.

Installation problems

Hello, I was trying to install the package, but apparently it is not available (R says that 'cannot open URL'). Also manually following links to Bioconductor does not lead to the proper page.
Do you have any suggestion?
Thanks!

SpatialExperiment::spatialData(as_df=TRUE) now returns a DFrame not a data.frame

Hey, Leo! c:

In the last days the SpatialExperiment package made changes to SpatialExperiment::spatialData(), in which they no longer return a data.frame but a DFrame when function is call with as_df=TRUE (drighelli/SpatialExperiment@bf2abe9). Therefore, the functions for plots are not working. Plotting calls produce the following error:

  • data must be a data frame, or other object coercible by fortify(), not an S4 object with class DFrame

Wrapping the calls SpatialExperiment::spatialData(spe_sub, cd_bind = TRUE, as_df = TRUE) with as.data.frame should fix the issue for now.

Defining a utility function to use in all those calls might also work:

function(spe){
    as.data.frame(
        SpatialExperiment::spatialData(spe, cd_bind = TRUE, as_df = TRUE)
    )
}

Trouble loading two gene sets

I'm having trouble with two of the gene sets.

The loaded Scatterstrom data doesn't have the correct column names. Here's the code I run and here's the error I get when trying to create asd_exome_geneList.

https://github.com/LieberInstitute/spatialDLPFC/blob/5790c2673cd1661bda7169451f1b75875899fd43/code/analysis/10_Clinical_Gene_Set_Enrichment/01_Clinical_Gene_Set_Enrichment.R#L78-L91

image

The second gene set doesn't load and I believe it to be a permissions problem. Here is the code I ran to load the data:

https://github.com/LieberInstitute/spatialDLPFC/blob/5790c2673cd1661bda7169451f1b75875899fd43/code/analysis/10_Clinical_Gene_Set_Enrichment/01_Clinical_Gene_Set_Enrichment.R#L172-L175

And here is the error message:

image

Update document of `sampleid` argument in viz_clus

There seems no sample_name variable in colData(spe) now. I wonder if the document should be updated accordingly too.

#' @param sampleid A `character(1)` specifying which sample to plot from
#' `colData(spe)$sample_name`.

Meanwhile, I wonder if the purpose of spatialLIBD is to be used as a viz tool for any spe object, or only spatialLIBD data. If it is for the prior case, I argue the sampleid argument with no default seems a little bit restrictive and reduces the generalizability of the function. Maybe consider making sampleid default to null such that it plots all spots in spe when no sample_id in the spe

shinyapps.io settings

Hi,

Based on the fact that the app loads about 2.5 GB of data into RAM to start off, plus looking at the metrics it seems like the app easily reaches 3GB sometimes even 4GB of RAM per user. I still haven't figured out the best set of settings to use for https://jhubiostatistics.shinyapps.io/spatialLIBD/ based on the documentation at https://docs.rstudio.com/shinyapps.io/applications.html#ApplicationPerformanceTuning and what I see in practice.

> pryr::object_size(sce)
2.08 GB
> pryr::object_size(sce_layer)
34 MB
> pryr::object_size(modeling_results)
20.3 MB
> pryr::object_size(sig_genes)
340 MB

## Total
> pryr::object_size(sce, sce_layer, modeling_results, sig_genes)
2.47 GB

We can run up to 10 instances, each of which can have XX number of R workers, with each R worker powering YY number of connections. Earlier I had XX = 1, YY = 1; however we easily ran into "503 resource unavailable" errors. So I now changed it to XX = 1, YY = 2 and added information on the landing page about how you can run the app locally with spatialLIBD::run_app(). Earlier today with a single instance, I could easily crash sessions (connections) if I opened 2-3 of them. And that's using xxxlarge, 8192 MB instances (the largest ones).

Anyway, if you have ideas of the best set of settings to use, please let me know.

Thanks!
Leo

Error in BiocFileCache::bfcrpath(bfc, url)

hello!
when I followed your vignette for getting Human DLPFC Visium dataset (https://bioconductor.org/packages/release/data/experiment/vignettes/spatialLIBD/inst/doc/spatialLIBD.html#downloading-the-data-with-spatiallibd), an error happened:

library(spatialLIBD)

ehub <- ExperimentHub::ExperimentHub()
sce <- fetch_data(type = "sce_example", eh = ehub)

error messages like this:

adding rname 'https://www.dropbox.com/s/5ra9o8ku9iyyf70/sce_sub_for_vignette.Rdata?dl=1'
Error in BiocFileCache::bfcrpath(bfc, url) : 
  not all 'rnames' found or unique.
此外: Warning messages:
1: download failed
  web resource path:https://www.dropbox.com/s/5ra9o8ku9iyyf70/sce_sub_for_vignette.Rdata?dl=1local file path:C:\Users\15927\AppData\Local/R/cache/R/BiocFileCache/1454412214226_sce_sub_for_vignette.Rdata%3Fdl%3D1reason: Failed to connect to www.dropbox.com port 443: Timed out 
2: bfcadd() failed; resource removed
  rid: BFC13
  fpath:https://www.dropbox.com/s/5ra9o8ku9iyyf70/sce_sub_for_vignette.Rdata?dl=1reason: download failed 
3: In value[[3L]](cond) : 
trying to add rname 'https://www.dropbox.com/s/5ra9o8ku9iyyf70/sce_sub_for_vignette.Rdata?dl=1' produced error:
  bfcadd() failed; see warnings()

Any suggestions?
Thank u so much!!!


this is my R session information

> options(width = 120)
> sessioninfo::session_info()
- Session info -------------------------------------------------------------------------------------------------------
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       Windows 10 x64 (build 19042)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  Chinese (Simplified)_China.936
 ctype    Chinese (Simplified)_China.936
 tz       Asia/Taipei
 date     2022-03-04
 rstudio  1.3.1073 Giant Goldenrod (desktop)
 pandoc   2.10 @ D:\\hsy\\software\\anaconda\\Scripts\\pandoc.exe

- Packages -----------------------------------------------------------------------------------------------------------
 ! package                * version  date (UTC) lib source
   AnnotationDbi            1.56.2   2021-11-09 [1] Bioconductor
   AnnotationHub            3.2.2    2022-03-01 [1] Bioconductor
   assertthat               0.2.1    2019-03-21 [1] CRAN (R 4.1.2)
   attempt                  0.3.1    2020-05-03 [1] CRAN (R 4.1.2)
   beachmat                 2.10.0   2021-10-26 [1] Bioconductor
   beeswarm                 0.4.0    2021-06-01 [1] CRAN (R 4.1.1)
   benchmarkme              1.0.7    2021-03-21 [1] CRAN (R 4.1.2)
   benchmarkmeData          1.0.4    2020-04-23 [1] CRAN (R 4.1.2)
   Biobase                * 2.54.0   2021-10-26 [1] Bioconductor
   BiocFileCache            2.2.1    2022-01-23 [1] Bioconductor
   BiocGenerics           * 0.40.0   2021-10-26 [1] Bioconductor
   BiocIO                   1.4.0    2021-10-26 [1] Bioconductor
   BiocManager              1.30.16  2021-06-15 [1] CRAN (R 4.1.2)
   BiocNeighbors            1.12.0   2021-10-26 [1] Bioconductor
   BiocParallel             1.28.3   2021-12-09 [1] Bioconductor
   BiocSingular             1.10.0   2021-10-26 [1] Bioconductor
   BiocVersion              3.14.0   2021-05-27 [1] Bioconductor
   Biostrings               2.62.0   2021-10-26 [1] Bioconductor
   bit                      4.0.4    2020-08-04 [1] CRAN (R 4.1.2)
   bit64                    4.0.5    2020-08-30 [1] CRAN (R 4.1.2)
   bitops                   1.0-7    2021-04-24 [1] CRAN (R 4.1.1)
   blob                     1.2.2    2021-07-23 [1] CRAN (R 4.1.2)
   brio                     1.1.3    2021-11-30 [1] CRAN (R 4.1.2)
   bslib                    0.3.1    2021-10-06 [1] CRAN (R 4.1.2)
   cachem                   1.0.6    2021-08-19 [1] CRAN (R 4.1.2)
   callr                    3.7.0    2021-04-20 [1] CRAN (R 4.1.2)
   cli                      3.2.0    2022-02-14 [1] CRAN (R 4.1.2)
   codetools                0.2-18   2020-11-04 [1] CRAN (R 4.1.2)
   colorspace               2.0-3    2022-02-21 [1] CRAN (R 4.1.2)
   config                   0.3.1    2020-12-17 [1] CRAN (R 4.1.2)
   cowplot                  1.1.1    2020-12-30 [1] CRAN (R 4.1.2)
   crayon                   1.5.0    2022-02-14 [1] CRAN (R 4.1.2)
   curl                     4.3.2    2021-06-23 [1] CRAN (R 4.1.2)
   data.table               1.14.2   2021-09-27 [1] CRAN (R 4.1.2)
   DBI                      1.1.2    2021-12-20 [1] CRAN (R 4.1.2)
   dbplyr                   2.1.1    2021-04-06 [1] CRAN (R 4.1.2)
   DelayedArray             0.20.0   2021-10-26 [1] Bioconductor
   DelayedMatrixStats       1.16.0   2021-10-26 [1] Bioconductor
   desc                     1.4.0    2021-09-28 [1] CRAN (R 4.1.2)
   digest                   0.6.29   2021-12-01 [1] CRAN (R 4.1.2)
   dockerfiler              0.1.4    2021-09-03 [1] CRAN (R 4.1.2)
   doParallel               1.0.17   2022-02-07 [1] CRAN (R 4.1.2)
   dotCall64                1.0-1    2021-02-11 [1] CRAN (R 4.1.2)
   dplyr                    1.0.8    2022-02-08 [1] CRAN (R 4.1.2)
   dqrng                    0.3.0    2021-05-01 [1] CRAN (R 4.1.2)
   DropletUtils             1.14.2   2022-01-09 [1] Bioconductor
   DT                       0.21     2022-02-26 [1] CRAN (R 4.1.2)
   edgeR                    3.36.0   2021-10-26 [1] Bioconductor
   ellipsis                 0.3.2    2021-04-29 [1] CRAN (R 4.1.2)
   ExperimentHub            2.2.1    2022-01-23 [1] Bioconductor
   fansi                    1.0.2    2022-01-14 [1] CRAN (R 4.1.2)
   fastmap                  1.1.0    2021-01-25 [1] CRAN (R 4.1.2)
   fields                   13.3     2021-10-30 [1] CRAN (R 4.1.2)
   filelock                 1.0.2    2018-10-05 [1] CRAN (R 4.1.2)
   foreach                  1.5.2    2022-02-02 [1] CRAN (R 4.1.2)
   fs                       1.5.2    2021-12-08 [1] CRAN (R 4.1.2)
   generics                 0.1.2    2022-01-31 [1] CRAN (R 4.1.2)
   GenomeInfoDb           * 1.30.1   2022-01-30 [1] Bioconductor
   GenomeInfoDbData         1.2.7    2022-03-03 [1] Bioconductor
   GenomicAlignments        1.30.0   2021-10-26 [1] Bioconductor
   GenomicRanges          * 1.46.1   2021-11-18 [1] Bioconductor
   ggbeeswarm               0.6.0    2017-08-07 [1] CRAN (R 4.1.2)
   ggplot2                  3.3.5    2021-06-25 [1] CRAN (R 4.1.2)
   ggrepel                  0.9.1    2021-01-15 [1] CRAN (R 4.1.2)
   glue                     1.6.2    2022-02-24 [1] CRAN (R 4.1.2)
   golem                    0.3.1    2021-04-17 [1] CRAN (R 4.1.2)
   gridExtra                2.3      2017-09-09 [1] CRAN (R 4.1.2)
   gtable                   0.3.0    2019-03-25 [1] CRAN (R 4.1.2)
   HDF5Array                1.22.1   2021-11-14 [1] Bioconductor
   htmltools                0.5.2    2021-08-25 [1] CRAN (R 4.1.2)
   htmlwidgets              1.5.4    2021-09-08 [1] CRAN (R 4.1.2)
   httpuv                   1.6.5    2022-01-05 [1] CRAN (R 4.1.2)
   httr                     1.4.2    2020-07-20 [1] CRAN (R 4.1.2)
   interactiveDisplayBase   1.32.0   2021-10-26 [1] Bioconductor
   IRanges                * 2.28.0   2021-10-26 [1] Bioconductor
   irlba                    2.3.5    2021-12-06 [1] CRAN (R 4.1.2)
   iterators                1.0.14   2022-02-05 [1] CRAN (R 4.1.2)
   jquerylib                0.1.4    2021-04-26 [1] CRAN (R 4.1.2)
   jsonlite                 1.8.0    2022-02-22 [1] CRAN (R 4.1.2)
   KEGGREST                 1.34.0   2021-10-26 [1] Bioconductor
   knitr                    1.37     2021-12-16 [1] CRAN (R 4.1.2)
   later                    1.3.0    2021-08-18 [1] CRAN (R 4.1.2)
   lattice                  0.20-45  2021-09-22 [1] CRAN (R 4.1.2)
   lazyeval                 0.2.2    2019-03-15 [1] CRAN (R 4.1.2)
   lifecycle                1.0.1    2021-09-24 [1] CRAN (R 4.1.2)
   limma                    3.50.1   2022-02-17 [1] Bioconductor
   locfit                   1.5-9.4  2020-03-25 [1] CRAN (R 4.1.2)
   magick                   2.7.3    2021-08-18 [1] CRAN (R 4.1.2)
   magrittr                 2.0.2    2022-01-26 [1] CRAN (R 4.1.2)
   maps                     3.4.0    2021-09-25 [1] CRAN (R 4.1.2)
   Matrix                   1.4-0    2021-12-08 [1] CRAN (R 4.1.2)
   MatrixGenerics         * 1.6.0    2021-10-26 [1] Bioconductor
   matrixStats            * 0.61.0   2021-09-17 [1] CRAN (R 4.1.2)
   memoise                  2.0.1    2021-11-26 [1] CRAN (R 4.1.2)
   mime                     0.12     2021-09-28 [1] CRAN (R 4.1.1)
   munsell                  0.5.0    2018-06-12 [1] CRAN (R 4.1.2)
   pillar                   1.7.0    2022-02-01 [1] CRAN (R 4.1.2)
   pkgbuild                 1.3.1    2021-12-20 [1] CRAN (R 4.1.2)
   pkgconfig                2.0.3    2019-09-22 [1] CRAN (R 4.1.2)
   pkgload                  1.2.4    2021-11-30 [1] CRAN (R 4.1.2)
   plotly                   4.10.0   2021-10-09 [1] CRAN (R 4.1.2)
   png                      0.1-7    2013-12-03 [1] CRAN (R 4.1.1)
   Polychrome               1.3.1    2021-07-16 [1] CRAN (R 4.1.2)
   prettyunits              1.1.1    2020-01-24 [1] CRAN (R 4.1.2)
   processx                 3.5.2    2021-04-30 [1] CRAN (R 4.1.2)
   promises                 1.2.0.1  2021-02-11 [1] CRAN (R 4.1.2)
   ps                       1.6.0    2021-02-28 [1] CRAN (R 4.1.2)
   purrr                    0.3.4    2020-04-17 [1] CRAN (R 4.1.2)
   R.methodsS3              1.8.1    2020-08-26 [1] CRAN (R 4.1.1)
   R.oo                     1.24.0   2020-08-26 [1] CRAN (R 4.1.1)
   R.utils                  2.11.0   2021-09-26 [1] CRAN (R 4.1.2)
   R6                       2.5.1    2021-08-19 [1] CRAN (R 4.1.2)
   rappdirs                 0.3.3    2021-01-31 [1] CRAN (R 4.1.2)
   RColorBrewer             1.1-2    2014-12-07 [1] CRAN (R 4.1.1)
   Rcpp                     1.0.8    2022-01-13 [1] CRAN (R 4.1.2)
   RCurl                    1.98-1.6 2022-02-08 [1] CRAN (R 4.1.2)
   remotes                  2.4.2    2021-11-30 [1] CRAN (R 4.1.2)
   restfulr                 0.0.13   2017-08-06 [1] CRAN (R 4.1.2)
   rhdf5                    2.38.0   2021-10-26 [1] Bioconductor
 D rhdf5filters             1.6.0    2021-10-26 [1] Bioconductor
   Rhdf5lib                 1.16.0   2021-10-26 [1] Bioconductor
   rjson                    0.2.21   2022-01-09 [1] CRAN (R 4.1.2)
   rlang                    1.0.1    2022-02-03 [1] CRAN (R 4.1.2)
   roxygen2                 7.1.2    2021-09-08 [1] CRAN (R 4.1.2)
   rprojroot                2.0.2    2020-11-15 [1] CRAN (R 4.1.2)
   Rsamtools                2.10.0   2021-10-26 [1] Bioconductor
   RSQLite                  2.2.10   2022-02-17 [1] CRAN (R 4.1.2)
   rstudioapi               0.13     2020-11-12 [1] CRAN (R 4.1.2)
   rsvd                     1.0.5    2021-04-16 [1] CRAN (R 4.1.2)
   rtracklayer              1.54.0   2021-10-26 [1] Bioconductor
   S4Vectors              * 0.32.3   2021-11-21 [1] Bioconductor
   sass                     0.4.0    2021-05-12 [1] CRAN (R 4.1.2)
   ScaledMatrix             1.2.0    2021-10-26 [1] Bioconductor
   scales                   1.1.1    2020-05-11 [1] CRAN (R 4.1.2)
   scater                   1.22.0   2021-10-27 [1] Bioconductor
   scatterplot3d            0.3-41   2018-03-14 [1] CRAN (R 4.1.1)
   scuttle                  1.4.0    2021-10-26 [1] Bioconductor
   sessioninfo              1.2.2    2021-12-06 [1] CRAN (R 4.1.2)
   shiny                    1.7.1    2021-10-02 [1] CRAN (R 4.1.2)
   shinyWidgets             0.6.4    2022-02-06 [1] CRAN (R 4.1.2)
   SingleCellExperiment   * 1.16.0   2021-10-26 [1] Bioconductor
   spam                     2.8-0    2022-01-06 [1] CRAN (R 4.1.2)
   sparseMatrixStats        1.6.0    2021-10-26 [1] Bioconductor
   SpatialExperiment      * 1.4.0    2021-10-26 [1] Bioconductor
   spatialLIBD            * 1.6.5    2022-01-12 [1] Bioconductor
   stringi                  1.7.6    2021-11-29 [1] CRAN (R 4.1.2)
   stringr                  1.4.0    2019-02-10 [1] CRAN (R 4.1.2)
   SummarizedExperiment   * 1.24.0   2021-10-26 [1] Bioconductor
   testthat                 3.1.2    2022-01-20 [1] CRAN (R 4.1.2)
   tibble                   3.1.6    2021-11-07 [1] CRAN (R 4.1.2)
   tidyr                    1.2.0    2022-02-01 [1] CRAN (R 4.1.2)
   tidyselect               1.1.2    2022-02-21 [1] CRAN (R 4.1.2)
   usethis                  2.1.5    2021-12-09 [1] CRAN (R 4.1.2)
   utf8                     1.2.2    2021-07-24 [1] CRAN (R 4.1.2)
   vctrs                    0.3.8    2021-04-29 [1] CRAN (R 4.1.2)
   vipor                    0.4.5    2017-03-22 [1] CRAN (R 4.1.2)
   viridis                  0.6.2    2021-10-13 [1] CRAN (R 4.1.2)
   viridisLite              0.4.0    2021-04-13 [1] CRAN (R 4.1.2)
   withr                    2.4.3    2021-11-30 [1] CRAN (R 4.1.2)
   xfun                     0.30     2022-03-02 [1] CRAN (R 4.1.2)
   XML                      3.99-0.9 2022-02-24 [1] CRAN (R 4.1.2)
   xml2                     1.3.3    2021-11-30 [1] CRAN (R 4.1.2)
   xtable                   1.8-4    2019-04-21 [1] CRAN (R 4.1.2)
   XVector                  0.34.0   2021-10-26 [1] Bioconductor
   yaml                     2.3.5    2022-02-21 [1] CRAN (R 4.1.2)
   zlibbioc                 1.40.0   2021-10-26 [1] Bioconductor

 [1] D:/hsy/software/R-4.1.2/library

 D -- DLL MD5 mismatch, broken installation.

----------------------------------------------------------------------------------------------------------------------

[Feature Request] registration_wrapper(): create and check validity of eventual pseudobulk factor names before starting

I recently ran registration_wrapper() on a very high-dimension dataset (~80 or ~200 clusters across 47 samples, depending on the granularity) and twice had runs go >8 hours before seeing warnings about invalid factors in the limma steps. For example, the first time around, the cluster names were character strings but with leading digits (e.g., "038_Nonneuron_OPC"). There was a single cluster of cells that had been annotated with a "/" in the name, which I didn't even consider the factor invalidity of.

Since the duplicateCorrelation step for datasets of extra high complexity can take several hours, it would be more resource efficient to have a pre-run check that stops the wrapper from running if invalid factor names are going to be generated down the line, rather than wait for limma to encounter them.

[BUG] Cannot resume manual annotation

First reported by @Erik-D-Nelson at https://jhu-genomics.slack.com/archives/C03KD30V3ST/p1657043593610579

I was using R version 4.2.0, SpatialExperiment version 1.6.0, and spatialLIBD version 1.8.3. I think the latest version of R is 4.2.1 but I believe the package versions are current
I'll try using this other Shiny app quickly and let you know what I find! Thanks!
I went on the lymph node app (EDIT: https://libd.shinyapps.io/spatialLIBD_Human_Lymph_Node_10x/) and successfully generated this csv file:
spatialLIBD_ManualAnnotation_2022-07-05_17-57-08.csv
It's just two square regions of the tissue, annotated test1 or test2. After I made these, I closed the app and started a new session. When I try to upload the csv to the Shiny app, it doesn't seem to work, as all spots are categorized as NA and none as test1 or test2. So, I think this may be an bug with the current version of spatialLIBD or a dependency/dependencies and not the HPC app

Can we increase the brightness?

Is it possible to increase the brightness of the image?

I'm not sure we can do this with plotly or maybe with R directly.

Investigate if it's possible to pass grob to plotly

Currently run_app() has the argument image_path at

image_path = system.file("app", "www", "data", package = "spatialLIBD"),
which then is used at
addResourcePath("imagedata", image_path)
because the images are read with readPNG() at

spatialLIBD/R/app_server.R

Lines 360 to 365 in 49d0735

pen <-
png::readPNG(file.path(
resourcePaths()["imagedata"],
sampleid,
"tissue_lowres_image.png"
))
and then converted to a raster at
source = raster2uri(as.raster(pen)),
.

There might be a way to do this directly from the rastergrob objects now included in SpatialExperiment. Can you check if there's such a way? Thanks!

Hopefully there's a way, that way we can eliminate this argument and make run_app() more flexible to use with new data.

FYI drighelli/SpatialExperiment#27 might be related

[BUG] Errors are shown when you select a gene for which there are no modeling results

Using https://github.com/LieberInstitute/spatialDLPFC/blob/6c572d57533ae4830ccb7364be91d4838f9d77cd/code/deploy_app_k16/app.R#L71 the app shows weird errors when selecting a gene for which there are no modeling results for the particular model type and test selected.

Screen Shot 2022-07-15 at 2 30 01 PM

We are encountering this issue on an app that for k = 16 clusters, meaning that there choose(k, 2) * 2 is equal to 72. That's a lot of combinations and genes, so we are using sig_genes_extract_all(n = 4000), and thus that's why not all genes are present. I had not anticipated this use case.

First reported by @abspangler13.

Improve code coverage

Improve internal code coverage using covr from the current 6% to at least 75% or higher for non-interactive functions.

[BUG] fetch_data(type = "spe") yields "Error: Other 'type' values are not supported."

When I follow along with the tutorial in the README, I encounter an error early on. Running the first five lines in the Processed data section.

## Load the package
library("spatialLIBD")

## Download the spot-level data
spe <- fetch_data(type = "spe")

Yields:

  |======================================================================| 100%

snapshotDate(): 2020-10-27
Error: Other 'type' values are not supported. Please use either 'sce', 'sce_layer', 'modeling_results', 'sce_example' or 've'.

Expected behavior

Output given in README, i.e.:

## This is a SpatialExperiment object
spe
#> class: SpatialExperiment 
#> dim: 33538 47681 
#> metadata(0):
#> assays(2): counts logcounts
#> rownames(33538): ENSG00000243485 ENSG00000237613 ... ENSG00000277475
#>   ENSG00000268674
#> rowData names(9): source type ... gene_search is_top_hvg
#> colnames(47681): AAACAACGAATAGTTC-1 AAACAAGTATCTCCCA-1 ...
#>   TTGTTTCCATACAACT-1 TTGTTTGTGTAAATTC-1
#> colData names(69): sample_id Cluster ... array_row array_col
#> reducedDimNames(6): PCA TSNE_perplexity50 ... TSNE_perplexity80
#>   UMAP_neighbors15
#> mainExpName: NULL
#> altExpNames(0):
#> spatialCoords names(2) : pxl_col_in_fullres pxl_row_in_fullres
#> imgData names(4): sample_id image_id data scaleFactor
R Session Information

Please report the output of either sessionInfo() or
sessioninfo::session_info() here.

options(width = 120)

R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] shiny_1.7.1                 spatialLIBD_1.2.1          
 [3] SingleCellExperiment_1.12.0 SummarizedExperiment_1.20.0
 [5] Biobase_2.50.0              GenomicRanges_1.42.0       
 [7] GenomeInfoDb_1.26.2         IRanges_2.24.1             
 [9] S4Vectors_0.28.1            BiocGenerics_0.36.0        
[11] MatrixGenerics_1.2.1        matrixStats_0.61.0         

loaded via a namespace (and not attached):
  [1] SpatialExperiment_1.0.0       ggbeeswarm_0.6.0             
  [3] colorspace_2.0-2              ellipsis_0.3.2               
  [5] benchmarkme_1.0.8             scuttle_1.0.4                
  [7] markdown_1.1                  XVector_0.30.0               
  [9] fs_1.5.2                      BiocNeighbors_1.8.2          
 [11] DT_0.17                       bit64_4.0.5                  
 [13] interactiveDisplayBase_1.28.0 AnnotationDbi_1.52.0         
 [15] Polychrome_1.5.1              golem_0.4.0                  
 [17] fansi_0.5.0                   codetools_0.2-18             
 [19] sparseMatrixStats_1.2.1       doParallel_1.0.16            
 [21] cachem_1.0.6                  scater_1.18.6                
 [23] config_0.3.1                  readbitmap_0.1.5             
 [25] spam_2.8-0                    jsonlite_1.7.2               
 [27] dbplyr_2.1.1                  png_0.1-7                    
 [29] BiocManager_1.30.10           compiler_4.0.3               
 [31] httr_1.4.2                    assertthat_0.2.1             
 [33] bmp_0.3                       Matrix_1.5-3                 
 [35] fastmap_1.1.0                 lazyeval_0.2.2               
 [37] cli_3.6.0                     later_1.3.0                  
 [39] BiocSingular_1.6.0            htmltools_0.5.2              
 [41] tools_4.0.3                   rsvd_1.0.3                   
 [43] dotCall64_1.0-1               gtable_0.3.0                 
 [45] glue_1.6.2                    GenomeInfoDbData_1.2.4       
 [47] dplyr_1.1.0                   maps_3.3.0                   
 [49] rappdirs_0.3.3                Rcpp_1.0.7                   
 [51] jquerylib_0.1.4               vctrs_0.5.2                  
 [53] ExperimentHub_1.16.0          crosstalk_1.2.0              
 [55] iterators_1.0.13              DelayedMatrixStats_1.12.3    
 [57] xfun_0.39                     stringr_1.4.0                
 [59] beachmat_2.6.4                mime_0.12                    
 [61] lifecycle_1.0.3               irlba_2.3.5                  
 [63] AnnotationHub_2.22.0          zlibbioc_1.36.0              
 [65] scales_1.2.1                  promises_1.2.0.1             
 [67] RColorBrewer_1.1-2            fields_13.3                  
 [69] yaml_2.2.1                    curl_4.3.2                   
 [71] memoise_2.0.0                 gridExtra_2.3                
 [73] ggplot2_3.4.0                 sass_0.4.0                   
 [75] stringi_1.7.6                 RSQLite_2.2.3                
 [77] BiocVersion_3.12.0            foreach_1.5.1                
 [79] tiff_0.1-11                   BiocParallel_1.24.1          
 [81] attempt_0.3.1                 benchmarkmeData_1.0.4        
 [83] rlang_1.0.6                   pkgconfig_2.0.3              
 [85] bitops_1.0-7                  fontawesome_0.5.1            
 [87] lattice_0.20-41               purrr_0.3.4                  
 [89] htmlwidgets_1.5.4             cowplot_1.1.1                
 [91] bit_4.0.4                     tidyselect_1.2.0             
 [93] magrittr_2.0.1                R6_2.5.1                     
 [95] generics_0.1.3                DelayedArray_0.16.2          
 [97] DBI_1.1.1                     withr_2.5.0                  
 [99] pillar_1.8.1                  scatterplot3d_0.3-41         
[101] RCurl_1.98-1.2                tibble_3.1.8                 
[103] crayon_1.4.2                  shinyWidgets_0.7.6           
[105] utf8_1.2.2                    BiocFileCache_1.14.0         
[107] plotly_4.10.0                 viridis_0.5.1                
[109] jpeg_0.1-8.1                  grid_4.0.3                   
[111] data.table_1.14.2             blob_1.2.1                   
[113] digest_0.6.29                 xtable_1.8-4                 
[115] tidyr_1.2.0                   httpuv_1.6.3                 
[117] munsell_0.5.0                 beeswarm_0.3.1               
[119] viridisLite_0.4.0             bslib_0.3.1                  
[121] vipor_0.4.5                   sessioninfo_1.1.1            

Indicate whether BiocManager::valid() returns TRUE.

  • BiocManager::valid() is TRUE -- NO

check_spe() considerations

Hi Leo.
Meeting Comments:

  1. check_spe() should consider the requested assaynames and not default ones.
  2. Probably barcode is now in colData and not in spatialData.
  3. Describe the request to have the key column as a requirement.
  4. Describe the special columns gene_id, gene_name, and gene_search.
  5. Describe how to define the Layer column (e.g. filled of "NA").

[BUG] run_app() error in frame_limits in newer R version

Describe the bug

I have custom object from my project that I have been running on spatialLIBD using 1.10.0 version on R 4.2.2. Currently, my collaborator told me she cannot run it on R 4.3.2 with a later version of the spatialLIBD (1.13.4). I tested it myself and I have the same issue with her. If we provide our custom www folder (which works fine in previous version) We get:

Warning: Error in if: argument is of length zero
  75: detect_html_document
  74: includeHTML
  60: ui
   3: runApp
   2: print.shiny.appobj
   1: <Anonymous>

And if we use the default www the package has, we get:

Warning: Error in frame_limits: all(c("array_row", "array_col", "pxl_row_in_fullres", "pxl_col_in_fullres") %in%  .... is not TRUE
  107: <Anonymous>
  106: stop
  105: stopifnot
  104: frame_limits
  103: renderPlotly
  102: func
   99: shinyRenderWidget
   98: func
   85: renderFunc
   84: output$histology_plotly
    3: runApp
    2: print.shiny.appobj
    1: <Anonymous>

Provide a minimally reproducible example (reprex)

Since we are about to publish our work, unfortunately, I cannot provide the object :/

Expected behavior

Normally I would just get the interactive app with my object.

R Session Information

Please report the output of either sessionInfo() or
sessioninfo::session_info() here.

options(width = 120)
## insert session info here
> sessioninfo::session_info()
─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.2 (2023-10-31 ucrt)
 os       Windows 10 x64 (build 19045)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  English_Switzerland.utf8
 ctype    English_Switzerland.utf8
 tz       Europe/Zurich
 date     2023-11-15
 rstudio  2023.09.1+494 Desert Sunflower (desktop)
 pandoc   NAPackages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package                * version   date (UTC) lib source
 abind                    1.4-5     2016-07-21 [1] CRAN (R 4.3.1)
 AnnotationDbi            1.64.1    2023-11-03 [1] Bioconductor
 AnnotationHub            3.10.0    2023-10-24 [1] Bioconductor
 attempt                  0.3.1     2020-05-03 [1] CRAN (R 4.3.2)
 beachmat                 2.18.0    2023-10-24 [1] Bioconductor
 beeswarm                 0.4.0     2021-06-01 [1] CRAN (R 4.3.1)
 benchmarkme              1.0.8     2022-06-12 [1] CRAN (R 4.3.2)
 benchmarkmeData          1.0.4     2020-04-23 [1] CRAN (R 4.3.2)
 Biobase                * 2.62.0    2023-10-24 [1] Bioconductor
 BiocFileCache            2.10.1    2023-10-26 [1] Bioconductor
 BiocGenerics           * 0.48.1    2023-11-01 [1] Bioconductor
 BiocIO                   1.12.0    2023-10-24 [1] Bioconductor
 BiocManager              1.30.22   2023-08-08 [1] CRAN (R 4.3.2)
 BiocNeighbors            1.20.0    2023-10-24 [1] Bioconductor
 BiocParallel             1.36.0    2023-10-24 [1] Bioconductor
 BiocSingular             1.18.0    2023-10-24 [1] Bioconductor
 BiocVersion              3.18.0    2023-04-26 [1] Bioconductor
 Biostrings               2.70.1    2023-10-25 [1] Bioconductor
 bit                      4.0.5     2022-11-15 [1] CRAN (R 4.3.2)
 bit64                    4.0.5     2020-08-30 [1] CRAN (R 4.3.2)
 bitops                   1.0-7     2021-04-24 [1] CRAN (R 4.3.1)
 blob                     1.2.4     2023-03-17 [1] CRAN (R 4.3.2)
 bslib                    0.5.1     2023-08-11 [1] CRAN (R 4.3.2)
 cachem                   1.0.8     2023-05-01 [1] CRAN (R 4.3.2)
 cli                      3.6.1     2023-03-23 [1] CRAN (R 4.3.2)
 codetools                0.2-19    2023-02-01 [2] CRAN (R 4.3.2)
 colorspace               2.1-0     2023-01-23 [1] CRAN (R 4.3.2)
 commonmark               1.9.0     2023-03-17 [1] CRAN (R 4.3.2)
 config                   0.3.2     2023-08-30 [1] CRAN (R 4.3.2)
 cowplot                  1.1.1     2020-12-30 [1] CRAN (R 4.3.2)
 crayon                   1.5.2     2022-09-29 [1] CRAN (R 4.3.2)
 curl                     5.1.0     2023-10-02 [1] CRAN (R 4.3.2)
 data.table               1.14.8    2023-02-17 [1] CRAN (R 4.3.2)
 DBI                      1.1.3     2022-06-18 [1] CRAN (R 4.3.2)
 dbplyr                   2.4.0     2023-10-26 [1] CRAN (R 4.3.2)
 DelayedArray             0.28.0    2023-10-24 [1] Bioconductor
 DelayedMatrixStats       1.24.0    2023-10-24 [1] Bioconductor
 digest                   0.6.33    2023-07-07 [1] CRAN (R 4.3.2)
 doParallel               1.0.17    2022-02-07 [1] CRAN (R 4.3.2)
 dotCall64                1.1-0     2023-10-17 [1] CRAN (R 4.3.2)
 dplyr                    1.1.3     2023-09-03 [1] CRAN (R 4.3.2)
 DT                       0.30      2023-10-05 [1] CRAN (R 4.3.2)
 edgeR                    4.0.1     2023-10-29 [1] Bioconductor
 ellipsis                 0.3.2     2021-04-29 [1] CRAN (R 4.3.2)
 ExperimentHub            2.10.0    2023-10-24 [1] Bioconductor
 fansi                    1.0.5     2023-10-08 [1] CRAN (R 4.3.2)
 farver                   2.1.1     2022-07-06 [1] CRAN (R 4.3.2)
 fastmap                  1.1.1     2023-02-24 [1] CRAN (R 4.3.2)
 fields                   15.2      2023-08-17 [1] CRAN (R 4.3.2)
 filelock                 1.0.2     2018-10-05 [1] CRAN (R 4.3.2)
 fontawesome              0.5.2     2023-08-19 [1] CRAN (R 4.3.2)
 foreach                  1.5.2     2022-02-02 [1] CRAN (R 4.3.2)
 fs                       1.6.3     2023-07-20 [1] CRAN (R 4.3.2)
 generics                 0.1.3     2022-07-05 [1] CRAN (R 4.3.2)
 GenomeInfoDb           * 1.38.1    2023-11-08 [1] Bioconductor
 GenomeInfoDbData         1.2.11    2023-11-15 [1] Bioconductor
 GenomicAlignments        1.38.0    2023-10-24 [1] Bioconductor
 GenomicRanges          * 1.54.1    2023-10-29 [1] Bioconductor
 ggbeeswarm               0.7.2     2023-04-29 [1] CRAN (R 4.3.2)
 ggplot2                  3.4.4     2023-10-12 [1] CRAN (R 4.3.2)
 ggrepel                  0.9.4     2023-10-13 [1] CRAN (R 4.3.2)
 glue                     1.6.2     2022-02-24 [1] CRAN (R 4.3.2)
 golem                    0.4.1     2023-06-05 [1] CRAN (R 4.3.2)
 gridExtra                2.3       2017-09-09 [1] CRAN (R 4.3.2)
 gtable                   0.3.4     2023-08-21 [1] CRAN (R 4.3.2)
 htmltools                0.5.7     2023-11-03 [1] CRAN (R 4.3.2)
 htmlwidgets              1.6.2     2023-03-17 [1] CRAN (R 4.3.2)
 httpuv                   1.6.12    2023-10-23 [1] CRAN (R 4.3.2)
 httr                     1.4.7     2023-08-15 [1] CRAN (R 4.3.2)
 interactiveDisplayBase   1.40.0    2023-10-24 [1] Bioconductor
 IRanges                * 2.36.0    2023-10-24 [1] Bioconductor
 irlba                    2.3.5.1   2022-10-03 [1] CRAN (R 4.3.2)
 iterators                1.0.14    2022-02-05 [1] CRAN (R 4.3.2)
 jquerylib                0.1.4     2021-04-26 [1] CRAN (R 4.3.2)
 jsonlite                 1.8.7     2023-06-29 [1] CRAN (R 4.3.2)
 KEGGREST                 1.42.0    2023-10-24 [1] Bioconductor
 later                    1.3.1     2023-05-02 [1] CRAN (R 4.3.2)
 lattice                  0.21-9    2023-10-01 [2] CRAN (R 4.3.2)
 lazyeval                 0.2.2     2019-03-15 [1] CRAN (R 4.3.2)
 lifecycle                1.0.4     2023-11-07 [1] CRAN (R 4.3.2)
 limma                    3.58.1    2023-10-31 [1] Bioconductor
 locfit                   1.5-9.8   2023-06-11 [1] CRAN (R 4.3.2)
 magick                   2.8.1     2023-10-22 [1] CRAN (R 4.3.2)
 magrittr                 2.0.3     2022-03-30 [1] CRAN (R 4.3.2)
 maps                     3.4.1.1   2023-11-03 [1] CRAN (R 4.3.2)
 markdown               * 1.11      2023-10-19 [1] CRAN (R 4.3.2)
 Matrix                   1.6-1.1   2023-09-18 [2] CRAN (R 4.3.2)
 MatrixGenerics         * 1.14.0    2023-10-24 [1] Bioconductor
 matrixStats            * 1.1.0     2023-11-07 [1] CRAN (R 4.3.2)
 memoise                  2.0.1     2021-11-26 [1] CRAN (R 4.3.2)
 mime                     0.12      2021-09-28 [1] CRAN (R 4.3.1)
 munsell                  0.5.0     2018-06-12 [1] CRAN (R 4.3.2)
 paletteer                1.5.0     2022-10-19 [1] CRAN (R 4.3.2)
 pillar                   1.9.0     2023-03-22 [1] CRAN (R 4.3.2)
 pkgconfig                2.0.3     2019-09-22 [1] CRAN (R 4.3.2)
 plotly                   4.10.3    2023-10-21 [1] CRAN (R 4.3.2)
 png                      0.1-8     2022-11-29 [1] CRAN (R 4.3.1)
 prismatic                1.1.1     2022-08-15 [1] CRAN (R 4.3.2)
 promises                 1.2.1     2023-08-10 [1] CRAN (R 4.3.2)
 purrr                    1.0.2     2023-08-10 [1] CRAN (R 4.3.2)
 R6                       2.5.1     2021-08-19 [1] CRAN (R 4.3.2)
 rappdirs                 0.3.3     2021-01-31 [1] CRAN (R 4.3.2)
 RColorBrewer             1.1-3     2022-04-03 [1] CRAN (R 4.3.1)
 Rcpp                     1.0.11    2023-07-06 [1] CRAN (R 4.3.2)
 RCurl                    1.98-1.13 2023-11-02 [1] CRAN (R 4.3.2)
 rematch2                 2.1.2     2020-05-01 [1] CRAN (R 4.3.2)
 restfulr                 0.0.15    2022-06-16 [1] CRAN (R 4.3.2)
 rjson                    0.2.21    2022-01-09 [1] CRAN (R 4.3.1)
 rlang                    1.1.2     2023-11-04 [1] CRAN (R 4.3.2)
 Rsamtools                2.18.0    2023-10-24 [1] Bioconductor
 RSQLite                  2.3.3     2023-11-04 [1] CRAN (R 4.3.2)
 rstudioapi               0.15.0    2023-07-07 [1] CRAN (R 4.3.2)
 rsvd                     1.0.5     2021-04-16 [1] CRAN (R 4.3.2)
 rtracklayer              1.62.0    2023-10-24 [1] Bioconductor
 S4Arrays                 1.2.0     2023-10-24 [1] Bioconductor
 S4Vectors              * 0.40.1    2023-10-26 [1] Bioconductor
 sass                     0.4.7     2023-07-15 [1] CRAN (R 4.3.2)
 ScaledMatrix             1.10.0    2023-10-24 [1] Bioconductor
 scales                   1.2.1     2022-08-20 [1] CRAN (R 4.3.2)
 scater                   1.30.0    2023-10-24 [1] Bioconductor
 scuttle                  1.12.0    2023-10-24 [1] Bioconductor
 sessioninfo              1.2.2     2021-12-06 [1] CRAN (R 4.3.2)
 shiny                  * 1.7.5.1   2023-10-14 [1] CRAN (R 4.3.2)
 shinyWidgets             0.8.0     2023-08-30 [1] CRAN (R 4.3.2)
 SingleCellExperiment   * 1.24.0    2023-10-24 [1] Bioconductor
 spam                     2.10-0    2023-10-23 [1] CRAN (R 4.3.2)
 SparseArray              1.2.2     2023-11-07 [1] Bioconductor
 sparseMatrixStats        1.14.0    2023-10-24 [1] Bioconductor
 SpatialExperiment      * 1.12.0    2023-10-24 [1] Bioconductor
 spatialLIBD            * 1.13.4    2023-05-25 [1] Bioconductor
 statmod                  1.5.0     2023-01-06 [1] CRAN (R 4.3.2)
 SummarizedExperiment   * 1.32.0    2023-10-24 [1] Bioconductor
 tibble                   3.2.1     2023-03-20 [1] CRAN (R 4.3.2)
 tidyr                    1.3.0     2023-01-24 [1] CRAN (R 4.3.2)
 tidyselect               1.2.0     2022-10-10 [1] CRAN (R 4.3.2)
 utf8                     1.2.4     2023-10-22 [1] CRAN (R 4.3.2)
 vctrs                    0.6.4     2023-10-12 [1] CRAN (R 4.3.2)
 vipor                    0.4.5     2017-03-22 [1] CRAN (R 4.3.2)
 viridis                  0.6.4     2023-07-22 [1] CRAN (R 4.3.2)
 viridisLite              0.4.2     2023-05-02 [1] CRAN (R 4.3.2)
 xfun                     0.41      2023-11-01 [1] CRAN (R 4.3.2)
 XML                      3.99-0.15 2023-11-02 [1] CRAN (R 4.3.2)
 xtable                   1.8-4     2019-04-21 [1] CRAN (R 4.3.2)
 XVector                  0.42.0    2023-10-24 [1] Bioconductor
 yaml                     2.3.7     2023-01-23 [1] CRAN (R 4.3.2)
 zlibbioc                 1.48.0    2023-10-24 [1] Bioconductor

 [1] C:/Users/Marit/AppData/Local/R/win-library/4.3
 [2] C:/Program Files/R/R-4.3.2/library

Indicate whether BiocManager::valid() returns TRUE.

  • BiocManager::valid() is TRUE

Note. To avoid potential issues with version mixing and reproducibility, do
not install packages from GitHub.

Additional Context

Here is my code:

# We load the libraries
library("spatialLIBD")
library("markdown")

options("golem.app.prod" = TRUE)

## Load the data (all paths are relative)
spe_wrapper <- readRDS("spe.rds")
vars <- colnames(colData(spe_wrapper))

## Run the app. This will start a separate window
run_app(
  spe_wrapper,
  sce_layer = NULL,
  modeling_results = NULL,
  sig_genes = NULL,
  title = "spatialLIBD: Mouse brain results",
  spe_discrete_vars = c("SCT_snn_res.0.5", "seurat_clusters",
                        "SCT_snn_res.0.8","ManualAnnotation"),
  spe_continuous_vars = c("nCount_SCT", "percent.ribo","sum_umi",
                          "sum_gene", "expr_chrM", "expr_chrM_ratio"),
  default_cluster = "seurat_clusters"
  # docs_path = "www"
)

Is the package installed via bioconda?

No

Thank you in advance for your assistance and sorry if I am missing something obvious.

an error when use check_sce() function

As you said before (#35), I downloaded the three files manually: modeling_results, sce, sce_layer. But when I tried to convert sce to spe object, error happened. I used check_sce(), there was the same message.

Code

library(spatialLIBD)
load("Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata")
load("Human_DLPFC_Visium_processedData_sce_scran_sce_layer_spatialLIBD.Rdata")
load("Human_DLPFC_Visium_modeling_results.Rdata")

spe <- sce_to_spe(sce)
check_sce(sce)

error information

Error in check_sce(sce) : 
  Not all of all(c("imagerow", "imagecol", "sample_name", "key", variables) %in% .... are TRUE

I found this was because the downloaded sce object didn't include the ManualAnnotation and spatialLIBD columns

#the variables vector is from check_sce() source code

> c("imagerow","imagecol","sample_name","key",variables)[! c("imagerow","imagecol","sample_name","key",variables) %in% colnames(colData(sce))]
[1] "ManualAnnotation" "spatialLIBD"

So the ManualAnnotation and spatialLIBD are important? could you provide them as .Rdata for us?
or should I delete these terms in check_sce() code for smooth running?

R session information

options(width = 120)
sessioninfo::session_info()

- Session info -------------------------------------------------------------------------------------------------------
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       Windows 10 x64 (build 19042)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  Chinese (Simplified)_China.936
 ctype    Chinese (Simplified)_China.936
 tz       Asia/Taipei
 date     2022-03-04
 rstudio  1.3.1073 Giant Goldenrod (desktop)
 pandoc   2.10 @ D:\\hsy\\software\\anaconda\\Scripts\\pandoc.exe

- Packages -----------------------------------------------------------------------------------------------------------
 ! package                * version  date (UTC) lib source
   AnnotationDbi            1.56.2   2021-11-09 [1] Bioconductor
   AnnotationHub            3.2.2    2022-03-01 [1] Bioconductor
   assertthat               0.2.1    2019-03-21 [1] CRAN (R 4.1.2)
   attempt                  0.3.1    2020-05-03 [1] CRAN (R 4.1.2)
   beachmat                 2.10.0   2021-10-26 [1] Bioconductor
   beeswarm                 0.4.0    2021-06-01 [1] CRAN (R 4.1.1)
   benchmarkme              1.0.7    2021-03-21 [1] CRAN (R 4.1.2)
   benchmarkmeData          1.0.4    2020-04-23 [1] CRAN (R 4.1.2)
   Biobase                * 2.54.0   2021-10-26 [1] Bioconductor
   BiocFileCache            2.2.1    2022-01-23 [1] Bioconductor
   BiocGenerics           * 0.40.0   2021-10-26 [1] Bioconductor
   BiocIO                   1.4.0    2021-10-26 [1] Bioconductor
   BiocManager              1.30.16  2021-06-15 [1] CRAN (R 4.1.2)
   BiocNeighbors            1.12.0   2021-10-26 [1] Bioconductor
   BiocParallel             1.28.3   2021-12-09 [1] Bioconductor
   BiocSingular             1.10.0   2021-10-26 [1] Bioconductor
   BiocVersion              3.14.0   2021-05-27 [1] Bioconductor
   Biostrings               2.62.0   2021-10-26 [1] Bioconductor
   bit                      4.0.4    2020-08-04 [1] CRAN (R 4.1.2)
   bit64                    4.0.5    2020-08-30 [1] CRAN (R 4.1.2)
   bitops                   1.0-7    2021-04-24 [1] CRAN (R 4.1.1)
   blob                     1.2.2    2021-07-23 [1] CRAN (R 4.1.2)
   brio                     1.1.3    2021-11-30 [1] CRAN (R 4.1.2)
   bslib                    0.3.1    2021-10-06 [1] CRAN (R 4.1.2)
   cachem                   1.0.6    2021-08-19 [1] CRAN (R 4.1.2)
   callr                    3.7.0    2021-04-20 [1] CRAN (R 4.1.2)
   cli                      3.2.0    2022-02-14 [1] CRAN (R 4.1.2)
   codetools                0.2-18   2020-11-04 [1] CRAN (R 4.1.2)
   colorspace               2.0-3    2022-02-21 [1] CRAN (R 4.1.2)
   config                   0.3.1    2020-12-17 [1] CRAN (R 4.1.2)
   cowplot                  1.1.1    2020-12-30 [1] CRAN (R 4.1.2)
   crayon                   1.5.0    2022-02-14 [1] CRAN (R 4.1.2)
   curl                     4.3.2    2021-06-23 [1] CRAN (R 4.1.2)
   data.table               1.14.2   2021-09-27 [1] CRAN (R 4.1.2)
   DBI                      1.1.2    2021-12-20 [1] CRAN (R 4.1.2)
   dbplyr                   2.1.1    2021-04-06 [1] CRAN (R 4.1.2)
   DelayedArray             0.20.0   2021-10-26 [1] Bioconductor
   DelayedMatrixStats       1.16.0   2021-10-26 [1] Bioconductor
   desc                     1.4.0    2021-09-28 [1] CRAN (R 4.1.2)
   digest                   0.6.29   2021-12-01 [1] CRAN (R 4.1.2)
   dockerfiler              0.1.4    2021-09-03 [1] CRAN (R 4.1.2)
   doParallel               1.0.17   2022-02-07 [1] CRAN (R 4.1.2)
   dotCall64                1.0-1    2021-02-11 [1] CRAN (R 4.1.2)
   dplyr                    1.0.8    2022-02-08 [1] CRAN (R 4.1.2)
   dqrng                    0.3.0    2021-05-01 [1] CRAN (R 4.1.2)
   DropletUtils             1.14.2   2022-01-09 [1] Bioconductor
   DT                       0.21     2022-02-26 [1] CRAN (R 4.1.2)
   edgeR                    3.36.0   2021-10-26 [1] Bioconductor
   ellipsis                 0.3.2    2021-04-29 [1] CRAN (R 4.1.2)
   ExperimentHub            2.2.1    2022-01-23 [1] Bioconductor
   fansi                    1.0.2    2022-01-14 [1] CRAN (R 4.1.2)
   fastmap                  1.1.0    2021-01-25 [1] CRAN (R 4.1.2)
   fields                   13.3     2021-10-30 [1] CRAN (R 4.1.2)
   filelock                 1.0.2    2018-10-05 [1] CRAN (R 4.1.2)
   foreach                  1.5.2    2022-02-02 [1] CRAN (R 4.1.2)
   fs                       1.5.2    2021-12-08 [1] CRAN (R 4.1.2)
   generics                 0.1.2    2022-01-31 [1] CRAN (R 4.1.2)
   GenomeInfoDb           * 1.30.1   2022-01-30 [1] Bioconductor
   GenomeInfoDbData         1.2.7    2022-03-03 [1] Bioconductor
   GenomicAlignments        1.30.0   2021-10-26 [1] Bioconductor
   GenomicRanges          * 1.46.1   2021-11-18 [1] Bioconductor
   ggbeeswarm               0.6.0    2017-08-07 [1] CRAN (R 4.1.2)
   ggplot2                  3.3.5    2021-06-25 [1] CRAN (R 4.1.2)
   ggrepel                  0.9.1    2021-01-15 [1] CRAN (R 4.1.2)
   glue                     1.6.2    2022-02-24 [1] CRAN (R 4.1.2)
   golem                    0.3.1    2021-04-17 [1] CRAN (R 4.1.2)
   gridExtra                2.3      2017-09-09 [1] CRAN (R 4.1.2)
   gtable                   0.3.0    2019-03-25 [1] CRAN (R 4.1.2)
   HDF5Array                1.22.1   2021-11-14 [1] Bioconductor
   htmltools                0.5.2    2021-08-25 [1] CRAN (R 4.1.2)
   htmlwidgets              1.5.4    2021-09-08 [1] CRAN (R 4.1.2)
   httpuv                   1.6.5    2022-01-05 [1] CRAN (R 4.1.2)
   httr                     1.4.2    2020-07-20 [1] CRAN (R 4.1.2)
   interactiveDisplayBase   1.32.0   2021-10-26 [1] Bioconductor
   IRanges                * 2.28.0   2021-10-26 [1] Bioconductor
   irlba                    2.3.5    2021-12-06 [1] CRAN (R 4.1.2)
   iterators                1.0.14   2022-02-05 [1] CRAN (R 4.1.2)
   jquerylib                0.1.4    2021-04-26 [1] CRAN (R 4.1.2)
   jsonlite                 1.8.0    2022-02-22 [1] CRAN (R 4.1.2)
   KEGGREST                 1.34.0   2021-10-26 [1] Bioconductor
   knitr                    1.37     2021-12-16 [1] CRAN (R 4.1.2)
   later                    1.3.0    2021-08-18 [1] CRAN (R 4.1.2)
   lattice                  0.20-45  2021-09-22 [1] CRAN (R 4.1.2)
   lazyeval                 0.2.2    2019-03-15 [1] CRAN (R 4.1.2)
   lifecycle                1.0.1    2021-09-24 [1] CRAN (R 4.1.2)
   limma                    3.50.1   2022-02-17 [1] Bioconductor
   locfit                   1.5-9.4  2020-03-25 [1] CRAN (R 4.1.2)
   magick                   2.7.3    2021-08-18 [1] CRAN (R 4.1.2)
   magrittr                 2.0.2    2022-01-26 [1] CRAN (R 4.1.2)
   maps                     3.4.0    2021-09-25 [1] CRAN (R 4.1.2)
   Matrix                   1.4-0    2021-12-08 [1] CRAN (R 4.1.2)
   MatrixGenerics         * 1.6.0    2021-10-26 [1] Bioconductor
   matrixStats            * 0.61.0   2021-09-17 [1] CRAN (R 4.1.2)
   memoise                  2.0.1    2021-11-26 [1] CRAN (R 4.1.2)
   mime                     0.12     2021-09-28 [1] CRAN (R 4.1.1)
   munsell                  0.5.0    2018-06-12 [1] CRAN (R 4.1.2)
   pillar                   1.7.0    2022-02-01 [1] CRAN (R 4.1.2)
   pkgbuild                 1.3.1    2021-12-20 [1] CRAN (R 4.1.2)
   pkgconfig                2.0.3    2019-09-22 [1] CRAN (R 4.1.2)
   pkgload                  1.2.4    2021-11-30 [1] CRAN (R 4.1.2)
   plotly                   4.10.0   2021-10-09 [1] CRAN (R 4.1.2)
   png                      0.1-7    2013-12-03 [1] CRAN (R 4.1.1)
   Polychrome               1.3.1    2021-07-16 [1] CRAN (R 4.1.2)
   prettyunits              1.1.1    2020-01-24 [1] CRAN (R 4.1.2)
   processx                 3.5.2    2021-04-30 [1] CRAN (R 4.1.2)
   promises                 1.2.0.1  2021-02-11 [1] CRAN (R 4.1.2)
   ps                       1.6.0    2021-02-28 [1] CRAN (R 4.1.2)
   purrr                    0.3.4    2020-04-17 [1] CRAN (R 4.1.2)
   R.methodsS3              1.8.1    2020-08-26 [1] CRAN (R 4.1.1)
   R.oo                     1.24.0   2020-08-26 [1] CRAN (R 4.1.1)
   R.utils                  2.11.0   2021-09-26 [1] CRAN (R 4.1.2)
   R6                       2.5.1    2021-08-19 [1] CRAN (R 4.1.2)
   rappdirs                 0.3.3    2021-01-31 [1] CRAN (R 4.1.2)
   RColorBrewer             1.1-2    2014-12-07 [1] CRAN (R 4.1.1)
   Rcpp                     1.0.8    2022-01-13 [1] CRAN (R 4.1.2)
   RCurl                    1.98-1.6 2022-02-08 [1] CRAN (R 4.1.2)
   remotes                  2.4.2    2021-11-30 [1] CRAN (R 4.1.2)
   restfulr                 0.0.13   2017-08-06 [1] CRAN (R 4.1.2)
   rhdf5                    2.38.0   2021-10-26 [1] Bioconductor
 D rhdf5filters             1.6.0    2021-10-26 [1] Bioconductor
   Rhdf5lib                 1.16.0   2021-10-26 [1] Bioconductor
   rjson                    0.2.21   2022-01-09 [1] CRAN (R 4.1.2)
   rlang                    1.0.1    2022-02-03 [1] CRAN (R 4.1.2)
   roxygen2                 7.1.2    2021-09-08 [1] CRAN (R 4.1.2)
   rprojroot                2.0.2    2020-11-15 [1] CRAN (R 4.1.2)
   Rsamtools                2.10.0   2021-10-26 [1] Bioconductor
   RSQLite                  2.2.10   2022-02-17 [1] CRAN (R 4.1.2)
   rstudioapi               0.13     2020-11-12 [1] CRAN (R 4.1.2)
   rsvd                     1.0.5    2021-04-16 [1] CRAN (R 4.1.2)
   rtracklayer              1.54.0   2021-10-26 [1] Bioconductor
   S4Vectors              * 0.32.3   2021-11-21 [1] Bioconductor
   sass                     0.4.0    2021-05-12 [1] CRAN (R 4.1.2)
   ScaledMatrix             1.2.0    2021-10-26 [1] Bioconductor
   scales                   1.1.1    2020-05-11 [1] CRAN (R 4.1.2)
   scater                   1.22.0   2021-10-27 [1] Bioconductor
   scatterplot3d            0.3-41   2018-03-14 [1] CRAN (R 4.1.1)
   scuttle                  1.4.0    2021-10-26 [1] Bioconductor
   sessioninfo              1.2.2    2021-12-06 [1] CRAN (R 4.1.2)
   shiny                    1.7.1    2021-10-02 [1] CRAN (R 4.1.2)
   shinyWidgets             0.6.4    2022-02-06 [1] CRAN (R 4.1.2)
   SingleCellExperiment   * 1.16.0   2021-10-26 [1] Bioconductor
   spam                     2.8-0    2022-01-06 [1] CRAN (R 4.1.2)
   sparseMatrixStats        1.6.0    2021-10-26 [1] Bioconductor
   SpatialExperiment      * 1.4.0    2021-10-26 [1] Bioconductor
   spatialLIBD            * 1.6.5    2022-01-12 [1] Bioconductor
   stringi                  1.7.6    2021-11-29 [1] CRAN (R 4.1.2)
   stringr                  1.4.0    2019-02-10 [1] CRAN (R 4.1.2)
   SummarizedExperiment   * 1.24.0   2021-10-26 [1] Bioconductor
   testthat                 3.1.2    2022-01-20 [1] CRAN (R 4.1.2)
   tibble                   3.1.6    2021-11-07 [1] CRAN (R 4.1.2)
   tidyr                    1.2.0    2022-02-01 [1] CRAN (R 4.1.2)
   tidyselect               1.1.2    2022-02-21 [1] CRAN (R 4.1.2)
   usethis                  2.1.5    2021-12-09 [1] CRAN (R 4.1.2)
   utf8                     1.2.2    2021-07-24 [1] CRAN (R 4.1.2)
   vctrs                    0.3.8    2021-04-29 [1] CRAN (R 4.1.2)
   vipor                    0.4.5    2017-03-22 [1] CRAN (R 4.1.2)
   viridis                  0.6.2    2021-10-13 [1] CRAN (R 4.1.2)
   viridisLite              0.4.0    2021-04-13 [1] CRAN (R 4.1.2)
   withr                    2.4.3    2021-11-30 [1] CRAN (R 4.1.2)
   xfun                     0.30     2022-03-02 [1] CRAN (R 4.1.2)
   XML                      3.99-0.9 2022-02-24 [1] CRAN (R 4.1.2)
   xml2                     1.3.3    2021-11-30 [1] CRAN (R 4.1.2)
   xtable                   1.8-4    2019-04-21 [1] CRAN (R 4.1.2)
   XVector                  0.34.0   2021-10-26 [1] Bioconductor
   yaml                     2.3.5    2022-02-21 [1] CRAN (R 4.1.2)
   zlibbioc                 1.40.0   2021-10-26 [1] Bioconductor

 [1] D:/hsy/software/R-4.1.2/library

 D -- DLL MD5 mismatch, broken installation.

----------------------------------------------------------------------------------------------------------------------

Check default shiny app color code

For some reason some two level factor variables, like spe$discard <- factor(c("TRUE", "FALSE")) are not being properly displayed in the shiny apps. They work well with the vis_clus*() functions. We noticed this in the Visium IF AD project with @shkwon17.

Disable the layer-level portion if it's not needed

We want to add support to run_app() such that if the user does not specify the sce_layer object (like sce_layer = NULL), then the layer-level panel won't show up. This can be done with uiOutput in shiny (see the docs), though I haven't tried it with golem.

Side by side

Under cluster (static) add option to see image and clusters side by side. Same for gene (static).

[BUG] An error when using registration_wrapper().

I'm so sorry to make troubles because I have no idea to solve the little bug.
I'm learing the spatial registraion when I'm following the Guide to Spatial Registration. I just copy and run the codes from the guide. However, when it turns to the function registration_wrapper(), I meet an error. Here is the code.

library("spatialLIBD")
library("SingleCellExperiment")

## get reference layer enrichment statistics
layer_modeling_results <- fetch_data(type = "modeling_results")

# Download and save a local cache of the data available at:
# https://github.com/LieberInstitute/10xPilot_snRNAseq-human#processed-data
bfc <- BiocFileCache::BiocFileCache()
url <- paste0(
  "https://libd-snrnaseq-pilot.s3.us-east-2.amazonaws.com/",
  "SCE_DLPFC-n3_tran-etal.rda"
)
local_data <- BiocFileCache::bfcrpath(url, x = bfc)

load(local_data, verbose = TRUE)

## Perform the spatial registration
sce_modeling_results <- registration_wrapper(
  sce = sce.dlpfc.tran,
  var_registration = "cellType",
  var_sample_id = "donor",
  gene_ensembl = "gene_id",
  gene_name = "gene_name"
)

It's the same with the guide.
And here is the error.

2023-10-26 21:23:51 make pseudobulk object
2023-10-26 21:23:55 dropping 13 pseudo-bulked samples that are below 'min_ncells'.
2023-10-26 21:23:55 drop lowly expressed genes
2023-10-26 21:23:55 normalize expression
2023-10-26 21:23:56 create model matrix
Error: The resulting model is not full rank. You might have some 'var_registration' levels that are empty which you can drop with 'droplevels()'. Check the output of 'table(sce_pseudo[[var_registration]])'.

Expected behavior

## Perform the spatial registration
sce_modeling_results <- registration_wrapper(
    sce = sce.dlpfc.tran,
    var_registration = "cellType",
    var_sample_id = "donor",
    gene_ensembl = "gene_id",
    gene_name = "gene_name"
)
#> 2023-09-05 20:41:51.590053 make pseudobulk object
#> 2023-09-05 20:41:54.461424 dropping 13 pseudo-bulked samples that are below 'min_ncells'.
#> 2023-09-05 20:41:54.569132 drop lowly expressed genes
#> 2023-09-05 20:41:54.90711 normalize expression
#> 2023-09-05 20:41:55.922038 create model matrix
#> 2023-09-05 20:41:55.972502 run duplicateCorrelation()
#> 2023-09-05 20:42:32.153248 The estimated correlation is: 0.138734774807097
#> 2023-09-05 20:42:32.157722 computing enrichment statistics
#> 2023-09-05 20:42:34.301225 extract and reformat enrichment results
#> 2023-09-05 20:42:34.464852 running the baseline pairwise model
#> 2023-09-05 20:42:34.695452 computing pairwise statistics
#> 2023-09-05 20:42:37.152251 computing F-statistics

R Session Information

Please report the output of either sessionInfo() or
sessioninfo::session_info() here.

options(width = 120)
## insert session info here
# sessioninfo::session_info() ## provides GitHub, pandoc, and other details
# sessionInfo() ## base R function in case you don't want to install sessioninfo
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 11 (bullseye)

Matrix products: default
BLAS:   /home/opt/R/4.2.1/lib/R/lib/libRblas.so
LAPACK: /home/opt/R/4.2.1/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] spatialLIBD_1.10.1          SpatialExperiment_1.8.1     SingleCellExperiment_1.18.0
 [4] SummarizedExperiment_1.26.1 Biobase_2.58.0              GenomicRanges_1.48.0       
 [7] GenomeInfoDb_1.34.9         IRanges_2.32.0              S4Vectors_0.36.2           
[10] BiocGenerics_0.44.0         MatrixGenerics_1.8.1        matrixStats_1.0.0          

loaded via a namespace (and not attached):
  [1] spam_2.9-1                    AnnotationHub_3.6.0          
  [3] BiocFileCache_2.6.1           lazyeval_0.2.2               
  [5] BiocParallel_1.32.6           ggplot2_3.4.2                
  [7] scater_1.26.1                 benchmarkme_1.0.8            
  [9] digest_0.6.33                 foreach_1.5.2                
 [11] htmltools_0.5.5               viridis_0.6.4                
 [13] magick_2.7.4                  fansi_1.0.4                  
 [15] magrittr_2.0.3                memoise_2.0.1                
 [17] ScaledMatrix_1.4.0            paletteer_1.5.0              
 [19] config_0.3.1                  doParallel_1.0.17            
 [21] limma_3.52.2                  Biostrings_2.66.0            
 [23] R.utils_2.12.0                colorspace_2.1-0             
 [25] ggrepel_0.9.3                 blob_1.2.4                   
 [27] rappdirs_0.3.3                dplyr_1.1.2                  
 [29] crayon_1.5.2                  RCurl_1.98-1.12              
 [31] jsonlite_1.8.7                iterators_1.0.14             
 [33] glue_1.6.2                    gtable_0.3.3                 
 [35] zlibbioc_1.44.0               XVector_0.38.0               
 [37] DelayedArray_0.22.0           BiocSingular_1.12.0          
 [39] DropletUtils_1.18.1           Rhdf5lib_1.18.2              
 [41] maps_3.4.0                    HDF5Array_1.24.2             
 [43] scales_1.2.1                  DBI_1.1.3                    
 [45] edgeR_3.38.4                  Rcpp_1.0.11                  
 [47] viridisLite_0.4.2             xtable_1.8-4                 
 [49] dqrng_0.3.0                   bit_4.0.5                    
 [51] rsvd_1.0.5                    dotCall64_1.0-2              
 [53] DT_0.28                       htmlwidgets_1.6.2            
 [55] httr_1.4.6                    RColorBrewer_1.1-3           
 [57] ellipsis_0.3.2                pkgconfig_2.0.3              
 [59] XML_3.99-0.10                 R.methodsS3_1.8.2            
 [61] scuttle_1.8.4                 sass_0.4.7                   
 [63] dbplyr_2.3.3                  locfit_1.5-9.6               
 [65] utf8_1.2.3                    tidyselect_1.2.0             
 [67] rlang_1.1.1                   later_1.3.1                  
 [69] AnnotationDbi_1.60.2          munsell_0.5.0                
 [71] BiocVersion_3.16.0            tools_4.2.1                  
 [73] cachem_1.0.8                  cli_3.6.1                    
 [75] generics_0.1.3                RSQLite_2.3.1                
 [77] ExperimentHub_2.6.0           fastmap_1.1.1                
 [79] yaml_2.3.7                    rematch2_2.1.2               
 [81] bit64_4.0.5                   purrr_1.0.1                  
 [83] KEGGREST_1.38.0               sparseMatrixStats_1.8.0      
 [85] mime_0.12                     R.oo_1.25.0                  
 [87] compiler_4.2.1                rstudioapi_0.14              
 [89] beeswarm_0.4.0                plotly_4.10.0                
 [91] filelock_1.0.2                curl_5.0.1                   
 [93] png_0.1-8                     interactiveDisplayBase_1.36.0
 [95] statmod_1.5.0                 tibble_3.2.1                 
 [97] bslib_0.5.0                   fields_14.1                  
 [99] lattice_0.20-45               Matrix_1.6-0                 
[101] vctrs_0.6.3                   pillar_1.9.0                 
[103] lifecycle_1.0.3               rhdf5filters_1.8.0           
[105] BiocManager_1.30.21.1         jquerylib_0.1.4              
[107] BiocNeighbors_1.16.0          data.table_1.14.8            
[109] cowplot_1.1.1                 bitops_1.0-7                 
[111] irlba_2.3.5                   httpuv_1.6.11                
[113] rtracklayer_1.58.0            R6_2.5.1                     
[115] BiocIO_1.8.0                  promises_1.2.0.1             
[117] gridExtra_2.3                 vipor_0.4.5                  
[119] sessioninfo_1.2.2             codetools_0.2-18             
[121] benchmarkmeData_1.0.4         golem_0.4.1                  
[123] rhdf5_2.40.0                  rjson_0.2.21                 
[125] withr_2.5.0                   shinyWidgets_0.7.6           
[127] GenomicAlignments_1.34.1      Rsamtools_2.14.0             
[129] GenomeInfoDbData_1.2.9        parallel_4.2.1               
[131] grid_4.2.1                    beachmat_2.12.0              
[133] tidyr_1.3.0                   attempt_0.3.1                
[135] DelayedMatrixStats_1.18.0     shiny_1.7.4.1                
[137] ggbeeswarm_0.7.2              restfulr_0.0.15              

[BUG] Possible missing data through R interface

Hello,

I was following along with the processed data demo, where the R package spatialLIBD is used to fetch the spot-level data, namely via the line spe <- fetch_data(type = "spe"). However, I encountered this error after loading the package and running that line:

> spe <- fetch_data(type = "spe")
  |======================================================================| 100%

snapshotDate(): 2020-10-27
Error: Other 'type' values are not supported. Please use either 'sce', 'sce_layer', 'modeling_results', 'sce_example' or 've'.

As suggested in the error, I was able to fetch data of type = "sce" instead without issues. Please note that I'm using R 4.0.4 via the conda_R/4.0.x module at JHPCE. I'm not sure if this is the most recent version of R and Bioconductor, which I see you require/suggest in the README.

R session information

> options(width = 120)
> sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.0.4 RC (2021-02-08 r79975)
 os       CentOS Linux 7 (Core)
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       US/Eastern
 date     2021-04-22Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
 package                * version  date       lib source
 AnnotationDbi            1.52.0   2020-10-27 [2] Bioconductor
 AnnotationHub            2.22.1   2021-04-16 [2] Bioconductor
 assertthat               0.2.1    2019-03-21 [2] CRAN (R 4.0.3)
 attempt                  0.3.1    2020-05-03 [1] CRAN (R 4.0.4)
 beachmat                 2.6.4    2020-12-20 [2] Bioconductor
 beeswarm                 0.2.3    2016-04-25 [1] CRAN (R 4.0.3)
 benchmarkme              1.0.7    2021-03-21 [1] CRAN (R 4.0.4)
 benchmarkmeData          1.0.4    2020-04-23 [1] CRAN (R 4.0.4)
 Biobase                * 2.50.0   2020-10-27 [2] Bioconductor
 BiocFileCache            1.14.0   2020-10-27 [1] Bioconductor
 BiocGenerics           * 0.36.1   2021-04-16 [2] Bioconductor
 BiocManager              1.30.12  2021-03-28 [2] CRAN (R 4.0.4)
 BiocNeighbors            1.8.1    2020-11-11 [1] Bioconductor
 BiocParallel             1.24.1   2020-11-06 [1] Bioconductor
 BiocSingular             1.6.0    2020-10-27 [1] Bioconductor
 BiocVersion              3.12.0   2020-04-27 [2] Bioconductor
 bit                      4.0.4    2020-08-04 [2] CRAN (R 4.0.3)
 bit64                    4.0.5    2020-08-30 [2] CRAN (R 4.0.3)
 bitops                   1.0-6    2013-08-17 [2] CRAN (R 4.0.3)
 blob                     1.2.1    2020-01-20 [2] CRAN (R 4.0.3)
 bmp                      0.3      2017-09-11 [1] CRAN (R 4.0.4)
 bslib                    0.2.4    2021-01-25 [2] CRAN (R 4.0.3)
 cachem                   1.0.4    2021-02-13 [2] CRAN (R 4.0.4)
 cli                      2.4.0    2021-04-05 [2] CRAN (R 4.0.4)
 codetools                0.2-18   2020-11-04 [3] CRAN (R 4.0.4)
 colorspace               2.0-0    2020-11-11 [2] CRAN (R 4.0.3)
 config                   0.3.1    2020-12-17 [1] CRAN (R 4.0.4)
 cowplot                  1.1.0    2020-09-08 [1] CRAN (R 4.0.3)
 crayon                   1.4.1    2021-02-08 [2] CRAN (R 4.0.3)
 curl                     4.3      2019-12-02 [2] CRAN (R 4.0.3)
 data.table               1.14.0   2021-02-21 [2] CRAN (R 4.0.4)
 DBI                      1.1.1    2021-01-15 [2] CRAN (R 4.0.3)
 dbplyr                   2.1.1    2021-04-06 [2] CRAN (R 4.0.4)
 DelayedArray             0.16.3   2021-03-24 [2] Bioconductor
 DelayedMatrixStats       1.12.3   2021-02-03 [2] Bioconductor
 desc                     1.3.0    2021-03-05 [2] CRAN (R 4.0.4)
 digest                   0.6.27   2020-10-24 [2] CRAN (R 4.0.3)
 dockerfiler              0.1.3    2019-03-19 [1] CRAN (R 4.0.4)
 doParallel               1.0.16   2020-10-16 [2] CRAN (R 4.0.3)
 dotCall64                1.0-1    2021-02-11 [2] CRAN (R 4.0.4)
 dplyr                    1.0.5    2021-03-05 [2] CRAN (R 4.0.4)
 DT                       0.18     2021-04-14 [2] CRAN (R 4.0.4)
 ellipsis                 0.3.1    2020-05-15 [2] CRAN (R 4.0.3)
 ExperimentHub            1.16.1   2021-04-16 [2] Bioconductor
 fansi                    0.4.2    2021-01-15 [2] CRAN (R 4.0.3)
 fastmap                  1.1.0    2021-01-25 [2] CRAN (R 4.0.3)
 fields                   11.6     2020-10-09 [2] CRAN (R 4.0.3)
 foreach                  1.5.1    2020-10-15 [2] CRAN (R 4.0.3)
 fs                       1.5.0    2020-07-31 [2] CRAN (R 4.0.3)
 generics                 0.1.0    2020-10-31 [2] CRAN (R 4.0.3)
 GenomeInfoDb           * 1.26.7   2021-04-08 [2] Bioconductor
 GenomeInfoDbData         1.2.4    2020-11-30 [2] Bioconductor
 GenomicRanges          * 1.42.0   2020-10-27 [1] Bioconductor
 ggbeeswarm               0.6.0    2017-08-07 [1] CRAN (R 4.0.3)
 ggplot2                  3.3.3    2020-12-30 [2] CRAN (R 4.0.3)
 glue                     1.4.2    2020-08-27 [2] CRAN (R 4.0.3)
 golem                    0.3.1    2021-04-17 [1] CRAN (R 4.0.4)
 gridExtra                2.3      2017-09-09 [2] CRAN (R 4.0.3)
 gtable                   0.3.0    2019-03-25 [2] CRAN (R 4.0.3)
 htmltools                0.5.1.1  2021-01-22 [2] CRAN (R 4.0.3)
 htmlwidgets              1.5.3    2020-12-10 [2] CRAN (R 4.0.3)
 httpuv                   1.5.5    2021-01-13 [2] CRAN (R 4.0.3)
 httr                     1.4.2    2020-07-20 [2] CRAN (R 4.0.3)
 interactiveDisplayBase   1.28.0   2020-10-27 [2] Bioconductor
 IRanges                * 2.24.1   2020-12-12 [2] Bioconductor
 irlba                    2.3.3    2019-02-05 [2] CRAN (R 4.0.3)
 iterators                1.0.13   2020-10-15 [2] CRAN (R 4.0.3)
 jpeg                     0.1-8.1  2019-10-24 [2] CRAN (R 4.0.3)
 jquerylib                0.1.3    2020-12-17 [2] CRAN (R 4.0.3)
 jsonlite                 1.7.2    2020-12-09 [2] CRAN (R 4.0.3)
 knitr                    1.30     2020-09-22 [1] CRAN (R 4.0.3)
 later                    1.1.0.1  2020-06-05 [2] CRAN (R 4.0.3)
 lattice                  0.20-41  2020-04-02 [3] CRAN (R 4.0.4)
 lazyeval                 0.2.2    2019-03-15 [2] CRAN (R 4.0.3)
 lifecycle                1.0.0    2021-02-15 [2] CRAN (R 4.0.4)
 magrittr                 2.0.1    2020-11-17 [2] CRAN (R 4.0.3)
 maps                     3.3.0    2018-04-03 [2] CRAN (R 4.0.3)
 Matrix                   1.3-2    2021-01-06 [3] CRAN (R 4.0.4)
 MatrixGenerics         * 1.2.1    2021-01-30 [2] Bioconductor
 matrixStats            * 0.58.0   2021-01-29 [2] CRAN (R 4.0.3)
 memoise                  2.0.0    2021-01-26 [2] CRAN (R 4.0.3)
 mime                     0.10     2021-02-13 [2] CRAN (R 4.0.4)
 munsell                  0.5.0    2018-06-12 [2] CRAN (R 4.0.3)
 pillar                   1.6.0    2021-04-13 [2] CRAN (R 4.0.4)
 pkgconfig                2.0.3    2019-09-22 [2] CRAN (R 4.0.3)
 pkgload                  1.2.1    2021-04-06 [2] CRAN (R 4.0.4)
 plotly                   4.9.2.1  2020-04-04 [1] CRAN (R 4.0.3)
 png                      0.1-7    2013-12-03 [2] CRAN (R 4.0.3)
 Polychrome               1.2.6    2020-11-11 [1] CRAN (R 4.0.4)
 promises                 1.2.0.1  2021-02-11 [2] CRAN (R 4.0.4)
 purrr                    0.3.4    2020-04-17 [2] CRAN (R 4.0.3)
 R6                       2.5.0    2020-10-28 [2] CRAN (R 4.0.3)
 rappdirs                 0.3.3    2021-01-31 [2] CRAN (R 4.0.3)
 RColorBrewer             1.1-2    2014-12-07 [1] CRAN (R 4.0.3)
 Rcpp                     1.0.6    2021-01-15 [2] CRAN (R 4.0.3)
 RCurl                    1.98-1.3 2021-03-16 [2] CRAN (R 4.0.4)
 readbitmap               0.1.5    2018-06-27 [1] CRAN (R 4.0.4)
 remotes                  2.3.0    2021-04-01 [2] CRAN (R 4.0.4)
 rlang                    0.4.10   2020-12-30 [2] CRAN (R 4.0.3)
 roxygen2                 7.1.1    2020-06-27 [2] CRAN (R 4.0.3)
 rprojroot                2.0.2    2020-11-15 [2] CRAN (R 4.0.3)
 RSQLite                  2.2.6    2021-04-11 [2] CRAN (R 4.0.4)
 rstudioapi               0.13     2020-11-12 [2] CRAN (R 4.0.3)
 rsvd                     1.0.3    2020-02-17 [1] CRAN (R 4.0.3)
 S4Vectors              * 0.28.1   2020-12-09 [2] Bioconductor
 sass                     0.3.1    2021-01-24 [2] CRAN (R 4.0.3)
 scales                   1.1.1    2020-05-11 [2] CRAN (R 4.0.3)
 scater                   1.18.3   2020-11-08 [1] Bioconductor
 scatterplot3d            0.3-41   2018-03-14 [1] CRAN (R 4.0.4)
 scuttle                  1.0.0    2020-10-27 [1] Bioconductor
 sessioninfo              1.1.1    2018-11-05 [2] CRAN (R 4.0.3)
 shiny                    1.6.0    2021-01-25 [2] CRAN (R 4.0.3)
 shinyWidgets             0.6.0    2021-03-15 [1] CRAN (R 4.0.4)
 SingleCellExperiment   * 1.12.0   2020-10-27 [2] Bioconductor
 spam                     2.6-0    2020-12-14 [2] CRAN (R 4.0.3)
 sparseMatrixStats        1.2.1    2021-02-02 [2] Bioconductor
 SpatialExperiment        1.0.0    2020-10-27 [1] Bioconductor
 spatialLIBD            * 1.2.1    2020-12-21 [1] Bioconductor
 stringi                  1.5.3    2020-09-09 [2] CRAN (R 4.0.3)
 stringr                  1.4.0    2019-02-10 [2] CRAN (R 4.0.3)
 SummarizedExperiment   * 1.20.0   2020-10-27 [1] Bioconductor
 testthat                 3.0.2    2021-02-14 [2] CRAN (R 4.0.4)
 tibble                   3.1.1    2021-04-18 [2] CRAN (R 4.0.4)
 tidyr                    1.1.3    2021-03-03 [2] CRAN (R 4.0.4)
 tidyselect               1.1.0    2020-05-11 [2] CRAN (R 4.0.3)
 tiff                     0.1-8    2021-03-31 [2] CRAN (R 4.0.4)
 usethis                  2.0.1    2021-02-10 [2] CRAN (R 4.0.4)
 utf8                     1.2.1    2021-03-12 [2] CRAN (R 4.0.4)
 vctrs                    0.3.7    2021-03-29 [2] CRAN (R 4.0.4)
 vipor                    0.4.5    2017-03-22 [1] CRAN (R 4.0.3)
 viridis                  0.6.0    2021-04-15 [2] CRAN (R 4.0.4)
 viridisLite              0.4.0    2021-04-13 [2] CRAN (R 4.0.4)
 withr                    2.4.2    2021-04-18 [2] CRAN (R 4.0.4)
 xfun                     0.22     2021-03-11 [2] CRAN (R 4.0.4)
 xml2                     1.3.2    2020-04-23 [2] CRAN (R 4.0.3)
 xtable                   1.8-4    2019-04-21 [2] CRAN (R 4.0.3)
 XVector                  0.30.0   2020-10-27 [2] Bioconductor
 yaml                     2.2.1    2020-02-01 [2] CRAN (R 4.0.3)
 zlibbioc                 1.36.0   2020-10-27 [2] Bioconductor

[1] /users/neagles/R/4.0.x
[2] /jhpce/shared/jhpce/core/conda/miniconda3-4.6.14/envs/svnR-4.0.x/R/4.0.x/lib64/R/site-library
[3] /jhpce/shared/jhpce/core/conda/miniconda3-4.6.14/envs/svnR-4.0.x/R/4.0.x/lib64/R/library

Add functions for running statistical models

It'll be easier to run the spatial registration process in your own data if we have functions for doing something like https://github.com/LieberInstitute/HumanPilot/blob/master/Analysis/Layer_Guesses/ad_snRNAseq_recast.R where we pseudo-bulk the data then compute t-stats for one cluster vs all others at a time, aka, the enrichment statistics. https://github.com/LieberInstitute/HumanPilot/blob/master/Analysis/Layer_Guesses/layer_specificity.R has the code for the whole set: anova and pairwise. Then https://github.com/LieberInstitute/HumanPilot/blob/master/Analysis/Layer_Guesses/misc_numbers.R re-shapes the results into what we can load with fetch_data("modeling_results").

This would help @abspangler13 @Nick-Eagles @sparthib and others.

Error when downloading the dataset

Hi, I'm trying to run the R code "sce <- fetch_data(type = 'sce', eh = ehub)" as is written in the tutorial to access the processed data , but Error occurs when running the code.
The Error messages are stated as follows:

> sce <- fetch_data(type = 'sce', eh = ehub)
adding rname 'https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1'
Error in BiocFileCache::bfcrpath(bfc, url) : 
  not all 'rnames' found or unique.
此外: Warning messages:
1: download failed
  web resource path: ‘https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1’
  local file path: ‘/tmp/RtmpRP4ATx/BiocFileCache/1f495f32f384_Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata%3Fdl%3D1’
  reason: Timeout was reached: [www.dropbox.com] Connection timed out after 10000 milliseconds 
2: bfcadd() failed; resource removed
  rid: BFC3
  fpath: ‘https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1’
  reason: download failed 
3: In value[[3L]](cond) : 
trying to add rname 'https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1' produced error:
  bfcadd() failed; see warnings()
> spe <- fetch_data(type = "spe")
snapshotDate(): 2021-10-19
adding rname 'https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1'
Error in BiocFileCache::bfcrpath(bfc, url) : 
  not all 'rnames' found or unique.
此外: Warning messages:
1: download failed
  web resource path: ‘https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1’
  local file path: ‘/tmp/RtmpRP4ATx/BiocFileCache/1f497f0d458c_Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata%3Fdl%3D1’
  reason: Timeout was reached: [www.dropbox.com] Connection timed out after 10000 milliseconds 
2: bfcadd() failed; resource removed
  rid: BFC4
  fpath: ‘https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1’
  reason: download failed 
3: In value[[3L]](cond) : 
trying to add rname 'https://www.dropbox.com/s/f4wcvtdq428y73p/Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata?dl=1' produced error:
  bfcadd() failed; see warnings()

So how can I get access to the processed data?

Thanks for your help!

Use ComplexHeatmap

Based on the spatialDLPFC project, we decided that the heatmaps look better when made with ComplexHeatmap. We need to change all internal heatmaps to use this package.

shiny updates break the app in spatialLIBD

The shiny app doesn't seem to work with R 4.1.x and bioc 3.14 (well, the current bioc 3.15 dev version installed on bioc 3.14). This looks like something changed in shiny.

Screen Shot 2021-11-08 at 1 43 34 PM

Loading required package: shiny

Listening on http://127.0.0.1:6985
Warning: Navigation containers expect a collection of `bslib::nav()`/`shiny::tabPanel()`s and/or `bslib::nav_menu()`/`shiny::navbarMenu()`s. Consider using `header` or `footer` if you wish to place content above (or below) every panel's contents.
Warning: Error in : Navigation containers expect a collection of `bslib::nav()`/`shiny::tabPanel()`s and/or `bslib::nav_menu()`/`shiny::navbarMenu()`s. Consider using `header` or `footer` if you wish to place content above (or below) every panel's contents.
  84: stop
  83: FUN
  82: lapply
  81: buildTabset
  80: navbarPage_
  79: navs_bar
  74: bslib::page_navbar
  72: navbarPage
  69: ui [/Users/lcollado/Dropbox/Code/spatialLIBD/R/app_ui.R#25]

reprex

## Download and save a local cache of the data provided by 10x Genomics
bfc <- BiocFileCache::BiocFileCache()
lymph.url <-
    paste0(
        "https://cf.10xgenomics.com/samples/spatial-exp/",
        "1.1.0/V1_Human_Lymph_Node/",
        c(
            "V1_Human_Lymph_Node_filtered_feature_bc_matrix.tar.gz",
            "V1_Human_Lymph_Node_spatial.tar.gz",
            "V1_Human_Lymph_Node_analysis.tar.gz"
        )
    )
lymph.data <- sapply(lymph.url, BiocFileCache::bfcrpath, x = bfc)

## Extract the files to a temporary location
## (they'll be deleted once you close your R session)
sapply(lymph.data, utils::untar, exdir = tempdir())


## Download the Gencode v32 GTF file and cache it
gtf_cache <- BiocFileCache::bfcrpath(
    bfc,
    paste0(
        "ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/",
        "release_32/gencode.v32.annotation.gtf.gz"
    )
)

## Show the GTF cache location
gtf_cache

## Import the data as a SpatialExperiment object
spe_wrapper <- read10xVisiumWrapper(
    samples = tempdir(),
    sample_id = "lymph",
    type = "sparse", data = "filtered",
    images = c("lowres", "highres"), load = TRUE,
    reference_gtf = gtf_cache
)

## Run our shiny app
if (interactive()) {
    vars <- colnames(colData(spe_wrapper))

    run_app(
        spe_wrapper,
        sce_layer = NULL,
        modeling_results = NULL,
        sig_genes = NULL,
        title = "spatialLIBD: human lymph node by 10x Genomics (made with wrapper)",
        spe_discrete_vars = c(vars[grep("10x_", vars)], "ManualAnnotation"),
        spe_continuous_vars = c("sum_umi", "sum_gene", "expr_chrM", "expr_chrM_ratio"),
        default_cluster = "10x_graphclust"
    )
}

R session info

options(width = 120); sessioninfo::session_info()
─ Session info  🍝  🇬🇹  🎐   ─────────────────────────────────────────────────────────────────────────────────────────
 hash: spaghetti, flag: Guatemala, wind chime

 setting  value
 version  R version 4.1.2 Patched (2021-11-04 r81141)
 os       macOS Monterey 12.0.1
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2021-11-08
 rstudio  2021.09.0+351 Ghost Orchid (desktop)
 pandoc   2.14.0.3 @ /Applications/RStudio.app/Contents/MacOS/pandoc/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
 !  package                * version    date (UTC) lib source
    AnnotationDbi            1.56.1     2021-10-29 [1] Bioconductor
    AnnotationForge          1.36.0     2021-10-26 [1] Bioconductor
    AnnotationHub            3.2.0      2021-10-26 [1] Bioconductor
    AnnotationHubData        1.24.0     2021-10-26 [1] Bioconductor
    assertthat               0.2.1      2019-03-21 [1] CRAN (R 4.1.0)
    attempt                  0.3.1      2020-05-03 [1] CRAN (R 4.1.0)
    backports                1.3.0      2021-10-27 [1] CRAN (R 4.1.0)
    beachmat                 2.10.0     2021-10-26 [1] Bioconductor
    beeswarm                 0.4.0      2021-06-01 [1] CRAN (R 4.1.0)
    benchmarkme              1.0.7      2021-03-21 [1] CRAN (R 4.1.0)
    benchmarkmeData          1.0.4      2020-04-23 [1] CRAN (R 4.1.0)
    Biobase                * 2.54.0     2021-10-26 [1] Bioconductor
    BiocCheck                1.30.0     2021-10-26 [1] Bioconductor
    BiocFileCache            2.2.0      2021-10-26 [1] Bioconductor
    BiocGenerics           * 0.40.0     2021-10-26 [1] Bioconductor
    BiocIO                   1.4.0      2021-10-26 [1] Bioconductor
    BiocManager              1.30.16    2021-06-15 [1] CRAN (R 4.1.0)
    BiocNeighbors            1.12.0     2021-10-26 [1] Bioconductor
    BiocParallel             1.28.0     2021-10-26 [1] Bioconductor
    BiocSingular             1.10.0     2021-10-26 [1] Bioconductor
    biocthis                 1.4.0      2021-10-26 [1] Bioconductor
    BiocVersion              3.14.0     2021-05-19 [1] Bioconductor
    biocViews                1.62.1     2021-11-02 [1] Bioconductor
    biomaRt                  2.50.0     2021-10-26 [1] Bioconductor
    Biostrings               2.62.0     2021-10-26 [1] Bioconductor
    bit                      4.0.4      2020-08-04 [1] CRAN (R 4.1.0)
    bit64                    4.0.5      2020-08-30 [1] CRAN (R 4.1.0)
    bitops                   1.0-7      2021-04-24 [1] CRAN (R 4.1.0)
    blob                     1.2.2      2021-07-23 [1] CRAN (R 4.1.0)
    bslib                    0.3.1      2021-10-06 [1] CRAN (R 4.1.0)
    cachem                   1.0.6      2021-08-19 [1] CRAN (R 4.1.0)
    callr                    3.7.0      2021-04-20 [1] CRAN (R 4.1.0)
    cli                      3.1.0      2021-10-27 [1] CRAN (R 4.1.0)
    codetools                0.2-18     2020-11-04 [1] CRAN (R 4.1.2)
    colorout                 1.2-2      2021-11-05 [1] Github (jalvesaq/colorout@79931fd)
    colorspace               2.0-2      2021-06-24 [1] CRAN (R 4.1.0)
    commonmark               1.7        2018-12-01 [1] CRAN (R 4.1.0)
    config                   0.3.1      2020-12-17 [1] CRAN (R 4.1.0)
    cowplot                  1.1.1      2020-12-30 [1] CRAN (R 4.1.0)
    crayon                   1.4.2      2021-10-29 [1] CRAN (R 4.1.0)
    curl                     4.3.2      2021-06-23 [1] CRAN (R 4.1.0)
    data.table               1.14.2     2021-09-27 [1] CRAN (R 4.1.0)
    DBI                      1.1.1      2021-01-15 [1] CRAN (R 4.1.0)
    dbplyr                   2.1.1      2021-04-06 [1] CRAN (R 4.1.0)
    DelayedArray             0.20.0     2021-10-26 [1] Bioconductor
    DelayedMatrixStats       1.16.0     2021-10-26 [1] Bioconductor
    desc                     1.4.0      2021-09-28 [1] CRAN (R 4.1.0)
    devtools               * 2.4.2      2021-06-07 [1] CRAN (R 4.1.0)
    digest                   0.6.28     2021-09-23 [1] CRAN (R 4.1.0)
    dockerfiler              0.1.4      2021-09-03 [1] CRAN (R 4.1.0)
    doParallel               1.0.16     2020-10-16 [1] CRAN (R 4.1.0)
    dotCall64                1.0-1      2021-02-11 [1] CRAN (R 4.1.0)
    dplyr                    1.0.7      2021-06-18 [1] CRAN (R 4.1.0)
    dqrng                    0.3.0      2021-05-01 [1] CRAN (R 4.1.0)
    DropletUtils             1.14.0     2021-10-26 [1] Bioconductor
    DT                       0.19       2021-09-02 [1] CRAN (R 4.1.0)
    edgeR                    3.36.0     2021-10-26 [1] Bioconductor
    ellipsis                 0.3.2      2021-04-29 [1] CRAN (R 4.1.0)
    evaluate                 0.14       2019-05-28 [1] CRAN (R 4.1.0)
    ExperimentHub            2.2.0      2021-10-26 [1] Bioconductor
    fansi                    0.5.0      2021-05-25 [1] CRAN (R 4.1.0)
    fastmap                  1.1.0      2021-01-25 [1] CRAN (R 4.1.0)
    fields                   13.3       2021-10-30 [1] CRAN (R 4.1.0)
    filelock                 1.0.2      2018-10-05 [1] CRAN (R 4.1.0)
    fontawesome              0.2.2      2021-07-02 [1] CRAN (R 4.1.0)
    foreach                  1.5.1      2020-10-15 [1] CRAN (R 4.1.0)
    formatR                  1.11       2021-06-01 [1] CRAN (R 4.1.0)
    fs                       1.5.0      2020-07-31 [1] CRAN (R 4.1.0)
    futile.logger          * 1.4.3      2016-07-10 [1] CRAN (R 4.1.0)
    futile.options           1.0.1      2018-04-20 [1] CRAN (R 4.1.0)
    generics                 0.1.1      2021-10-25 [1] CRAN (R 4.1.0)
    GenomeInfoDb           * 1.30.0     2021-10-26 [1] Bioconductor
    GenomeInfoDbData         1.2.7      2021-11-05 [1] Bioconductor
    GenomicAlignments        1.30.0     2021-10-26 [1] Bioconductor
    GenomicFeatures          1.46.1     2021-10-27 [1] Bioconductor
    GenomicRanges          * 1.46.0     2021-10-26 [1] Bioconductor
    getopt                   1.20.3     2019-03-22 [1] CRAN (R 4.1.0)
    ggbeeswarm               0.6.0      2017-08-07 [1] CRAN (R 4.1.0)
    ggplot2                  3.3.5      2021-06-25 [1] CRAN (R 4.1.0)
    ggrepel                  0.9.1      2021-01-15 [1] CRAN (R 4.1.0)
    glue                     1.4.2      2020-08-27 [1] CRAN (R 4.1.0)
    golem                    0.3.1      2021-04-17 [1] CRAN (R 4.1.0)
    graph                    1.72.0     2021-10-26 [1] Bioconductor
    gridExtra                2.3        2017-09-09 [1] CRAN (R 4.1.0)
    gtable                   0.3.0      2019-03-25 [1] CRAN (R 4.1.0)
    HDF5Array                1.22.0     2021-10-26 [1] Bioconductor
    here                     1.0.1      2020-12-13 [1] CRAN (R 4.1.0)
    hms                      1.1.1      2021-09-26 [1] CRAN (R 4.1.0)
    htmltools                0.5.2      2021-08-25 [1] CRAN (R 4.1.0)
    htmlwidgets              1.5.4      2021-09-08 [1] CRAN (R 4.1.0)
    httpuv                   1.6.3      2021-09-09 [1] CRAN (R 4.1.0)
    httr                     1.4.2      2020-07-20 [1] CRAN (R 4.1.0)
    interactiveDisplayBase   1.32.0     2021-10-26 [1] Bioconductor
    IRanges                * 2.28.0     2021-10-26 [1] Bioconductor
    irlba                    2.3.3      2019-02-05 [1] CRAN (R 4.1.0)
    iterators                1.0.13     2020-10-15 [1] CRAN (R 4.1.0)
    jquerylib                0.1.4      2021-04-26 [1] CRAN (R 4.1.0)
    jsonlite                 1.7.2      2020-12-09 [1] CRAN (R 4.1.0)
    KEGGREST                 1.34.0     2021-10-26 [1] Bioconductor
    knitr                    1.36       2021-09-29 [1] CRAN (R 4.1.0)
    lambda.r                 1.2.4      2019-09-18 [1] CRAN (R 4.1.0)
    later                    1.3.0      2021-08-18 [1] CRAN (R 4.1.0)
    lattice                  0.20-45    2021-09-22 [1] CRAN (R 4.1.2)
    lazyeval                 0.2.2      2019-03-15 [1] CRAN (R 4.1.0)
    lifecycle                1.0.1      2021-09-24 [1] CRAN (R 4.1.0)
    limma                    3.50.0     2021-10-26 [1] Bioconductor
    locfit                   1.5-9.4    2020-03-25 [1] CRAN (R 4.1.0)
    magick                   2.7.3      2021-08-18 [1] CRAN (R 4.1.0)
    magrittr                 2.0.1      2020-11-17 [1] CRAN (R 4.1.0)
    maps                     3.4.0      2021-09-25 [1] CRAN (R 4.1.0)
    markdown                 1.1        2019-08-07 [1] CRAN (R 4.1.0)
    Matrix                   1.3-4      2021-06-01 [1] CRAN (R 4.1.2)
    MatrixGenerics         * 1.6.0      2021-10-26 [1] Bioconductor
    matrixStats            * 0.61.0     2021-09-17 [1] CRAN (R 4.1.0)
    memoise                  2.0.0      2021-01-26 [1] CRAN (R 4.1.0)
    mime                     0.12       2021-09-28 [1] CRAN (R 4.1.0)
    munsell                  0.5.0      2018-06-12 [1] CRAN (R 4.1.0)
    optparse                 1.7.1      2021-10-08 [1] CRAN (R 4.1.0)
    OrganismDbi              1.36.0     2021-10-26 [1] Bioconductor
    pillar                   1.6.4      2021-10-18 [1] CRAN (R 4.1.0)
    pkgbuild                 1.2.0      2020-12-15 [1] CRAN (R 4.1.0)
    pkgconfig                2.0.3      2019-09-22 [1] CRAN (R 4.1.0)
    pkgload                  1.2.3      2021-10-13 [1] CRAN (R 4.1.0)
    plotly                   4.10.0     2021-10-09 [1] CRAN (R 4.1.0)
    png                      0.1-7      2013-12-03 [1] CRAN (R 4.1.0)
    Polychrome               1.3.1      2021-07-16 [1] CRAN (R 4.1.0)
    prettyunits              1.1.1      2020-01-24 [1] CRAN (R 4.1.0)
    processx                 3.5.2      2021-04-30 [1] CRAN (R 4.1.0)
    progress                 1.2.2      2019-05-16 [1] CRAN (R 4.1.0)
    promises                 1.2.0.1    2021-02-11 [1] CRAN (R 4.1.0)
    pryr                     0.1.5      2021-07-26 [1] CRAN (R 4.1.0)
    ps                       1.6.0      2021-02-28 [1] CRAN (R 4.1.0)
    purrr                    0.3.4      2020-04-17 [1] CRAN (R 4.1.0)
    R.cache                  0.15.0     2021-04-30 [1] CRAN (R 4.1.0)
    R.methodsS3              1.8.1      2020-08-26 [1] CRAN (R 4.1.0)
    R.oo                     1.24.0     2020-08-26 [1] CRAN (R 4.1.0)
    R.utils                  2.11.0     2021-09-26 [1] CRAN (R 4.1.0)
    R6                       2.5.1      2021-08-19 [1] CRAN (R 4.1.0)
    rappdirs                 0.3.3      2021-01-31 [1] CRAN (R 4.1.0)
    RBGL                     1.70.0     2021-10-26 [1] Bioconductor
    RColorBrewer             1.1-2      2014-12-07 [1] CRAN (R 4.1.0)
    Rcpp                     1.0.7      2021-07-07 [1] CRAN (R 4.1.0)
    RCurl                    1.98-1.5   2021-09-17 [1] CRAN (R 4.1.0)
    rematch2                 2.1.2      2020-05-01 [1] CRAN (R 4.1.0)
    remotes                  2.4.1      2021-09-29 [1] CRAN (R 4.1.0)
    restfulr                 0.0.13     2017-08-06 [1] CRAN (R 4.1.0)
    rhdf5                    2.38.0     2021-10-26 [1] Bioconductor
    rhdf5filters             1.6.0      2021-10-26 [1] Bioconductor
    Rhdf5lib                 1.16.0     2021-10-26 [1] Bioconductor
    rjson                    0.2.20     2018-06-08 [1] CRAN (R 4.1.0)
    rlang                    0.4.12     2021-10-18 [1] CRAN (R 4.1.0)
    rmarkdown                2.11       2021-09-14 [1] CRAN (R 4.1.0)
    roxygen2                 7.1.2      2021-09-08 [1] CRAN (R 4.1.0)
    rprojroot                2.0.2      2020-11-15 [1] CRAN (R 4.1.0)
    Rsamtools                2.10.0     2021-10-26 [1] Bioconductor
    RSQLite                  2.2.8      2021-08-21 [1] CRAN (R 4.1.0)
    rsthemes                 0.2.1.9000 2021-11-05 [1] Github (gadenbuie/rsthemes@19299e5)
    rstudioapi               0.13       2020-11-12 [1] CRAN (R 4.1.0)
    rsvd                     1.0.5      2021-04-16 [1] CRAN (R 4.1.0)
    rtracklayer              1.54.0     2021-10-26 [1] Bioconductor
    RUnit                    0.4.32     2018-05-18 [1] CRAN (R 4.1.0)
    S4Vectors              * 0.32.0     2021-10-26 [1] Bioconductor
    sass                     0.4.0.9000 2021-11-05 [1] Github (rstudio/sass@f95b436)
    ScaledMatrix             1.2.0      2021-10-26 [1] Bioconductor
    scales                   1.1.1      2020-05-11 [1] CRAN (R 4.1.0)
    scater                   1.22.0     2021-10-26 [1] Bioconductor
    scatterplot3d            0.3-41     2018-03-14 [1] CRAN (R 4.1.0)
    scuttle                  1.4.0      2021-10-26 [1] Bioconductor
    sessioninfo              1.2.1      2021-11-02 [1] CRAN (R 4.1.0)
    shiny                  * 1.7.1      2021-10-02 [1] CRAN (R 4.1.0)
    shinyWidgets             0.6.2      2021-09-17 [1] CRAN (R 4.1.0)
    SingleCellExperiment   * 1.16.0     2021-10-26 [1] Bioconductor
    spam                     2.7-0      2021-06-25 [1] CRAN (R 4.1.0)
    sparseMatrixStats        1.6.0      2021-10-26 [1] Bioconductor
    SpatialExperiment      * 1.4.0      2021-10-26 [1] Bioconductor
 VP spatialLIBD            * 1.7.1      2021-10-30 [?] Bioconductor (on disk 1.6.0)
    stringdist               0.9.8      2021-09-09 [1] CRAN (R 4.1.0)
    stringi                  1.7.5      2021-10-04 [1] CRAN (R 4.1.0)
    stringr                  1.4.0      2019-02-10 [1] CRAN (R 4.1.0)
    styler                   1.6.2      2021-09-23 [1] CRAN (R 4.1.0)
    SummarizedExperiment   * 1.24.0     2021-10-26 [1] Bioconductor
    testthat               * 3.1.0      2021-10-04 [1] CRAN (R 4.1.0)
    tibble                   3.1.5      2021-09-30 [1] CRAN (R 4.1.0)
    tidyr                    1.1.4      2021-09-27 [1] CRAN (R 4.1.0)
    tidyselect               1.1.1      2021-04-30 [1] CRAN (R 4.1.0)
    usethis                * 2.1.3      2021-10-27 [1] CRAN (R 4.1.0)
    utf8                     1.2.2      2021-07-24 [1] CRAN (R 4.1.0)
    vctrs                    0.3.8      2021-04-29 [1] CRAN (R 4.1.0)
    vipor                    0.4.5      2017-03-22 [1] CRAN (R 4.1.0)
    viridis                  0.6.2      2021-10-13 [1] CRAN (R 4.1.0)
    viridisLite              0.4.0      2021-04-13 [1] CRAN (R 4.1.0)
    withr                    2.4.2      2021-04-18 [1] CRAN (R 4.1.0)
    xfun                     0.28       2021-11-04 [1] CRAN (R 4.1.1)
    XML                      3.99-0.8   2021-09-17 [1] CRAN (R 4.1.0)
    xml2                     1.3.2      2020-04-23 [1] CRAN (R 4.1.0)
    xtable                   1.8-4      2019-04-21 [1] CRAN (R 4.1.0)
    XVector                  0.34.0     2021-10-26 [1] Bioconductor
    yaml                     2.2.1      2020-02-01 [1] CRAN (R 4.1.0)
    zlibbioc                 1.40.0     2021-10-26 [1] Bioconductor

 [1] /Library/Frameworks/R.framework/Versions/4.1devel/Resources/library

 V ── Loaded and on-disk version mismatch.
 P ── Loaded and on-disk path mismatch.

How to use spatialLIBD with other data

We want to write a new vignette that shows how you can use spatialLIBD using the data from https://support.10xgenomics.com/spatial-gene-expression/datasets. I think that it can start with https://github.com/LieberInstitute/spatialDLPFC/blob/main/analysis/01_build_SPE.R but run a quick clustering algorithm like K-means (maybe using minibatchkmeans). The vignette should include the code from https://github.com/LieberInstitute/spatialDLPFC/blob/main/analysis/03_try_shiny.R as well.

With biocthis::use_bioc_vignette() we can start the new Rmd file.

In the future when https://github.com/HelenaLC/TENxVisiumData is on BioC, the vignette could show how to use it.

Subset and plotting issue with vis_gene()

plots using the vis_gene() function are not generated:

spatialLIBD::vis_gene(
spe = spe,
sampleid = "panel1",
geneid = "Xkr4; ENSMUSG00000051951"
)

geneid references gene_search variables

sessionInfo():

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base

other attached packages:
[1] Matrix_1.3-3 GEOquery_2.60.0 rsconnect_0.8.18
[4] spatialLIBD_1.4.0 pryr_0.1.4 rtracklayer_1.52.0
[7] SpatialExperiment_1.2.1 SingleCellExperiment_1.14.1 SummarizedExperiment_1.22.0
[10] Biobase_2.52.0 GenomicRanges_1.44.0 GenomeInfoDb_1.28.0
[13] IRanges_2.26.0 MatrixGenerics_1.4.0 matrixStats_0.59.0
[16] BiocFileCache_2.0.0 dbplyr_2.1.1 S4Vectors_0.30.0
[19] BiocGenerics_0.38.0

loaded via a namespace (and not attached):
[1] spam_2.6-0 AnnotationHub_3.0.1 lazyeval_0.2.2
[4] Polychrome_1.2.6 BiocParallel_1.26.0 scater_1.20.1
[7] usethis_2.0.1 ggplot2_3.3.4 benchmarkme_1.0.7
[10] digest_0.6.27 foreach_1.5.1 htmltools_0.5.1.1
[13] viridis_0.6.1 magick_2.7.2 fansi_0.5.0
[16] magrittr_2.0.1 memoise_2.0.0 ScaledMatrix_1.0.0
[19] config_0.3.1 doParallel_1.0.16 remotes_2.4.0
[22] limma_3.48.0 readr_1.4.0 Biostrings_2.60.1
[25] R.utils_2.10.1 colorspace_2.0-1 blob_1.2.1
[28] rappdirs_0.3.3 xfun_0.24 dplyr_1.0.7
[31] crayon_1.4.1 RCurl_1.98-1.3 jsonlite_1.7.2
[34] roxygen2_7.1.1 iterators_1.0.13 glue_1.4.2
[37] gtable_0.3.0 zlibbioc_1.38.0 XVector_0.32.0
[40] DelayedArray_0.18.0 BiocSingular_1.8.1 DropletUtils_1.12.1
[43] Rhdf5lib_1.14.1 maps_3.3.0 HDF5Array_1.20.0
[46] scales_1.1.1 DBI_1.1.1 edgeR_3.34.0
[49] Rcpp_1.0.6 viridisLite_0.4.0 xtable_1.8-4
[52] dqrng_0.3.0 rsvd_1.0.5 bit_4.0.4
[55] dotCall64_1.0-1 DT_0.18 htmlwidgets_1.5.3
[58] httr_1.4.2 RColorBrewer_1.1-2 ellipsis_0.3.2
[61] farver_2.1.0 dockerfiler_0.1.3 pkgconfig_2.0.3
[64] XML_3.99-0.6 R.methodsS3_1.8.1 scuttle_1.2.0
[67] sass_0.4.0 locfit_1.5-9.4 utf8_1.2.1
[70] labeling_0.4.2 tidyselect_1.1.1 rlang_0.4.11
[73] later_1.2.0 AnnotationDbi_1.54.1 munsell_0.5.0
[76] BiocVersion_3.13.1 tools_4.1.0 cachem_1.0.5
[79] cli_2.5.0 generics_0.1.0 RSQLite_2.2.7
[82] ExperimentHub_2.0.0 stringr_1.4.0 fastmap_1.1.0
[85] yaml_2.2.1 knitr_1.33 fs_1.5.0
[88] bit64_4.0.5 purrr_0.3.4 KEGGREST_1.32.0
[91] sparseMatrixStats_1.4.0 mime_0.10 R.oo_1.24.0
[94] xml2_1.3.2 compiler_4.1.0 rstudioapi_0.13
[97] beeswarm_0.4.0 plotly_4.9.4.1 filelock_1.0.2
[100] curl_4.3.1 png_0.1-7 interactiveDisplayBase_1.30.0
[103] testthat_3.0.3 tibble_3.1.2 bslib_0.2.5.1
[106] stringi_1.6.1 desc_1.3.0 fields_12.3
[109] lattice_0.20-44 vctrs_0.3.8 pillar_1.6.1
[112] lifecycle_1.0.0 rhdf5filters_1.4.0 BiocManager_1.30.16
[115] jquerylib_0.1.4 BiocNeighbors_1.10.0 irlba_2.3.3
[118] data.table_1.14.0 cowplot_1.1.1 bitops_1.0-7
[121] httpuv_1.6.1 R6_2.5.0 BiocIO_1.2.0
[124] promises_1.2.0.1 gridExtra_2.3 vipor_0.4.5
[127] sessioninfo_1.1.1 codetools_0.2-18 pkgload_1.2.1
[130] benchmarkmeData_1.0.4 assertthat_0.2.1 golem_0.3.1
[133] rhdf5_2.36.0 rprojroot_2.0.2 rjson_0.2.20
[136] shinyWidgets_0.6.0 withr_2.4.2 GenomicAlignments_1.28.0
[139] Rsamtools_2.8.0 GenomeInfoDbData_1.2.6 hms_1.1.0
[142] grid_4.1.0 beachmat_2.8.0 tidyr_1.1.3
[145] attempt_0.3.1 DelayedMatrixStats_1.14.0 scatterplot3d_0.3-41
[148] shiny_1.6.0 ggbeeswarm_0.6.0 restfulr_0.0.13

Wrong SpatialExperiment version loaded from pkgload

When trying to run app.R, I get the following warnings which do not allow me proceed:
Need SpatialExperiment >= 1.1.5 but loaded version is 1.0.0
2: object ‘imgData<-’ is not exported by 'namespace:SpatialExperiment'
3: object ‘spatialCoordsNames<-’ is not exported by 'namespace:SpatialExperiment'
4: object ‘spatialData<-’ is not exported by 'namespace:SpatialExperiment'
5: object ‘SpatialImage’ is not exported by 'namespace:SpatialExperiment'
6: object ‘imgData’ is not exported by 'namespace:SpatialExperiment'
7: object ‘spatialData’ is not exported by 'namespace:SpatialExperiment'

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.