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().) 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] = , a restraint of type 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 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')