## Restraints.make() — make restraints

`make(atmsel, restraint_type, spline_on_site, residue_span_range=(0, 99999), residue_span_sign=True, restraint_sel_atoms=1, basis_pdf_weight='LOCAL', basis_relative_weight=0.05, intersegment=True, dih_lib_only=False, spline_dx=0.5, spline_min_points=5, spline_range=4.0, mnch_lib=1, accessibility_type=8, surftyp=1, distngh=6.0, aln=None, edat=None, io=None)`

Requirements:
  topology `&` parameters

> This command calculates and selects new restraints of a specified type. See the original papers for the most detailed definition and description of the restraints [Šali & Blundell, 1993,Šali & Overington, 1994]. The calculation of restraints of all types is now (partly) limited to the atoms in the atom selection atmsel. The new restraints are added to any currently present.

> The physical restraint type of the new restraints is specified by restraint_group, and should be an object from the `physical` module (see Table 6.1).

> restraint_type selects the types of the generated restraints. (For restraint type `DISTANCE`, do not use this command; instead, use Restraints.make_distance().) Only one restraint type can be selected at a time, except for the stereochemical restraints (`BOND`, `ANGLE`, `DIHEDRAL`, `IMPROPER`) that can all be calculated at the same time. It is useful to distinguish between the stereochemical restraints and homology-derived restraints. The stereochemical restraints are obtained from libraries that depend on atom and/or residue types only (e.g., CHARMM 22 force field [MacKerell et al., 1998] or statistical potentials), and do not require the alignment aln with template structures. In contrast, the homology-derived restraints are calculated from related protein structures, which correspond to all but the last sequence in the alignment aln (the target). These templates are read from coordinate files, which are the only data files required. All restraints are added to the existing restraints, even if they duplicate them (but see the comment for the `'OMEGA'` restraints below).

> The atoms for non-bonded restraints also have to be within the residue spanning range specified by residue_span_range = `(r1, r2)`, such that the residue index difference when residue_span_sign = `False` and when residue_span_sign = `True`.

> Stereochemical restraints:

- `'BOND'`. This calculates covalent bond restraints (harmonic terms). It relies on the list of the atom-atom bonds for MODEL, prepared previously by the model.generate_topology() command. The mean values and force constants are obtained from the parameter library in memory. Only those bonds are restrained that have all or at least restraint_sel_atoms in the selection atmsel.

- `'ANGLE'`. This calculates covalent angle restraints (harmonic terms). It relies on the list of the atom-atom-atom bonds for MODEL, prepared previously by the model.generate_topology() command. The mean values and force constants are obtained from the parameter library in memory. Only those angles are restrained that have all or at least restraint_sel_atoms in the selection atmsel.

- `'DIHEDRAL'`. This calculates covalent dihedral angle restraints (cosine terms). It relies on the list of the atom-atom-atom-atom dihedral angles for MODEL, prepared previously by the model.generate_topology() command. The minima, phases, and force constants are obtained from the parameter library in memory. Only those dihedral angles are restrained that have all or at least restraint_sel_atoms in the selection atmsel.

- `'IMPROPER'`. This calculates improper dihedral angle restraints (harmonic terms). It relies on the list of the improper dihedral angles for MODEL, prepared previously by the model.generate_topology() command. The mean values and force constants are obtained from the parameter library in memory. Only those impropers are restrained that have all or at least restraint_sel_atoms in the selection atmsel.

- `'STEREO'`. This implies all `'BOND'`, `'ANGLE'`, `'DIHEDRAL'`, and `'IMPROPER'` restraints.

- `'SPHERE14'`. This constructs soft-sphere overlap restraints (lower harmonic bounds) for atom pairs separated by exactly three bonds (1-4 pairs). It relies on atom radii from the `'$RADII14_LIB'` library. Only those non-bonded pairs are restrained that have all or at least energy_data.nonbonded_sel_atoms in the selection atmsel. They must also satisfy the residue_span_range & residue_span_sign criterion.

- `'LJ14'`. This constructs 1-4 Lennard-Jones restraints using the modified 1-4 Lennard-Jones parameters from the CHARMM parameter library. There is no way to calculate `'LJ14'` as dynamic restraints. Only those non-bonded pairs are restrained that have all or at least energy_data.nonbonded_sel_atoms in the selection atmsel. They must also satisfy the residue_span_range & residue_span_sign criterion.

- `'COULOMB14'`. This constructs 1-4 Coulomb restraints by relying on the atomic charges from the CHARMM topology library. There is no way to calculate `'COULOMB14'` as dynamic restraints. Only those non-bonded pairs are restrained that have all or at least energy_data.nonbonded_sel_atoms in the selection atmsel. They must also satisfy the residue_span_range & residue_span_sign criterion.

- `'SPHERE'`. This constructs soft-sphere overlap restraints (lower harmonic bounds) for all atom pairs that are not in bonds, angles, dihedral angles, improper dihedral angles, nor are explicitly excluded by the `'E'` entries read from a restraint file or added by the Restraints.add() command. Only those non-bonded pairs are restrained that have all or at least energy_data.nonbonded_sel_atoms in the selection atmsel. They must also satisfy the residue_span_range & residue_span_sign criterion. Note that this makes these restraints static (i.e., not dynamic) and that you must set energy_data.dynamic_sphere to `False` before evaluating the molecular pdf if you want to avoid duplicated restraints. These restraints should usually not be combined with the Lennard-Jones (`'LJ'`) restraints.

  When intersegment is `True`, the inter-segment non-bonded restraints are also constructed; otherwise, the segments do not feel each other via the non-bonded restraints. This option does not apply to the optimizers (Section 6.11) where information about segments is not used at all (i.e., they behave as if intersegment = `True`).

- `'LJ'`. This constructs Lennard-Jones restraints for all atom pairs that are not in bonds, angles, dihedral angles, improper dihedral angles, nor are explicitly excluded by the `'E'` entries read from a restraint file or added by the Restraints.add() command. Only those non-bonded pairs are restrained that have all or at least energy_data.nonbonded_sel_atoms in the selection atmsel. They must also satisfy the residue_span_range & residue_span_sign criterion. Note that this command makes the non-bonded restraints static (i.e., not dynamic) and that you must set energy_data.dynamic_lennard to `False` before evaluating the molecular pdf if you want to avoid duplicated restraints. Note that CHARMM uses both `'LJ14'` and `'LJ'`. For large molecules, it is better to calculate `'LJ'` as dynamic restraints because you can use distance cutoff energy_data.contact_shell in optimization (Section 6.11) to reduce significantly the number of non-bonded atom pairs.

- `'COULOMB'`. This constructs Coulomb restraints for all atom pairs that are not in bonds, angles, dihedral angles, improper dihedral angles, nor are explicitly excluded by the `'E'` entries read from a restraint file or added by the Restraints.add() command. Only those non-bonded pairs are restrained that have all or at least energy_data.nonbonded_sel_atoms in the selection atmsel. They must also satisfy the residue_span_range & residue_span_sign criterion. Note that this command makes the non-bonded restraints static (i.e., not dynamic) and that you must set energy_data.dynamic_coulomb to `False` before evaluating the molecular pdf if you want to avoid duplicated restraints. Note that CHARMM uses both `'COULOMB14'` and `'COULOMB'`. For large molecules, it is better to calculate `'COULOMB'` as dynamic restraints because you can use distance cutoff energy_data.contact_shell in optimization (Section 6.11) to reduce significantly the number of non-bonded atom pairs.

> Homology-derived restraints:

> For these restraints, the input alignment aln must be given.

- `'CHI1_DIHEDRAL'`, `'CHI2_DIHEDRAL'`, `'CHI3_DIHEDRAL'`, `'CHI4_DIHEDRAL'`, `'PHI_DIHEDRAL'`, `'PSI_DIHEDRAL'`, `'OMEGA_DIHEDRAL'`, `'PHI-PSI_BINORMAL'` are the mainchain and sidechain dihedral angle restraints. Only those dihedral angles are restrained that have all or at least energy_data.nonbonded_sel_atoms in the selection atmsel. The means and standard deviations for the dihedral Gaussian restraints are obtained from the `$RESDIH_LIB` and `$MNCH?_LIB` libraries and their weights from the MDT tables, which are read in as specified by `MDT_LIB` in `$LIB/libs.lib`. The large MDT tables give the conditional weights for each possible dihedral angle class, as a function of all possible combinations of features on which a particular class depends. If dih_lib_only is `True` or there is no equivalent residue in any of the templates, the weights for the dihedral angle classes depend only on the residue type and are obtained from the `'$RESDIH_LIB'` and `'$MNCH?_LIB'` libraries; the dih_lib_only argument allows one to force the calculation of the “homology-derived” mainchain and sidechain dihedral angle restraints that ignore template information. basis_pdf_weight has the same effect as for the distance pdf's.

  When MODELLER's `'OMEGA'` restraints are calculated, the currently existing restraints on atoms `'O C +N +CA'` in all residues are automatically deleted. These deleted restraints correspond to the improper dihedral angles involving the ω atoms. They are deleted because they could be “frustrated” by the new `'OMEGA'` restraints. No action is taken with regard to any of the previously existing, possibly duplicated dihedral angle restraints. Thus, to avoid restraint duplication, including that of the `'OMEGA'` restraints, call the Restraints.unpick_redundant() command after all the restraints are calculated.

  Dihedral restraints are only calculated for the 20 standard amino acids, plus the two alternate histidine protonation states (HSE and HSP). The statistics for HIS are applied to HSE and HSP.

> The weights of basis pdf's depend on local sequence similarity between the target and the templates when basis_pdf_weight = `'LOCAL'` and on global sequence identity when basis_pdf_weight = `'GLOBAL'`.

> basis_relative_weight is the cutoff for removing weak basis pdf's from poly-Gaussian feature pdf's: a basis pdf whose weight is less than the basis_relative_weight fraction of the largest weight is deleted.

> If spline_on_site is `True`, then certain dihedral restraints are automatically replaced by splines for efficiency. See Restraints.spline() for a description of the spline_dx, spline_min_points, and spline_range parameters.

> Several restraint types look up information from pre-calculated MDT tables, and for these the accessibility_type variable defines the type of solvent accessibility.

Example: examples/commands/make_restraints.py

      # Example for: restraints.make(), restraints.spline(), restraints.write()

      # This will compare energies of bond length restraints expressed
      # by harmonic potential and by cubic spline.

      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')

      code = '1fas'
      mdl = complete_pdb(env, code)
      mdl.write(file=code+'.ini')

      sel = selection(mdl)
      mdl.restraints.make(sel, restraint_type='bond', spline_on_site=False)
      mdl.restraints.write(file=code+'-1.rsr')
      edat = energy_data(dynamic_sphere=False)
      sel.energy(edat=edat)

      mdl.restraints.spline(forms.gaussian, features.distance, physical.bond,
                            spline_range=5.0, spline_dx=0.005, edat=edat)
      mdl.restraints.condense()
      mdl.restraints.write(file=code+'-2.rsr')
      sel.energy(edat=edat)