Skip to content

Commit

Permalink
adds presentations luciano
Browse files Browse the repository at this point in the history
  • Loading branch information
Geert van Geest committed Oct 29, 2024
1 parent ddb7f78 commit cd50cc1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 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": "1be8d3749096b9eacbc06fd6a3c5be09",
"hash": "52afd51c30892f3b3203123bef3b9334",
"result": {
"markdown": "---\ntitle: \"Integration\"\n---\n\n\n## Material\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\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
Binary file added assets/pdf/Dimensionality_Reduction_SIB.pdf
Binary file not shown.
Binary file added assets/pdf/Integration_SIB.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion day2/day2-1_dimensionality_reduction.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: "Dimensionality reduction"

## Material

{{< downloadthis ../assets/pdf/scRNAseq_RM_Integration_dimreduction.pdf dname="scRNAseq_RM_Integration_dimreduction" label="Download the presentation" icon="filetype-pdf" >}}
{{< downloadthis ../assets/pdf/Dimensionality_Reduction_SIB.pdf dname="Dimensionality_Reduction_SIB" label="Download the presentation" icon="filetype-pdf" >}}

{{< video https://youtu.be/QS6ZH_41b4s?si=fvaNGkqjsIcxTEFn >}}

Expand Down
2 changes: 2 additions & 0 deletions day2/day2-2_integration.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: "Integration"

## Material

{{< downloadthis ../assets/pdf/Integration_SIB.pdf dname="Integration_SIB" label="Download the presentation" icon="filetype-pdf" >}}

{{< video https://youtu.be/2TsW5A53hTg?si=Bas__YskLl21-YjF >}}

## Exercises
Expand Down

0 comments on commit cd50cc1

Please sign in to comment.