Skip to content

Commit

Permalink
updates presentations
Browse files Browse the repository at this point in the history
  • Loading branch information
Geert van Geest committed Oct 31, 2024
1 parent 2cb88c7 commit c879372
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 13 deletions.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions _freeze/day2/day2-2_integration/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hash": "52afd51c30892f3b3203123bef3b9334",
"hash": "4f0751afb431ed605dee413e7f52cd56",
"result": {
"markdown": "---\ntitle: \"Integration\"\n---\n\n\n## Material\n\n\n{{< downloadthis ../assets/pdf/Integration_SIB.pdf dname=\"Integration_SIB\" label=\"Download the presentation\" icon=\"filetype-pdf\" >}}\n\n\n{{< video https://youtu.be/2TsW5A53hTg?si=Bas__YskLl21-YjF >}}\n\n\n\n## Exercises\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-1_2e73120ec6ed776c4833390d0d61218b'}\n\n:::\n\n\nLet's have a look at the UMAP again. Although cells of different samples are shared amongst 'clusters', you can still see seperation within the clusters:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-2_79eb911a4b7970c3b1eb125b14ad124a'}\n\n```{.r .cell-code}\nSeurat::DimPlot(seu, reduction = \"umap\")\n```\n\n::: {.cell-output-display}\n![](day2-2_integration_files/figure-html/unnamed-chunk-2-1.png){width=672}\n:::\n:::\n\n\nTo perform the integration, we split our object by sample, resulting into a set of layers within the `RNA` assay. The layers are integrated and stored in the reduction slot - in our case we call it `integrated.cca`. Then, we re-join the layers\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-3_1e63f55eac8216c49406128ede54eb12'}\n\n```{.r .cell-code}\nseu[[\"RNA\"]] <- split(seu[[\"RNA\"]], f = seu$orig.ident)\n\nseu <- Seurat::IntegrateLayers(object = seu, method = CCAIntegration,\n orig.reduction = \"pca\",\n new.reduction = \"integrated.cca\",\n verbose = FALSE)\n\n# re-join layers after integration\nseu[[\"RNA\"]] <- JoinLayers(seu[[\"RNA\"]])\n```\n:::\n\n\n\nWe can then use this new integrated matrix for clustering and visualization. Now, we can re-run and visualize the results with UMAP.\n\n::: {.callout-important}\n## Exercise\nCreate the UMAP again on the `integrated.cca` reduction (using the function `RunUMAP` - set the option `reduction` accordingly). After that, generate the UMAP plot. Did the integration perform well?\n::: \n\n::: {.callout-tip collapse=\"true\"}\n## Answer\n\nPerforming the scaling, PCA and UMAP:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-4_0482443b43a57d2cfa527d2cdb471376'}\n\n```{.r .cell-code}\nseu <- RunUMAP(seu, dims = 1:30, reduction = \"integrated.cca\")\n```\n:::\n\n\nPlotting the UMAP:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-5_f7f85ce27c690dd8dd267e206a65ebc8'}\n\n```{.r .cell-code}\nSeurat::DimPlot(seu, reduction = \"umap\")\n```\n\n::: {.cell-output-display}\n![](day2-2_integration_files/figure-html/unnamed-chunk-5-1.png){width=672}\n:::\n:::\n\n::: \n\n\n### Save the dataset and clear environment\n\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-6_120af022df6fc12be96284075d624134'}\n\n```{.r .cell-code}\nsaveRDS(seu, \"seu_day2-2.rds\")\n```\n:::\n\n\nClear your environment:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-7_e2ee4d1c633d3765009a37395acfae7d'}\n\n```{.r .cell-code}\nrm(list = ls())\ngc()\n.rs.restartR()\n```\n:::\n",
"markdown": "---\ntitle: \"Integration\"\n---\n\n\n## Material\n\n\n{{< downloadthis ../assets/pdf/Integration_SIB.pdf dname=\"Integration_SIB\" label=\"Download the presentation\" icon=\"filetype-pdf\" >}}\n\n\n{{< video https://youtu.be/2TsW5A53hTg?si=Bas__YskLl21-YjF >}}\n\n\n{{< downloadthis ../assets/pdf/scRNAseq_RM_Integration_dimreduction.pdf dname=\"scRNAseq_RM_Integration_dimreduction\" label=\"Download the presentation from the video\" icon=\"filetype-pdf\" >}}\n\n\n\n## Exercises\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-1_2e73120ec6ed776c4833390d0d61218b'}\n\n:::\n\n\nLet's have a look at the UMAP again. Although cells of different samples are shared amongst 'clusters', you can still see seperation within the clusters:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-2_79eb911a4b7970c3b1eb125b14ad124a'}\n\n```{.r .cell-code}\nSeurat::DimPlot(seu, reduction = \"umap\")\n```\n\n::: {.cell-output-display}\n![](day2-2_integration_files/figure-html/unnamed-chunk-2-1.png){width=672}\n:::\n:::\n\n\nTo perform the integration, we split our object by sample, resulting into a set of layers within the `RNA` assay. The layers are integrated and stored in the reduction slot - in our case we call it `integrated.cca`. Then, we re-join the layers\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-3_1e63f55eac8216c49406128ede54eb12'}\n\n```{.r .cell-code}\nseu[[\"RNA\"]] <- split(seu[[\"RNA\"]], f = seu$orig.ident)\n\nseu <- Seurat::IntegrateLayers(object = seu, method = CCAIntegration,\n orig.reduction = \"pca\",\n new.reduction = \"integrated.cca\",\n verbose = FALSE)\n\n# re-join layers after integration\nseu[[\"RNA\"]] <- JoinLayers(seu[[\"RNA\"]])\n```\n:::\n\n\n\nWe can then use this new integrated matrix for clustering and visualization. Now, we can re-run and visualize the results with UMAP.\n\n::: {.callout-important}\n## Exercise\nCreate the UMAP again on the `integrated.cca` reduction (using the function `RunUMAP` - set the option `reduction` accordingly). After that, generate the UMAP plot. Did the integration perform well?\n::: \n\n::: {.callout-tip collapse=\"true\"}\n## Answer\n\nPerforming the scaling, PCA and UMAP:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-4_0482443b43a57d2cfa527d2cdb471376'}\n\n```{.r .cell-code}\nseu <- RunUMAP(seu, dims = 1:30, reduction = \"integrated.cca\")\n```\n:::\n\n\nPlotting the UMAP:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-5_f7f85ce27c690dd8dd267e206a65ebc8'}\n\n```{.r .cell-code}\nSeurat::DimPlot(seu, reduction = \"umap\")\n```\n\n::: {.cell-output-display}\n![](day2-2_integration_files/figure-html/unnamed-chunk-5-1.png){width=672}\n:::\n:::\n\n::: \n\n\n### Save the dataset and clear environment\n\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-6_120af022df6fc12be96284075d624134'}\n\n```{.r .cell-code}\nsaveRDS(seu, \"seu_day2-2.rds\")\n```\n:::\n\n\nClear your environment:\n\n\n::: {.cell hash='day2-2_integration_cache/html/unnamed-chunk-7_e2ee4d1c633d3765009a37395acfae7d'}\n\n```{.r .cell-code}\nrm(list = ls())\ngc()\n.rs.restartR()\n```\n:::\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
Expand Down
Loading

0 comments on commit c879372

Please sign in to comment.