torchcell.paper.tables.phenotype_descriptor

phenotype_descriptor(record: dict[str, Any]) → tuple[str, str][source]

Derive (shape, graph_role) for one record from its stored instance.

shape is the shape of a SINGLE phenotype instance: scalar or vector (D) (a length-1 vector is a scalar). graph_role is where the label sits in the cell graph: global / node / bipartite node (from graph_level), or – for a gene interaction – edge when it relates two gene nodes and hyperedge when it relates three or more, derived from the number of perturbations (so a digenic interaction reads edge and a trigenic one hyperedge, regardless of the stored graph_level). Everything is read from the record, never hand-authored.