# Example for: model.rotate_dihedrals() # This will optimize and randomize dihedrals in a MODEL env = environ() 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')