API

Import liana as:

import liana as li

Single-cell

Callable Ligand-Receptor Method instances

Ligand-receptor method instances provide helper functions and consistent attributes, to describe each method instance, and are callable:

liana.method.cellchat.__call__(adata, groupby)

Run a ligand-receptor method.

liana.method.cellphonedb.__call__(adata, groupby)

Run a ligand-receptor method.

liana.method.connectome.__call__(adata, groupby)

Run a ligand-receptor method.

liana.method.logfc.__call__(adata, groupby)

Run a ligand-receptor method.

liana.method.natmi.__call__(adata, groupby)

Run a ligand-receptor method.

liana.method.singlecellsignalr.__call__(...)

Run a ligand-receptor method.

liana.method.geometric_mean.__call__(adata, ...)

Run a ligand-receptor method.

liana.method.rank_aggregate.__call__(adata, ...)

Get an aggregate of ligand-receptor scores from multiple methods.

Spatial

Local bivariate metrics

liana.method.bivariate.__call__(mdata[, ...])

A method for bivariate local spatial metrics.

Learn Spatial Relationships

liana.method.MistyData(data[, obs, ...])

MistyData Class used to construct multi-view objects

liana.method.genericMistyData(intra[, ...])

Construct a MistyData object from an AnnData object with views as presented in the manuscript.

liana.method.lrMistyData(adata[, ...])

Generate a MistyData object from an AnnData object in ligand-receptor format.

Multi-Sample

liana.multi.df_to_lr(adata, dea_df, groupby, ...)

Convert DEA results to ligand-receptor pairs.

liana.multi.to_tensor_c2c([adata, ...])

Function to convert a LIANA result to a tensor for cell2cell analysis.

liana.multi.adata_to_views(adata, groupby, ...)

Converts an AnnData object to a MuData object with views that represent an aggregate for each entity in adata.obs[groupby].

liana.multi.lrs_to_views(adata[, score_key, ...])

Converts a LIANA result to a MuData object with views that represent an aggregate for each entity in adata.obs[groupby].

liana.multi.nmf([adata, df, n_components, ...])

Fits NMF to an AnnData object.

liana.multi.estimate_elbow(X, k_range[, verbose])

Visualization options

liana.plotting.dotplot([adata, uns_key, ...])

Dotplot interactions by source and target cells

liana.plotting.dotplot_by_sample([adata, ...])

A dotplot of interactions by sample

liana.plotting.tileplot([adata, liana_res, ...])

Tileplot interactions by source and target cells

liana.plotting.connectivity(adata, idx[, ...])

Plot spatial connectivity weights.

liana.plotting.target_metrics([misty, stat, ...])

Plot target metrics.

liana.plotting.contributions([misty, ...])

Plot view contributions per target.

liana.plotting.interactions([misty, ...])

Plot interaction importances.

Utility functions

liana.utils.obsm_to_adata(adata, obsm_key[, ...])

Extracts a dataframe from adata.obsm and returns a new AnnData object with the values stored in X.

liana.utils.mdata_to_anndata(mdata, x_mod, y_mod)

Convert a MultiData object to an AnnData object.

liana.utils.zi_minmax(X[, cutoff])

Zero-inflated min-max scaling.

liana.utils.neg_to_zero(X[, cutoff])

Set negative values to 0.

liana.utils.spatial_neighbors(adata[, ...])

Generate spatial connectivity weights using Euclidean distance.

liana.utils.get_factor_scores(adata[, ...])

Extract factor scores from an AnnData object.

liana.utils.get_variable_loadings(adata[, ...])

Extract variable loadings from an AnnData object.

liana.utils.interpolate_adata(target, ...[, ...])

Interpolates spatial data from a target AnnData object to a reference AnnData object based on spatial coordinates.

Prior knowledge

liana.resource.select_resource([resource_name])

Read resource of choice from the pre-generated resources in LIANA.

liana.resource.show_resources()

Show available resources.

liana.resource.generate_lr_geneset(resource, net)

Generate a ligand-receptor gene set from a resource and a network.

liana.resource.explode_complexes(resource[, ...])

Function to explode ligand-receptor complexes

liana.resource.get_metalinks([db_path, ...])

Fetches edges of metabolite-proteins with specified annotations, applying filters if they are not None.

liana.resource.describe_metalinks([db_path, ...])

Prints the schema information and foreign key details for all tables in the specified SQLite database.

liana.resource.get_metalinks_values(...[, ...])

Fetches distinct values from a specified column in a specified table.

Intracellular

liana.method.find_causalnet(prior_graph, ...)

Find the causal network that best explains the input/output node scores.

liana.method.build_prior_network(ppis, ...)

Build Prior Network from PPIs and input/output nodes.