From f68bad3c4aa9376df5fdaa6b54d75bbfdeb91d8f Mon Sep 17 00:00:00 2001 From: Ruitong Li Date: Tue, 11 Nov 2025 19:27:47 -0500 Subject: [PATCH] change tabset for norm_integration --- 02_integration/norm_integration.qmd | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/02_integration/norm_integration.qmd b/02_integration/norm_integration.qmd index 84c7b6d..a4923a2 100644 --- a/02_integration/norm_integration.qmd +++ b/02_integration/norm_integration.qmd @@ -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. @@ -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. @@ -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. @@ -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**. @@ -479,6 +485,8 @@ g <- signaturePlot(seurat_sctnorm, g[[1]] + ggtitle("S1") | g[[2]] + ggtitle("S2") ``` +::: + # Integration ## CCA integration @@ -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} @@ -739,6 +749,8 @@ DimPlot(seurat_clust, ------------------------------------------------------------------------ +::: + ```{r} saveRDS(seurat_clust, file = seurat_output) ```