removeMiss: Feature filtering based on proportions of missing values

View source: R/removeFeatures-functions.R

removeMissR Documentation

Feature filtering based on proportions of missing values

Description

Removes Features based on proportions of missing values in the matrix where rows represent features and columns represent samples. Features can be removed based on missing values within a specific group or multiple groups. A feature will be retained, if there is at least one group with a proportion of non-missing values above a cut-off.

Usage

removeMiss(x, group, levels = NULL, cut = 0.7)

Arguments

x

A matrix-like object.

group

A character vector for the information about each sample's group.

levels

A string or character vector specifying one or more groups for filter filtering based on missing values. If NULL, all group levels in group will be used.

cut

A numeric value between 0 and 1 specifying a minimum proportion of non-missing values to retain a feature.

Value

A matrix containing the filtered features.

See Also

See removeFeatures that provides a SummarizedExperiment-friendly wrapper for this function.

Examples


data(faahko_se)
m <- assay(faahko_se, "raw")
g <- colData(faahko_se)$sample_group
table(g)

## Filter based on missing values in "KO" and "WT" groups
removeMiss(m, group = g, cut = 0.9)

## Consider only "KO" group (can be useful for QC-based filtering)
removeMiss(m, group = g, levels = "KO", cut = 0.9)


HimesGroup/qmtools documentation built on April 16, 2023, 8 p.m.