mantispy.tl.enrich#
- mantispy.tl.enrich(adata, net=None, by='feature_group', method='ulm', top_fraction=0.05, copy=False, **decoupler_kwargs)#
Score every profile against every feature set.
- Parameters:
adata (
AnnData) – Profiles to score. Normalize first, since the methods use the values as given.net (
DataFrame|None(default:None)) – A decoupler network withsource,targetandweight, for example prior-knowledge sets. Built frombywhen omitted.by (
str|Sequence[str] (default:'feature_group')) – Passed tofeature_sets()whennetis not given.method (
str(default:'ulm')) –"ulm"fits a linear model per set and is the usual choice;"mlm"fits all sets jointly, which handles overlapping sets;"ora"is an over-representation test on the extremes.top_fraction (
float(default:0.05)) – Fraction of features, ranked by value, thatmethod="ora"counts as extreme. The default 0.05 tests the top twentieth against the rest. Ignored whenn_upis passed, and by"ulm"and"mlm", which use every feature.copy (
bool(default:False)) – Return a modified copy instead of mutating in place.decoupler_kwargs (
Any) – Passed through to decoupler, e.g.tminfor the smallest usable set.
- Return type:
- Returns:
None, or the modified copy. decoupler writesobsm["score_<method>"]andobsm["padj_<method>"], both frames indexed by set name.- Raises:
ValueError –
methodis not one ofMETHODS, no feature set could be built fromby, ortop_fractionis outside (0, 1).