pertpy.metadata.Moa

pertpy.metadata.Moa#

class Moa[source]#

Utilities to fetch metadata for mechanism of action studies.

Methods table#

annotate(adata[, query_id, target, ...])

Annotate cells affected by perturbations by mechanism of action.

lookup()

Generate LookUp object for Moa metadata.

Methods#

Moa.annotate(adata, query_id='perturbation', target=None, verbosity=5, copy=False)[source]#

Annotate cells affected by perturbations by mechanism of action.

For each cell, we fetch the mechanism of action and molecular targets of the compounds sourced from clue.io.

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

  • query_id (str, default: 'perturbation') – The column of .obs with the name of a perturbagen.

  • target (str | None, default: None) – The column of .obs with target information. If set to None, all MoAs are retrieved without comparing molecular targets.

  • 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 MoA annotation.

Moa.lookup()[source]#

Generate LookUp object for Moa metadata.

The LookUp object provides an overview of the metadata to annotate.

Return type:

LookUp

Returns:

Returns a LookUp object specific for MoA annotation.