Skip to main content
Ctrl+K
liana - Home liana - Home

Getting started

  • Installation
  • Quickstart

Guides

  • Tutorials
    • Prior knowledge

      • Prior Knowledge
    • Dissociated single-cell data

      • Differential Expression Analysis for CCC & Downstream Signalling Networks
      • Comparative Cell-Cell Communication with LIANA+ and CrossTalkeR
      • Intercellular Context Factorization with MOFA
      • MOFAcellular - Multicellular Factor Analysis
      • Intercellular Context Factorization with Tensor-Cell2cell
    • Spatially-resolved data

      • Spatially-informed Bivariate Metrics
      • Learning Spatial Relationships with MISTy
      • Inferring Cell–Cell Interactions at Single Cell Resolution
      • Inflow & MOFA-Flex: Spatially-Resolved Cell-Cell Communication Programs
      • Ligand-Receptor Interaction Correlation (LRIC)
    • Multi-modal data

      • Multi-Modal Ligand-Receptor Inference
      • Integrating Multi-Modal Spatially-Resolved Technologies with LIANA+

Reference

  • API
    • Preprocessing (li.pp)

      • liana.pp.obsm_to_adata
      • liana.pp.zi_minmax
      • liana.pp.neg_to_zero
      • liana.pp.spatial_neighbors
      • liana.pp.spatial_pair_proximity
      • liana.pp.expand_coordinates
      • liana.pp.query_bandwidth
      • liana.pp.interpolate_adata
    • Multi-Sample (li.ms)

      • liana.ms.to_tensor_c2c
      • liana.ms.adata_to_views
      • liana.ms.lrs_to_views
      • liana.ms.lrdata_to_mudata
      • liana.ms.filter_view_markers
      • liana.ms.nmf
      • liana.ms.estimate_elbow
      • liana.ms.get_factor_scores
      • liana.ms.get_variable_loadings
      • liana.ms.mdata_to_anndata
    • Prior knowledge (li.rs)

      • liana.rs.select_resource
      • liana.rs.show_resources
      • liana.rs.generate_lr_geneset
      • liana.rs.translate_resource
      • liana.rs.translate_column
      • liana.rs.get_hcop_orthologs
      • liana.rs.get_metalinks
      • liana.rs.describe_metalinks
      • liana.rs.get_metalinks_values
      • liana.rs.build_prior_network
    • Datasets (li.ds)

      • liana.ds.kang_2018
      • liana.ds.kuppe_2022
      • liana.ds.citeseq_pbmc5k
      • liana.ds.vicari_2024
      • liana.ds.yao_2023
      • liana.ds.generate_toy_adata
      • liana.ds.generate_toy_spatial
      • liana.ds.generate_toy_mdata
      • liana.ds.sample_lrs
    • Visualization (li.pl)

      • liana.pl.dotplot
      • liana.pl.dotplot_by_sample
      • liana.pl.tileplot
      • liana.pl.elbow
      • liana.pl.circle_plot
      • liana.pl.connectivity
      • liana.pl.misty_target_metrics
      • liana.pl.misty_contributions
      • liana.pl.misty_interactions
      • liana.pl.annulus
      • liana.pl.lric_lineplot
      • liana.pl.lric_divergence
      • liana.pl.feature_by_group
  • About LIANA+

Project

  • Changelog
  • Contributing guide
  • Citation
  • Bibliography
  • GitHub
  • Discourse
  • API
  • liana.mt.estimate_metalinks
  • GitHub
  • Discourse
  • scverse.org
  • Core
  • AnnData
  • decoupler
  • MuData
  • Muon
  • Pertpy
  • rapids-singlecell
  • Scanpy
  • Scirpy
  • scvi-tools
  • SnapATAC2
  • SpatialData
  • Squidpy
  • Ecosystem
  • AESTETIK
  • AlphaPeptTools
  • AmbiDose
  • annbatch
  • anndata for R
  • anndataR
  • annsel
  • AnnZarro
  • ATLAS
  • benGRN
  • bento-tools
  • biolord
  • cell2location
  • Cell_BLAST
  • CellAnnotator
  • CellCharter
  • CellMapper
  • CellOracle
  • CellphoneDB
  • CellRank
  • cellxgene
  • Cirrocumulus
  • clone2vec
  • cuspa
  • dandelion
  • delnx
  • DOTools_py
  • DoubletDetection
  • DRVI
  • dvp-io
  • dynamo-release
  • epiScanpy
  • eschr
  • fava
  • flashdeconv
  • flowsom
  • GATAC
  • GPTBioInsightor
  • grassp
  • GRnnData
  • gssnng
  • harpy
  • hotspot
  • illico
  • infercnvpy
  • kompot
  • LazySlide
  • liana
  • mantispy
  • Marsilea
  • maxspin
  • moscot
  • Mowgli
  • Multivelo
  • ncountr
  • NicheNetPy
  • nichepca
  • novae
  • omicverse
  • Palantir
  • Panpipes
  • ParTIpy
  • PathML
  • pcdl
  • PEAKQC
  • pegasus
  • PILOT
  • popV
  • pycea
  • pychromVAR
  • pyCrossTalkeR
  • PyDESeq2
  • pyLemur
  • pySCENIC
  • pytximport
  • pyUCell
  • Rectangle
  • SC2Spa
  • SCALEX
  • scanpro
  • scATrans
  • scCellFie
  • scDataLoader
  • scFair
  • scFates
  • scGen
  • schist
  • scib
  • scib-metrics
  • scib-rapids
  • scmcp
  • scPRINT
  • scPRINT-2
  • scTriangulate
  • scVelo
  • scviva-tools
  • scxmatch
  • scXpand
  • scyan
  • sift-sc
  • sincei
  • Sobolev Alignment
  • sopa
  • spatial-eggplant
  • spatialdataR
  • spatialproteomics
  • spatiomic
  • STMiner
  • Symphonypy
  • tangram
  • TAU Community Detection
  • TreeData
  • vitessce
  • wsidata
  • zellkonverter

liana.mt.estimate_metalinks#

liana.mt.estimate_metalinks(adata, resource, pd_net, t_net=None, x_name='metabolite', y_name='receptor', use_raw=False, layer=None, verbose=False, **kwargs)#

Estimate Metabolites from anndata object, and return a MuData object of metabolites and receptors.

Parameters:
adata AnnData

Annotated data matrix.

resource DataFrame

Resource to use for ligand-receptor inference, with the metabolites in a ligand (or source) column and the receptors in the y_name column, e.g. as returned by liana.rs.get_metalinks() with split=True.

pd_net DataFrame

Metabolic production-degradation network to use.

t_net DataFrame | None (default: None)

Transport set to use.

x_name str (default: 'metabolite')

Name of the metabolite modality.

y_name str (default: 'receptor')

Name of the receptor modality. Must be present as a column in the resource.

use_raw bool (default: False)

Whether to use the .raw attribute of adata. Defaults to False (uses .X).

layer str | None (default: None)

Layer in anndata.AnnData.layers to use. If None, use anndata.AnnData.X.

verbose bool | None (default: False)

Verbosity flag. False, the default, hides progress and info messages but still warns about data-altering conditions; True shows both; None silences everything, warnings included.

**kwargs object

Additional arguments to pass to the decoupler-py functions. Method-specific arguments are not supported.

Return type:

MuData

Returns:

A MuData object with metabolite & receptor assays.

Examples

pd_net is a metabolite-to-enzyme network whose weights say whether a gene produces (+) or degrades (-) a metabolite, and resource links metabolites to their receptors. Both normally come from MetalinksDB (see liana.rs.get_metalinks()); toy ones are built here so the example stays offline:

>>> import numpy as np
>>> import pandas as pd
>>> import liana as li
>>> adata = li.ds.generate_toy_adata()
>>> genes = adata.var_names[:16].tolist()
>>> pd_net = pd.DataFrame({"source": np.repeat(["HMDB0000122", "HMDB0000148"], 8), "target": genes, "weight": 1.0})
>>> resource = pd.DataFrame({"ligand": ["HMDB0000122", "HMDB0000148"], "receptor": ["CD4", "ITGB2"]})
>>> mdata = li.mt.estimate_metalinks(adata, resource=resource, pd_net=pd_net)

Metabolite abundances are estimated from the enzyme expression and returned in a 'metabolite' modality, next to the receptors in a 'receptor' one. Pass t_net to additionally require a transporter for metabolites that cannot cross the membrane on their own. The result is the input to liana.mt.bivariate or to any single-cell method, with x_mod='metabolite' and y_mod='receptor'. The metabolite scores are signed activities, so any liana single-cell method would need the scores to be pre-transformed.

previous

liana.mt.find_causalnet

next

liana.mt.df_to_lr

On this page
  • estimate_metalinks()
Edit on GitHub
Show Source
© 2026, the LIANA+ developers scverse is a NumFOCUS affiliated project. Governance · Discourse · Get involved