def find_metal_binding(self, mol):
        """Looks for atoms that could possibly be involved in chelating a metal ion.
        This can be any main chain oxygen atom or oxygen, nitrogen and sulfur from specific amino acids"""
        data = namedtuple('metal_binding', 'atom atom_orig_idx type restype resnr reschain location')
        a_set = []
        for res in pybel.ob.OBResidueIter(mol.OBMol):
            restype, reschain, resnr = res.GetName().upper(), res.GetChain(), res.GetNum()
            if restype in ['ASP', 'GLU', 'SER', 'THR', 'TYR']:  # Look for oxygens here
                for a in pybel.ob.OBResidueAtomIter(res):
                    if a.GetType().startswith('O') and res.GetAtomProperty(a, 8) \
                            and not self.Mapper.mapid(a.GetIdx(), mtype='protein') in self.altconf:
                        atom_orig_idx = self.Mapper.mapid(a.GetIdx(), mtype=self.mtype, bsid=self.bsid)
                        a_set.append(data(atom=pybel.Atom(a), atom_orig_idx=atom_orig_idx, type='O', restype=restype,
                                          resnr=resnr, reschain=reschain,
                                          location='protein.sidechain'))
            if restype == 'HIS':  # Look for nitrogen here
                for a in pybel.ob.OBResidueAtomIter(res):
                    if a.GetType().startswith('N') and res.GetAtomProperty(a, 8) \
                            and not self.Mapper.mapid(a.GetIdx(), mtype='protein') in self.altconf:
                        atom_orig_idx = self.Mapper.mapid(a.GetIdx(), mtype=self.mtype, bsid=self.bsid)
                        a_set.append(data(atom=pybel.Atom(a), atom_orig_idx=atom_orig_idx, type='N', restype=restype,
                                          resnr=resnr, reschain=reschain,
                                          location='protein.sidechain'))
            if restype == 'CYS':  # Look for sulfur here
                for a in pybel.ob.OBResidueAtomIter(res):
                    if a.GetType().startswith('S') and res.GetAtomProperty(a, 8) \
                            and not self.Mapper.mapid(a.GetIdx(), mtype='protein') in self.altconf:
                        atom_orig_idx = self.Mapper.mapid(a.GetIdx(), mtype=self.mtype, bsid=self.bsid)
                        a_set.append(data(atom=pybel.Atom(a), atom_orig_idx=atom_orig_idx, type='S', restype=restype,
                                          resnr=resnr, reschain=reschain,
                                          location='protein.sidechain'))
            for a in pybel.ob.OBResidueAtomIter(res):  # All main chain oxygens
                if a.GetType().startswith('O') and res.GetAtomProperty(a, 2) \
                        and not self.Mapper.mapid(a.GetIdx(), mtype='protein') in self.altconf and restype != 'HOH':
                    atom_orig_idx = self.Mapper.mapid(a.GetIdx(), mtype=self.mtype, bsid=self.bsid)
                    a_set.append(data(atom=pybel.Atom(a), atom_orig_idx=atom_orig_idx, type='O', restype=res.GetName(),
                                      resnr=res.GetNum(), reschain=res.GetChain(),
                                      location='protein.mainchain'))
        return a_set
def find_metal_binding ( self , mol ) : data = namedtuple ( 'metal_binding' , 'atom atom_orig_idx type restype resnr reschain location' ) a_set = [ ] for res in pybel . ob . OBResidueIter ( mol . OBMol ) : restype , reschain , resnr = res . GetName ( ) . upper ( ) , res . GetChain ( ) , res . GetNum ( ) if restype in [ 'ASP' , 'GLU' , 'SER' , 'THR' , 'TYR' ] : for a in pybel . ob . OBResidueAtomIter ( res ) : if a . GetType ( ) . startswith ( 'O' ) and res . GetAtomProperty ( a , 8 ) and not self . Mapper . mapid ( a . GetIdx ( ) , mtype = 'protein' ) in self . altconf : atom_orig_idx = self . Mapper . mapid ( a . GetIdx ( ) , mtype = self . mtype , bsid = self . bsid ) a_set . append ( data ( atom = pybel . Atom ( a ) , atom_orig_idx = atom_orig_idx , type = 'O' , restype = restype , resnr = resnr , reschain = reschain , location = 'protein.sidechain' ) ) if restype == 'HIS' : for a in pybel . ob . OBResidueAtomIter ( res ) : if a . GetType ( ) . startswith ( 'N' ) and res . GetAtomProperty ( a , 8 ) and not self . Mapper . mapid ( a . GetIdx ( ) , mtype = 'protein' ) in self . altconf : atom_orig_idx = self . Mapper . mapid ( a . GetIdx ( ) , mtype = self . mtype , bsid = self . bsid ) a_set . append ( data ( atom = pybel . Atom ( a ) , atom_orig_idx = atom_orig_idx , type = 'N' , restype = restype , resnr = resnr , reschain = reschain , location = 'protein.sidechain' ) ) if restype == 'CYS' : for a in pybel . ob . OBResidueAtomIter ( res ) : if a . GetType ( ) . startswith ( 'S' ) and res . GetAtomProperty ( a , 8 ) and not self . Mapper . mapid ( a . GetIdx ( ) , mtype = 'protein' ) in self . altconf : atom_orig_idx = self . Mapper . mapid ( a . GetIdx ( ) , mtype = self . mtype , bsid = self . bsid ) a_set . append ( data ( atom = pybel . Atom ( a ) , atom_orig_idx = atom_orig_idx , type = 'S' , restype = restype , resnr = resnr , reschain = reschain , location = 'protein.sidechain' ) ) for a in pybel . ob . OBResidueAtomIter ( res ) : if a . GetType ( ) . startswith ( 'O' ) and res . GetAtomProperty ( a , 2 ) and not self . Mapper . mapid ( a . GetIdx ( ) , mtype = 'protein' ) in self . altconf and restype != 'HOH' : atom_orig_idx = self . Mapper . mapid ( a . GetIdx ( ) , mtype = self . mtype , bsid = self . bsid ) a_set . append ( data ( atom = pybel . Atom ( a ) , atom_orig_idx = atom_orig_idx , type = 'O' , restype = res . GetName ( ) , resnr = res . GetNum ( ) , reschain = res . GetChain ( ) , location = 'protein.mainchain' ) ) return a_set
Looks for atoms that could possibly be involved in chelating a metal ion.
        This can be any main chain oxygen atom or oxygen, nitrogen and sulfur from specific amino acids