filter_global_mv: Filter Features based on the absolute number or fraction of...

View source: R/filters.R

filter_global_mvR Documentation

Filter Features based on the absolute number or fraction of samples it was found in

Description

Filters features based on the number or fraction of samples they are found in. This is usually one of the first steps in metabolomics data analysis and often already performed when the feature table is first created from the raw spectral files..

Usage

filter_global_mv(data, min_found = 0.5, fraction = TRUE)

Arguments

data

A tidy tibble created by metamorphr::read_featuretable().

min_found

In how many samples must a Feature be found? If fraction == TRUE, a value between 0 and 1 (e.g., 0.5 if a Feature must be found in at least half the samples). If fraction == FALSE the absolute maximum number of samples (e.g., 5 if a specific Feature must be found in at least 5 samples).

fraction

Either TRUE or FALSE. Should min_found be the absolute number of samples or a fraction?

Value

A filtered tibble.

Examples

# Example 1: A feature must be found in at least 50 % of the samples
toy_metaboscape %>%
  filter_global_mv(min_found = 0.5)

# Example 2: A feature must be found in at least 8 samples
toy_metaboscape %>%
  filter_global_mv(min_found = 8, fraction = FALSE)

metamorphr documentation built on June 10, 2026, 5:07 p.m.