calculate_drdt_plate: Calculate dR/dT of melt curves for of every well in a plate.

View source: R/amp_melt_curve_functions.R

calculate_drdt_plateR Documentation

Calculate dR/dT of melt curves for of every well in a plate.

Description

dR/dT, the derivative of the melt curve (of fluorescence signal R vs temperature T), has a maximum at the melting temperature Tm. A single peak in this suggests a single-length PCR product is present in the well.

Usage

calculate_drdt_plate(platemelt, method = "spline", ...)

Arguments

platemelt

data frame describing melt curves, including variables well, temperature, fluor_raw (raw fluorescence value).

method

to use for smoothing:

"spline" default, uses smoothing spline stats::smooth.spline.

"diff" base::diff for lagged difference

...

other arguments to pass to smoothing method.

Details

Note that this function does not group by plate, only by well. The function will give strange results if you pass it data from more than one plate. Avoid this by analysing one plate at a time.

Value

platemelt with additional column dRdT.

See Also

Other melt_curve_functions: calculate_dydx()

Examples

# create simple curve
# create simple dataset of raw fluorescence with two samples
temp_tibble <- tibble(sample_id = rep(c("S1", "S2"), each = 10),
                          target_id = "T1",
                          well_row = "A",
                          well_col = rep(c(1, 2), each = 10),
                          well = rep(c("A1", "A2"), each = 10),
                          temperature = rep(56:65,2),
                          fluor_raw = c(1:10, 6:15))

# calculate drdt of all melt curves
#----- use case 1 : using splines
temp_tibble |>
    calculate_drdt_plate()

# optional arguments are passed to smooth.splines function
temp_tibble |>
    calculate_drdt_plate(spar = 0.5)

#----- use case 2 : using difference between adjacent points
temp_tibble |>
    calculate_drdt_plate(method = "diff")


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