Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Jun 17, 2024
1 parent 521ff09 commit 5c7ca78
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cdf2f835
297f9113
2 changes: 1 addition & 1 deletion 3_normalization_scaling.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ <h1 class="title">Normalization and scaling</h1>
</div>
</div>
</div>
<p>Now that we have done the transformation it is also possible to plot gene experssion information in a spatial context, e.g.&nbsp;<code>Calb2</code>:</p>
<p>Now that we have done the transformation it is also possible to plot gene experssion information in a spatial context, e.g.&nbsp;<code>Myl4</code>:</p>
<div class="cell">
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="fu"><a href="https://satijalab.org/seurat/reference/SpatialPlot.html">SpatialPlot</a></span><span class="op">(</span><span class="va">seu_list</span><span class="op">$</span><span class="va">Anterior</span>,</span>
<span> features <span class="op">=</span> <span class="st">"Myl4"</span><span class="op">)</span> <span class="op">+</span> </span>
Expand Down
2 changes: 1 addition & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"href": "3_normalization_scaling.html#normalization-and-scaling-with-sctransform",
"title": "Normalization and scaling",
"section": "Normalization and scaling with SCTransform",
"text": "Normalization and scaling with SCTransform\nBiological heterogeneity in spatial RNA-seq data is often confounded by technical factors including sequencing depth. The number of molecules detected in each spot can vary significantly between spots, even within the same celltype. Note that the variance in molecular counts/spot can be substantial for spatial datasets, particularly if there are differences in cell density across the tissue.\nTherefore, we apply sctransform normalization (Hafemeister and Satija, Genome Biology 2019), which builds regularized negative binomial models of gene expression in order to account for technical artifacts while preserving biological variance. During the normalization, we also remove confounding sources of variation (here we take mitochondrial mapping percentage).\nWe need to apply SCTransform on each individual slice. Therefore, we split the object back into a list (with SplitObject). Next, we run into a small issue that both slice images are maintained in the split object, so we have keep only the image corresponding to the count table. Then, we apply SCTransform on the individual slices and merge the objects back together with merge:\n\nseu_list &lt;- SplitObject(seu, split.by = \"orig.ident\")\n\n# preparing both objects for SCTransform\nfor(slice in names(seu_list)) {\n \n # images aren't split with SplitObject. Resetting the images. \n seu_list[[slice]]@images &lt;- setNames(\n list(seu_list[[slice]]@images[[slice]]),\n slice)\n \n # bugfix based on https://github.com/satijalab/seurat/issues/8216\n seu_list[[slice]][[\"RNA\"]] &lt;- seu_list[[slice]][[\"Spatial\"]]\n DefaultAssay(seu_list[[slice]]) &lt;- \"RNA\"\n \n}\n\nseu_list &lt;- lapply(X = seu_list, FUN = SCTransform, assay = \"RNA\",\n vars.to.regress = \"percent_mt\")\n\n\n\n\n\n\n\nExercise\n\n\n\nAfter running the code, to do the SCT transformation, which assays have been added to the seurat object? Note that you can get assay data with the function Assays.\n\n\n\n\n\n\n\n\nAnswer\n\n\n\n\n\nJust by typing the object name (seu) we see which layers are in there:\n\nAssays(seu_list[[1]])\n\n[1] \"Spatial\" \"RNA\" \"SCT\" \n\n\nShowing us that an assay called SCT has appeared.\n\n\n\nNow that we have done the transformation it is also possible to plot gene experssion information in a spatial context, e.g. Calb2:\n\nSpatialPlot(seu_list$Anterior,\n features = \"Myl4\") + \n SpatialPlot(seu_list$Posterior, \n features = \"Myl4\") + \n plot_layout(guides = \"collect\") & \n theme(legend.position = \"right\")\n\n\n\n\n\n\n\n\n\n\n\n\n\nExercise\n\n\n\nCreate the same plot, but now for the gene Calb2. In which two parts of the brain is it primarily expressed?\nHint: check out Allen Brain Atlas for the names of the different parts of the brain.\n\n\n\n\n\n\n\n\nAnswer\n\n\n\n\n\n\ngene &lt;- \"Calb2\"\nSpatialPlot(seu_list$Anterior,\n features = gene) + \n SpatialPlot(seu_list$Posterior, \n features = gene) + \n plot_layout(guides = \"collect\") & \n theme(legend.position = \"right\")\n\n\n\n\n\n\n\nIt’s mainly expressed in the olfactory bulb (left of the anterior slice) and cerebellum (right of the posterior slice).\n\n\n\nAfter quality control and transformation, we can save the output as an rds files:\n\nsaveRDS(seu_list,\n paste0(\"output/seu_part3.rds\"))"
"text": "Normalization and scaling with SCTransform\nBiological heterogeneity in spatial RNA-seq data is often confounded by technical factors including sequencing depth. The number of molecules detected in each spot can vary significantly between spots, even within the same celltype. Note that the variance in molecular counts/spot can be substantial for spatial datasets, particularly if there are differences in cell density across the tissue.\nTherefore, we apply sctransform normalization (Hafemeister and Satija, Genome Biology 2019), which builds regularized negative binomial models of gene expression in order to account for technical artifacts while preserving biological variance. During the normalization, we also remove confounding sources of variation (here we take mitochondrial mapping percentage).\nWe need to apply SCTransform on each individual slice. Therefore, we split the object back into a list (with SplitObject). Next, we run into a small issue that both slice images are maintained in the split object, so we have keep only the image corresponding to the count table. Then, we apply SCTransform on the individual slices and merge the objects back together with merge:\n\nseu_list &lt;- SplitObject(seu, split.by = \"orig.ident\")\n\n# preparing both objects for SCTransform\nfor(slice in names(seu_list)) {\n \n # images aren't split with SplitObject. Resetting the images. \n seu_list[[slice]]@images &lt;- setNames(\n list(seu_list[[slice]]@images[[slice]]),\n slice)\n \n # bugfix based on https://github.com/satijalab/seurat/issues/8216\n seu_list[[slice]][[\"RNA\"]] &lt;- seu_list[[slice]][[\"Spatial\"]]\n DefaultAssay(seu_list[[slice]]) &lt;- \"RNA\"\n \n}\n\nseu_list &lt;- lapply(X = seu_list, FUN = SCTransform, assay = \"RNA\",\n vars.to.regress = \"percent_mt\")\n\n\n\n\n\n\n\nExercise\n\n\n\nAfter running the code, to do the SCT transformation, which assays have been added to the seurat object? Note that you can get assay data with the function Assays.\n\n\n\n\n\n\n\n\nAnswer\n\n\n\n\n\nJust by typing the object name (seu) we see which layers are in there:\n\nAssays(seu_list[[1]])\n\n[1] \"Spatial\" \"RNA\" \"SCT\" \n\n\nShowing us that an assay called SCT has appeared.\n\n\n\nNow that we have done the transformation it is also possible to plot gene experssion information in a spatial context, e.g. Myl4:\n\nSpatialPlot(seu_list$Anterior,\n features = \"Myl4\") + \n SpatialPlot(seu_list$Posterior, \n features = \"Myl4\") + \n plot_layout(guides = \"collect\") & \n theme(legend.position = \"right\")\n\n\n\n\n\n\n\n\n\n\n\n\n\nExercise\n\n\n\nCreate the same plot, but now for the gene Calb2. In which two parts of the brain is it primarily expressed?\nHint: check out Allen Brain Atlas for the names of the different parts of the brain.\n\n\n\n\n\n\n\n\nAnswer\n\n\n\n\n\n\ngene &lt;- \"Calb2\"\nSpatialPlot(seu_list$Anterior,\n features = gene) + \n SpatialPlot(seu_list$Posterior, \n features = gene) + \n plot_layout(guides = \"collect\") & \n theme(legend.position = \"right\")\n\n\n\n\n\n\n\nIt’s mainly expressed in the olfactory bulb (left of the anterior slice) and cerebellum (right of the posterior slice).\n\n\n\nAfter quality control and transformation, we can save the output as an rds files:\n\nsaveRDS(seu_list,\n paste0(\"output/seu_part3.rds\"))"
},
{
"objectID": "5_marker_gene_identification.html",
Expand Down
16 changes: 8 additions & 8 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/precourse_preparations.html</loc>
<lastmod>2024-06-17T07:24:51.758Z</lastmod>
<lastmod>2024-06-17T08:57:56.747Z</lastmod>
</url>
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/course_schedule.html</loc>
<lastmod>2024-06-17T07:24:51.758Z</lastmod>
<lastmod>2024-06-17T08:57:56.747Z</lastmod>
</url>
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/4_integration_clustering.html</loc>
<lastmod>2024-06-17T07:24:51.738Z</lastmod>
<lastmod>2024-06-17T08:57:56.727Z</lastmod>
</url>
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/2_quality_control.html</loc>
<lastmod>2024-06-17T07:24:51.738Z</lastmod>
<lastmod>2024-06-17T08:57:56.727Z</lastmod>
</url>
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/1_setup.html</loc>
<lastmod>2024-06-17T07:24:51.738Z</lastmod>
<lastmod>2024-06-17T08:57:56.727Z</lastmod>
</url>
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/3_normalization_scaling.html</loc>
<lastmod>2024-06-17T07:24:51.738Z</lastmod>
<lastmod>2024-06-17T08:57:56.727Z</lastmod>
</url>
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/5_marker_gene_identification.html</loc>
<lastmod>2024-06-17T07:24:51.738Z</lastmod>
<lastmod>2024-06-17T08:57:56.727Z</lastmod>
</url>
<url>
<loc>https://sib-swiss.github.io/spatial-transcriptomics-training/index.html</loc>
<lastmod>2024-06-17T07:24:51.758Z</lastmod>
<lastmod>2024-06-17T08:57:56.747Z</lastmod>
</url>
</urlset>

0 comments on commit 5c7ca78

Please sign in to comment.