Gene scores from multinomial elastic-net cell-type classification
Source:R/statistical_metrics.R
compute_glmnet_gene_scores.RdFits a multinomial (or binomial) elastic net (glmnet::glmnet()) that
predicts cell type from expression features. Inputs are purified
expression profiles
\(\boldsymbol{X}\in\mathcal{M}_{G\times J\times N}\) (genes \(\times\)
cell types \(\times\) samples) and length-\(J\) cell-type labels.
Variability across samples replaces synthetic isotropic noise. Gene scores
are the sum over classes of absolute coefficients at a chosen
\(\lambda\) (intercept excluded). For nested / CV selection of
\(\lambda\), see the experimental
compute_glmnet_gene_scores_cv() helper (not shipped in the package
build).
Usage
compute_glmnet_gene_scores(
expression_profiles,
celltype_labels,
alpha = 0.5,
lambda = NULL,
...
)Arguments
- expression_profiles
Numeric array \(G\times J\times N\) of purified profiles.
- celltype_labels
Character or factor labels of length \(J\) (one per cell-type slice).
- alpha
Elastic-net mixing parameter in \([0,1]\) (default
0.5).- lambda
Optional penalty value at which coefficients are extracted. When
NULL, uses the smallest \(\lambda\) on the fitted path.- ...
Additional arguments forwarded to
glmnet::glmnet().