Last updated: 2020-01-11

Checks: 7 0

Knit directory: STUtility_web_site/

This reproducible R Markdown analysis was created with workflowr (version 1.5.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20191031) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rproj.user/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


Background

STUtility R-package is an effort to create a user-friendly visualization and analysis tool for analysis of spatial transcriptomcis data. It’s built around Seurat, which is a single-cell genomics toolkit.

Spatial Transcriptomics (ST)


Spatial Transcriptomics is a method that allows visualization and quantitative analysis of the transcriptome in individual tissue sections by combining gene expression data and microscopy based image data. The invention was presented in science in 2016. Prof Joakim Lundeberg (KTH Royal Institute of Technology) and Prof Jonas Frisén (Karolinska Institutet) received a key initial support from the Knut and Alice Wallenberg Foundation in 2012 to develop and use the Spatial Transcriptomics technology for analysis and discovery of transcriptional patterns in tissue, with a focus on the brain. The method has received increasing attention and is currently the basis of several national and international collaborations. The research is predominantly done at Science for Life Laboratory, Stockholm.

For details, see the publication. In short, the schematic below gives a brief overview of the concept. An introductory animation is available on our website: http://www.spatialresearch.org/

Schematic Spatial Transcriptomics

Schematic Spatial Transcriptomics

The array featured 1000 capture-spots, 100 µm in diameter and accordingly we refer this as the “1k” array in this tutorial and package parameters. The ST technology was futher developed, and the capture-spot number increased to 2000, hence the “2k” array.

10X Visium


In Dec 2018, 10X Genomics aquired Spatial Transcriptomics, and in Nov 2019 they started shipping the Visium array, which is a further development of the original ST array. This array features 5000 capture-spots, 55µm in diameter.

The array is broadly available for commercial use

Notes about the tool

Selecting spots - original ST arrays

The gene expression data consists of a count matrix with genes in rows and “capture-spots” in columns. Each spot represents a small area on an ST array from which the captured transcripts have been barcoded with a unique sequence. The unique barcode makes it possible to map the transcripts onto a spatial position on the tissue section and would be equivalent to a cell specific barcode in scRNA-seq data but can tag a mixture of transcripts from multiple cells. The spatial position of a spot is an (x, y) coordinate that defines the centroid of the spot area. These spatial coordinates are stored in the spot ids (column names) and allows us to visualize gene expression (and other spot features) in the array grid system. However, if you want to overlay a visualization on top the HE image you want to make sure that the spot coordinates are exact in relation to morphological features of the image. When the spots are printed onto the ST array surface, they will sometimes deviate from the (x, y) coordinates given by the spot ids and should therefore be adjusted. In addition to the spot adjustment, you will also need to label the spots that are located directly under the tissue. Spot adjustment and selection can be done automatically using our ST spot detector web tool which outputs a table of adjusted coordinates and labels for the spots under tissue.

Selecting spots - 10X Visium arrays

10X Genomics has developed their own tool for visualization and spot selection called SpaceRanger [fixa denna link]. In SpaceRanger you can …..

Multiple samples

The STUtility tool was developed with the goal of multiple sample inputs. As with all biological data, using multiple samples add power to the analysis and is a necessity to enable comprehensive insight which otherwise suffers from stochastic uncertainty. Within this vignette, we display how you can input multiple samples, look for aggravating circumstances like batch effects and missing data, apply methods to correct such if present, get a holistic picture of your data as well as conduct more in depth analysis in various ways.

Seurat workflow

We have extensively tried different methods and workflows for handling ST data. While all roads lead to Rome, as of the date of this writing we find the Seurat approach to be the most well suited for this type of data. Seurat is an R package designed for single-cell RNAseq data. Obviously, this deviates from the data that the ST technology currently produce, as the resolution on the array implies that each capture-spot consists of transcripts originating from multiple cells. Nevertheless, the characteristics of the ST data resembles that of scRNAseq to a large extent. Note that the STUtility package requires Seurat v3.0 or higher.

The data obtained from an ST experiment can treated like a scRNA-seq experiment and be processed and analyzed using the Seurat package. STUtility provides image processing and visualization functionallity on top of this framework.

Naming conventions

For users familiar with the Seurat workflow, there are a number of Seruat plotting functions, e.g. Seurat::FeaturePlot(), those plotting functions all have a “ST version”, which is called upon by adding “ST.” prior to the original function name e.g. STutility::ST.FeaturePlot().

The external STUtility functions are following a PascalCase convention.

 

A work by Joseph Bergenstråhle and Ludvig Larsson

 


sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

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

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

loaded via a namespace (and not attached):
 [1] workflowr_1.5.0 Rcpp_1.0.3      rprojroot_1.3-2 digest_0.6.22  
 [5] later_0.8.0     R6_2.4.0        backports_1.1.4 git2r_0.26.1   
 [9] magrittr_1.5    evaluate_0.14   stringi_1.4.3   fs_1.3.1       
[13] promises_1.0.1  rmarkdown_1.15  tools_3.6.1     stringr_1.4.0  
[17] glue_1.3.1      httpuv_1.5.2    xfun_0.9        yaml_2.2.0     
[21] compiler_3.6.1  htmltools_0.3.6 knitr_1.24