next up previous contents index
Next: model.orient() center Up: The model class: handling Previous: model.reorder_atoms() standardize   Contents   Index

model.rotate_dihedrals() -- change dihedral angles

dihedrals = <str:0> 'PHI' 'PSI' 'CHI1' 'CHI2' 'CHI3' 'CHI4' dihedral angle type selection: 'phi' | 'psi' | 'omega' | 'chi1' | 'chi2' | 'chi3' | 'chi4' | 'chi5' | 'alpha'
change = <str:1> 'RANDOMIZE' what to do: 'RANDOMIZE' | 'OPTIMIZE'
deviation = <float:1> 0.0 amplitude of dihedral angle randomization

Requirements:

for change='OPTIMIZE': topology & restraints
for change='RANDOMIZE': topology

Description:
This command changes the dihedral angles in MODEL.

change selects an optimization (when equal to 'OPTIMIZE') or randomization (when equal to 'RANDOMIZE'):

  1. When optimizing, this command finds the first selected restraint that restrains the specified dihedral angle of each selected residue. It then sets the value of that dihedral to the most likely value. A residue is selected if any of its atoms is in the set 1 of selected atoms.

  2. When randomizing, the command changes the specified dihedral angle of each selected residue by adding a random value distributed uniformly from $-{\sf deviation}\index{deviation@{\sf deviation}}$ to $+{\sf deviation}\index{deviation@{\sf deviation}}$ degrees.

dihedrals can be either a vector of dihedral angle names or a single string containing all the dihedral angle names separated by blanks. The dihedral angles involved in cyclic structures are not changed (e.g., sidechain dihedral angles in disulfide bonds and prolines). The dihedral angles that can be changed are listed at the top of the $RESDIH_LIB library: alpha, phi, psi, omega, chi1, chi2, chi3, chi4, chi5. Dihedral angle 'alpha' is the virtual ${C}_\alpha$ dihedral angle defined by four consecutive ${C}_\alpha$ atoms.

The bond connectivity of the MODEL has to exist before this command is executed. If you read in the model by model.read(), the bond connectivity is defined by subsequent calls to topology.append() and model.generate_topology() (also make sure that sequence entry does not exist in the alignment or that no alignment is in memory).

Example: examples/commands/rotate_dihedrals.py


# Example for: model.rotate_dihedrals()

# This will optimize and randomize dihedrals in a MODEL
env = environ(rand_seed=-2312)
env.libs.topology.read(file='$(LIB)/top_heav.lib')
env.libs.parameters.read(file='$(LIB)/par.lib')

# Select dihedral angle types for optimization and randomization:
dih = 'phi psi omega chi1 chi2 chi3 chi4 chi5'

# Read the sequence, get its topology and coordinates:
code='1fas'
mdl = model(env, file=code)
aln = alignment(env)
aln.append_model(mdl, align_codes=code, atom_files=code)
aln.append_model(mdl, align_codes=code+'_ini', atom_files=code+'_ini')
mdl.generate_topology(aln, sequence=code+'_ini')
mdl.transfer_xyz(aln)
mdl.build(initialize_xyz=False, build_method='INTERNAL_COORDINATES')
mdl.rotate_dihedrals(change='RANDOMIZE', deviation=90.0, dihedrals=dih)
mdl.write(file='1fas.ini1')

# Get restraints from somewhere and optimize dihedrals:
mdl.restraints.make(aln, restraint_type='stereo', spline_on_site=False)
mdl.rotate_dihedrals(change='OPTIMIZE', deviation=90.0, dihedrals=dih)
mdl.write(file='1fas.ini2')


next up previous contents index
Next: model.orient() center Up: The model class: handling Previous: model.reorder_atoms() standardize   Contents   Index
Ben Webb 2005-04-21