qpcr_clean: Remove outliers

Description Usage Arguments Details Value Examples

View source: R/qpcr_clean.R

Description

qpcr_clean removes outliers from technical qPCR replicates. These outliers can occur because of inaccurate pipetting, pipetting in the wrong well, seal detachment, etc. The function removes them based on the deviation from the median Cq value. See details for exact rules of outlier removal.

Usage

1
qpcr_clean(.data, cq, threshold, ...)

Arguments

.data

A data frame or tibble.

cq

Unquoted expression. The name of the column containing the Cq values.

threshold

A numeric. The maximum allowed deviation from the median.

...

Tidy-select. One or more unquoted expressions separated by commas. These are the names of all other columns that are not the Cq values or denote technical replicates. They will be used to make groups, so calculations will be made for each unique combination of variables.

Details

The rules for what is an outlier and what is not are as follows:

  1. If only one Cq value is present (i.e. the other replicates failed to produce a Cq value), it will be removed.

  2. If only two Cq values are present, they need to be less than the threshold apart.

  3. For three or more technical replicates:

    • If the absolute distance between a Cq value and the median Cq is greater than the set threshold, than this value will be removed.

    • If all Cq values within a technical replicate are more than the threshold apart, they will all be removed.

Value

Returns the same type as the input (e.g. a data frame or tibble). Rows that are deemed outliers are removed from the output. If you want to inspect these rows see qpcr_outlier_context.

Examples

1
2
3
4
clean_data <- qpcr_clean(ex_data,
                         cq = cq_values,
                         threshold = 1,
                         treatment, primer_pair, bio_rep)

JorikBot/tidyqpcr documentation built on Jan. 28, 2021, 11:44 a.m.