Skip to content

Commit

Permalink
Merge pull request #643 from biolink/go-site-2049-gorule-0000001-GAF-…
Browse files Browse the repository at this point in the history
…line-should-specify-DB-Object-symbol

For #2049 Added check for DB object symbol
  • Loading branch information
mugitty committed Aug 30, 2023
2 parents 6218621 + e7ff2c9 commit 3dd9050
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ontobio/io/gafparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ def to_association(gaf_line: List[str], report=None, group="unknown", dataset="u
## We use indeces here because we run GO RULES before we split the vals into individual variables
DB_INDEX = 0
DB_OBJECT_INDEX = 1
DB_OBJECT_SYMBOL = 2
TAXON_INDEX = 12
REFERENCE_INDEX = 5
if gaf_line[DB_INDEX] == "":
Expand All @@ -387,6 +388,9 @@ def to_association(gaf_line: List[str], report=None, group="unknown", dataset="u
if gaf_line[DB_OBJECT_INDEX] == "":
report.error(source_line, Report.INVALID_ID, "EMPTY", "col2 is empty", taxon=gaf_line[TAXON_INDEX], rule=1)
return assocparser.ParseResult(source_line, [], True, report=report)
if gaf_line[DB_OBJECT_SYMBOL] == "":
report.error(source_line, Report.INVALID_ID, "EMPTY", "col3 is empty", taxon=gaf_line[TAXON_INDEX], rule=1)
return assocparser.ParseResult(source_line, [], True, report=report)
if gaf_line[REFERENCE_INDEX] == "":
report.error(source_line, Report.INVALID_ID, "EMPTY", "reference column 6 is empty", taxon=gaf_line[TAXON_INDEX], rule=1)
return assocparser.ParseResult(source_line, [], True, report=report)
Expand Down

0 comments on commit 3dd9050

Please sign in to comment.