knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  dpi = 200
)

amplify

amplify automates routine pcr-based tasks - including plate planning, dilution making, visualizing, and analyzing.

Installation

You can install this package from GitHub with:

# install.packages("devtools")
devtools::install_github("KaiAragaki/amplify")
library(amplify)
library(readxl)
library(knitr)
library(dplyr)

Tidying qPCR data

Data exported from QuantStudio is fairly non-standard:

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.frames

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

tidy_pcr |> 
  pcr_rq("RD1") |> 
  pcr_plot()

Additionally, overviews of plate features can be done using pcr_plate

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:

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:

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:

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:

qc |> pcr_lib_qc_plot_conc()

All QC plotting functions can be run and generate a report using pcr_lib_qc_report.

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



KaiAragaki/amplify documentation built on Oct. 14, 2024, 11:46 p.m.