Harmonic restraints from temperature factors

PURPOSE:
The attached script will create a harmonic restraint at the current coordinate for all heavy backbone atoms (line 14) in the current Molecule Window. The force constant is set to 10/sqrt(iso), (line 50), where iso is the integer part of the x-ray Isotropic Displacement, or B-factor. Note, this is not a recommendation on how to incorporate B-factors as restraints, but merely an illustrative example. Restraints are only created for atoms with sensible (>0) B-factors. We only use the integer part of the temperature factor to cut down on the number of different weights (restraint sets) to generate. You will get a warning if there are more than 200 sets, as CHARMm has some limits on the number.

DISCLAIMER:
This custom script is compatible with Discovery Studio 2.5. It is provided "as is" and is NOT supported by Accelrys nor is it warranted for any purpose whatsoever. The user assumes responsibility for any malfunctions or bugs.

REQUIREMENTS:
A molecule window containing a typed protein molecule. This is so the backbone selection works, the script could easily be modified to use all heavy atoms or some other criteria.

EXPECTED RESULTS:
A set of Harmonic Atom Restraints are created, one per unique value of the B-factors. They can be used when you then run a protocol from the Simulation folder, for the "Constraints" parameter(s).