View source: R/calculate_deltacq.R
calculate_deltadeltacq_bytargetid | R Documentation |
\Delta \Delta Cq
) to globally normalize
quantification cycle (log2-fold) data across sample_id.By default, \Delta \Delta Cq
is positive if a target is more highly
detected in the relevant sample, compared to reference samples. This can be
flipped by setting the parameter 'ddcq_positive' to 'FALSE'. In either case,
The fold change, 2^{\Delta \Delta Cq}
, is also reported.
calculate_deltadeltacq_bytargetid(
deltacq_df,
ref_sample_ids,
norm_function = median,
ddcq_positive = TRUE
)
deltacq_df |
a data frame containing columns 'sample_id', value_name (default 'delta_cq') and tid_name (default 'target_id'). Crucially, sample_id should be the same for different technical replicates measuring identical reactions in different wells of the plate, but differ for different biological and experimental replicates. Usually this will be a data frame that was output by 'calculate_deltacq_bysampleid'. |
ref_sample_ids |
reference sample_ids to normalize by |
norm_function |
Function to use to calculate the value to normalize by on given scale. Default is median, alternatively could use mean. |
ddcq_positive |
(default TRUE) output |
This function does a global normalization, where all samples are compared to one or more reference samples specified in 'ref_sample_ids'. There are other experimental designs that require comparing samples in pairs or small groups, e.g. a time course comparing 'delta_cq' values against a reference strain at each time point. For those situations, instead we recommend adapting code from this function, changing the grouping variables used in to 'dplyr::group_by' to draw the contrasts appropriate for the experiment.
data frame like cq_df with three additional columns:
ref_delta_cq | summary (median/mean) \Delta Cq
value for target_id in reference sample ids |
deltadelta_cq | the
normalized value, \Delta \Delta Cq |
fold_change | the
normalized fold-change ratio, 2^(-\Delta \Delta Cq) |
# create simple deltacq dataset with two samples, two targets and 3 reps
deltacq_tibble <- tibble(sample_id = rep(c("S_1","S_1","S_1", "S_norm", "S_norm", "S_norm"), 2),
target_id = rep(c("T_1",
"T_2"), each = 6),
tech_rep = rep(1:3, 4),
well_row = rep(c("A",
"B"), each = 6),
well_col = rep(1:6, 2),
well = paste0(well_row,well_col),
delta_cq = c(1, 1, 1, 3, 3, 2,
4, 5, 4, 5, 5, 5))
# calculate deltadeltacq using reference target_id called 'S_norm'
#----- use case 1: median reference sample_id value
deltacq_tibble |>
calculate_deltadeltacq_bytargetid(ref_sample_ids = "S_norm")
#----- use case 2: mean reference sample_id value
deltacq_tibble |>
calculate_deltadeltacq_bytargetid(ref_sample_ids = "S_norm",
norm_function = mean)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.