This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ReporteR.scRNAseq/inst/content/02-quality-control-C-tsne.Rmd
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (26 sloc)
1.81 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r parameters-and-defaults, include = FALSE} | |
module <- "scRNAseq" | |
section <- "quality_control" | |
``` | |
```{r parameter-merge, include = FALSE} | |
local_params <- module %>% | |
options() %>% | |
magrittr::extract2(module) %>% | |
magrittr::extract2(section) %>% | |
ReporteR.base::validate_params(parameters_and_defaults) | |
``` | |
```{r scRNAseq-quality-control-C-tsne-checks} | |
assertive.sets::assert_is_subset(local_params$features, colnames(SummarizedExperiment::colData(object))) | |
``` | |
```{r scRNAseq-quality-control-C-tsne-processing, include = FALSE} | |
object %<>% | |
singlecellutils::calculate_qc_map(features = local_params$features, perplexity = 51, max_iter = 2000) | |
``` | |
### t-SNE based quality map | |
Here we use **t**-**S**tochastic **N**eighbor **E**mbedding[@maaten_tsne_2008] (t-SNE), an algorithm for unsupervised dimension reduction, to visualize single cells in a *sample quality subspace*. t-SNE works on the assumption that a low-dimensional structure exists, although objects are embedded in a high dimensional space. In case of the quality subspace, samples are embedded in a high dimensional space described by the features `r ReporteR.base::itemize(local_params$features)`. Typically, t-SNE arranges samples that are associated with low quality features in close proximity and enables exclusion of those samples from downstream analysis (Figure \@ref(fig:scRNAseq-quality-control-C-tsne-figure)). | |
```{r scRNAseq-quality-control-C-tsne-figure, warning = FALSE, message = FALSE, echo = FALSE, fig.cap = "Biplot of dimensions 1 vs. 2 from *t-SNE* [@maaten_tsne_2008] of the sample quality subspace. Percentages in the axis labels indicate the fractional variance explained by the corresponding dimension."} | |
object %>% | |
scater::plotReducedDim(use_dimred = "qcmap", colour_by = local_params$features[1]) + | |
ggplot2::guides(colour = FALSE) + | |
theme_qc_pca | |
``` |