Skip to content

Commit

Permalink
Merge pull request #603 from monarch-initiative/issue-830-add-go-publ…
Browse files Browse the repository at this point in the history
…ications

Populate publications for GO annotation ingest, plus update tests & doc to match
  • Loading branch information
kevinschaper authored Oct 14, 2024
2 parents 81d8561 + a2c4afc commit 743fdab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/Sources/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ __**Associations**__
* object (go_term.id)
* negated
* has_evidence
* publications
* aggregating_knowledge_source (["infores:monarchinitiative"])
* primary_knowledge_source

Expand All @@ -55,6 +56,7 @@ OR
* object (go_term.id)
* negated
* has_evidence
* publications
* aggregating_knowledge_source (["infores:monarchinitiative"])
* primary_knowledge_source

Expand All @@ -65,6 +67,7 @@ OR
* object (go_term.id)
* negated
* has_evidence
* publications
* aggregating_knowledge_source (["infores:monarchinitiative"])
* primary_knowledge_source

Expand All @@ -75,6 +78,7 @@ OR
* object (go_term.id)
* negated
* has_evidence
* publications
* aggregating_knowledge_source (["infores:monarchinitiative"])
* primary_knowledge_source

Expand All @@ -87,6 +91,7 @@ __**Possible Additional Gene to Gene Ontology Term Association?**__
* object (go_term.id)
* negated
* has_evidence
* publications
* aggregating_knowledge_source (["infores:monarchinitiative"])
* primary_knowledge_source

Expand Down
4 changes: 3 additions & 1 deletion src/monarch_ingest/ingests/go/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
)
from loguru import logger


koza_app = get_koza_app("go_annotation")

# for row in koza_app.source: # doesn't play nice with tests
Expand Down Expand Up @@ -101,6 +100,8 @@
# actual primary knowledge source of the GOA knowledge statement
assigned_by = get_infores(row['Assigned_By'])

publications = [p.replace('MGI:MGI:','MGI:') for p in row['DB_Reference'].split("|")] if row['DB_Reference'] else []

# Instantiate the appropriate Gene-to-GO Term instance
association = gene_go_term_association_class(
id="uuid:" + str(uuid.uuid1()),
Expand All @@ -109,6 +110,7 @@
predicate=predicate,
negated=negated,
has_evidence=[eco_term],
publications=publications,
# subject_context_qualifier=ncbitaxa, # Biolink Pydantic model support missing for this slot
aggregator_knowledge_source=["infores:monarchinitiative"],
primary_knowledge_source=assigned_by,
Expand Down
1 change: 1 addition & 0 deletions src/monarch_ingest/ingests/go/annotation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ edge_properties:
- 'negated'
- 'has_evidence'
- 'object'
- 'publications'
- 'aggregator_knowledge_source'
- 'primary_knowledge_source'
- 'knowledge_level'
Expand Down
1 change: 1 addition & 0 deletions tests/unit/go/test_go_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@ def test_mgi_curie(mgi_entities):
association = [association for association in mgi_entities if isinstance(association, Association)][0]
assert association
assert association.subject == "MGI:1918911"
assert association.publications == ["MGI:2156816", "GO_REF:0000015"]
assert association.primary_knowledge_source == "infores:mgi"
assert "infores:monarchinitiative" in association.aggregator_knowledge_source

0 comments on commit 743fdab

Please sign in to comment.