-
Notifications
You must be signed in to change notification settings - Fork 1
/
massqc_sample_boxplot.Rmd
89 lines (77 loc) · 1.83 KB
/
massqc_sample_boxplot.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
84
85
86
87
88
89
---
title: "Boxplot for each sample"
author:
- name: Xiaotao Shen (https://www.shenxt.info/)
date: "Created on 2021-12-04 and updated on `r Sys.Date()`"
output:
html_document:
df_print: paged
toc: no
pdf_document:
toc: no
vignette: >
%\VignetteIndexEntry{massqc_sample_boxplot}
%\VignettePackage{massqc}
% \VignetteEngine{knitr::rmarkdown}
% \usepackage[utf8]{inputenc}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE, echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
warning = FALSE,
message = TRUE,
out.width = "100%"
)
```
# **Data preparation**
```{r,eval=TRUE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
library(massdataset)
library(tidyverse)
library(massqc)
data("sample_info", package = "massdataset")
data("expression_data", package = "massdataset")
data("variable_info", package = "massdataset")
object =
create_mass_dataset(
expression_data = expression_data,
sample_info = sample_info,
variable_info = variable_info
)
object
```
# **Sample boxplot**
```{r,eval=TRUE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
object %>%
massqc_sample_boxplot()
object %>%
log(10) %>%
massqc_sample_boxplot()
object %>%
log(10) %>%
massqc_sample_boxplot(color_by = "class")
object %>%
log(10) %>%
massqc_sample_boxplot(fill_by = "class") +
ggsci::scale_fill_lancet()
object %>%
log(10) %>%
massqc_sample_boxplot(
fill_by = "class",
color_by = "class",
point = TRUE,
point_alpha = 0.3
) +
ggsci::scale_fill_lancet()
object %>%
log(10) %>%
massqc_sample_boxplot(color_by = "class",
point = TRUE,
point_alpha = 0.3) +
ggsci::scale_color_lancet()
```
# **Session information**
```{r,eval=TRUE,warning=FALSE, R.options="", message=FALSE, cache=TRUE}
sessionInfo()
```