Skip to content

Commit

Permalink
For #2002 - Added term to ontology for test; return annotation if tes…
Browse files Browse the repository at this point in the history
…t fails
  • Loading branch information
mugitty committed Sep 15, 2023
1 parent c072412 commit 6a9924a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ontobio/io/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ 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"), repaired_annotation)
return TestResult(repair_result(RepairState.FAILED, 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
36 changes: 36 additions & 0 deletions tests/resources/obsolete.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,42 @@
"type" : "CLASS",
"lbl" : "nucleus"
}, {
"id" : "http://purl.obolibrary.org/obo/GO_0007155",
"meta" : {
"definition" : {
"val" : "The attachment of a cell, either to another cell or to an underlying substrate such as the extracellular matrix, via cell adhesion molecules.",
"xrefs" : [ "GOC:hb", "GOC:pf" ]
},
"subsets" : [ "http://purl.obolibrary.org/obo/go#goslim_candida", "http://purl.obolibrary.org/obo/go#goslim_generic", "http://purl.obolibrary.org/obo/go#prokaryote_subset", "http://purl.obolibrary.org/obo/go#goslim_pombe", "http://purl.obolibrary.org/obo/go#goslim_pir", "http://purl.obolibrary.org/obo/go#goslim_drosophila", "http://purl.obolibrary.org/obo/go#goslim_chembl", "http://purl.obolibrary.org/obo/go#goslim_metagenomics" ],
"xrefs" : [ {
"val" : "Wikipedia:Cell_adhesion"
} ],
"synonyms" : [ {
"pred" : "hasRelatedSynonym",
"val" : "single organism cell adhesion",
"xrefs" : [ ]
}, {
"pred" : "hasRelatedSynonym",
"val" : "cell adhesion molecule activity",
"xrefs" : [ ]
} ],
"basicPropertyValues" : [ {
"pred" : "http://www.geneontology.org/formats/oboInOwl#hasAlternativeId",
"val" : "GO:0098602"
}, {
"pred" : "http://www.geneontology.org/formats/oboInOwl#created_by",
"val" : "dos"
}, {
"pred" : "http://www.geneontology.org/formats/oboInOwl#creation_date",
"val" : "2014-04-15T15:59:10Z"
}, {
"pred" : "http://www.geneontology.org/formats/oboInOwl#hasOBONamespace",
"val" : "biological_process"
} ]
},
"type" : "CLASS",
"lbl" : "cell adhesion"
},{
"id" : "http://www.geneontology.org/formats/oboInOwl#hasAlternativeId",
"type" : "PROPERTY",
"lbl" : "has_alternative_id"
Expand Down

0 comments on commit 6a9924a

Please sign in to comment.