From c6eccf425a4967530662a3fdd482f363d7dbc128 Mon Sep 17 00:00:00 2001 From: leungmanhin Date: Tue, 21 Apr 2020 20:34:28 +0800 Subject: [PATCH] Generate the EvaluationLinks for Uniprot and gene --- tcmid.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tcmid.py b/tcmid.py index 8ceb695..57b496a 100644 --- a/tcmid.py +++ b/tcmid.py @@ -175,4 +175,22 @@ def is_available(entry): chebi_fp.close() + for line in lines: + print("--- Reading line: " + line) + if is_available(line): + contents = line.split("\t") + ingredient = contents[0].lower().strip() + chebi_id = chebi_dict.get(ingredient) + uniprot_id = contents[2] + gene = contents[3] + omim_ids = contents[4].split(";") + drug_ids = contents[5].split(";") + + if is_available(chebi_id): + chebi_id_full = "ChEBI:" + chebi_id + if is_available(uniprot_id): + evalink("interacts_with", "MoleculeNode", "MoleculeNode", chebi_id_full, uniprot_id) + if is_available(gene): + evalink("interacts_with", "MoleculeNode", "GeneNode", chebi_id_full, gene) + out_fp.close()