Skip to content

Commit

Permalink
Correctly type drugs and nucleic acids in IntAct ingest
Browse files Browse the repository at this point in the history
  • Loading branch information
justaddcoffee committed Jun 11, 2020
1 parent 145c7bb commit 1620843
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions kg_covid_19/transform_utils/intact/intact.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ def __init__(self, input_dir: str = None, output_dir: str = None) -> None:
source_name = "intact"
super().__init__(source_name, input_dir, output_dir)
# interactor type to biolink category
bl_protein_cat = 'biolink:Protein'
bl_rna_cat = 'biolink:RNA'
bl_nucleic_acid = 'biolink:MolecularEntity'
bl_drug_cat = 'biolink:Drug'
self.type_to_biolink_category = {
'protein': 'biolink:Protein',
'protein': bl_protein_cat,
'peptide': bl_protein_cat,
'rna': bl_rna_cat,
'mrna': bl_rna_cat,
'snrna': bl_rna_cat
'snrna': bl_rna_cat,
'nucleic acid': bl_nucleic_acid,
'small molecule': bl_drug_cat
}
self.db_to_prefix = {
'uniprot': 'UniProtKB',
Expand Down Expand Up @@ -255,6 +261,8 @@ def interactor_to_node(self, interactor) -> List[Union[int, list]]:
interactor.getElementsByTagName('interactorType')[0].getElementsByTagName(
'shortLabel')[0].childNodes[0].data
type = type.lower()
if type == 'small molecule':
pass
if type in self.type_to_biolink_category:
category = self.type_to_biolink_category[type]
except (KeyError, IndexError, AttributeError) as e:
Expand Down

0 comments on commit 1620843

Please sign in to comment.