View source: R/1a-propr-backend.R
index_reference | R Documentation |
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.
index_reference(counts, ivar)
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) or index(es) of variable(s) to use as a reference. - Use NA to skip log-ratio transformation and any other pre-processing, like zero replacement. This is useful when the input data is already pre-processed. |
A numeric vector representing the indices of features selected.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.