Skip to content

Commit

Permalink
Improve typedefs in sources
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Dec 1, 2023
1 parent cfc7924 commit 9ad4a0d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/pyobo/sources/mirbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def _process_definitions_lines(
xref_prefix, xref_identifier, xref_label = map(str.strip, line.split(";"))
xref_prefix = xref_prefix.lower()
xref_prefix = xref_mapping.get(xref_prefix, xref_prefix)
if xref_prefix == "pictar":
continue
xrefs.append(
Reference(prefix=xref_prefix, identifier=xref_identifier, name=xref_label or None)
)
Expand Down
1 change: 1 addition & 0 deletions src/pyobo/sources/mirbase_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class MiRBaseFamilyGetter(Obo):

ontology = PREFIX
bioversions_key = "mirbase"
typedefs = [has_member]

def iter_terms(self, force: bool = False) -> Iterable[Term]:
"""Iterate over terms in the ontology."""
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/sources/pombase.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PomBaseGetter(Obo):
"""An ontology representation of PomBase's fission yeast gene nomenclature."""

ontology = bioversions_key = PREFIX
typedefs = [from_species, has_gene_product]
typedefs = [from_species, has_gene_product, orthologous]

def iter_terms(self, force: bool = False) -> Iterable[Term]:
"""Iterate over terms in the ontology."""
Expand Down
13 changes: 10 additions & 3 deletions src/pyobo/struct/typedef.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,21 @@ def get_reference_tuple(relation: RelationHint) -> Tuple[str, str]:
reference=Reference(prefix="debio", identifier="0000006", name="has salt"),
)

example_of_usage = Reference(prefix=IAO_PREFIX, identifier="0000112", name="example of usage")
alternative_term = Reference(prefix=IAO_PREFIX, identifier="0000118", name="alternative term")
term_replaced_by = TypeDef.from_triple(
prefix=IAO_PREFIX, identifier="0100001", name="term replaced by"
)
example_of_usage = TypeDef.from_triple(
prefix=IAO_PREFIX, identifier="0000112", name="example of usage"
)
alternative_term = TypeDef.from_triple(
prefix=IAO_PREFIX, identifier="0000118", name="alternative term"
)
has_ontology_root_term = TypeDef.from_triple(
prefix=IAO_PREFIX, identifier="0000700", name="has ontology root term"
)
has_dbxref = TypeDef.from_curie("oboInOwl:hasDbXref", name="has database cross-reference")

editor_note = Reference(prefix=IAO_PREFIX, identifier="0000116", name="editor note")
editor_note = TypeDef.from_triple(prefix=IAO_PREFIX, identifier="0000116", name="editor note")

is_immediately_transformed_from = TypeDef.from_triple(
prefix=SIO_PREFIX, identifier="000658", name="is immediately transformed from"
Expand Down

0 comments on commit 9ad4a0d

Please sign in to comment.