## model.patch_ss_templates() — guess MODEL disulfides from templates

`patch_ss_templates(aln, io=None)`

> This command defines and patches disulfide bonds in the MODEL using an alignment of the MODEL sequence with one or more template structures. The MODEL sequence has to be the last sequence in the alignment, aln. The template structures are all the other proteins in the alignment. All Cys-Cys pairs in the target sequence that are aligned with at least one template disulfide are defined as disulfide bonds themselves. (Template disulfide bridges are assumed to exist between all pairs of Cys residues whose SG-SG distances are less than 2.5Å. PDB annotations such as SSBOND are not used.) The covalent connectivity is patched accordingly.

> This command should be run after model.generate_topology() and before Restraints.make() to ensure that the disulfides are restrained properly by the bond length, angle, and dihedral angle restraints and that no SG-SG non-bonded interactions are applied.

> The disulfide bond, angle and dihedral angle restraints have their own physical restraint type separate from the other bond, angle and dihedral angle restraints (Table 6.1).

Example: examples/commands/patch_disulfides.py

      # Example for: model.patch_ss_templates() and model.patch_ss()

      # This will patch CYS-CYS disulfide bonds using disulfides in aligned templates:

      from modeller import *

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

      # Read the sequence, calculate its topology, and coordinates:
      aln = alignment(env, file='toxin.ali', align_codes=('2ctx', '2abx'))
      # Superpose the two template structures without changing the alignment.
      # This is for TRANSFER_XYZ to work properly. It relies on not reading
      # the atom files again before TRANSFER_XYZ.
      aln.malign3d(fit=False) # This is for TRANSFER_XYZ to work properly.
      # Restore the alignment, and add in the model sequence, 1fas:
      aln.clear()
      aln.append(file='toxin.ali', align_codes=('2ctx', '2abx', '1fas'))
      mdl = model(env)
      mdl.generate_topology(aln['1fas'])
      mdl.transfer_xyz(aln)
      mdl.build(initialize_xyz=True, build_method='INTERNAL_COORDINATES')
      mdl.write(file='1fas.noSS')
      # Create the disulfide bonds using equivalent disulfide bonds in templates:
      mdl.patch_ss_templates(aln)

      # Create the stereochemical restraints
      sel = selection(mdl)
      mdl.restraints.make(sel, restraint_type='stereo', spline_on_site=False)

      # Calculate energy to test the disulfide restraints (bonds, angles, dihedrals):
      sel.energy()

      mdl.read(file='1fas.noSS')
      # Create the disulfide bonds guessing by coordinates
      mdl.patch_ss()

      # Create the stereochemical restraints
      mdl.restraints.make(sel, restraint_type='stereo', spline_on_site=False)

      # Calculate energy to test the disulfide restraints (bonds, angles, dihedrals):
      sel.energy()