Hi: I want to use a part structure of template which belongs GPCR family. I write 'model-segment.py' scripts to model, the following is the scripts:
from modeller import * log.verbose() class mymodel(automodel): def selection_atoms(self): self.pick_atoms(selection_segment=('37:A','63:A'), selection_search='segment',pick_atoms_set=1, res_types='all',atom_types='all', selection_from='all',selection_status='initialize') self.pick_atoms(selection_segment=('74:A','96:A'), selection_search='segment',pick_atoms_set=2, res_types='all',atom_types='all', selection_from='all',selection_status='initialize') self.pick_atoms(selection_segment=('111:A','133:A'), selection_search='segment',pick_atoms_set=3, res_types='all',atom_types='all', selection_from='all',selection_status='initialize') self.pick_atoms(selection_segment=('153:A','173:A'), selection_search='segment',pick_atoms_set=4, res_types='all',atom_types='all', selection_from='all',selection_status='initialize') self.pick_atoms(selection_segment=('203:A','224:A'), selection_search='segment',pick_atoms_set=5, res_types='all',atom_types='all', selection_from='all',selection_status='initialize') self.pick_atoms(selection_segment=('250:A','274:A'), selection_search='segment',pick_atoms_set=6, res_types='all',atom_types='all', selection_from='all',selection_status='initialize') self.pick_atoms(selection_segment=('287:A','308:A'), selection_search='segment',pick_atoms_set=7, res_types='all',atom_types='all', selection_from='all',selection_status='initialize') env=environ() env.io.atom_files_directory='./:../atom_files' env.edat.nonbonded_sel_atoms=2 a=mymodel(env, alnfile='1u19-tm.ali', knows='1u19', sequence='mrg-tm') a.starting_model=1 a.ending_model=1 a.make()
But when I run the mod9v1, there appears some errors: Traceback (most recent call last): File "model-segment.py", line 3, in ? class mymodel(automodel): NameError: name 'automodel' is not define How to define the 'automodel', please? thanks a lot!!
jinlian05@lzu.cn wrote: > Hi: > I want to use a part structure of template which belongs GPCR family. I write > 'model-segment.py' scripts to model, the following is the scripts: > > from modeller import * > log.verbose() > class mymodel(automodel): > def selection_atoms(self): > self.pick_atoms(selection_segment=('37:A','63:A'), > selection_search='segment',pick_atoms_set=1, > res_types='all',atom_types='all', > selection_from='all',selection_status='initialize') > self.pick_atoms(selection_segment=('74:A','96:A'), > selection_search='segment',pick_atoms_set=2, > res_types='all',atom_types='all', > selection_from='all',selection_status='initialize') > self.pick_atoms(selection_segment=('111:A','133:A'), > selection_search='segment',pick_atoms_set=3, > res_types='all',atom_types='all', > selection_from='all',selection_status='initialize') > self.pick_atoms(selection_segment=('153:A','173:A'), > selection_search='segment',pick_atoms_set=4, > res_types='all',atom_types='all', > selection_from='all',selection_status='initialize') > self.pick_atoms(selection_segment=('203:A','224:A'), > selection_search='segment',pick_atoms_set=5, > res_types='all',atom_types='all', > selection_from='all',selection_status='initialize') > self.pick_atoms(selection_segment=('250:A','274:A'), > selection_search='segment',pick_atoms_set=6, > res_types='all',atom_types='all', > selection_from='all',selection_status='initialize') > self.pick_atoms(selection_segment=('287:A','308:A'), > selection_search='segment',pick_atoms_set=7, > res_types='all',atom_types='all', > selection_from='all',selection_status='initialize') > env=environ() > env.io.atom_files_directory='./:../atom_files' > env.edat.nonbonded_sel_atoms=2 > a=mymodel(env, > alnfile='1u19-tm.ali', > knows='1u19', > sequence='mrg-tm') > a.starting_model=1 > a.ending_model=1 > a.make() > > But when I run the mod9v1, there appears some errors: > Traceback (most recent call last): > File "model-segment.py", line 3, in ? > class mymodel(automodel): > NameError: name 'automodel' is not define > How to define the 'automodel', please?
Please see http://salilab.org/modeller/9v1/manual/node22.html for an example. You have three problems with the script above: 1. You need to 'import' the automodel class, which is done in the example script with from modeller.automodel import *
2. You can't name the selection method 'selection_atoms'. It has to be called select_atoms.
3. There is no pick_atoms method; you have to return a selection object. In your case, something like return selection(self.residue_range('37:A', '63:A'), self.residue_range('74:A', '96:A'), self.residue_range('111:A', '133:A'), self.residue_range('153:A', '173:A'), self.residue_range('203:A', '224:A'), self.residue_range('250:A', '274:A'), self.residue_range('287:A', '308:A'))
should be suitable.
Ben Webb, Modeller Caretaker
participants (2)
-
jinlian05@lzu.cn
-
Modeller Caretaker