#!/usr/bin/env python# -*- coding: utf-8 -*-## This file is part of the `pypath` python module## Copyright 2014-2023# EMBL, EMBL-EBI, Uniklinik RWTH Aachen, Heidelberg University## Authors: see the file `README.rst`# Contact: Dénes Türei (turei.denes@gmail.com)## Distributed under the GPLv3 License.# See accompanying file LICENSE.txt or copy at# https://www.gnu.org/licenses/gpl-3.0.html## Website: https://pypath.omnipathdb.org/#from__future__importannotationsfromtypingimportGenerator,Literalimportcollectionsimportpypath.resources.urlsasurlsimportpypath.share.curlascurl
[docs]defcompath_mappings(source_db:Literal['kegg','wikipathways','reactome']|None=None,target_db:Literal['kegg','wikipathways','reactome']|None=None,)->Generator[tuple]|pd.DataFrame:""" Cross-database pathway to pathway mappings from Compath. Compath contains proposed and accepted mappings by the users/curators between pairs of pathways across databases. The source and target databases specify the direction of the mapping. Args: source_db: Name of the source database. target_db: Name of the target database. return_df: Return a pandas data frame. Returns: Tuples of pathway-to-pathway mappings. """result=_compath_mappings(source_db,target_db)returnpd.DataFrame(result)ifreturn_dfelseresult