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)#
Fetches edges of metabolite-proteins with specified annotations, applying filters if they are not 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 will be downloaded to the current working directory.
- 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.
- db_path
- Return type:
- Returns:
A pandas DataFrame containing the query results without the source column.
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", )