Restraints on pseudo atoms: Difference between revisions

No edit summary
(Fix broken links, tidy up markup, add to Examples category)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
<!-- ## page was renamed from [[PseudoRsrAtom]] -->
<!-- ## page was renamed from Restraints_on_pseudo_atoms -->
pseudo.top demonstrates the use of a restraint between a real atom and a pseudo atom. This input file should work with Modeller 6v2 or later.
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 [https://salilab.org/modeller/archive/pseudo-rsr-example/pseudo.atm pseudo.atm] input.


[http://salilab.org/modeller/archive/pseudo-rsr-example.tar.gz pseudo-rsr-example.tar.gz]


Files: [http://salilab.org/modeller/archive/pseudo-rsr-example/pseudo.top pseudo.top]  [http://salilab.org/modeller/archive/pseudo-rsr-example/pseudo.atm pseudo.atm] [http://salilab.org/modeller/archive/pseudo-rsr-example/pseudo.rsr pseudo.rsr] [http://salilab.org/modeller/archive/pseudo-rsr-example/pseudo.log pseudo.log] [http://salilab.org/modeller/archive/pseudo-rsr-example/pseudoout.atm pseudoout.atm] [http://salilab.org/modeller/archive/pseudo-rsr-example/README README]
<syntaxhighlight lang="python">
from modeller import *
from modeller.optimizers import ConjugateGradients


The input file pseudo.top does the following:
e = Environ()
e.edat.dynamic_sphere = False
log.verbose()


* READ_MODEL reads pseudo.atm, which defines five real atoms - four of these are positioned at the corners of a square in the xy plane, with center 0,0,0, and the fifth is off in space.
# Read in a dummy PDB, which defines five real atoms - four are positioned at
* READ_RESTRAINTS then reads pseudo.rsr, the first line of which defines a pseudo atom:
# the corners of a square in the xy place, and the fifth is off in space
m = Model(e, file='pseudo.atm')


P 6 1 4 1 2 3 4
# 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)


This reads, in order, as 'define a pseudo atom (P) as atom number 6, of type 1, which is a gravity center of 4 atoms, of numbers 1, 2, 3 and 4'. See http://salilab.org/modeller/6v2/manual/node99.html for more details. Note that the atom number (6) of the pseudo atom must be greater than the number of real atoms in the model (5 in this case).
# Create a restraint on the distance between the real fifth atom and the newly
The second line defines an actual restraint in the MODELLER format. See http://salilab.org/modeller/6v2/manual/node98.html for more details:
# 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)


R 3 1 1 27 2 2 0 5 6 0.0 0.100
# 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')
</syntaxhighlight>


These fields map to:
* R: define a restraint
* 3: of form '3' (harmonic potential, table 2.2)
* 1: of modality '1' (ignored in this case)
* 1: using feature '1' (distance, table 2.3)
* 27: report energy in group 27 (Distance restraints 5, table 2.4)
* 2: restrain 2 atoms
* 2: the restraint takes two parameters (fmean and sigma, table 2.2)
* 0: ignored
* 5,6: act on real atom 5 and pseudo atom 6
* 0.0: fmean is zero
* 0.100: sigma (standard deviation, strength of the restraint) is 0.100
* With this restraints file read, we have created a harmonic restraining potential between real atom 5 and the gravity center of atoms 1, 2, 3 and 4, which, since fmean is zero, will tend to force atom 5 to coexist with this gravity center. The subsequent optimization yields a file pseudoout.atm which demonstrates this.


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, http://salilab.org/modeller/6v2/FAQ.html#9
modeling run - see for example, [https://salilab.org/modeller/10.0/manual/node28.html Adding additional restraints to the defaults].


[[Category:Examples]]

Latest revision as of 21:25, 16 August 2022

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 pseudo.atm input.


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.