def load(self, filepath):
        """Import '[Term]' entries from an .obo file."""
        for attributeLines in oboTermParser(filepath):
            oboTerm = _attributeLinesToDict(attributeLines)
            if oboTerm['id'] not in self.oboTerms:
                self.oboTerms[oboTerm['id']] = oboTerm            
            else:
                oldOboTerm = self.oboTerms[oboTerm['id']]
                oldTermIsObsolete = _termIsObsolete(oldOboTerm)
                newTermIsObsolete = _termIsObsolete(oboTerm)
                if oldTermIsObsolete and not newTermIsObsolete:
                    self.oboTerms[oboTerm['id']] = oboTerm
                else:
                    #At least one of two terms with identical id must be obsolete
                    assert oldTermIsObsolete or newTermIsObsolete
def load ( self , filepath ) : for attributeLines in oboTermParser ( filepath ) : oboTerm = _attributeLinesToDict ( attributeLines ) if oboTerm [ 'id' ] not in self . oboTerms : self . oboTerms [ oboTerm [ 'id' ] ] = oboTerm else : oldOboTerm = self . oboTerms [ oboTerm [ 'id' ] ] oldTermIsObsolete = _termIsObsolete ( oldOboTerm ) newTermIsObsolete = _termIsObsolete ( oboTerm ) if oldTermIsObsolete and not newTermIsObsolete : self . oboTerms [ oboTerm [ 'id' ] ] = oboTerm else : assert oldTermIsObsolete or newTermIsObsolete
Import '[Term]' entries from an .obo file.