grassp.tl.resolve_diffusion#
- resolve_diffusion(data, gene_sets, key_added='ann_diffusion', mode='likelihood', min_term_size=0, term_threshold=0.5, eta=1.0, tau=0.4, maxk=3, cap=12, nest_threshold=0.8, gene_key='gene_symbol', species='hsap', out_key=None, inplace=True)[source]#
(Re)resolve stored diffusion probabilities into a per-protein label, in place.
Reads
obsm[{key_added}_probabilities](written byindependent_diffusion()) and writesobs[out_key]andobs[f"{out_key}_label_compact"].out_keydefaults tokey_addedfor likelihood/argmax – overwriting the primary call, since that is what re-resolving means – and tof"{key_added}_specific"for specific, so an alternative resolution sits beside the default rather than replacing it. The resolver parameters are as inindependent_diffusion();gene_setsmust be the vocabulary that was diffused (it defines the nesting). Re-resolving with the same parameters reproduces the stored call exactly. Lets you obtain several resolutions (e.g. likelihood and specific) or sweepmin_term_sizewithout re-diffusing. Withinplace=Falsethe labels are written to a copy, which is returned.