from modeller.automodel import *

class mymodel(automodel):
    def special_restraints(self, aln):
        rsr = self.restraints
        for ids in (('NH1:161', 'O1A:334'),
                    ('NH2:161', 'O1B:334'),
                    ('NE2:186', 'O2:334')):
            rsr.add(atom_ids=ids,
                    restraint_parameters=(2, 1, 1, 22, 2, 2, 0, 3.5, 0.1))

env = environ()
env.io.hetatm = True
a = mymodel(env, alnfile='TvLDH-4mdh-1emd_ed.ali',
            knowns=('4mdhA', '1emd_ed'), sequence='TvLDH')
a.starting_model = 1
a.ending_model = 5
a.make()
