omicverse-bulk-metabol-multivariate
Installation
SKILL.md
OmicVerse Bulk Metabolomics — Multivariate & Biomarker
Goal
Given a preprocessed metabolomics AnnData (output of the omicverse-bulk-metabol-preprocessing skill), discriminate two groups with PLS-DA / OPLS-DA, rank features by VIP, inspect the OPLS-DA S-plot, then build and validate a biomarker panel via per-feature ROC AUC and nested-CV multi-metabolite classification with a permutation null. The output is a ranked feature list, model-quality metrics (R²X / R²Y / Q² / mean AUC / permutation p-value), and an actionable biomarker panel.
This skill is discrimination + biomarker selection only. Imputation / normalization / transformation belong in the preprocessing skill; pathway interpretation of the resulting hits belongs in the pathway-multifactor skill.
Quick Workflow
- Confirm the input
AnnDatahas been PQN-normalized + log-transformed + Pareto-scaled. Multivariate models on un-Pareto-scaled data are dominated by a few high-intensity features. - Fit
ov.metabol.plsda(...)first as a baseline; inspectr2x,r2y,q2. A positiveQ²is the minimum bar for a model that beats mean prediction. - Fit
ov.metabol.opls_da(n_ortho=1)to separate group-discriminating signal (predictive component) from within-group variation (orthogonal components). Comparer2y/q2against the PLS-DA baseline. - Pull the VIP table with
result.to_vip_table(adata.var_names)and visualize the top features withov.metabol.vip_bar(...). - Run
ov.metabol.s_plot(...)to see covariance vs. correlation against the predictive component — features in the corners are robust biomarker candidates. - For biomarker selection: get per-feature univariate AUC + bootstrap CI with
ov.metabol.roc_feature(...). - Build a multi-metabolite panel with
ov.metabol.biomarker_panel(...)using nested CV; include a permutation null to test whether the panel beats random feature selection. - Plot the held-out ROC curve from
panel.outer_predictions/panel.outer_labelsfor the report.