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
Now we create a Seurat object with pathway activities inferred from [`PROGENy`](https://saezlab.github.io/progeny/index.html). We delete the PROGENy assay done by Kuppe et al. and load a model matrix with the top 1000 significant genes for each of the 15 available pathways. We then extract the genes that are both common to the PROGENy model and the snRNA-seq assay from the Seurat object. We estimate the pathway activity with a multivariate linear model. We save the result in a Seurat assay and clean the row names to handle problematic variables.
74
+
Now we create a Seurat object with pathway activities inferred from [`PROGENy`](https://saezlab.github.io/progeny/index.html). We delete the PROGENy assay done by Kuppe et al. and load a model matrix with the top 1000 significant genes for each of the 14 available pathways. We then extract the genes that are both common to the PROGENy model and the snRNA-seq assay from the Seurat object. We estimate the pathway activity with a multivariate linear model using [`decoupleR`](https://saezlab.github.io/decoupleR/). We save the result in a Seurat assay and clean the row names to handle problematic variables.
75
75
76
76
```{r}
77
77
seurat_vs[['progeny']] <- NULL
@@ -165,15 +165,15 @@ With the collected results, we can now answer the following questions:
165
165
166
166
### 1. To what extent can the analyzed surrounding tissues' activities explain the pathway activity of the spot compared to the intraview?
167
167
168
-
Here we can look at two different statistics: multi.R2 shows the total variance explained by the multiview model. gain.R2 shows the increase in explainable variance from the paraview.
168
+
Here we can look at two different statistics: `multi.R2` shows the total variance explained by the multiview model. `gain.R2` shows the increase in explainable variance from the paraviews.
169
169
170
170
```{r}
171
171
misty_results %>%
172
-
plot_improvement_stats("gain.R2") %>%
173
-
plot_improvement_stats("multi.R2")
172
+
plot_improvement_stats("multi.R2") %>%
173
+
plot_improvement_stats("gain.R2")
174
174
```
175
175
176
-
The paraview particularly increases the explained variance for TGFb and PI3K. In general, the significant gain in R2 can be interpreted as the following:
176
+
The paraviews particularly increase the explained variance for TGFb and PI3K. In general, the significant gain in R2 can be interpreted as the following:
177
177
178
178
"We can better explain the expression of marker X when we consider additional views other than the intrinsic view."
Copy file name to clipboardExpand all lines: vignettes/FunctionalPipelinePathwaySpecific.Rmd
+5-5
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ Now we need to create the Misty views of interest. We are interested in the rela
99
99
100
100
We are also intrigued about the relationship of VEGF-responsive genes with TGF-beta responsive genes in the broader tissue. For this, we again create an intra- and paraview, this time for VEGF, but from this view, we only need the paraview. In the next step, we add it to the TGF-beta views to achieve our intended views.
@@ -126,15 +126,15 @@ With the collected results, we can now answer the following questions:
126
126
127
127
### 1. To what extent can the surrounding tissues' gene expression explain the gene expression of the spot compared to the intraview?
128
128
129
-
Here we can look at two different statistics: multi.R2 shows the total variance explained by the multiview model. gain.R2 shows the increase in explainable variance from the paraview.
129
+
Here we can look at two different statistics: `multi.R2` shows the total variance explained by the multiview model. `gain.R2` shows the increase in explainable variance from the paraviews.
130
130
131
131
```{r}
132
132
misty_results %>%
133
133
plot_improvement_stats("gain.R2") %>%
134
134
plot_improvement_stats("multi.R2")
135
135
```
136
136
137
-
The paraview particularly increases the explained variance for COMP, ID1, and COL4A1. In general, the significant gain in R2 can be interpreted as the following:
137
+
The paraviews particularly increase the explained variance for COMP, ID1, and COL4A1. In general, the significant gain in R2 can be interpreted as the following:
138
138
139
139
"We can better explain the expression of marker X when we consider additional views other than the intrinsic view."
140
140
@@ -161,9 +161,9 @@ We can observe that COL4A1 and ID1 are a significant predictor for the expressio
161
161
SpatialFeaturePlot(seurat_vs, features = c("ID1", "SMAD7"), image.alpha = 0)
162
162
```
163
163
164
-
We can see that in spots with ID1 mRNA often SMAD7 is also expressed.
164
+
Areas with high levels of ID1 mRNA expression also tend to show high SMAD7 expression.
165
165
166
-
Now we repeat this analysis with the TGF-beta paraview. With `trim` we display only targets with a value above 0.5 for `gain.R2`. To set an importance threshold we apply `cutoff`.
166
+
Now we repeat this analysis with the TGF-beta paraview. With `trim` we display only targets with a value above 0.5% for `gain.R2`. To set an importance threshold we apply `cutoff`.
Copy file name to clipboardExpand all lines: vignettes/MistyRStructuralAnalysisPipelineC2L.Rmd
+2-2
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ Based on the plots, we can observe that some cell types are found more frequentl
88
88
89
89
## MISTy views
90
90
91
-
First, we need to define an intraview that captures the cell type proportions within a spot. To capture the distribution of cell type proportions in the surrounding tissue, we add a paraview. For this vignette, the radius we choose is the distance to the nearest neighbor plus the standard deviation. We calculate the weights of each spot with `family = gaussian`. Then we run MISTy and collect the results.
91
+
First, we need to define an intraview that captures the cell type proportions within a spot. To capture the distribution of cell type proportions in the surrounding tissue, we add a paraview. For this vignette, the radius we choose is the mean of the distance to the nearest neighbor plus the standard deviation. We calculate the weights of each spot with `family = gaussian`. Then we run MISTy and collect the results.
We can observe that areas with high proportions of cardiomyocytes have low proportions of fibroblasts and vice versa.
152
152
153
-
Now we repeat this analysis with the paraview. With `trim` we display only targets with a value above 1.75 for `gain.R2`. To set an importance threshold we apply `cutoff`.
153
+
Now we repeat this analysis with the paraview. With `trim` we display only targets with a value above 1.75% for `gain.R2`. To set an importance threshold we apply `cutoff`.
Copy file name to clipboardExpand all lines: vignettes/MistyRStructuralAnalysisPipelineDOT.Rmd
+8-6
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ library(distances)
53
53
54
54
## Get and load the data
55
55
56
-
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 spot coordinates on the slides which we will need for decomposition First, we have to download and extract the file:
56
+
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 spot coordinates on the slides which we will need for decomposition. First, we have to download and extract the file:
For deconvolution, we additionally need a reference single-cell data set containing a gene x cell count matrix and a vector containing the corresponding cell annotations. Kuppe et al., 2022, obtained from each sample isolated nuclei from the remaining tissue that they used for snRNA-seq. The data corresponding to the same patient as the spatial data will be used as reference data in `DOT`. First download the file:
73
+
For deconvolution, we additionally need a reference single-cell data set containing a gene x cell count matrix and a vector containing the corresponding cell annotations. Kuppe et al., 2022, isolated nuclei from each sample's remaining tissue for snRNA-seq. The data corresponding to the same patient as the spatial data will be used as reference data in `DOT`. First download the file:
Next, we need to set up the DOT object. The two inputs we need are the count matrix and pixel coordinates of the spatial data and the count matrix and cell annotations of the single-cell reference data.
92
+
Next, we need to set up the DOT object. The inputs we need are the count matrix and pixel coordinates of the spatial data and the count matrix and cell annotations of the single-cell reference data.
@@ -134,6 +134,8 @@ Based on the plots, we can observe that some cell types are found more frequentl
134
134
135
135
## MISTy views
136
136
137
+
First, we need to define an intraview that captures the cell type proportions within a spot. To capture the distribution of cell type proportions in the surrounding tissue, we add a paraview. For this vignette, the radius we choose is the mean of the distance to the nearest neighbor plus the standard deviation. We calculate the weights of each spot with family = gaussian. Then we run MISTy and collect the results.
138
+
137
139
```{r message=FALSE, warning=FALSE}
138
140
# Calculating the radius
139
141
geom_dist <- as.matrix(distances(geometry))
@@ -164,13 +166,13 @@ misty_results %>%
164
166
plot_improvement_stats("gain.R2")
165
167
```
166
168
167
-
The paraview particularly increases the explained variance for adipocytes and mast cells. In general, the significant gain in R^2^ can be interpreted as the following:
169
+
The paraview particularly increases the explained variance for adipocytes. In general, the significant gain in R^2^ can be interpreted as the following:
168
170
169
171
"We can better explain the expression of marker X when we consider additional views other than the intrinsic view."
170
172
171
173
#### 2. What are the specific relations that can explain the contributions?
172
174
173
-
To explain the contributions, we can visualize the importance of each cell type in predicting the cell type distribution for each view separately. With `trim`, we display only targets with a value above 50 for `multi.R2`. To set an importance threshold we would apply `cutoff`.
175
+
To explain the contributions, we can visualize the importance of each cell type in predicting the cell type distribution for each view separately. With `trim`, we display only targets with a value above 50% for `multi.R2`. To set an importance threshold we would apply `cutoff`.
Here, we select the target adipocytes, as we know from previous analysis that the paraview contributes a large part to explaining its distribution. The best predictor for adipocytes are Myeloid cells. To better identify the localization of the two cell types, we set the color scaling to a smaller range, as there are a few spots with a high proportion, which makes the distribution of spots with a low proportion difficult to recognize.
217
+
Here, we select the target adipocytes, as we know from previous analysis that adipocytes have the highest `gain.R2`. The best predictor for adipocytes are Myeloid cells. To better identify the localization of the two cell types, we set the color scaling to a smaller range, as there are a few spots with a high proportion, which makes the distribution of spots with a low proportion difficult to recognize.
0 commit comments