Skip to content

Commit

Permalink
Merge pull request #649 from biolink/go-site-2002-gorule-0000061-fix-…
Browse files Browse the repository at this point in the history
…for-obsolete-terms

Reverting FAIL to OKAY since obsolete terms have no namespace
  • Loading branch information
kltm authored Oct 7, 2023
2 parents 9247bf1 + f079f69 commit 615de60
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ontobio/io/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,8 @@ def test(self, annotation: association.GoAssociation, config: assocparser.AssocP
else:
# If we reach here, we're in a weird case where a term is not in either
# of the three main GO branches, or does not have a namespace defined.
return TestResult(repair_result(RepairState.FAILED, self.fail_mode), "{}: {}".format(self.message(repair_state), "GO term has no namespace"), annotation)
# If this is the case we should just pass along as if the ontology is missing
return TestResult(repair_result(RepairState.OKAY, self.fail_mode), "{}: {}".format(self.message(repair_state), "GO term has no namespace"), annotation)

allowed_str = ", ".join([str(a) for a in allowed])
return TestResult(repair_result(repair_state, self.fail_mode), "{}: {} should be one of {}".format(self.message(repair_state), relation, allowed_str), repaired_annotation)
Expand Down
57 changes: 57 additions & 0 deletions tests/resources/goslim_generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -4939,6 +4939,63 @@
},
"type" : "CLASS",
"lbl" : "oxidoreductase activity"
}, {
"id" : "http://purl.obolibrary.org/obo/GO_0006850",
"meta" : {
"definition" : {
"val" : "The process in which pyruvate is transported across a mitochondrial membrane, into or out of the mitochondrion.",
"xrefs" : [ "GOC:vw", "PMID:22628558" ]
},
"synonyms" : [ {
"pred" : "hasRelatedSynonym",
"val" : "pyruvate transmembrane transport in mitochondria",
"xrefs" : [ ]
}, {
"pred" : "hasRelatedSynonym",
"val" : "pyruvate transmembrane transport in mitochondrion",
"xrefs" : [ ]
}, {
"pred" : "hasRelatedSynonym",
"val" : "mitochondrial pyruvate transport",
"xrefs" : [ ]
}, {
"pred" : "hasRelatedSynonym",
"val" : "pyruvate membrane transport in mitochondria",
"xrefs" : [ ]
}, {
"pred" : "hasRelatedSynonym",
"val" : "pyruvate membrane transport in mitochondrion",
"xrefs" : [ ]
} ],
"basicPropertyValues" : [ {
"pred" : "http://www.geneontology.org/formats/oboInOwl#creation_date",
"val" : "2013-08-15T11:19:35Z"
}, {
"pred" : "http://www.geneontology.org/formats/oboInOwl#hasAlternativeId",
"val" : "GO:1902361"
}, {
"pred" : "http://www.geneontology.org/formats/oboInOwl#hasOBONamespace",
"val" : "biological_process"
}, {
"pred" : "http://www.geneontology.org/formats/oboInOwl#created_by",
"val" : "dph"
} ]
},
"type" : "CLASS",
"lbl" : "mitochondrial pyruvate transmembrane transport"
}, {
"id" : "http://purl.obolibrary.org/obo/GO_1902361",
"meta" : {
"basicPropertyValues" : [ {
"pred" : "http://purl.obolibrary.org/obo/IAO_0100001",
"val" : "http://purl.obolibrary.org/obo/GO_0006850"
}, {
"pred" : "http://purl.obolibrary.org/obo/IAO_0000231",
"val" : "http://purl.obolibrary.org/obo/IAO_0000227"
} ],
"deprecated" : true
},
"type" : "CLASS"
}, {
"id" : "http://www.geneontology.org/formats/oboInOwl#hasScope",
"type" : "PROPERTY",
Expand Down
7 changes: 7 additions & 0 deletions tests/test_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,13 @@ def test_gorule61():
assert test_result.result_type == qc.ResultType.WARNING
assert test_result.result.relation == association.Curie(namespace="BFO", identity="0000050")

# obsoleted term - these won't have namespace in ontology so ensure they aren't failed by this rule 61
# instead should be handled by rule 20
assoc = make_annotation(goid="GO:1902361", qualifier="involved_in", evidence="ISS", from_gaf=True,
version="2.2")
test_result = qc.GoRule61().test(assoc.associations[0], config)
assert test_result.result_type == qc.ResultType.PASS


def test_all_rules():
# pass
Expand Down

0 comments on commit 615de60

Please sign in to comment.