Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions 02_integration/norm_integration.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ After filtering, each sample contributed the following number of cells to the an
table(seurat_qc$orig.ident)
```

# Sources of variability Log normalization {.tabset}
# Sources of variability Log normalization

In this section, we look at potential confounding variables in our (post-QC) dataset, to determine whether their effect needs to be accounted for before normalizing and integrating the data.

Expand Down Expand Up @@ -182,6 +182,8 @@ seurat_lognorm <- RunUMAP(seurat_lognorm, 1:40)
saveRDS(seurat_lognorm, file = "seurat_lognorm.rds")
```

:::{.panel-tabset}

## Examine highly variable genes

Highly variable gene selection is extremely important since many downstream steps are computed only on these genes. Seurat allows us to access the ranked highly variable genes with the VariableFeatures() function. We can additionally visualize the dispersion of all genes using Seurat’s VariableFeaturePlot(), which shows a gene’s average expression across all cells on the x-axis and variance on the y-axis. Ideally we want to use genes that have high variance since this can indicate a change in expression depending on populations of cells. Adding labels using the LabelPoints() helps us understand which genes will be driving shape of our data.
Expand Down Expand Up @@ -319,7 +321,9 @@ g <- signaturePlot(seurat_lognorm,
g[[1]] + ggtitle("S1") | g[[2]] + ggtitle("S2")
```

# SCT Normalization {.tabset}
:::

# SCT Normalization

Now that we have established which effects are observed in our data, we can use the SCTransform method to regress out these effects. The SCTransform method was proposed as a better alternative to the log transform normalization method that we used for exploring sources of unwanted variation. The method not only normalizes data, but it also performs a variance stabilization and allows for additional covariates to be regressed out.

Expand Down Expand Up @@ -358,6 +362,8 @@ seurat_sctnorm <- RunUMAP(seurat_sctnorm, 1:40)
saveRDS(seurat_sctnorm, file = "seurat_sctnorm.rds")
```

:::{.panel-tabset}

### Look at UMAPs post SCT

The plots below show the same variables as before, this time **displayed on the UMAP calculated after applying SCT-normalization**.
Expand Down Expand Up @@ -479,6 +485,8 @@ g <- signaturePlot(seurat_sctnorm,
g[[1]] + ggtitle("S1") | g[[2]] + ggtitle("S2")
```

:::

# Integration

## CCA integration
Expand Down Expand Up @@ -679,10 +687,12 @@ show_this <- "umap.cca"
clustree(meta, prefix = prefix_clu)
```

## Visualize clusters {.tabset}
## Visualize clusters

We take a look at how the clusters look at resolutions 0.1, 0.2,0.4, and 0.6

:::{.panel-tabset}

### 0.1

```{r umap_0.1}
Expand Down Expand Up @@ -739,6 +749,8 @@ DimPlot(seurat_clust,

------------------------------------------------------------------------

:::

```{r}
saveRDS(seurat_clust, file = seurat_output)
```
Expand Down
Loading