detect_outlier(
  object,
  na_percentage_cutoff = 0.5,
  sd_fold_change = 6,
  mad_fold_change = 6,
  dist_p_cutoff = 0.05
)

Arguments

object

A mass_dataset object.

na_percentage_cutoff

na_percentage_cutoff

sd_fold_change

sd_fold_change

mad_fold_change

mad_fold_change

dist_p_cutoff

dist_p_cutoff

Value

A new mass_dataset object.

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

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)