flag_quality: Flag low-quality features

Description Usage Arguments Details Value References Examples

Description

Flags low-quality features using the quality metrics defined in (Broadhurst 2018). The metrics are described in more detain in Details. A condition for keeping the features is given as a character, which is passed to dplyr::filter.

Usage

1
2
flag_quality(object,
  condition = "(RSD_r < 0.2 & D_ratio_r < 0.4) | (RSD < 0.1 & RSD_r < 0.1 & D_ratio < 0.1)")

Arguments

object

a MetaboSet object

condition

character, condition for keeping the features, see Details

Details

The quality metrics measure two things: internal spread of the QCs, and spread of the QCs compared to the spread of the biological samples. Internal spread is measured with relative standard deviation (RSD), also known as coefficient of variation (CV).

RSD = \frac{s_{QC}}{\bar{x}_{QC}}

Wheres_{QC} is the standard deviation of the QC samples and \bar{x}_{QC} is the sample mean of the signal in the QC samples. RSD can also be replaced by a non-parametric, robust version based on the median and median absolute deviation (MAD):

RSD\_r = \frac{1.4826 \cdot MAD_{QC}}{\text{median}(x_{QC}}

The spread of the QC samples compared to the biological samples is measured using a metric called D-ratio:

D\_ratio = \frac{s_{QC}}{s_{biological}}

Or, as before, a non-parametric, robust alternative:

D\_ratio\_r = \frac{MAD_{QC}}{MAD_{biological}}

The default condition keeps features that pass either of the two following conditions:

RSD_r < 0.2 & D_ratio_r < 0.4

RSD < 0.1 & RSD_r < 0.1 & D_ratio < 0.1

Value

a MetaboSet object with the features flagged

References

Broadhurst, David et al. Guidelines and considerations for the use of system suitability and quality control samples in mass spectrometry assays applied in untargeted clinical metabolomic studies. Metabolomics : Official journal of the Metabolomic Society vol. 14,6 (2018): 72. doi:10.1007/s11306-018-1367-3

Examples

1
2
3
4
5
ex_set <- flag_quality(merged_sample)
results(ex_set)
# Custom condition
ex_set <- flag_quality(merged_sample, condition = "RSD_r < 0.3 & D_ratio_r < 0.6")
results(ex_set)

antonvsdata/amp documentation built on Jan. 8, 2020, 3:15 a.m.