liana.mt.AggregateClass#

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

LIANA’s Method Consensus Class

Parameters:
_SCORE MethodMeta

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

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()

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 | None | Literal['full'] (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 object

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

Return type:

None

AggregateClass.get_meta()#

Returns method metadata as pandas row

Return type:

DataFrame

AggregateClass.getdoc() → str | None#