omicverse.metabol.aggregate_by_class#
- omicverse.metabol.aggregate_by_class(adata, *, agg='sum')[source]#
Collapse the matrix to class-level totals.
adata.var['lipid_class']must already exist (runannotate_lipidsfirst). Returns a new AnnData withn_vars = n_lipid_classesand per-sample class totals in.X. Handy for quick-look class-level QC and for some regression models.- Return type: