You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/spatialHotspot.Rmd
+18-14
Original file line number
Diff line number
Diff line change
@@ -7,37 +7,38 @@ vignette: >
7
7
%\VignetteEngine{knitr::rmarkdown}
8
8
%\VignetteEncoding{UTF-8}
9
9
---
10
+
11
+
# Introduction
12
+
In this vignette, we demonstrate how to use VISION to identify de-novo transcriptional gene modules and interpret them. To this end, we use Hotspot - an algorithm that identifies modules of genes that are significantly autocorrelated with one another on some latent space that can be used to define cell-cell similarity (e.g., the first 30 principal components). Qualitatively, this can be interpreted as a co-expression analysis that takes into account the distribution of gene expression values and nuanced cell-cell similarities. If you are more interested in learning more about the algorithm, you can read the [original publication](https://www.cell.com/cell-systems/fulltext/S2405-4712(21)00114-9).
13
+
14
+
In the example below, we use spatial transcriptomic data from the Slide-seq technology for the Hotspot analysis, following the original [Hotspot tutorial](https://yoseflab.github.io/Hotspot/Spatial_Tutorial.html). Though this analysis is extensible to more typical latent spaces, this is an interesting example where we show that VISION can use spatial coordinates to define cell-cell similarities.
15
+
10
16
# Preliminaries
11
17
12
18
If you have yet to install VISION, we recommend installing the package from Github to install this package. Full source code can be found at the VISION Github repository, available [here](http://www.github.com/YosefLab/VISION).
13
19
14
-
```r
20
+
```r{eval=FALSE}
15
21
require(devtools)
16
22
install_github("YosefLab/VISION")
17
23
```
18
24
19
-
Once VISION and R are installed, you may load in VISION using `library(VISION)`.
25
+
Once VISION and R are installed, you may load in VISION using `library(VISION)`. Also make sure that you have installed `reticular` appropriately, as this will be necessary for running Hotspot.
20
26
21
-
Hotspot is a tool for identifying informative genes (and gene modules) in a single-cell dataset. Hotspot is installed directly from the git repository using the following command:
27
+
You'll also need to install Hotspot, which can be installed directly from the git repository using the following command:
Running an analysis with vision consists of three steps:
30
-
31
-
1. Creating the VISION object
32
-
2. Running the `analyze` function
33
-
3. Running Hotspot
34
-
3. Browsing results
35
+
Below, we first run the VISION pipeline as usual. In addition to importing VISION, we'll have to import `reticulate` for the Hotspot analaysis.
35
36
36
37
First, we need to load VISION and reticulate.
37
38
```{r setup, eval=F}
38
39
knitr::opts_chunk$set(echo = TRUE)
39
40
library(VISION)
40
-
library(reticulate)
41
+
library(reticulate) # for the Hotspot analysis
41
42
```
42
43
43
44
## Creating a Vision Object
@@ -64,9 +65,9 @@ vis <- Vision(expr, signatures=c(sig), latentSpace = pos, meta=meta) # TODO add
64
65
```
65
66
**Expression Data**
66
67
67
-
The provided expression data should be scaled and normalized. It is recommended to apply more advanced normalization procedures such as batch correction or removal of technical confounders.
68
+
The provided expression data should be library-normalized.
68
69
69
-
The expression data should not be log-transformed prior to loading into VISION.
70
+
The expression data should not be log-transformed prior to loading into VISION. For more information about how to transform the expression data, refer to the central [VISION vignette](VISION-vignette.html).
70
71
71
72
**Signatures**
72
73
@@ -94,15 +95,18 @@ vis <- analyze(vis)
94
95
95
96
## Running Hotpsot analysis
96
97
97
-
We can also perform Hotspot module analysis. For more on the Hotspot API see[here](https://yoseflab.github.io/Hotspot/index.html) and [the PhyloVision vignette](phyloVision.html).
98
+
Conveniently, the Hotspot analysis can be performed directly ontop of the VISION object we just processed. To do so, we'll use the `runHotspot` function which invokes the Hotspot pipeline. For more information about the analysis pipeline & Hotspot API, you can refer the documentation website[here](https://yoseflab.github.io/Hotspot/index.html) and [the PhyloVision vignette](phyloVision.html).
98
99
```{r hotspot, eval=F}
99
100
vis@params$latentSpace$projectionGenes <- rownames(vis@exprData) # Use all genes.
100
101
vis <- runHotspot(vis, model="bernoulli", num_umi=meta["num_umi"], logdata=FALSE)
101
102
```
102
103
104
+
The [PhyloVision vignette](phyloVision.html) additionally describes the additional API that is exposed for iterating on the Hotspot analysis.
105
+
106
+
After running the Hotpsot module, the VISION object will have populated slots storing the gene modules, the scores for each cell with respect to these new gene modules, and the enrichment score between user-specified signatures and the new Hotspot gene modules. These results can be explored in the Hotspot mode of the VISION web-based report.
103
107
104
108
## Viewing results
105
-
Finally, we can launch the Vision browser.
109
+
Finally, we can launch the Vision browser. The results from the Hotspot analysis can be viewed by clicking on the "Hotspot" button on the top-right of the web report.
0 commit comments