liana.method.AggregateClass#

class liana.method.AggregateClass(_SCORE, methods)#

LIANA’s Method Consensus Class

Parameters:
  • _SCORE (Method) – Scoring method instance

  • methods (list[Method]) – List of method instances to aggregate

_SCORE#

Scoring method instance

methods#

List of method instances to aggregate

specificity_specs#

Collection of method specificity’s specifications

magnitude_specs#

Collection of method magnitudes’ specifications

add_cols#

Additional columns required for each method

complex_cols#

Columns relevant for protein complexes for each method

Attributes table#

Methods table#

by_sample(adata, sample_key[, key_added, ...])

Run a method by sample.

describe()

Briefly describes the method

get_meta()

Returns method metadata as pandas row

getdoc()

reference()

Prints out reference in Harvard format

Attributes#

AggregateClass.instances: list = [<weakproxy at 0x760ec19c81d0 to MethodMeta>, <weakproxy at 0x760ec19c82c0 to Method>, <weakproxy at 0x760ec0a93c90 to MethodMeta>, <weakproxy at 0x760ec0a930b0 to Method>, <weakproxy at 0x760ec0a93dd0 to MethodMeta>, <weakproxy at 0x760ec0a93e70 to Method>, <weakproxy at 0x760ec0a93c40 to MethodMeta>, <weakproxy at 0x760ec0a93f60 to Method>, <weakproxy at 0x760ec0a93f10 to MethodMeta>, <weakproxy at 0x760ec0ab4270 to Method>, <weakproxy at 0x760ec0ab43b0 to MethodMeta>, <weakproxy at 0x760ec0ab44f0 to Method>, <weakproxy at 0x760ec0ab49a0 to MethodMeta>, <weakproxy at 0x760ec0ab48b0 to MethodMeta>, <weakproxy at 0x760ec0ab46d0 to Method>, <weakproxy at 0x760ec0ab4a40 to MethodMeta>, <weakproxy at 0x760ec0ab4a90 to Method>, <weakproxy at 0x760ec1d4bd30 to AggregateClass>]#

Methods#

AggregateClass.by_sample(adata, sample_key, key_added='liana_res', inplace=True, verbose=False, **kwargs)#

Run a method by sample.

Parameters:
  • adata (AnnData | MuData) – Annotated data object.

  • sample_key (str) – key in adata.obs to use for grouping by sample or context.

  • key_added (str (default: 'liana_res')) – Key under which the results will be stored in adata.uns if inplace is True.

  • inplace (bool (default: True)) – Whether to store results in place, or else to return them.

  • verbose (bool (default: False)) – Possible values: False, True, ‘full’, where ‘full’ will print the results for each sample, and True will only print the sample progress bar. Default is False.

  • **kwargs – Keyword arguments to pass to the method

Raises:

ValueError – If sample_key is not present in adata.obs

Return type:

DataFrame | None

Returns:

A pandas DataFrame with the results and a column sample is stored in adata.uns[key_added] if inplace is True, else the DataFrame is returned.

AggregateClass.describe()#

Briefly describes the method

AggregateClass.get_meta()#

Returns method metadata as pandas row

AggregateClass.getdoc() str | None#
AggregateClass.reference()#

Prints out reference in Harvard format