Skip to content

Commit

Permalink
inputs.reactome: create URL from parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Feb 11, 2025
1 parent 581662a commit 5fb1180
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions pypath/inputs/reactome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,33 @@ def _reactome_txt(fname: str, colnames: list[str]) -> Generator[tuple]:
yield from csv.DictReader(c.fileobj, delimiter='\t', fieldnames=colnames)


def reactome_raw():
def reactome_raw(
id_type: str,
physical_entities: bool = False,
event_type: Literal['all', 'lowest', 'reaction'],
) -> Generator[tuple]:

IDTYPES = {
'uniprot': 'UniProt',
'ensembl': 'Ensembl',
'entrez': 'NCBI',
'mirbase': 'miRBase',
'gtop': 'GtoP',
'chebi': 'ChEBI',
}
EVENT_TYPES = {
'lowest': 'Pathway',
'all': 'All_levels',
'reaction': 'Reactions',
}

colnames = ['id', 'pathway_id', 'url', 'pathway_name', 'evidence_code', 'species']
yield from _reactome_txt(fname='ChEBI2Reactome_PE_All_Levels', colnames=colnames)

fname = f'{id_type}2Reactome{pe}{event_type}'

yield from _reactome_txt(
fname = 'ChEBI2Reactome_PE_All_Levels',
colnames = colnames,
)


0 comments on commit 5fb1180

Please sign in to comment.