-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
83 lines (57 loc) · 1.73 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(emo)
```
# scrappy
<!-- badges: start -->
<!-- badges: end -->
scrappy provides an easy way to visualize the quality of scRNA single-cells.
## Installation
You can install the development version with:
``` r
# install.packages("remotes")
remotes::install_github("darlanminussi/scrappy")
```
scrappy uses the percentage of mitochondrial gene expression to classify the cells as:
`r emo::ji("smile")`: Great Quality.
`r emo::ji("slightly_smiling_face")`: Good quality.
`r emo::ji("nauseated")`: OK quality.
`r emo::ji("poop")`: Low quality.
scrappy can be used on [SingleCellExperiment](https://osca.bioconductor.org/) objects as well as [Seurat](https://satijalab.org/seurat/) objects.
## Example
```{r, include = FALSE}
library(scRNAseq)
sce <- ZeiselBrainData()
# Quality control.
library(scater)
is.mito <- grepl("^mt-", rownames(sce))
table(is.mito)
sce <- addPerCellQC(sce, subsets=list(Mito=is.mito))
# Normalization.
sce <- logNormCounts(sce)
# Feature selection.
library(scran)
dec <- modelGeneVar(sce)
hvg <- getTopHVGs(dec, prop=0.1)
# Dimensionality reduction.
set.seed(1234)
sce <- runPCA(sce, ncomponents=25, subset_row=hvg)
sce <- runTSNE(sce, dimred = 'PCA', external_neighbors=TRUE)
```
```{r}
sce
```
```{r example, fig.width=6, fig.height=6, dpi = 300}
library(scrappy)
scrappyPlot(sce, "TSNE")
```
PS: If you want to learn about QC metrics and how to filter your single-cell datasets follow this [link](https://osca.bioconductor.org/quality-control.html#choice-of-qc-metrics).