inspect_dc: Flag the results of drift correction

Description Usage Arguments Details Value See Also Examples

View source: R/drift_correction.R

Description

Determines whether the drift correction worked. The primary reason is to search for features where there were too many missing values in the QCs, so it was not possible to run drift correction. If the drift correction is run on the original values (not log-transformed), then there is also a need to check that the correction did not result in any negative values. This can sometimes happen if the prediction curve takes an extreme shape. If quality is monitored, a quality condition is checked for each feature. If the condition is fulfilled, the drift corrected feature is retained, otherwise the original feature is retained and the drift corrected feature is discarded. The result of this operation is recorded in the feature data.

Usage

1
2
inspect_dc(orig, dc, check_quality,
  condition = "RSD_r < 0 & D_ratio_r < 0")

Arguments

orig

a MetaboSet object, before drift correction

dc

a MetaboSet object, after drift correction

check_quality

logical, whether quality should be monitored.

condition

a character specifying the condition, see Details

Details

The condition parameter should be a character giving a condition compatible with dplyr::filter. The condition is applied on the changes in the quality metrics RSD, RSD_r, D_ratio and D_ratio_r. For example, the default is "RSD_r < 0 and D_ratio_r < 0", meaning that both RSD_r and D_ratio_r need to decrease in the drift correction, otherwise the drift corrected feature is discarded and the original is retained.

Value

MeatboSet object

See Also

correct_drift, save_dc_plots

Examples

1
2
3
4
dc <- dc_cubic_spline(merged_sample)
corrected <- dc$object
inspected <- inspect_dc(orig = merged_sample, dc = corrected,
                        check_quality = TRUE)

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