next up previous contents index
Next: model.restraints.condense() remove Up: Calculation of spatial restraints Previous: model.restraints.clear() delete   Contents   Index

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

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 = <float:35> 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
   

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

The selection is added to any existing selected atoms; if instead you want to select only these atoms, call model.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, model.restraints.pick() may select them; to prevent this, do model.restraints.condense() before calling model.restraints.pick().

A static restraint is selected if all or at least restraint_sel_atoms of its atoms are selected (set 1), 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]. (If residue_span_range is set to -999 -999, then the residue span range is instead taken to be between 0 and the number given in the third column of the current schedule; see model.schedule.make(). 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 model.restraints.make() and model.optimize() commands 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: model.restraints.pick(), model.restraints.condense()

# This will pick only restraints that include at least one
# CA atom and write them to a file.

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

code = '1fas'
mdl = model(env, file=code)
aln = alignment(env)
aln.append_model(mdl, atom_files=code, align_codes=code)
aln.append_model(mdl, atom_files=code+'.ini', align_codes=code+'-ini')
mdl.generate_topology(aln, sequence=code+'-ini')
mdl.transfer_xyz(aln)
mdl.build(initialize_xyz=False, build_method='INTERNAL_COORDINATES')

mdl.restraints.make(aln, restraint_type='stereo', spline_on_site=False)
mdl.energy()

mdl.pick_atoms(aln, atom_types='CA N C O')
mdl.restraints.pick(add_restraints=False, restraint_sel_atoms=1)
# Delete the unselected restraints from memory:
mdl.restraints.condense()
mdl.energy()

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


next up previous contents index
Next: model.restraints.condense() remove Up: Calculation of spatial restraints Previous: model.restraints.clear() delete   Contents   Index
Ben Webb 2005-06-20