Beispiel #1
0
 def __init__(self, config, num):
     self.name, self.conformation, self.location = config['ligand'][num]
     self.selection = 'name CA and not HETERO'
     try:
         pdb = Pdb(self.name, selection=self.selection)
         atoms = pdb.atoms.models()[0]
         atoms.update_sec(pdb.dssp())
     except InvalidPdbCode:
         seq = self.name.split(':')[0]
         check_peptide_sequence(seq)
         atoms = Atoms(self.name)
     atoms.set_bfac(0.0)
     Atoms.__init__(self, atoms)
     # checks the input peptide sequence for non-standard amino acids.
     rev_dct = dict(map(reversed, AA_NAMES.items()))
     [
         check_peptide_sequence(rev_dct[peptide.resname])
         for peptide in atoms.atoms
     ]
Beispiel #2
0
    def __init__(self, config):
        name = config['receptor']
        selection = 'name CA and not HETERO'
        pdb = Pdb(name, selection=selection)
        atoms = pdb.atoms.models()[0]

        token = config.get('receptor_flexibility')
        if token:
            try:
                bfac = float(token)
                atoms.set_bfac(bfac)
            except ValueError:
                if token.lower() == 'bf':
                    pass
                elif token.lower() == 'bfi':
                    for a in atoms:
                        if a.bfac > 1.:
                            a.bfac = 0.
                        else:
                            a.bfac = 1. - a.bfac
                elif exists(token):
                    d, de = self.read_flexibility(token)
                    atoms.update_bfac(d, de)
                elif exists(join(config['work_dir'], token)):
                    d, de = self.read_flexibility(
                        join(config['work_dir'], token))
                    atoms.update_bfac(d, de)
                else:
                    raise Exception(
                        'Invalid receptor_flexibility setting in \'%s\'!!!' %
                        token)
        else:
            atoms.set_bfac(1.0)

        self.old_ids = atoms.update_sec(
            pdb.dssp(dssp_command=config['dssp_command'])).fix_broken_chains()
        self.new_ids = {v: k for k, v in self.old_ids.items()}
        Atoms.__init__(self, atoms)
        self.center = self.cent_of_mass()
        self.dimension = self.max_dimension()
        self.patches = {}
        self.check_residue_modifications()