cellflow.preprocessing.get_molecular_fingerprints

cellflow.preprocessing.get_molecular_fingerprints(adata, compound_keys, smiles_keys=None, control_value='control', uns_key_added='fingerprints', radius=4, n_bits=1024, copy=False)[source]

Computes Morgan fingerprints for compounds in adata and stores them in uns.

Parameters:
  • adata – An AnnData object.

  • compound_keys (str | list[str]) – Key(s) in obs containing the compound identifiers.

  • control_value (str) – Skip control_value (and None values).

  • smiles_keys (str | None) – Key(s) in obs containing the SMILES strings. If None, uses f"{compound_key}_smiles".

  • uns_key_added (str) – Key in uns to store the fingerprints.

  • radius (int) – Radius of the Morgan fingerprints.

  • n_bits (int) – Number of bits in the fingerprint.

  • copy (bool) – Return a copy of adata instead of updating it in place.

Return type:

None | AnnData

Returns:

: Updates uns with the computed fingerprints.

Sets the following fields:

  • .uns[uns_key_added]: Dictionary containing the fingerprints for each compound.