pertpy.metadata.Compound¶
Methods table¶
|
Fetch compound annotation from pubchempy. |
|
Generate LookUp object for CompoundMetaData. |
Methods¶
annotate_compounds¶
- 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
) – The column of .obs with compound identifiers. Defaults to ‘perturbation’.query_id_type (
Literal
['name'
,'cid'
]) – The type of compound identifiers, ‘name’ or ‘cid’. Defaults to ‘name’.verbosity (
int
|str
) – The number of unmatched identifiers to print, can be either non-negative values or “all”. Defaults to 5.copy (
bool
) – Determines whether a copy of the adata is returned. Defaults to False.
- Return type:
- Returns:
Returns an AnnData object with compound annotation.
lookup¶
- 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.