---
layout: rule
id: GORULE:0000020
title: "Automatic repair of annotations to merged or obsoleted terms"
type: repair
fail_mode: hard
status: implemented
contact: "go-quality@lists.stanford.edu"
implementations:
  - source: https://github.com/biolink/ontobio/blob/master/ontobio/io/assocparser.py
    language: python
examples:
  repair:
    - comment: repair test
      format: gaf
      input: "FB	FBgn0033449	CG1663		GO:1902361	FB:FBrf0202953|GO_REF:0000024	ISS	UniProtKB:Q05516	P			protein	taxon:7227	20171127	FlyBase"
      output: "FB	FBgn0033449	CG1663		GO:0006850	FB:FBrf0202953|GO_REF:0000024	ISS	UniProtKB:Q05516	P			protein	taxon:7227	20171127	FlyBase"
---
There should be no annotations to obsolete terms or to an alternate ID (Column 5 of GAF, Column 4 of GPAD). As well, GO terms present in annotations also should be repaired if possible: 
* with/from: Column 8 of GAF, Column 7 of GPAD
* extensions, Column 16 of GAF, Column 11 of GPAD 

Obsolete terms that have a `replaced_by` tag and terms annotated to one of their alternative IDs (merged terms; `alt_id` in the .obo files) will automatically be repaired to the valid term id.
If no replacement is found, the annotation will be filtered.


