Skip to contents

This function will calculate the delta delta Ct metric for all applicable observations in a data.frame by applying the calc_delta_delta_ct function. The data.frame must have the following columns: 'location_id', 'sample_date', 'target_name', and 'ct_value'. The relevant target_names and associated reference_names must be provided. The result is a data.frame containing a 'delta_delta_ct' column which can be merge into the source data.frame.

Usage

apply_delta_delta_ct(
  df,
  target_names,
  reference_names,
  pae_names = NULL,
  pae_values = NULL
)

Arguments

df

A data.frame containing the following columns: 'location_id', 'sample_date', 'target_name', and 'ct_value'.

target_names

Character vector giving the names of the target genes.

reference_names

Character vector giving the names of the reference genes associated with each target gene.

pae_names

Character vector giving the names of the target genes and reference genes for which the percentile amplification efficiency has been estimated. Default is NULL.

pae_values

A numeric scalar giving the estimated PCR amplification efficiency for each of the names in pae_names. Defaults is NULL, which assumes 100% efficiency.

Value

data.frame

Examples


pae <- apply_amplification_efficiency(template_WES_standard_curve)

ddct_standard <- apply_delta_delta_ct(df = template_WES_data,
                                      target_names = c('target_1', 'target_2', 'target_3'),
                                      reference_names = rep('target_0', 3))

ddct_adjusted <- apply_delta_delta_ct(df = template_WES_data,
                                      target_names = c('target_1', 'target_2', 'target_3'),
                                      reference_names = rep('target_0', 3),
                                      pae_names = pae$target_name,
                                      pae_values = pae$mean)

head(ddct_adjusted)
#>   location_id sample_date target_name delta_delta_ct
#> 1           1  2017-06-11    target_1       1.000000
#> 2           1  2017-06-15    target_1      23.056872
#> 3           1  2017-06-27    target_1      41.051045
#> 4           1  2017-06-28    target_1      44.685668
#> 5           1  2017-07-04    target_1       6.698673
#> 6           1  2017-07-08    target_1      10.677717