Skip to content

Commit

Permalink
Add taxon & taxon label fields for subject & object (#228)
Browse files Browse the repository at this point in the history
Adds subject_taxon, subject_taxon_label, object_taxon,
object_taxon_label fields
  • Loading branch information
kevinschaper authored Jul 18, 2023
1 parent 73303b5 commit 8b38a7a
Show file tree
Hide file tree
Showing 19 changed files with 10,466 additions and 3,553 deletions.
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "monarch-py"
version = "0.13.4"
version = "0.13.5"
description = "Python package for interacting with Monarch Initiative knowledge graph"
authors = [
"glass-ships <[email protected]>",
Expand Down
8 changes: 8 additions & 0 deletions backend/src/monarch_py/datamodels/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class Association(ConfiguredBaseModel):
default_factory=list,
description="""Field containing subject name and the names of all of it's ancestors""",
)
subject_taxon: Optional[str] = Field(None)
subject_taxon_label: Optional[str] = Field(None)
predicate: str = Field(...)
object: str = Field(...)
original_object: Optional[str] = Field(None)
Expand All @@ -74,6 +76,8 @@ class Association(ConfiguredBaseModel):
default_factory=list,
description="""Field containing object name and the names of all of it's ancestors""",
)
object_taxon: Optional[str] = Field(None)
object_taxon_label: Optional[str] = Field(None)
primary_knowledge_source: Optional[str] = Field(None)
aggregator_knowledge_source: Optional[List[str]] = Field(default_factory=list)
category: Optional[str] = Field(None)
Expand Down Expand Up @@ -204,6 +208,8 @@ class DirectionalAssociation(Association):
default_factory=list,
description="""Field containing subject name and the names of all of it's ancestors""",
)
subject_taxon: Optional[str] = Field(None)
subject_taxon_label: Optional[str] = Field(None)
predicate: str = Field(...)
object: str = Field(...)
original_object: Optional[str] = Field(None)
Expand All @@ -218,6 +224,8 @@ class DirectionalAssociation(Association):
default_factory=list,
description="""Field containing object name and the names of all of it's ancestors""",
)
object_taxon: Optional[str] = Field(None)
object_taxon_label: Optional[str] = Field(None)
primary_knowledge_source: Optional[str] = Field(None)
aggregator_knowledge_source: Optional[List[str]] = Field(default_factory=list)
category: Optional[str] = Field(None)
Expand Down
12 changes: 12 additions & 0 deletions backend/src/monarch_py/datamodels/model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ classes:
- subject_closure
- subject_label
- subject_closure_label
- subject_taxon
- subject_taxon_label
- predicate
- object
- original_object
Expand All @@ -42,6 +44,8 @@ classes:
- object_closure
- object_label
- object_closure_label
- object_taxon
- object_taxon_label
- primary_knowledge_source
- aggregator_knowledge_source
- category
Expand Down Expand Up @@ -401,6 +405,10 @@ slots:
subject_closure_label:
multivalued: true
description: Field containing subject name and the names of all of it's ancestors
subject_taxon:
is_a: in_taxon
subject_taxon_label:
is_a: in_taxon_label
object_label:
is_a: name
description: The name of the object entity
Expand All @@ -416,6 +424,10 @@ slots:
object_closure_label:
multivalued: true
description: Field containing object name and the names of all of it's ancestors
object_taxon:
is_a: in_taxon
object_taxon_label:
is_a: in_taxon_label
frequency_qualifier_label:
is_a: name
description: The name of the frequency_qualifier entity
Expand Down
6 changes: 3 additions & 3 deletions backend/tests/fixtures/association_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ def association_counts():
"items": [
{
"label": "Phenotypes",
"count": 4011,
"count": 4312,
"category": "biolink:DiseaseToPhenotypicFeatureAssociation",
},
{
"label": "Causal Genes",
"count": 121,
"count": 123,
"category": "biolink:CausalGeneToDiseaseAssociation",
},
{
"label": "Correlated Genes",
"count": 147,
"count": 149,
"category": "biolink:CorrelatedGeneToDiseaseAssociation",
},
]
Expand Down
Loading

0 comments on commit 8b38a7a

Please sign in to comment.