index_reference: Index Reference for Selecting Features

View source: R/1a-propr-backend.R

index_referenceR Documentation

Index Reference for Selecting Features

Description

This function computes an index reference for selecting features from the input count matrix based on the provided 'ivar' argument. The index reference can be obtained using different options, such as selecting all features, using a user-defined vector of indices, selecting features by name, using the "clr" transformation, or computing the IQLR (Interquartile Range Log Ratio) features.

Usage

index_reference(counts, ivar)

Arguments

counts

A data matrix representing counts. It is assumed that the matrix contains numerical values only.

ivar

An indicator specifying the method for log-ratio transformation. It can take the following values: - "clr" (default): Centered log-ratio transformation. - "alr": Additive log-ratio transformation ("pcor.bshrink" metric only). - "iqlr": Inter-quartile log-ratio transformation from ALDEx2. - The explicit name(s) of variable(s) to use as a reference. Use NA to skip log-ratio transformation.

Value

A numeric vector representing the indices of features selected.

Examples

# Sample input count data
data <- matrix(c(1, 2, 3, 4, 0, 6), nrow = 2, byrow = TRUE)

# Index reference using all features
all_features <- index_reference(data, ivar = "all")

# Index reference using custom numeric vector
custom_indices <- index_reference(data, ivar = c(1, 3))

# Index reference using IQLR features
iqlr_features <- index_reference(data, ivar = "iqlr")


tpq/propr documentation built on April 21, 2024, 12:50 p.m.