Detect outlier samples. See more here: https://privefl.github.io/blog/detecting-outlier-samples-in-pca/
detect_outlier(
object,
na_percentage_cutoff = 0.5,
sd_fold_change = 6,
mad_fold_change = 6,
dist_p_cutoff = 0.05
)
A mass_dataset object.
na_percentage_cutoff
sd_fold_change
mad_fold_change
dist_p_cutoff
A new mass_dataset object.
library(massdataset)
#> Version 1.0.12 (2022-08-07 01:01:35)
#>
#> Attaching package: ‘massdataset’
#> The following object is masked from ‘package:stats’:
#>
#> filter
data("expression_data")
data("sample_info")
data("variable_info")
object =
create_mass_dataset(
expression_data = expression_data,
sample_info = sample_info,
variable_info = variable_info
)
object =
object %>%
log() %>%
scale()
outlier_samples =
object %>%
detect_outlier()
extract_outlier_table(outlier_samples)
#> according_to_na pc_sd pc_mad accordint_to_distance
#> Blank_3 TRUE FALSE FALSE FALSE
#> Blank_4 TRUE FALSE FALSE FALSE
#> QC_1 FALSE FALSE FALSE FALSE
#> QC_2 FALSE FALSE FALSE FALSE
#> PS4P1 FALSE FALSE FALSE FALSE
#> PS4P2 FALSE FALSE FALSE FALSE
#> PS4P3 FALSE FALSE FALSE FALSE
#> PS4P4 FALSE FALSE FALSE FALSE
###MV plot
massdataset::show_sample_missing_values(object = object,
color_by = "class",
percentage = TRUE)