예제 #1
0
    def is_reference_to_db(self, db_minicode):
        db_minicode = db_minicode.upper()
        if not db_minicode in self.valid_references:
            line1 = '{0} is not a valid DBref code'.format(db_minicode)
            line2 = 'Available codes: {0}'.format(self.valid_references.keys())
            SBIglobals.error(self, "\n".join([line1, line2]))

        #SWS and TREMBL are parts of UNP
        if db_minicode == 'UNP' and self._db in ['SWS', 'TREMBL']:
            return True
        return self._db == db_minicode
예제 #2
0
    def __init__(self, pdb_line):
        '''
        @type  pdb_line:     String
        @param pdb_pdb_line: Line of a PDB. Starts with DBREF

        @raise AttributeError if line does not start with DBREF
        '''
        if not pdb_line.startswith('DBREF '):
            SBIglobals.error(self, '{0} cannot create DBref'.format(pdb_line))
        data = self._process_line(pdb_line)

        self._pdb = data[0]
        self._chain = data[1]
        self._start = data[2]
        self._end = data[3]
        self._db = data[4]
        self._ref = data[5]