getOutlierIds: Get Flagged Ids From MAD Outlier Map

View source: R/getOutlierIds.R

getOutlierIdsR Documentation

Get Flagged Ids From MAD Outlier Map

Description

Return the IDs of flagged samples for objects of the outlier_map class. Samples are flagged based on the percent analytes (RFU columns) for a given sample that were identified as outliers using the median absolute deviation (MAD).

Usage

getOutlierIds(x, flags = 0.05, data = NULL, include = NULL)

Arguments

x

An object of class:

  • outlier_map - from calcOutlierMap()

flags

Numeric in ⁠[0, 1]⁠. For an "outlier_map", the proportion of the analytes (columns) for a given sample that must be outliers for a flag to be placed at the right-axis, right-axis, thus flagging that sample. If NULL (default), 0.05 (5%) is selected.

data

Optional. The data originally used to create the map x. If omitted, a single column data frame is returned.

include

Optional. Character vector of column name(s) in data to include in the resulting data frame. Ignored if data = NULL.

Value

A data.frame of the indices (idx) of flagged samples, along with any additional variables as specified by include.

Author(s)

Caleb Scheidel

See Also

Other Calc Map: calcOutlierMap(), plot.Map()

Examples

# flagged outliers
# create a single sample outlier (12)
out_adat <- example_data
apts     <- getAnalytes(out_adat)
out_adat[12, apts] <- out_adat[12, apts] * 10

om <- calcOutlierMap(out_adat)
getOutlierIds(om, out_adat, flags = 0.05, include = c("Sex", "Subarray"))

SomaDataIO documentation built on June 8, 2025, 10:13 a.m.