Skip to content

Commit 44a91c1

Browse files
committed
small corrections
1 parent e464031 commit 44a91c1

4 files changed

+21
-19
lines changed

vignettes/FunctionalPipelinePathwayActivityLigands.Rmd

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ geometry <- GetTissueCoordinates(seurat_vs, scale = NULL)
7171

7272
## Pathway activity
7373

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 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.
7575

7676
```{r}
7777
seurat_vs[['progeny']] <- NULL
@@ -165,15 +165,15 @@ With the collected results, we can now answer the following questions:
165165

166166
### 1. To what extent can the analyzed surrounding tissues' activities explain the pathway activity of the spot compared to the intraview?
167167

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.
169169

170170
```{r}
171171
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")
174174
```
175175

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:
177177

178178
"We can better explain the expression of marker X when we consider additional views other than the intrinsic view."
179179

@@ -202,7 +202,7 @@ SpatialFeaturePlot(seurat_vs, features = c("tnfa", "nfkb"), image.alpha = 0)
202202

203203
We can observe a correlation between high TNFa activity and high NFkB activity.
204204

205-
Now we repeat this analysis with the pathway activity paraview. With `trim` we display only targets with a value above 0.5 for `gain.R2`.
205+
Now we repeat this analysis with the pathway activity paraview. With `trim` we display only targets with a value above 0.5% for `gain.R2`.
206206

207207
```{r}
208208
misty_results %>%

vignettes/FunctionalPipelinePathwaySpecific.Rmd

+5-5
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Now we need to create the Misty views of interest. We are interested in the rela
9999

100100
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.
101101

102-
```{r}
102+
```{r message=FALSE, warning=FALSE}
103103
TGFb_views <- create_initial_view(t(expression[TGFb_footprints,]) %>% as_tibble()) %>%
104104
add_paraview(geometry, l=10, family = "constant")
105105
@@ -126,15 +126,15 @@ With the collected results, we can now answer the following questions:
126126

127127
### 1. To what extent can the surrounding tissues' gene expression explain the gene expression of the spot compared to the intraview?
128128

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.
130130

131131
```{r}
132132
misty_results %>%
133133
plot_improvement_stats("gain.R2") %>%
134134
plot_improvement_stats("multi.R2")
135135
```
136136

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:
138138

139139
"We can better explain the expression of marker X when we consider additional views other than the intrinsic view."
140140

@@ -161,9 +161,9 @@ We can observe that COL4A1 and ID1 are a significant predictor for the expressio
161161
SpatialFeaturePlot(seurat_vs, features = c("ID1", "SMAD7"), image.alpha = 0)
162162
```
163163

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.
165165

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`.
167167

168168
```{r}
169169
misty_results %>%

vignettes/MistyRStructuralAnalysisPipelineC2L.Rmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Based on the plots, we can observe that some cell types are found more frequentl
8888

8989
## MISTy views
9090

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.
9292

9393
```{r message=FALSE, warning=FALSE}
9494
# Calculating the radius
@@ -150,7 +150,7 @@ SpatialFeaturePlot(seurat_vs, keep.scale = NULL, features = c("Fib","CM"), image
150150

151151
We can observe that areas with high proportions of cardiomyocytes have low proportions of fibroblasts and vice versa.
152152

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`.
154154

155155
```{r}
156156
misty_results %>% plot_interaction_heatmap(view = "para.126", clean = TRUE,

vignettes/MistyRStructuralAnalysisPipelineDOT.Rmd

+8-6
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ library(distances)
5353

5454
## Get and load the data
5555

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:
5757

5858
```{r}
5959
# Download the data
@@ -70,7 +70,7 @@ spatial_data <- readRDS("ACH005/ACH005.rds")
7070
geometry <- GetTissueCoordinates(spatial_data, cols = c("imagerow", "imagecol"), scale = NULL)
7171
```
7272

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, 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:
7474

7575
```{r}
7676
download.file("https://www.dropbox.com/scl/fi/sq24xaavxplkc98iimvpz/hca_p14.rds?rlkey=h8cyxzhypavkydbv0z3pqadus&dl=1",
@@ -89,7 +89,7 @@ ref_ct <- ref_data$celltypes
8989

9090
## Deconvolution with DOT
9191

92-
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.
9393

9494
```{r message=FALSE, warning=FALSE}
9595
dot.srt <-setup.srt(srt_data = spatial_data@assays$Spatial@counts, srt_coords = geometry)
@@ -134,6 +134,8 @@ Based on the plots, we can observe that some cell types are found more frequentl
134134

135135
## MISTy views
136136

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+
137139
```{r message=FALSE, warning=FALSE}
138140
# Calculating the radius
139141
geom_dist <- as.matrix(distances(geometry))
@@ -164,13 +166,13 @@ misty_results %>%
164166
plot_improvement_stats("gain.R2")
165167
```
166168

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:
168170

169171
"We can better explain the expression of marker X when we consider additional views other than the intrinsic view."
170172

171173
#### 2. What are the specific relations that can explain the contributions?
172174

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`.
174176

175177
First, for the intrinsic view:
176178

@@ -212,7 +214,7 @@ misty_results %>% plot_interaction_heatmap(view = "para.126",
212214
trim.measure = "gain.R2")
213215
```
214216

215-
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.
216218

217219
```{r fig.height=7, fig.width=5, message=FALSE}
218220
draw_maps(geometry,

0 commit comments

Comments
 (0)