Update current GOTerm with optional record.

def update_rec(self, rec, line):
        """Update current GOTerm with optional record."""
        if 'def' in self.optional_attrs and line[:5] == "def: ":
            assert not hasattr(rec, 'defn'), "ATTR(defn) ALREADY SET({VAL})".format(VAL=rec.defn)
            # Use 'defn' because 'def' is a reserved word in python
            rec.defn = line[5:]
        elif 'synonym' in self.optional_attrs and line[:9] == "synonym: ":
            rec.synonym.append(self._get_synonym(line[9:]))
        # http://geneontology.org/page/ontology-relations
        elif 'relationship' in self.optional_attrs and line[:14] == "relationship: ":
            # relationships are stored in a dict of sets, mirroring
            # the structure implied in the GO DAG. Example:
            #
            #  relationship = {
            #     'part_of': set(['GO:0021513', 'GO:0006310']),
            #     'regulates': set(['GO:0006313']),
            #     'negatively_regulates': set(['GO:0021910']),
            #     'positively_regulates': set(['GO:0006313']),
            # }
            rel, goid = line[14:].split()[:2]
            if rel not in rec.relationship:
                rec.relationship[rel] = set([goid])
            else:
                rec.relationship[rel].add(goid)
        elif 'xref' in self.optional_attrs and line[:6] == "xref: ":
            rec.xref.add(self._get_xref(line[6:]))
        elif 'subset' in self.optional_attrs and line[:8] == "subset: ":
            rec.subset.add(line[8:])
        elif 'comment' in self.optional_attrs and line[:9] == "comment: ":
            rec.comment = line[9:]