from modeller import * from modeller.automodel import * # Load the automodel class log.verbose() # Override the 'special_restraints' and 'user_after_single_model' methods: class MyModel(automodel): def special_restraints(self, aln): # Constrain the A and B chains to be identical (but only restrain # the C-alpha atoms, to reduce the number of interatomic distances # that need to be calculated): s1 = selection(self.chains['A']).only_atom_types('CA') s2 = selection(self.chains['B']).only_atom_types('CA') s3 = selection(self.chains['C']).only_atom_types('CA') s4 = selection(self.chains['D']).only_atom_types('CA') s5 = selection(self.chains['E']).only_atom_types('CA') s6 = selection(self.chains['F']).only_atom_types('CA') s7 = selection(self.chains['G']).only_atom_types('CA') s8 = selection(self.chains['H']).only_atom_types('CA') s9 = selection(self.chains['I']).only_atom_types('CA') s10 = selection(self.chains['J']).only_atom_types('CA') s11 = selection(self.chains['K']).only_atom_types('CA') s12 = selection(self.chains['L']).only_atom_types('CA') self.restraints.symmetry.append(symmetry(s1, s2, 1)) self.restraints.symmetry.append(symmetry(s2, s3, 1)) self.restraints.symmetry.append(symmetry(s3, s4, 1)) self.restraints.symmetry.append(symmetry(s4, s5, 1)) self.restraints.symmetry.append(symmetry(s5, s6, 1)) self.restraints.symmetry.append(symmetry(s6, s7, 1)) self.restraints.symmetry.append(symmetry(s7, s8, 1)) self.restraints.symmetry.append(symmetry(s8, s9, 1)) self.restraints.symmetry.append(symmetry(s9, s10, 1)) self.restraints.symmetry.append(symmetry(s10, s11, 1)) self.restraints.symmetry.append(symmetry(s11, s12, 1)) def user_after_single_model(self): # Report on symmetry violations greater than 1A after building # each model: self.restraints.symmetry.report(1.0) env = environ() # directories for input atom files env.io.atom_files_directory = ['.', '../atom_files'] # Be sure to use 'MyModel' rather than 'automodel' here! a = MyModel(env, alnfile= 'acr1-mult2.ali', # alignment filename knowns = ('2BYU', '1gme1', '1gme2', '1gme3', '1gme4', '1gme5', '1gme6'),# codes of the templates sequence = 'acr1', # code of the target assess_methods=(assess.DOPE, assess.GA341)) a.starting_model= 1 # index of the first model a.ending_model = 10 # index of the last model # (determines how many models to calculate) a.md_level = refine.slow a.make() # do homology modeling