Correct sample density values using gradient position information
Source:R/correct_gradient_pos_density.R
correct_gradient_pos_density.Rd
Used in conjunction with plot_density_outliers()
, this function will correct
the gradient_pos_density values for outliers based on the gradient_position
values. A linear model is built using the gradient_position and
gradient_pos_density, and if the Cook's outlier value is above the cutoff, then
that sample's gradient_pos_density value is replaced with the fitted value. If
it isn't above the cut-off, then no correction is made for that sample.