Skip to contents

This function calculates the quantitative value of the qPCR Ct value. Cycle threshold here is converted into the estimated number of gene target copies (e.g. viral load for a viral pathogen) by fitting a log linear model to the standard curve data and then using that model to find a point estimate for the provided Ct values.

Usage

calc_n_copies(ct_values, target_names, standard_curves)

Arguments

ct_values

A numeric vector giving the Ct value for each observation.

target_names

A character vector giving the target names for each element in 'ct_values'.

standard_curves

A data.frame containing results from standard curve dilution experiment. Elements in 'target_names' must map to either 'target_name_unique' or 'target_name_concise'. See package data object template_WES_standard_curves for template.

Value

Vector

Examples


df <- template_WES_data[template_WES_data$target_name == 'target_1',]
sc <- template_WES_standard_curve[template_WES_standard_curve$target_name == 'target_1',]

tmp <- calc_n_copies(ct_values = df$ct_value,
                     target_names = df$target_name,
                     standard_curves = sc)

df$n_copies <- tmp
head(df)
#>    sample_date location_id   lat   lon target_name ct_value  n_copies
#> 5   2017-06-11           1 23.80 90.37    target_1 31.60111  62.85220
#> 6   2017-06-11           1 23.80 90.37    target_1 32.20208  43.24349
#> 15  2017-06-11           2 23.80 90.38    target_1 28.91009 335.36183
#> 16  2017-06-11           2 23.80 90.38    target_1       NA        NA
#> 25  2017-06-11           3 23.81 90.37    target_1 28.05273 571.73967
#> 26  2017-06-11           3 23.81 90.37    target_1       NA        NA