calculate_efficiency_bytargetid: Calibrate multiple probes by calculating detection efficiency...

View source: R/calculate_efficiency.R

calculate_efficiency_bytargetidR Documentation

Calibrate multiple probes by calculating detection efficiency and R squared

Description

See calibration vignette for example of usage.

Usage

calculate_efficiency_bytargetid(
  cq_df,
  formula = cq ~ log2(dilution) + biol_rep,
  use_prep_types = "+RT"
)

Arguments

cq_df

a data frame with cq (quantification cycle) data, 1 row per well

Must have columns prep_type, target_id, cq, dilution. Only prep_type=="+RT" columns are used.

formula

formula to use for log-log regression fit.

Default value assumes multiple biological replicates, cq ~ log2(dilution) + biol_rep.

If only a single Biological Replicate, change to cq ~ log2(dilution). If multiple sample_ids, change to cq ~ log2(dilution) + sample_id.

See ?formula for background and help.

use_prep_types

prep_type column values to use, default "+RT" for RT-qPCR.

By default, this includes only reverse-transcribed values in the efficiency estimation, so excludes negative controls such as no-template and no-RT.

To skip this filtering step, set use_prep_types=NA.

Details

Note efficiency is given in ratio, not per cent; multiply by 100 for that.

Value

data frame with columns: target_id, efficiency, efficiency.sd, r.squared.

See Also

calculate_efficiency

Examples


# create simple dilution dataset for two target_ids with two biological reps
dilution_tibble <- tibble(target_id = rep(c("T_1",
                                            "T_2"), each = 8),
                          well_row = rep(c("A",
                                           "B"), each = 8),
                          well_col = rep(1:8, 2),
                          well = paste0(well_row, well_col),
                          dilution = rep(c(1, 0.1, 0.001, 0.0001), 4),
                          cq = c(1, 3, 4, 6, 1, 3, 5, 7,
                                 4, 5, 6, 7, 3, 7, 8, 9),
                          biol_rep = rep(c(1, 1, 1, 1, 2, 2, 2, 2), 2),
                          prep_type = "+RT")
                     
# calculate primer efficiency for multiple targets

#----- use case 1: include difference across replicates in model
dilution_tibble |>
    calculate_efficiency_bytargetid()

#----- use case 2: ignore difference across replicates
dilution_tibble |>
    calculate_efficiency_bytargetid(formula = cq ~ log2(dilution))


ewallace/tidyqpcr documentation built on June 5, 2024, 10:04 a.m.