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.rs.get_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.rs.get_metalinks#

liana.rs.get_metalinks(db_path=None, types=None, cell_location=None, tissue_location=None, biospecimen_location=None, disease=None, pathway=None, hmdb_ids=None, uniprot_ids=None, source=None, *, split=False)#

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

Overloads:
  • db_path (str | Path | None) = None, types (str | list[str] | None) = None, cell_location (str | list[str] | None) = None, tissue_location (str | list[str] | None) = None, biospecimen_location (str | list[str] | None) = None, disease (str | list[str] | None) = None, pathway (str | list[str] | None) = None, hmdb_ids (str | list[str] | None) = None, uniprot_ids (str | list[str] | None) = None, source (str | list[str] | None) = None, *, split (Literal[False]) = False → DataFrame

  • db_path (str | Path | None) = None, types (str | list[str] | None) = None, cell_location (str | list[str] | None) = None, tissue_location (str | list[str] | None) = None, biospecimen_location (str | list[str] | None) = None, disease (str | list[str] | None) = None, pathway (str | list[str] | None) = None, hmdb_ids (str | list[str] | None) = None, uniprot_ids (str | list[str] | None) = None, source (str | list[str] | None) = None, *, split (Literal[True]) → tuple[DataFrame, DataFrame, DataFrame | None]

  • db_path (str | Path | None) = None, types (str | list[str] | None) = None, cell_location (str | list[str] | None) = None, tissue_location (str | list[str] | None) = None, biospecimen_location (str | list[str] | None) = None, disease (str | list[str] | None) = None, pathway (str | list[str] | None) = None, hmdb_ids (str | list[str] | None) = None, uniprot_ids (str | list[str] | None) = None, source (str | list[str] | None) = None, *, split (bool) = False → DataFrame | tuple[DataFrame, DataFrame, DataFrame | None]

Allows filtering by lists of hmdb and uniprot IDs and avoids duplicate column names, and returns the results as a pandas DataFrame. Filters are applied using INNER JOINs and WHERE clauses - i.e. the results are the intersection of the filters.

Parameters:
db_path str | Path | None (default: None)

Path to the SQLite database file. If None, the database is fetched into scanpy.settings.datasetdir and reused from there.

types str | list[str] | None (default: None)

Desired edge types. Options are: [‘lr’, ‘pd’], where ‘lr’ stands for ‘ligand-receptor’ and ‘pd’ stands for ‘production-degradation’.

cell_location str | list[str] | None (default: None)

Desired metabolite cell locations.

tissue_location str | list[str] | None (default: None)

Desired metabolite tissue locations.

biospecimen_location str | list[str] | None (default: None)

Desired metabolite biospecimen locations.

disease str | list[str] | None (default: None)

Desired metabolite diseases.

pathway str | list[str] | None (default: None)

Desired metabolite pathways.

hmdb_ids str | list[str] | None (default: None)

Desired HMDB IDs.

uniprot_ids str | list[str] | None (default: None)

Desired UniProt IDs.

source str | list[str] | None (default: None)

Desired source databases.

split bool (default: False)

Whether to split the edges into the inputs of liana.mt.estimate_metalinks(). Requires both ‘lr’ and ‘pd’ types, which is also the default when types is None.

Returns:

If split is False, a pandas DataFrame with one row per edge and curating source, so an edge annotated by several

databases appears once per database and a per-edge mean of mor is a vote across them.

If split is True, a tuple of (resource, pd_net, t_net):

  • resource: the unique metabolite-receptor pairs of the ‘lr’ edges, with ligand and receptor columns.

  • pd_net: the ‘pd’ edges as source (metabolite), target (gene), and weight – the mean mor across curating databases, so +1 is production, -1 is degradation, and 0 is a tie that is kept.

  • t_net: the ‘pd’ edges with a transport direction, with export (‘out’) as +1 and import (‘in’) as -1, averaged per edge and with ties (0) removed; None if no such edges remain.

Examples

This function downloads MetalinksDB on first use, so it is not run here. Metabolite-receptor edges restricted to secreted metabolites are obtained with:

resource = get_metalinks(
    types=["lr"],
    biospecimen_location="Blood",
)

With split=True, the edges are instead returned as the inputs of liana.mt.estimate_metalinks():

resource, pd_net, t_net = get_metalinks(biospecimen_location="Blood", split=True)
mdata = li.mt.estimate_metalinks(adata, resource, pd_net=pd_net, t_net=t_net)

previous

liana.rs.get_hcop_orthologs

next

liana.rs.describe_metalinks

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