pertpy.metadata.Compound#

class Compound[source]#

Utilities to fetch metadata for compounds.

Methods table#

annotate_compounds(adata[, query_id, ...])

Fetch compound annotation from pubchempy.

lookup()

Generate LookUp object for CompoundMetaData.

Methods#

Compound.annotate_compounds(adata, query_id='perturbation', query_id_type='name', verbosity=5, copy=False)[source]#

Fetch compound annotation from pubchempy.

Parameters:
  • adata (AnnData) – The data object to annotate.

  • query_id (str, default: 'perturbation') – The column of .obs with compound identifiers.

  • query_id_type (Literal['name', 'cid'], default: 'name') – The type of compound identifiers, ‘name’ or ‘cid’.

  • verbosity (int | str, default: 5) – The number of unmatched identifiers to print, can be either non-negative values or “all”.

  • copy (bool, default: False) – Determines whether a copy of the adata is returned.

Return type:

AnnData

Returns:

Returns an AnnData object with compound annotation.

Compound.lookup()[source]#

Generate LookUp object for CompoundMetaData.

The LookUp object provides an overview of the metadata to annotate. Each annotate_{metadata} function has a corresponding lookup function in the LookUp object, where users can search the reference_id in the metadata and compare with the query_id in their own data.

Return type:

LookUp

Returns:

Returns a LookUp object specific for compound annotation.