Restraints on pseudo atoms: Difference between revisions
(page was renamed from Restraints_on_pseudo_atoms) |
(Update for 10.0 class names, manual URLs) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<!-- ## page was renamed from Restraints_on_pseudo_atoms --> | <!-- ## page was renamed from Restraints_on_pseudo_atoms --> | ||
pseudo.py demonstrates the use of a restraint between a real atom and a pseudo atom. This input file should work with Modeller | pseudo.py demonstrates the use of a restraint between a real atom and a pseudo atom. This input file should work with Modeller 10.0 or later. You will also need the [[attachment:pseudo.atm]] input. | ||
<pre><nowiki>#!python | <pre><nowiki>#!python | ||
from modeller import * | from modeller import * | ||
from modeller.optimizers import | from modeller.optimizers import ConjugateGradients | ||
e = | e = Environ() | ||
e.edat.dynamic_sphere = False | e.edat.dynamic_sphere = False | ||
log.verbose() | log.verbose() | ||
Line 14: | Line 14: | ||
# Read in a dummy PDB, which defines five real atoms - four are positioned at | # Read in a dummy PDB, which defines five real atoms - four are positioned at | ||
# the corners of a square in the xy place, and the fifth is off in space | # the corners of a square in the xy place, and the fifth is off in space | ||
m = | m = Model(e, file='pseudo.atm') | ||
# Define a pseudo atom as the gravity center of the first 4 atoms, and add | # Define a pseudo atom as the gravity center of the first 4 atoms, and add | ||
# it to the model's restraints | # it to the model's restraints | ||
p = pseudo_atom. | p = pseudo_atom.GravityCenter(m.atoms[0:5]) | ||
m.restraints.pseudo_atoms.append(p) | m.restraints.pseudo_atoms.append(p) | ||
Line 24: | Line 24: | ||
# created pseudo atom, and add it to the model's restraints. Since the mean is | # created pseudo atom, and add it to the model's restraints. Since the mean is | ||
# zero, this will force atom 5 to coexist with the gravity center. | # zero, this will force atom 5 to coexist with the gravity center. | ||
r = forms. | r = forms.Gaussian(group=physical.xy_distance, | ||
feature=features. | feature=features.Distance(m.atoms[4], p), | ||
mean=0.0, stdev=0.100) | mean=0.0, stdev=0.100) | ||
m.restraints.add(r) | m.restraints.add(r) | ||
# Calculate the starting energy of all atoms in the system, then optimize | # Calculate the starting energy of all atoms in the system, then optimize | ||
s = | s = Selection(m) | ||
s.energy() | s.energy() | ||
cg = | cg = ConjugateGradients() | ||
cg.optimize(s, max_iterations=200) | cg.optimize(s, max_iterations=200) | ||
Line 41: | Line 41: | ||
It is straightforward to add restraints of this type to a comparative | It is straightforward to add restraints of this type to a comparative | ||
modeling run - see for example, [ | modeling run - see for example, [https://salilab.org/modeller/10.0/manual/node28.html Adding additional restraints to the defaults]. | ||
Revision as of 20:34, 10 February 2021
pseudo.py demonstrates the use of a restraint between a real atom and a pseudo atom. This input file should work with Modeller 10.0 or later. You will also need the attachment:pseudo.atm input.
#!python from modeller import * from modeller.optimizers import ConjugateGradients e = Environ() e.edat.dynamic_sphere = False log.verbose() # Read in a dummy PDB, which defines five real atoms - four are positioned at # the corners of a square in the xy place, and the fifth is off in space m = Model(e, file='pseudo.atm') # Define a pseudo atom as the gravity center of the first 4 atoms, and add # it to the model's restraints p = pseudo_atom.GravityCenter(m.atoms[0:5]) m.restraints.pseudo_atoms.append(p) # Create a restraint on the distance between the real fifth atom and the newly # created pseudo atom, and add it to the model's restraints. Since the mean is # zero, this will force atom 5 to coexist with the gravity center. r = forms.Gaussian(group=physical.xy_distance, feature=features.Distance(m.atoms[4], p), mean=0.0, stdev=0.100) m.restraints.add(r) # Calculate the starting energy of all atoms in the system, then optimize s = Selection(m) s.energy() cg = ConjugateGradients() cg.optimize(s, max_iterations=200) # Write out the final coordinates m.write(file='pseudoout.atm')
It is straightforward to add restraints of this type to a comparative
modeling run - see for example, Adding additional restraints to the defaults.