detect_outlier: Detect outlier samples

View source: R/detect_outlier_samples.R

detect_outlierR Documentation

Detect outlier samples

Description

Detect outlier samples. See more here: https://privefl.github.io/blog/detecting-outlier-samples-in-pca/

Usage

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(s)

Xiaotao Shen shenxt1990@outlook.com

Examples

library(massdataset)
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)

###MV plot
massdataset::show_sample_missing_values(object = object,
                                        color_by = "class",
                                        percentage = TRUE)

tidymass/masscleaner documentation built on Sept. 4, 2023, 3:21 a.m.