interpret_simlr_vector2.Rd
This function interprets a vector from SiMLR (similarity-driven multivariate linear reconstruction) specifically focusing on a given variable (e.g., a specific principal component or cluster). It extracts and normalizes the vector associated with the specified SiMLR variable, sorts it to identify the top elements, and optionally filters out non-significant values. This function is useful for understanding the contribution of different features in the context of the SiMLR analysis. Assumes this input is generated by antspymm_simlr.
interpret_simlr_vector2(
simlrResult,
simlrVariable,
n2show = 5,
shortnames = TRUE,
return_dataframe = FALSE
)
a specific v matrix out of SiMLR
A string specifying the variable within `simlrResult` to interpret. The variable name should include both an identifier (e.g., "PC" for principal component) and a numeric index.
An integer specifying the number of top elements to show from the sorted, normalized vector. Defaults to 5. If `NULL` or greater than the length of the vector, all elements are shown.
boolean
boolean
A named vector of the top `n2show` elements (or all if `n2show` is `NULL` or too large), sorted in decreasing order of their absolute values. Elements are named according to their identifiers in `simlrMats` and filtered to exclude non-significant values (absolute value > 0).
# This example assumes you have SiMLR result `simlrResult`, matrices `simlrMats`, and you want to
# interpret the first principal component "PC1".
# simlrResult <- list(v = list(PC = matrix(runif(20), ncol = 2)))
# simlrMats <- list(PC = matrix(runif(100), ncol = 10))
# simlrVariable <- "PC1"
# interpretedVector <- interpret_simlr_vector2(simlrResult$v[[1]] )
# print(interpretedVector)