-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
136 lines (99 loc) · 3.08 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
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%",
dpi = 200
)
```
# amplify <img src='man/figures/logo.png' align="right" height="138" />
<!-- badges: start -->
<!-- badges: end -->
**amplify** automates routine pcr-based tasks - including plate planning, dilution making, visualizing, and analyzing.
## Installation
You can install this package from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("KaiAragaki/amplify")
```
```{r message=FALSE, warning=FALSE}
library(amplify)
library(readxl)
library(knitr)
library(dplyr)
```
## Tidying qPCR data
Data exported from QuantStudio is fairly non-standard:
```{r untidy_pcr}
untidy_file_path <- system.file("extdata", "untidy-pcr-example.xls", package = "amplify")
untidy_file_path |>
read_excel() |>
select(1:10) |>
head()
```
amplify provides `read_pcr` to read in and `tidy_lab` (from {mop}) to automatically tidy these files. `scrub` (also from {mop}) can convert `tidy_lab` objects to `data.frame`s
```{r tidy_pcr}
tidy_pcr <- untidy_file_path |>
read_pcr() |>
tidy_lab()
tidy_pcr |>
scrub() |>
select(1:10) |>
head()
```
This works with both ddCt or standard curve result files.
## Plotting qPCR results
Tidied results can be plotted using `pcr_plot`
```{r pcr_plot}
tidy_pcr |>
pcr_rq("RD1") |>
pcr_plot()
```
Additionally, overviews of plate features can be done using `pcr_plate`
```{r}
tidy_pcr |>
pcr_plate_view("target_name")
```
More details can be found in the **Analyzing ddCt qPCR with amplify** vignette.
## Library Preparation Quantification
### Library Preparation Quantification Calculation
RNA library preparation results output from Quantstudio can be tidied using `pcr_tidy`:
```{r}
untidy_lib_path <- system.file("extdata", "untidy-standard-curve.xlsx", package = "amplify")
tidy_lib <- read_pcr(untidy_lib_path) |>
tidy_lab(pad_zero = TRUE)
tidy_lib |>
scrub() |>
select(1:10) |>
head()
```
Calculating the concentration of library (before dilution) can be performed using `pcr_lib_calc`:
```{r}
calc_lib <- pcr_lib_calc(tidy_lib)
calc_lib |>
scrub() |>
filter(task == "UNKNOWN") |>
select(sample_name, concentration) |>
head()
```
### Library preparation quantification quality control
We can generate useful plots to determine the quality of the quantification run by first using `pcr_lib_qc`:
```{r}
qc <- calc_lib |>
pcr_lib_qc()
lapply(qc, head, n = 3)
```
These data, by themselves, are not particularly useful. However, a suite of QC plotting functions can be used upon these data to give insight, such as:
```{r}
qc |> pcr_lib_qc_plot_conc()
```
All QC plotting functions can be run and generate a report using `pcr_lib_qc_report`.
```{r eval = FALSE}
qc |> pcr_lib_qc_report("path/to/my/report.html")
```
More information about the plots available, as well as their interpretations, can be found in **Performing Library Quantification QC**