def _get_replacement_pdb_id(self):
        '''Checks to see if the PDB file has been deprecated and, if so, what the new ID is.'''
        deprecation_lines = self.parsed_lines['OBSLTE']
        date_regex = re.compile('(\d+)-(\w{3})-(\d+)')
        if deprecation_lines:
            assert(len(deprecation_lines) == 1)
            tokens = deprecation_lines[0].split()[1:]
            if tokens[1].upper() in obsolete_pdb_ids_with_no_replacement_entries:
                assert(len(tokens) == 2)
            else:
                assert(len(tokens) == 3)
            if self.pdb_id:
                mtchs = date_regex.match(tokens[0])
                assert(mtchs)
                _day = int(mtchs.group(1))
                _month = mtchs.group(2)
                _year = int(mtchs.group(3)) # only two characters?
                assert(tokens[1] == self.pdb_id)
                self.deprecation_date = (_day, _month, _year) # no need to do anything fancier unless this is ever needed
                self.deprecated = True
                if len(tokens) == 3:
                    assert(len(tokens[2]) == 4)
                    self.replacement_pdb_id = tokens[2]
def _get_replacement_pdb_id ( self ) : deprecation_lines = self . parsed_lines [ 'OBSLTE' ] date_regex = re . compile ( '(\d+)-(\w{3})-(\d+)' ) if deprecation_lines : assert ( len ( deprecation_lines ) == 1 ) tokens = deprecation_lines [ 0 ] . split ( ) [ 1 : ] if tokens [ 1 ] . upper ( ) in obsolete_pdb_ids_with_no_replacement_entries : assert ( len ( tokens ) == 2 ) else : assert ( len ( tokens ) == 3 ) if self . pdb_id : mtchs = date_regex . match ( tokens [ 0 ] ) assert ( mtchs ) _day = int ( mtchs . group ( 1 ) ) _month = mtchs . group ( 2 ) _year = int ( mtchs . group ( 3 ) ) assert ( tokens [ 1 ] == self . pdb_id ) self . deprecation_date = ( _day , _month , _year ) self . deprecated = True if len ( tokens ) == 3 : assert ( len ( tokens [ 2 ] ) == 4 ) self . replacement_pdb_id = tokens [ 2 ]
Checks to see if the PDB file has been deprecated and, if so, what the new ID is.