next up previous contents index
Next: Providing your own restraints Up: More advanced usage Previous: Building an all hydrogen   Contents   Index


Refining only part of the model

The automodel class contains a 'select_atoms' method which selects the atoms to be moved during optimization. By default, the routine selects all atoms, but you can redefine it to select any subset of atoms and then only those atoms will be refined. (To redefine the routine, it is necessary to create a subclass of automodel, here called mymodel, which has the modified routine within it. We then use mymodel in place of automodel.)

By default, these atoms will ``feel'' the presence of other atoms via all the static and possibly dynamic restraints that include both selected and un-selected atoms. However, you can turn off dynamic interactions between the selected and unselected regions by setting env.edat.nonbonded_sel_atoms to 2 (by default it is 1). For example, the script below would refine only atoms in residues 1 and 2. The difference between this script and the one for loop modeling is that here the selected regions are optimized with the default optimization protocol and the default restraints, which generally include template-derived restraints. In contrast, the loop modeling routine does not use template-dependent restraints, but does a much more thorough optimization.

Example: examples/automodel/model-segment.py


# Homology modelling by the automodel class
#
# Demonstrates how to refine only a part of the model.
#
# You may want to use the more exhaustive "loop" modeling routines instead.
#

from modeller.automodel import *    # Load the automodel class

log.verbose()

# Override the 'select_atoms' routine in the 'automodel' class
class mymodel(automodel):
    def select_atoms(self):
        self.pick_atoms(selection_segment=('1:', '2:'),
                        selection_search='segment', pick_atoms_set=1,
                        res_types='all', atom_types='all',
                        selection_from='all', selection_status='initialize')

env = environ()
# directories for input atom files
env.io.atom_files_directory = './:../atom_files'
# selected atoms do not feel the neighborhood
env.edat.nonbonded_sel_atoms = 2

a = mymodel(env,
            alnfile  = 'alignment.ali',     # alignment filename
            knowns   = '5fd1',              # codes of the templates
            sequence = '1fdx')              # code of the target

a.starting_model= 3                # index of the first model 
a.ending_model  = 3                # index of the last model
                                   # (determines how many models to calculate)
a.make()                           # do homology modelling


next up previous contents index
Next: Providing your own restraints Up: More advanced usage Previous: Building an all hydrogen   Contents   Index
Ben Webb 2005-04-21