Correlate network features with an external score
Source:R/statistical_analysis.R
correlate_features_with_score.RdComputes the Spearman correlation between an external per-patient score (e.g. an immune response score) and every feature column, pooled across all patients ("All") and, optionally, within each group separately.
Arguments
- feature_matrix
Numeric matrix or data frame with patients in rows (identified by
rownames()) and features in columns.- score
Named numeric vector of per-patient scores. Names must match
rownames(feature_matrix); patients missing a score are dropped.- group
Optional grouping vector (e.g. cancer type or cohort), in the same row order as
feature_matrix. When supplied, correlations are also computed separately within each group.- p_adjust_method
Multiple-testing correction method passed to
stats::p.adjust().