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
%\VignetteIndexEntry{Learning functional and structural spatial relationships with MistyR}
20
+
%\VignetteIndexEntry{Learning functional and structural spatial relationships with MISTy}
15
21
%\VignetteEngine{knitr::rmarkdown}
16
22
%\VignetteEncoding{UTF-8}
17
23
---
18
24
19
25
## Introduction
20
26
21
-
MistyR analyzes spatial omics datasets within and between distinct spatial contexts referred to as views. This analysis can focus on functional information, for example, gene expression, and structural information, like cell-type compositions.
22
-
23
-
Visium is a method that captures spatial transcriptomic information from spots possibly containing multiple cells. In this vignette, we will use the gene expression information from Visium data to infer pathway and transcription factor activity and separately investigate spatial relationships between them and the cell-type composition. In addition, we will examine spatial relationships of ligands and receptors.
27
+
10X Visium captures spatially resolved transcriptomic profiles in spots containing multiple cells. In this vignette, we will use the gene expression information from Visium data to infer pathway and transcription factor activity and separately investigate spatial relationships between them and the cell-type composition. In addition, we will examine spatial relationships of ligands and receptors.
24
28
25
29
Load the necessary R packages:
26
30
27
31
```{r message=FALSE, warning=FALSE}
28
-
# Misty
32
+
# MISTy
29
33
library(mistyR)
30
34
31
35
# For using Python
@@ -57,7 +61,7 @@ import decoupler as dc
57
61
58
62
## Get and load data
59
63
60
-
For this showcase, we use a 10X Visium spatial slide from [Kuppe et al., 2022](https://doi.org/10.1038/s41586-022-05060-x), where they created a spatial multi-omic map of human myocardial infarction. The tissue example data comes from the human heart of patient 14, which is in a later state after myocardial infarction. The Seurat object contains, among other things, the normalized and raw gene counts. First, we have to download and extract the file:
64
+
For this showcase, we use a 10X Visium spatial slide from [Kuppe et al., 2022](https://doi.org/10.1038/s41586-022-05060-x), where they created a spatial multi-omic map of human myocardial infarction. The tissue example data comes from the human heart of patient 14, which is in a chronic state following myocardial infarction. The Seurat object contains, among other things, the normalized and raw gene counts. First, we have to download and extract the file:
The Seurat Object of the tissue slide also contains the estimated cell type proportions from cell2location. We extract them into a separate object we will later use with Misty and visualize some of the cell types:
92
+
The Seurat Object of the tissue slide also contains the estimated cell type proportions from cell2location. We extract them into a separate object we will later use with MISTy and visualize some of the cell types:
SpatialFeaturePlot(seurat, features = c("jak.stat", "hypoxia"), image.alpha = 0)
145
149
```
146
150
147
-
### Misty Views
151
+
### MISTy Views
148
152
149
-
For the Misty view, we will use cell type compositions per spot as the intraview and add the estimated [`PROGENy`](https://saezlab.github.io/progeny/index.html) pathway activities as juxta and paraviews. The size of the neighborhood and the kernel, as well as the kernel family, should be chosen depending on the experiment. Here both distances were chosen to enclose only a small number of neighboring spots.
153
+
For the MISTy view, we will use cell type compositions per spot as the intraview and add the estimated [`PROGENy`](https://saezlab.github.io/progeny/index.html) pathway activities as juxta and paraviews. The size of the neighborhood and the kernel, as well as the kernel family, should be chosen depending on the experiment. Here both distances were chosen to enclose only a small number of neighboring spots.
@@ -225,7 +229,7 @@ We observe similar distributions for both.
225
229
226
230
## Pathway activities on cell-type composition - Linear Model
227
231
228
-
The default model used by Misty to model each view is the random forest. However, there are different models to choose from, like the faster and more interpretable linear model.
232
+
The default model used by MISTy to model each view is the random forest. However, there are different models to choose from, like the faster and more interpretable linear model.
229
233
230
234
Another option we haven't used yet is `bypass.intra`. With this, we bypass training the baseline model that predicts the intraview with features from the intraview itself. We will still be able to see how the other views explain the intraview. We will use the same view composition as before:
231
235
@@ -285,7 +289,7 @@ The object with the estimation contains two elements: The first are the estimate
285
289
est_TF <- py$acts_tfs
286
290
```
287
291
288
-
To speed up the following model training, we calculate the 1000 most variable genes expressed. We then extract the TF from the highly variable genes to create a Misty view.
292
+
To speed up the following model training, we calculate the 1000 most variable genes expressed. We then extract the TF from the highly variable genes to create a MISTy view.
Please remember, that Misty does not only infer interactions between ligands and their respective receptor, but rather all possible interactions between ligands and receptors. We can visualize one of the interactions with high importance:
410
+
Remember that MISTy does not only infer interactions between ligands and their respective receptor, but rather all possible interactions between ligands and receptors. We can visualize one of the interactions with high importance:
%\VignetteIndexEntry{MistyR functional analysis pipeline - pathway activity and ligand expression}
20
+
%\VignetteIndexEntry{Functional analysis with MISTy - pathway activity and ligand expression}
15
21
%\VignetteEngine{knitr::rmarkdown}
16
22
%\VignetteEncoding{UTF-8}
17
23
---
18
24
19
25
## Introduction
20
26
21
-
MistyR analyzes spatial omics datasets within and between distinct spatial contexts referred to as views. This analysis can focus on functional information, for example, gene expression.
22
-
23
-
Visium is a method that captures spatial transcriptomic information from spots possibly containing multiple cells. In this vignette, we will use the gene expression information from Visium data to infer pathway activity and investigate spatial relationships between some pathways and ligand expression.
27
+
10X Visium captures spatially resolved transcriptomic profiles in spots containing multiple cells. In this vignette, we will use the gene expression information from Visium data to infer pathway activity and investigate spatial relationships between some pathways and ligand expression.
Now we need to create the Misty views of interest. We are interested in the relationship of the pathway activity in the same spot (intraview) and the ten closest spots (paraview). Therefore we choose the family \`constant\` and set l to ten, which will select the ten nearest neighbors. Depending on the goal of the analysis, different families can be applied.
139
+
Now we need to create the MISTy views of interest. We are interested in the relationship of the pathway activity in the same spot (intraview) and the ten closest spots (paraview). Therefore we choose the family \`constant\` and set l to ten, which will select the ten nearest neighbors. Depending on the goal of the analysis, different families can be applied.
138
140
139
141
We are also intrigued about the relationship of ligand expression and pathway activity in the broader tissue. For this, we again create an intra- and paraview, this time for the expression of the ligands, but from this view, we only need the paraview. In the next step, we add it to the pathway activity views to achieve our intended view composition.
0 commit comments