mantispy.tl.feature_signature#
- mantispy.tl.feature_signature(adata, key='differential', by=('feature_group', 'channel', 'object'), statistic='t')#
Collapse a differential table into a perturbation-by-feature-family matrix.
- Parameters:
adata (
AnnData) – Object carryinguns["mantispy"][key], as written bydifferential_features().key (
str(default:'differential')) – Which table to collapse.by (
Sequence[str] (default:('feature_group', 'channel', 'object'))) –varcolumns whose combination names a family. The default is the feature group, the channel it was measured in, and the compartment it was measured on.statistic (
str(default:'t')) – Column of the table to average within each family, such as"t"or"difference"(the raw contrast).
- Return type:
- Returns:
A new
AnnDataof perturbations by families, with each family’sbycolumns andn_featuresinvar. It is a perturbation-level profile object, sosc.pp.neighbors,sc.tl.leidenandnn_moa_classify()accept it.- Raises:
KeyError –
uns["mantispy"][key]is missing, that table has nostatisticcolumn, orvaris missing one of thebycolumns.
Notes
Signed statistics are averaged, so a family that decreased stays distinct from one that increased. On BBBC021, microtubule stabilizers score +2.2 on
Intensity|CorrTub|Nuclei, while destabilizers score +1.4 onIntensity|CorrActin|Nucleiwith no tubulin signal; as the microtubules come apart the cells round up, which is the largest remaining change.