calc_n_copies {WES}R Documentation

Calculate number of target copies

Description

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)


[Package WES version 1.0.0 Index]