R/subtyper.R
adjust_assoc_matrix.Rd
This function takes a feature × domain association matrix and applies different methods to control for global/shared correlation structure (e.g., some features are globally correlated with all domains). It then provides domain assignments based on the adjusted scores.
adjust_assoc_matrix(
assoc_mat,
method = c("none", "row_normalize", "col_normalize", "both_normalize", "pc1_regress",
"glasso"),
lambda = 0.1,
return_scores = FALSE
)
A numeric matrix of size (features × domains).
A character string specifying adjustment method. Options: - "none" (raw associations) - "row_normalize" (z-score across rows) - "col_normalize" (z-score across columns) - "both_normalize" (z-score rows and columns) - "pc1_regress" (remove 1st principal component effect) - "glasso" (apply graphical lasso for partial correlations).
Numeric penalty parameter for glasso (only used if method="glasso").
Logical; if TRUE, return the full adjusted score matrix. If FALSE, return only best assignments per feature.
If return_scores=FALSE, a character vector of assigned domains (one per feature). If TRUE, a list with: - adjusted_matrix: the adjusted score matrix - assignments: best-matching domain per feature