-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathreport.Rmd
More file actions
58 lines (50 loc) · 1.34 KB
/
report.Rmd
File metadata and controls
58 lines (50 loc) · 1.34 KB
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
---
output: html_document
params:
file:
value: x
set_title:
value: x
title: '`r params$set_title`'
date: '`r strftime(Sys.time(), format = "%B %d, %Y")`'
---
```{r, include=FALSE}
library(knitr)
opts_chunk$set(fig.height = 6, fig.width = 8, fig.align = 'center', echo = FALSE)
library(scater)
library(SingleCellExperiment)
d <- readRDS(paste0("scater-objects/", params$file))
cell_types <- sort(colnames(colData(d))[grepl("cell_type", colnames(colData(d)))])
```
## QC of library size and detected genes
```{r}
if(!is.null(d$total_counts) & !is.null(d$total_features)) {
for(ct in cell_types) {
print(plotPhenoData(d, aes_string(x = "total_counts", y = "total_features", colour = ct)))
}
}
```
```{r}
if(!is.null(d$total_counts) & !is.null(d$total_features)) {
for(ct in cell_types) {
print(plotPhenoData(d, aes_string(x = ct, y = "total_features", colour = "log10_total_counts")) + theme(axis.text.x = element_text(angle = 90, hjust = 1)))
}
}
```
## QC of expression
```{r, message=FALSE, warning=FALSE}
if(!is.null(d$total_features)) {
plotQC(d, type = "highest-expression")
}
```
```{r}
if(!is.null(rowData(d)$mean_counts) & !is.null(rowData(d)$n_cells_counts)) {
plotQC(d, type = "exprs-freq-vs-mean")
}
```
## PCA plot
```{r}
for(ct in cell_types) {
print(plotPCA(d, colour_by = ct))
}
```