Skip to content

Commit

Permalink
Prepend PHARMGKB to gene IDs for which we can't find Uniprot IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
justaddcoffee committed May 11, 2020
1 parent 6e120aa commit 5577772
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kg_covid_19/transform_utils/pharmgkb/pharmgkb.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,13 @@ def make_pharmgkb_gene_node(self,
write_node_edge_item(fh=fh, header=self.node_header, data=data)

def get_uniprot_id(self,
this_id: str):
this_id: str,
pharmgkb_prefix: str='PHARMGKB'):
try:
gene_id = self.uniprot_curie_prefix + \
self.gene_id_map[this_id][self.key_parsed_ids][self.uniprot_id_key]
except KeyError:
gene_id = this_id
gene_id = pharmgkb_prefix + ":" + this_id
return gene_id

def make_pharmgkb_chemical_node(self,
Expand Down

0 comments on commit 5577772

Please sign in to comment.