Skip to content

Commit

Permalink
fix tests according to the type change for GPI 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Jul 23, 2024
1 parent 157eac5 commit aed972e
Show file tree
Hide file tree
Showing 5 changed files with 4,830 additions and 4,710 deletions.
113 changes: 113 additions & 0 deletions fixed_test.gaf
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
!gaf-version: 2.1
!
!generated-by: GOC
!
!date-generated: 2024-07-23T15:40
!
!Header from test source association file:
!=================================
MGI MGI:101757 Cfl1 GO:0051015 GO_REF:0000119 ISO UniProtKB:P23528 F cofilin 1, non-muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101757 Cfl1 GO:0007010 GO_REF:0000119 ISO UniProtKB:P23528 P cofilin 1, non-muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101757 Cfl1 GO:0022604 GO_REF:0000119 ISO UniProtKB:P23528 P cofilin 1, non-muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101757 Cfl1 GO:0030042 GO_REF:0000119 ISO UniProtKB:P23528 P cofilin 1, non-muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101757 Cfl1 GO:0044794 GO_REF:0000119 ISO UniProtKB:P23528 P cofilin 1, non-muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101757 Cfl1 GO:0061001 GO_REF:0000119 ISO UniProtKB:P23528 P cofilin 1, non-muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101757 Cfl1 GO:0005737 GO_REF:0000119 ISO UniProtKB:P23528 C cofilin 1, non-muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101759 Syt4 GO:0033604 GO_REF:0000119 ISO UniProtKB:Q9H2B2 P synaptotagmin IV gene_product taxon:10090 20240319 GO_Central
MGI MGI:101759 Syt4 GO:1903861 GO_REF:0000119 ISO UniProtKB:Q9H2B2 P synaptotagmin IV gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0000976 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0003676 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0003680 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0003906 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0008301 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0031492 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0035497 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0035500 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0035501 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0046332 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0051575 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0061629 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0070742 GO_REF:0000119 ISO UniProtKB:P52926 F high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0000122 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0001837 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0002062 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0003131 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0006284 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0006355 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0010564 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0010628 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0031507 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0035556 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0035987 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0035988 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0043066 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0043392 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0043922 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0045444 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0045869 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0045892 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0045893 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0045944 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0048333 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0048762 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0071902 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0090402 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:2000036 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:2000648 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:2001033 GO_REF:0000119 ISO UniProtKB:P52926 P high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0005634 GO_REF:0000119 ISO UniProtKB:P52926 C high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0032993 GO_REF:0000119 ISO UniProtKB:P52926 C high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0035985 GO_REF:0000119 ISO UniProtKB:P52926 C high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101761 Hmga2 GO:0071141 GO_REF:0000119 ISO UniProtKB:P52926 C high mobility group AT-hook 2 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0000978 GO_REF:0000119 ISO UniProtKB:P41970 F ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0001227 GO_REF:0000119 ISO UniProtKB:P41970 F ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0001228 GO_REF:0000119 ISO UniProtKB:P41970 F ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0032422 GO_REF:0000119 ISO UniProtKB:P41970 F ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:1990837 GO_REF:0000119 ISO UniProtKB:P41970 F ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0045892 GO_REF:0000119 ISO UniProtKB:P41970 P ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0045944 GO_REF:0000119 ISO UniProtKB:P41970 P ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0005654 GO_REF:0000119 ISO UniProtKB:P41970 C ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101762 Elk3 GO:0005739 GO_REF:0000119 ISO UniProtKB:P41970 C ELK3, member of ETS oncogene family gene_product taxon:10090 20240319 GO_Central
MGI MGI:101763 Cfl2 GO:0030042 GO_REF:0000119 ISO UniProtKB:Q9Y281 P cofilin 2, muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101763 Cfl2 GO:0030836 GO_REF:0000119 ISO UniProtKB:Q9Y281 P cofilin 2, muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101763 Cfl2 GO:0030018 GO_REF:0000119 ISO UniProtKB:Q9Y281 C cofilin 2, muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101763 Cfl2 GO:0031674 GO_REF:0000119 ISO UniProtKB:Q9Y281 C cofilin 2, muscle gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0019901 GO_REF:0000119 ISO UniProtKB:Q15078 F cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0043539 GO_REF:0000119 ISO UniProtKB:Q15078 F cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0018105 GO_REF:0000119 ISO UniProtKB:Q15078 P cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0018107 GO_REF:0000119 ISO UniProtKB:Q15078 P cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0045348 GO_REF:0000119 ISO UniProtKB:Q15078 P cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0045892 GO_REF:0000119 ISO UniProtKB:Q15078 P cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:2000273 GO_REF:0000119 ISO UniProtKB:Q15078 P cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0000307 GO_REF:0000119 ISO UniProtKB:Q15078 C cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0005654 GO_REF:0000119 ISO UniProtKB:Q15078 C cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0016533 GO_REF:0000119 ISO UniProtKB:Q15078 C cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0043231 GO_REF:0000119 ISO UniProtKB:Q15078 C cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101764 Cdk5r1 GO:0048471 GO_REF:0000119 ISO UniProtKB:Q15078 C cyclin dependent kinase 5, regulatory subunit 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0004674 GO_REF:0000119 ISO UniProtKB:Q00535 F cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0016310 GO_REF:0000119 ISO UniProtKB:Q00535 P cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0018105 GO_REF:0000119 ISO UniProtKB:Q00535 P cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0045861 GO_REF:0000119 ISO UniProtKB:Q00535 P cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0045892 GO_REF:0000119 ISO UniProtKB:Q00535 P cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0048709 GO_REF:0000119 ISO UniProtKB:Q00535 P cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0000307 GO_REF:0000119 ISO UniProtKB:Q00535 C cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0005654 GO_REF:0000119 ISO UniProtKB:Q00535 C cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0005886 GO_REF:0000119 ISO UniProtKB:Q00535 C cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0016533 GO_REF:0000119 ISO UniProtKB:Q00535 C cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101765 Cdk5 GO:0030054 GO_REF:0000119 ISO UniProtKB:Q00535 C cyclin dependent kinase 5 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101766 Ryk GO:0004888 GO_REF:0000119 ISO UniProtKB:P34925 F receptor-like tyrosine kinase gene_product taxon:10090 20240319 GO_Central
MGI MGI:101766 Ryk GO:0043410 GO_REF:0000119 ISO UniProtKB:P34925 P receptor-like tyrosine kinase gene_product taxon:10090 20240319 GO_Central
MGI MGI:101769 Mcl1 GO:0046982 GO_REF:0000119 ISO UniProtKB:Q07820 F myeloid cell leukemia sequence 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:101769 Mcl1 GO:0051434 GO_REF:0000119 ISO UniProtKB:Q07820 F myeloid cell leukemia sequence 1 gene_product taxon:10090 20240319 GO_Central
MGI MGI:103067 Atrx GO:0005515 PMID:17296936 IPI PR:Q9Z2D6 F ATRX, chromatin remodeler DXHXS6677E|Rad54|Hp1bp2|Xnp|XH2|HP1-BP38|4833408C14Rik|alpha thalassemia/mental retardation syndrome X-linked protein_coding_gene taxon:10090 20081010 MGI has_input(PR:Q9Z2D6)
MGI MGI:107157 Sin3a GO:0008134 PMID:14593184 IPI PR:Q9Z2D6 F transcriptional regulator, SIN3A (yeast) Sin3|mSin3A protein_coding_gene taxon:10090 20081010 MGI has_input(PR:Q9Z2D6)
MGI MGI:88494 Creb1 GO:0005515 PMID:18511691 IPI PR:Q9Z2D6 F cAMP responsive element binding protein 1 Creb|Creb-1|2310001E10Rik|3526402H21Rik protein_coding_gene taxon:10090 20081010 MGI has_input(PR:Q9Z2D6)
MGI MGI:99918 Mecp2 GO:0003682 PMID:18334558 IDA F methyl-CpG-binding protein 2 isoform 2 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20120126 MGI Q9Z2D6-2:PR
MGI MGI:99918 Mecp2 GO:0005634 PMID:15034150 IDA C methyl-CpG-binding protein 2 isoform 2 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20120126 MGI Q9Z2D6-2:PR
MGI MGI:99918 Mecp2 GO:0003682 PMID:18334558 IDA F methyl-CpG-binding protein 2 isoform 1 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20101014 MGI Q9Z2D6-1:PR
MGI MGI:99918 Mecp2 GO:0005634 PMID:15034150 IDA C methyl-CpG-binding protein 2 isoform 2 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20090410 MGI Q9Z2D6-2:PR
MGI MGI:99918 Mecp2 GO:0005634 PMID:18334558 IDA C methyl-CpG-binding protein 2 isoform 2 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20120126 MGI Q9Z2D6-2:PR
MGI MGI:99918 Mecp2 GO:0000792 PMID:18334558 IDA C methyl-CpG-binding protein 2 isoform 2 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20201009 MGI Q9Z2D6-2:PR
MGI MGI:99918 Mecp2 GO:0005634 PMID:18334558 IDA C methyl-CpG-binding protein 2 isoform 1 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20101014 MGI Q9Z2D6-1:PR
MGI MGI:99918 Mecp2 GO:0000792 PMID:18334558 IDA C methyl-CpG-binding protein 2 isoform 1 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20201009 MGI Q9Z2D6-1:PR
MGI MGI:99918 Mecp2 GO:0006641 PMID:30137367 IMP MGI:MGI:5584016 P methyl-CpG-binding protein 2 isoform 2 (mouse) WBP10|Mbd5|1500041B07Rik|D630021H01Rik gene_product taxon:10090 20200304 MGI Q9Z2D6-2:PR
8 changes: 4 additions & 4 deletions ontobio/io/entitywriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
from datetime import datetime

from ontobio.model.association import gp_type_label_to_curie
from ontobio.model.association import map_gp_type_label_to_curie

external_taxon = re.compile("taxon:([0-9]+)")
internal_taxon = re.compile("NCBITaxon:([0-9]+)")
Expand Down Expand Up @@ -101,8 +101,8 @@ def __init__(self, file=None, version=None):
if self.file:
if self.version == "2.0":
self.file.write("!gpi-version: 2.0\n")
self.file.write("!date_generated: {}\n".format(str(datetime.now().strftime("%Y-%m-%dT%H:%M"))))
self.file.write("!generated_by: {}\n".format("GO Central"))
self.file.write("!date_generated: " + datetime.now().strftime("%Y-%m-%dT%H:%M") + "\n")
self.file.write("!generated_by: GO Central\n")
else:
self.file.write("!gpi-version: 1.2\n")

Expand Down Expand Up @@ -154,7 +154,7 @@ def write_entity(self, entity):
entity.get('full_name'), # DB_Object_Name
entity.get('synonyms'), # DB_Object_Synonyms
# GPI spec says this is single valued, GpiParser returns list, so take the first element here.
gp_type_label_to_curie(entity.get('type')[0]), # DB_Object_Type to curie vs. label
str(map_gp_type_label_to_curie(entity.get('type')[0])), # DB_Object_Type to curie vs. label
taxon, # DB_Object_Taxon, normalized to NCBITaxon prefix
"", # Encoded_by
entity.get('parents'), # Parent_Protein
Expand Down
4 changes: 4 additions & 0 deletions ontobio/model/association.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,23 @@ def map_gp_type_label_to_curie(type_label: str) -> Curie:
global __repair_entity_type_to_curie_mapping
if type_label not in __default_entity_type_to_curie_mapping and type_label in __repair_entity_type_to_curie_mapping:
return __repair_entity_type_to_curie_mapping.get(type_label)
# if the value type_label is not in the default dictionary, then return gene_product identifier/curie.
return __default_entity_type_to_curie_mapping.get(type_label, __default_entity_type_to_curie_mapping["gene_product"])


def gp_type_label_to_curie(type: Curie) -> str:
"""
This is the reverse of `map_gp_type_label_to_curie`
"""
global __default_entity_type_to_curie_mapping
return __default_entity_type_to_curie_mapping.inverse.get(type, "gene_product")


def map_gp_type_label_to_repair_curie(type_label: str) -> Curie:
global __repair_entity_type_to_curie_mapping
return __repair_entity_type_to_curie_mapping.get(type_label)


@dataclass(unsafe_hash=True)
class Term:
"""
Expand Down
Loading

0 comments on commit aed972e

Please sign in to comment.