torchcell.datamodels.identity.compound_identity_key

compound_identity_key(compound: Compound) → str[source]

The join key for a compound, as "<field>:<value>".

Precedence: inchikey, else chebi_id, else pubchem_cid, else the normalized lowercase name (normalize_compound_name, the same folding the environment collision check uses, so ‘NaCl’ and ‘sodium chloride’ agree even with no identifier on either side). The field name is part of the key, so a name that happens to be spelled like an InChIKey cannot collide with a real one.