removeBlankRatio: Feature Filtering based on QC/blank ratio

View source: R/removeFeatures-functions.R

removeBlankRatioR Documentation

Feature Filtering based on QC/blank ratio

Description

Removes Features with based on QC/blank ratios using the data matrix where rows represent features and columns represent samples. A feature will be retained if there are not enough blank samples to calculate an intensity ratio for a feature (or completely absent in blank samples). Use removeMiss to remove features based on a proportion of missing values. Features with a QC/blank ratio below a cut-off will be discarded.

Usage

removeBlankRatio(
  x,
  blank_samples,
  qc_samples,
  cut = 2,
  type = c("median", "mean"),
  blank_min_n = 3
)

Arguments

x

A matrix-like object.

blank_samples

A vector of sample names or column indices specifying blank samples for the calculation of ratio. Must be a subset of colnames(x) if it is a character vector.

qc_samples

A vector of sample names or column indices specifying QC samples for the calculation of ratio. Must be a subset of colnames(x) if it is a character vector.

cut

A numeric value greater than 1 specifying a QC/blank ratio cut-off to retain a feature.

type

A method to compute a QC/blank ratio. Either "median" or "mean".

blank_min_n

An integer value specifying the minimum number of blank samples to calculate a ratio.

Value

A matrix containing the filtered features.

See Also

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

Examples

set.seed(1e7)

m_blank <- matrix(rlnorm(200), ncol = 5)
m_qc <- matrix(rlnorm(400, 1), ncol = 10)
m <- cbind(m_blank, m_qc)
colnames(m) <- c(paste0("B", seq_len(5)), paste0("Q", seq_len(10)))

removeBlankRatio(m, blank_samples = paste0("B", seq_len(5)),
                 qc_samples = paste0("Q", seq_len(10)))


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