def optimize(self): """Run the optimization with MMTK""" print '\n-------------------------------------------------------------------------------' print '\n MMTK Optimization starts...' print '\t.. building universe' configuration = PDBConfiguration(self.temp_pdb_file) # Construct the nucleotide chain object. This also constructs positions # for the missing hydrogens, using geometrical criteria. chain = configuration.createNucleotideChains()[0] universe = InfiniteUniverse() universe.addObject(chain) restraints = self.create_restraints(chain) # define force field print '\t.. setting up force field' if restraints: ff = Amber94ForceField() + restraints else: ff = Amber94ForceField() universe.setForceField(ff) # do the minimization print '\t.. starting minimization with %i cycles'%self.cycles minimizer = ConjugateGradientMinimizer(universe) minimizer(steps = self.cycles) # write the intermediate output print '\t.. writing MMTK output to %s'% self.temp_pdb_file if self.model_passive: print '\t (please note that MMTK applies a different numeration of residues.\n\t The original one will be restored in the final output).' universe.writeToFile(self.mmtk_output_file) open(self.temp_pdb_file, 'w').write(open(self.mmtk_output_file).read()) print '\n-------------------------------------------------------------------------------'
continue if not done.has_key((index1, index2)): clist.append(Contact(a1, a2, dist)) done[(index1, index2)] = 1 return clist if __name__ == '__main__': from MMTK.PDB import PDBConfiguration from MMTK import Units import sys target_filename = sys.argv[2] pdb_conf1 = PDBConfiguration(target_filename) if sys.argv[1][:2] == '-f': chains = pdb_conf1.createNucleotideChains() molecule_names = [] if len(chains) >= 2: clist = findContacts(chains[0], chains[1]) else: molecule_names = [] for (key, mol) in pdb_conf1.molecules.items(): for o in mol: molecule_names.append(o.name) targets = pdb_conf1.createAll(molecule_names = molecule_names) if len(molecule_names) > 1: clist = findContacts(targets[0], targets[1]) else: atoms = targets.atomList() mid = len(atoms)/2 clist = findContacts(Collection(atoms[:mid]),
""" nucleotide_construction.py creates a nucleotide chain with a ligand from PDB file """ from MMTK import * from MMTK.PDB import PDBConfiguration from MMTK.NucleicAcids import NucleotideChain from MMTK.Visualization import view """ Load PDB entry 110d. It contains a single DNA strand with a ligand daunomycin """ configuration = PDBConfiguration('110d.pdb') """ Construct nucleotide chain object. This also constructs positions for missing hydrogens, using geometrical criteria. """ chain = configuration.createNucleotideChains()[0] """ Construct the ligand. There is no definition of it in the database, so it can only be constructed as a collection of atoms. The second argument of createMolecules() is set to one in order to allow this use of an unknown residue. """ ligand = configuration.createMolecules(['DM1'], 1) # Put everything in a universe and show it graphically universe = InfiniteUniverse() universe.addObject(chain) universe.addObject(ligand) view(universe)
if not done.has_key((index1, index2)): clist.append(Contact(a1, a2, dist)) done[(index1, index2)] = 1 return clist if __name__ == '__main__': from MMTK.PDB import PDBConfiguration from MMTK import Units import sys target_filename = sys.argv[2] pdb_conf1 = PDBConfiguration(target_filename) if sys.argv[1][:2] == '-f': chains = pdb_conf1.createNucleotideChains() molecule_names = [] if len(chains) >= 2: clist = findContacts(chains[0], chains[1]) else: molecule_names = [] for (key, mol) in pdb_conf1.molecules.items(): for o in mol: molecule_names.append(o.name) targets = pdb_conf1.createAll(molecule_names=molecule_names) if len(molecule_names) > 1: clist = findContacts(targets[0], targets[1]) else: atoms = targets.atomList() mid = len(atoms) / 2 clist = findContacts(Collection(atoms[:mid]),
# Create a nucleotide chain with a ligand from a PDB file. # from MMTK import * from MMTK.PDB import PDBConfiguration from MMTK.NucleicAcids import NucleotideChain from MMTK.Visualization import view # Load the PDB entry 110d. It contains a single DNA strand with a # ligand (daunomycin). configuration = PDBConfiguration('110d.pdb') # Construct the nucleotide chain object. This also constructs positions # for the missing hydrogens, using geometrical criteria. chain = configuration.createNucleotideChains()[0] # Construct the ligand. There is no definition of it in the database, # so it can only be constructed as a collection of atoms. The second # argument of createMolecules() is set to one in order to allow # this use of an unknown residue. ligand = configuration.createMolecules(['DM1'], 1) # Put everyting in a universe and show it graphically. universe = InfiniteUniverse() universe.addObject(chain) universe.addObject(ligand) view(universe)