next up previous contents index
Next: restraints.condense() remove Up: The restraints class: static Previous: restraints.clear() delete   Contents   Index

restraints.pick() -- pick restraints for selected atoms

atmsel = <selection>   Atom selection
residue_span_range = <int:2> 0 99999 range of residues spanning the allowed distances; for MAKE_RESTRAINTS, PICK_RESTRAINTS, non-bonded dynamic pairs
restraints_filter = <physical.values> 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 keep restraints?
restraint_sel_atoms = <int:1> 1 a restraint has to have at least as many selected atoms

This command selects some or all of the restraints currently in memory.

The selection is added to any existing selected restraints; if instead you want to select only these restraints, call restraints.unpick_all() first.

This command runs over all restraints in memory, including the currently unselected restraints. Be careful about this: If you have some unselected restraints in memory, restraints.pick() may select them; to prevent this, do restraints.condense() before calling restraints.pick().

A static restraint is selected if all or at least restraint_sel_atoms of its atoms are within the atom selection atmsel, if it is strong enough based on its standard deviations or force constants (see the next paragraph), and if it does not span fewer residues than residue_span_range[0], or more than residue_span_range[1]. Restraints which act on only a single atom are not subject to this range check.) Note that here restraint_sel_atoms is used for all restraints, while the restraints.make() command and optimizers (Section 6.11) use it for all restraint types except non-bonded pairs. (energy_data.nonbonded_sel_atoms is used for non-bonded pairs by these routines.)

To decide if a restraint is strong enough, the current standard deviations or force constants are compared with the corresponding restraints_filter[physical_restraint_type]. A harmonic restraint, lower and upper bounds, and multi-modal Gaussian restraints are selected if the (smallest) standard deviation is less than the corresponding restraints_filter[i]. The cosine energy term is selected if its force constant is larger than the corresponding restraints_filter[i]. If restraints_filter[i] = $ -999$ , a restraint of type $ i$ is always selected. Restraints of the other physical_restraint_types are always selected (Coulomb, Lennard-Jones, binormal, and spline). The restraints_filter angles have to be specified in radians.

Example: examples/commands/pick_restraints.py


# Example for: restraints.pick(), restraints.condense()

# This will pick only restraints that include at least one
# mainchain (CA, N, C, O) atom and write them to a file.

from modeller import *
from modeller.scripts import complete_pdb

log.verbose()
env = environ()
env.io.atom_files_directory = '../atom_files'
env.libs.topology.read(file='$(LIB)/top_heav.lib')
env.libs.parameters.read(file='$(LIB)/par.lib')

mdl = complete_pdb(env, '1fas')

aln = alignment(env)
allsel = selection(mdl)
mdl.restraints.make(allsel, aln, restraint_type='stereo', spline_on_site=False)
allsel.energy()

atmsel = allsel.only_atom_types('CA N C O')
mdl.restraints.pick(atmsel, restraint_sel_atoms=1)
# Delete the unselected restraints from memory:
mdl.restraints.condense()
atmsel.energy()

mdl.restraints.write(file='1fas.rsr')


next up previous contents index
Next: restraints.condense() remove Up: The restraints class: static Previous: restraints.clear() delete   Contents   Index
Ben Webb 2007-01-19