No edit summary
No edit summary
Line 6: Line 6:
For example, the script below builds a cyclic model of 1fdx using 5fd1 as a template (attachment:alignment.ali is the example from the Modeller distribution).
For example, the script below builds a cyclic model of 1fdx using 5fd1 as a template (attachment:alignment.ali is the example from the Modeller distribution).


/!\ It is important that you get the numbering of '''residue_ids''' correct; the residue numbers must correspond to the '''last''' and '''first''' residue in the cyclic protein respectively (in the model, not the template). If in doubt, build a regular model first and look at the residue numbers in the final models or `.ini` file.
/!\ It is important that you get the residue order correct; the residues must be the '''last''' and '''first''' residue in the cyclic protein respectively (in the model, not the template). If in doubt, build a regular model first and look at the residue numbers and chain IDs in the final models or `.ini` file.




Line 20: Line 20:
class mymodel(automodel):
class mymodel(automodel):
     def special_patches(self, aln):
     def special_patches(self, aln):
         # Link between residues 54 and 1 to make chain cyclic:
         # Link between last residue (-1) and first (0) to make chain cyclic:
         self.patch(residue_type='LINK',
         self.patch(residue_type='LINK',
                   residues=(self.residues['54'], self.residues['1']))
                   residues=(self.residues[-1], self.residues[0]))


# Use the new 'mymodel' class rather than 'automodel'
# Use the new 'mymodel' class rather than 'automodel'

Revision as of 00:00, 1 January 1970

To build a model of a cyclic protein, you must do two things:

  1. Disable the default patching, which would create a C and N terminus.
  2. Use the LINK patching residue in the special_patches routine to link the last and first residues.

For example, the script below builds a cyclic model of 1fdx using 5fd1 as a template (attachment:alignment.ali is the example from the Modeller distribution).

/!\ It is important that you get the residue order correct; the residues must be the last and first residue in the cyclic protein respectively (in the model, not the template). If in doubt, build a regular model first and look at the residue numbers and chain IDs in the final models or `.ini` file.


#!python
from modeller.automodel import *

log.verbose()
env = environ()

# Disable default NTER and CTER patching
env.patch_default = False 

class mymodel(automodel):
    def special_patches(self, aln):
        # Link between last residue (-1) and first (0) to make chain cyclic:
        self.patch(residue_type='LINK',
                   residues=(self.residues[-1], self.residues[0]))

# Use the new 'mymodel' class rather than 'automodel'
a = mymodel(env, alnfile='alignment.ali', knowns='5fd1', sequence='1fdx')

a.starting_model = a.ending_model = 1
a.make()