Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For #1658 #661

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ontobio/io/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ def make_virion_component_descendents_if_not_present(self, ontology: Optional[on
def test(self, annotation: association.GoAssociation, config: assocparser.AssocParserConfig, group=None) -> TestResult:
"""
* GO:0003674 "molecular function"
* Term: GO:0005554 => relation is RO:0002327 "enables", else relation is RO:0002327 "enables" + repair,
* Term: subclass of GO:0005554 => relations: {RO:0002327 "enables", RO:0002326 "contributes_to"}, else relation is RO:0002327 "enables" + repair
* Term: GO:0003674 => relation is RO:0002327 "enables", else relation is RO:0002327 "enables" + repair,
* Term: subclass of GO:0003674 => relations: {RO:0002327 "enables", RO:0002326 "contributes_to"}, else relation is RO:0002327 "enables" + repair
* GO:0008150 "biological process"
* Term: GO:0008150 => RO:0002331 "involved_in" + repair
* Term: subclass of GO:0008150 => relations: {RO:0002331 "involved_in", RO:0002264 "acts upstream or within", RO:0004032 "acts upstream of or within, positive effect", RO:0004033 "acts upstream of or within, negative effect", RO:0002263 "acts upstream of", RO:0004034 "acts upstream of, positive effect", RO:0004035 "acts upstream of, negative effect"} else relation is RO:0002264 "acts upstream of or within" + repair
Expand All @@ -856,7 +856,7 @@ def test(self, annotation: association.GoAssociation, config: assocparser.AssocP
allowed = set()

repaired_annotation = annotation
if term == "GO:0005554":
if term == "GO:0003674":
enables = association.Curie(namespace="RO", identity="0002327")
if relation != enables:
repaired_annotation = copy.deepcopy(annotation)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,13 +714,13 @@ def test_gorule58():

def test_gorule61():
config = all_rules_config(ontology=ontology)
assoc = make_annotation(goid="GO:0005554", qualifier="enables", evidence=ikr_eco, from_gaf=False, version="1.2")
assoc = make_annotation(goid="GO:0003674", qualifier="enables", evidence=ikr_eco, from_gaf=False, version="1.2")
assert assoc.report.reporter.messages.get("gorule-0000001", []) == []
test_result = qc.GoRule61().test(assoc.associations[0], config)
assert test_result.result_type == qc.ResultType.PASS

# Using `contributes_to`, but should be repaired to RO:0002327 enables
assoc = make_annotation(goid="GO:0005554", qualifier="contributes_to", evidence=ikr_eco, from_gaf=False, version="1.2")
assoc = make_annotation(goid="GO:0003674", qualifier="contributes_to", evidence=ikr_eco, from_gaf=False, version="1.2")
test_result = qc.GoRule61().test(assoc.associations[0], config)
assert test_result.result.relation == association.Curie("RO", "0002327")
assert test_result.result_type == qc.ResultType.WARNING
Expand Down
Loading