Dear all

My name is Sergio Garay and I am pretty new using modeller so it is
probable that my questions can be "a little" silly. I am trying to
build a model with two kind of restrictions (using a multiple templates
alignment): a disulphide bridge and the position of ligands. I was able
to obtain (following your tutorial) models with each restriction applied
in a separate way. The problem appear (errors) when I try to combine both
restriction at the same time. I am using mod9v6, and I follow the examples of
that version. Is there any problem in my py script?

Any help will be appreciated.

Below I've pasted the python script that I used:

# Homology modeling by the automodel class
from modeller import *              # Load standard Modeller classes
from modeller.automodel import *    # Load the automodel class

# Redefine the special_patches routine to include the additional disulfides
# (this routine is empty by default):
class MyModel(automodel):
    def special_patches(self, aln):
        # A disulfide between residues 345 and 668:
        self.patch(residue_type='DISU', residues=(self.residues['345'],
                                                  self.residues['668']))

log.verbose()    # request verbose output
env = environ()  # create a new MODELLER environment to build this model in

# directories for input atom files
env.io.atom_files_directory = './:../atom_files'

# Read in HETATM records from template PDBs
env.io.hetatm = True


a = MyModel(env,
            alnfile  = 'alignment.ali',  # alignment filename
            knowns   = ('2ioaB_amidase', '2vobB', '2ioaB_sinthetase'),  # codes of the templates
            sequence = 'tcruzi')              # 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 the actual homology modeling

The error in the terminal:

Traceback (most recent call last):
  File "model-mixed.py", line 30, in ?
    a.make()                            # do the actual homology modeling
  File "/usr/lib/modeller9v6/modlib/modeller/automodel/automodel.py", line 98, in make
    self.homcsr(exit_stage)
  File "/usr/lib/modeller9v6/modlib/modeller/automodel/automodel.py", line 427, in homcsr
    self.make_initial_model(aln)
  File "/usr/lib/modeller9v6/modlib/modeller/automodel/automodel.py", line 441, in make_initial_model
    self.generate_method(self, aln)
  File "/usr/lib/modeller9v6/modlib/modeller/automodel/generate.py", line 25, in transfer_xyz
    mdl.create_topology(aln)
  File "/usr/lib/modeller9v6/modlib/modeller/automodel/automodel.py", line 659, in create_topology
    self.special_patches(aln)
  File "model-mixed.py", line 10, in special_patches
    self.patch(residue_type='DISU', residues=(self.residues['345'],
  File "/usr/lib/modeller9v6/modlib/modeller/coordinates.py", line 226, in __getitem__
    (self.offset, self.length, self.suffix))
  File "/usr/lib/modeller9v6/modlib/modeller/util/modutil.py", line 19, in handle_seq_indx
    int_indx = lookup_func(*args)
  File "/usr/lib/modeller9v6/modlib/modeller/coordinates.py", line 283, in _indxres
    raise KeyError("No such residue: %s" % indx)
KeyError: 'No such residue: 345'

The log file write by Modeller:

                         MODELLER 9v6, 2009/01/30, r6593

     PROTEIN STRUCTURE MODELLING BY SATISFACTION OF SPATIAL RESTRAINTS


                     Copyright(c) 1989-2009 Andrej Sali
                            All Rights Reserved

                             Written by A. Sali
                               with help from
           B. Webb, M.S. Madhusudhan, M-Y. Shen, M.A. Marti-Renom,
                N. Eswar, F. Alber, M. Topf, B. Oliva, A. Fiser,
                    R. Sanchez, B. Yerkovich, A. Badretdinov,
                      F. Melo, J.P. Overington, E. Feyfant
                 University of California, San Francisco, USA
                    Rockefeller University, New York, USA
                      Harvard University, Cambridge, USA
                   Imperial Cancer Research Fund, London, UK
              Birkbeck College, University of London, London, UK


Kind, OS, HostName, Kernel, Processor: 4, Linux leichmania.unl.edu.ar 2.6.26.8-57.fc8 x86_64
Date and time of compilation         : 2009/01/30 23:00:55
MODELLER executable type             : x86_64-intel8
Job starting time (YY/MM/DD HH:MM:SS): 2009/03/05 07:20:23

openf___224_> Open           $(LIB)/restyp.lib
openf___224_> Open           ${MODINSTALL9v6}/modlib/resgrp.lib
rdresgr_266_> Number of residue groups:        2
openf___224_> Open           ${MODINSTALL9v6}/modlib/sstruc.lib

Dynamically allocated memory at   amaxlibraries [B,KiB,MiB]:      3234076    3158.277     3.084

Dynamically allocated memory at   amaxlibraries [B,KiB,MiB]:      3234604    3158.793     3.085
openf___224_> Open           ${MODINSTALL9v6}/modlib/resdih.lib

Dynamically allocated memory at   amaxlibraries [B,KiB,MiB]:      3283204    3206.254     3.131
rdrdih__263_> Number of dihedral angle types         :        9
              Maximal number of dihedral angle optima:        3
              Dihedral angle names                   :  Alph Phi Psi Omeg chi1 chi2 chi3 chi4 chi5
openf___224_> Open           ${MODINSTALL9v6}/modlib/radii.lib

Dynamically allocated memory at   amaxlibraries [B,KiB,MiB]:      3292444    3215.277     3.140
openf___224_> Open           ${MODINSTALL9v6}/modlib/radii14.lib
openf___224_> Open           ${MODINSTALL9v6}/modlib/af_mnchdef.lib
rdwilmo_274_> Mainchain residue conformation classes:  APBLE
openf___224_> Open           ${MODINSTALL9v6}/modlib/mnch.lib
rdclass_257_> Number of classes:        5
openf___224_> Open           ${MODINSTALL9v6}/modlib/mnch1.lib
openf___224_> Open           ${MODINSTALL9v6}/modlib/mnch2.lib
openf___224_> Open           ${MODINSTALL9v6}/modlib/mnch3.lib
openf___224_> Open           ${MODINSTALL9v6}/modlib/xs4.mat
rdrrwgh_268_> Number of residue types:       21
io_data____W> Setting io.atom_files_directory to a colon-delimited string is
              deprecated, as it is not robust on Windows systems. Set it to
              a list of directories instead. For example:
              env.io.atom_files_directory = ['./', '../atom_files']
openf___224_> Open           alignment.ali

Dynamically allocated memory at   amaxalignment [B,KiB,MiB]:      3303901    3226.466     3.151

Dynamically allocated memory at   amaxalignment [B,KiB,MiB]:      3305351    3227.882     3.152

Dynamically allocated memory at   amaxalignment [B,KiB,MiB]:      3308251    3230.714     3.155

Dynamically allocated memory at   amaxalignment [B,KiB,MiB]:      3314051    3236.378     3.161

Dynamically allocated memory at   amaxalignment [B,KiB,MiB]:      3325651    3247.706     3.172

Dynamically allocated memory at   amaxalignment [B,KiB,MiB]:      3554183    3470.882     3.390

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3554211    3470.909     3.390

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3554239    3470.937     3.390

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3554267    3470.964     3.390

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3554295    3470.991     3.390

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3555003    3471.683     3.390

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3557363    3473.987     3.393

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3559015    3475.601     3.394

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      3561899    3478.417     3.397
read_al_374_> Non-standard residue type,position,sequence:  .      739        3
read_al_374_> Non-standard residue type,position,sequence:  .      740        3
read_al_374_> Non-standard residue type,position,sequence:  .      741        3
read_al_374_> Non-standard residue type,position,sequence:  .      739        4
read_al_374_> Non-standard residue type,position,sequence:  .      740        4
read_al_374_> Non-standard residue type,position,sequence:  .      741        4

Read the alignment from file       : alignment.ali
Total number of alignment positions:   741

  #  Code        #_Res #_Segm PDB_code    Name
-------------------------------------------------------------------------------
  1  2ioaB_ami     178      1 2ioaB_amida
  2      2vobB     591      1       2vobB
  3  2ioaB_sin     414      2 2ioaB_sinth
  4     tcruzi     722      2      tcruzi
check_a_343_> >> BEGINNING OF COMMAND
openf___224_> Open           ./2ioaB_amidase.pdb

Dynamically allocated memory at   amaxstructure [B,KiB,MiB]:      3665465    3579.556     3.496
openf___224_> Open           ./2vobB.pdb

Dynamically allocated memory at   amaxstructure [B,KiB,MiB]:      4011534    3917.514     3.826
openf___224_> Open           ./2ioaB_sinthetase.pdb

Dynamically allocated memory at   amaxstructure [B,KiB,MiB]:      4253508    4153.816     4.056
replace_706W> BLK ('.') residue type in alignment will force 'automodel'
              model building to treat residue type  MG as a rigid body,
              even though topology information appears to be at least
              partially available. To treat this residue flexibly
              instead, use 1-letter code ' $' in the alignment.
replace_706W> BLK ('.') residue type in alignment will force 'automodel'
              model building to treat residue type  MG as a rigid body,
              even though topology information appears to be at least
              partially available. To treat this residue flexibly
              instead, use 1-letter code ' $' in the alignment.
replace_706W> BLK ('.') residue type in alignment will force 'automodel'
              model building to treat residue type  ADP as a rigid body,
              even though topology information appears to be at least
              partially available. To treat this residue flexibly
              instead, use 1-letter code ' &' in the alignment.
fndatmi_285W> Only      411 residues out of      414 contain atoms of type  CA
              (This is usually caused by non-standard residues, such
              as ligands, or by PDB files with missing atoms.)

check_ali___> Checking pairwise structural superpositions.

Equivalent CA pairs with distance difference larger than  6.0 angstroms:

ALN_POS TMPL1 TMPL2  RID1  RID2  NAM1  NAM2     DIST
----------------------------------------------------
drmsq1__W> n<2
drmsq3__W> n<2
    248     2     3  215   204      P     I    7.832
    249     2     3  216   205      P     A    6.141
    371     2     3  335   324      N     R    6.155
    405     2     3  368   356      G     G    6.617
    407     2     3  370   357      D     N    6.545
    508     2     3  466   451      D     I    6.965
    509     2     3  467   452      Y     R    6.999
    524     2     3  477   464      N     I   10.068
    530     2     3  482   469      P     P    7.125
    588     2     3  539   525      E     L    6.179
    592     2     3  543   529      H     G    6.116
    596     2     3  547   533      K     K    7.078
    601     2     3  578   536      R     A   15.389
    667     2     3  579   565      N     N    6.052
    707     2     3  617   605      S     I    6.995
END OF TABLE
fndatmi_285W> Only      411 residues out of      414 contain atoms of type  CA
              (This is usually caused by non-standard residues, such
              as ligands, or by PDB files with missing atoms.)

check_ali___> Checking the sequence-structure alignment.

Implied target CA(i)-CA(i+1) distances longer than  8.0 angstroms:

ALN_POS  TMPL  RID1  RID2  NAM1  NAM2     DIST
----------------------------------------------
     45     1   31    43      R     I   15.730
    288     2  250   265      G     F   19.941
    513     3  454   459      A     W    9.670
    600     2  551   578      G     R   11.251
    721     2  632   637      R     Q   14.815
END OF TABLE
check_a_344_> << END OF COMMAND
openf___224_> Open           ${LIB}/top_heav.lib
read_to_681_> topology.submodel read from topology file:        3
openf___224_> Open           ${MODINSTALL9v6}/modlib/models.lib
openf___224_> Open           ${LIB}/par.lib

Dynamically allocated memory at  amaxparameters [B,KiB,MiB]:      5202292    5080.363     4.961
openf___224_> Open           ${LIB}/par.lib
read_pa_232_> parameters    BONDS   ANGLS  DIHEDS IMPROPS    MODE
                              227     561     661     112       0

Dynamically allocated memory at       amaxmodel [B,KiB,MiB]:      5315018    5190.447     5.069

Dynamically allocated memory at       amaxmodel [B,KiB,MiB]:      5876166    5738.443     5.604

Dynamically allocated memory at       amaxmodel [B,KiB,MiB]:      5963014    5823.256     5.687

getf_______W> RTF restraint not found in the atoms list:
              residue type, indices:    18   719
              atom names           : C     +N
              atom indices         :  5706     0

getf_______W> RTF restraint not found in the atoms list:
              residue type, indices:    18   719
              atom names           : C     CA    +N    O
              atom indices         :  5706  5702     0  5707

mkilst______> segment topology constructed from sequence and RTF:
              segments residues atoms bonds angles dihedrals impropers:
                     1      719  5707  5854      0         0      2501

Dynamically allocated memory at       amaxmodel [B,KiB,MiB]:      6209366    6063.834     5.922

patch_______> segment topology patched using RTF:     1  ;  MET  ;  NTER
              segments residues atoms bonds angles dihedrals impropers:
                     1      719  5707  5854   7949      9437      2501


Dynamically allocated memory at       amaxmodel [B,KiB,MiB]:      6484142    6332.170     6.184
patch_______> segment topology patched using RTF:   719  ;  VAL  ;  CTER
              segments residues atoms bonds angles dihedrals impropers:
                     1      719  5708  5855   7951      9439      2502

genseg______> segment topology constructed from sequence and RTF:
              segments residues atoms bonds angles dihedrals impropers:
                     1      719  5708  5855   7951      9439      2502

Dynamically allocated memory at    amaxsequence [B,KiB,MiB]:      6484170    6332.197     6.184

Dynamically allocated memory at       amaxmodel [B,KiB,MiB]:      6484641    6332.657     6.184

Dynamically allocated memory at       amaxmodel [B,KiB,MiB]:      6486699    6334.667     6.186

mkilst______> segment topology constructed from sequence and RTF:
              segments residues atoms bonds angles dihedrals impropers:
                     2      722  5737  5855   7951      9439      2502

genseg______> segment topology constructed from sequence and RTF:
              segments residues atoms bonds angles dihedrals impropers:
                     2      722  5737  5855   7951      9439      2502
fndatmi_285W> Only      411 residues out of      414 contain atoms of type  CA
              (This is usually caused by non-standard residues, such
              as ligands, or by PDB files with missing atoms.)

The alignmet used:

>P1; 2ioaB_amidase
structureX:2ioaB_amidase:12:B:200:B:::-1.00:-1.00
-------------------FGTLLGYAPGGVAIYSSD---Y---SV--------------
FRSYIDDEYMGHKWQCVEFARRFLFLNYGVVFTDVGMAWEIFSLRFLREVVND-NILPLQ
AFPNGSPRAPVAGALLIWDKGGEFKDTGHVAIITQLHGNKVRIAEQNVIHSPLPQGQQWT
RELEMVVEN-GCYTLKD-TFD-D-TTILGWMIQTEDTEYSLP------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
-------------------/---*

>P1; 2vobB
structureX:2vobB:5:B:652:B:::-1.00:-1.00
-----QRASVSFNKPGHIPFGAVQGYAPGGVPAYSNKHDHYFSG----------------
ERNIEDNIFFGFKYQCVEFARRWLLVRKGLLLPDVNWACHIFQLKEVRDAATT-ESFAVL
QVRNGTTTKPEADALLVYPSTDAN-PVGHVGTITEVGDDYVCVADQNYRFHKWE--SSCA
YKLKLDHRD-GIWTIIDDIDADEIEIPLGWLTFP--------GRANRPEGAPPVALHPSL
HFKE---PP--KPYLLRRNF-LPW--------LDMNNPAERLFVEEFG----------VS
YYESNHEFHLRCVAYGTQLHAIFMEATAQVIESDEKLRLFAIPEEFWPRIRHSWKYQQ-T
YISGRFDFAFNNETGEVKCFEYNADSASTLLECGLIQQKWAESV-GLDDTRGSGFAVERN
LKMAWANSG------ATGRVHFCVDEEREEQYTALYCMQAAEAVGLEGKLCILFDEFRF-
DDNGHVVDSDGVRVRNVWKTWMWESAITDYYAAR-----EERGEN-WKPSPK-DKVRLCD
LLLGDDWEILYFEPMWKVIPSNKAILPMIYHNHPEHPAILKAEYELTDELRKHGYAKKPI
VR----------------------------------------------------------
-------NMIYQQLFELKKQDDYYAIIGGWMIGDAFSGTGIREDK--S-----PFAAVRI
-KPHPVTLKDIDKMAEDE-/---*

>P1; 2ioaB_sinthetase
structureX:2ioaB_sinthetase:201:B:621:B:::-1.00:-1.00
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
----QPEIAGELLKISGARLEN--KGQFDGKWLDEKDPLQNAYVQAN--GQVINQDPYHY
YTITESAEQELIKATNELHLMYLHATDKVLKDDNLLALFDIPKILWPRLRLSWQRRRHHM
ITGRMDFCMDER--GLKVYEYNADSASCHTEAGLILERWAEQGYKG-NGFNPAEGLINEL
AGAWKHSRA------RPFVHIMQDKDIEENYHAQFMEQALHQAGFETRILRGLDELGW--
G--QLIDGEGRLVNCVWKTWAWETAFDQIRE--VFAAVP-----IR-TGHPQNEVRLIDV
LLR--PEVLVFEPLWTVIPGNKAILPILWSLFPHHRYLLDTDFTVNDELVKTGYAVKPI-
-AGRCGSNIDLVSHH-------------------------------------EEVLDKTS
GKFAEQKNIYQQLWCLPKVDGKYIQVCTFTVGGNYGGTCLRGDESLVIKKESDIEPLIVV
K------------------/...*

>P1; tcruzi
sequence:tcruzi:::::::0.00:0.00
MENTDKQRGVHASETEHVSFGGVIGVTDCGVPVFSNGEKKFFSERISFAPDCKRVEAAAP
TTVIGTHDTLGYKWLCLEFARRYLLMTKGVWLASVPTAEDIWEIDEIVTSVPIGTPVPVE
REKHGDTTSMPSVGDLLVWSRTEDSPYGHLAVVTHVSDNGVCVAEQNYEFKRWQEGKNYS
RRFDCEKREDGVTVFVGETHLLGWVIIKAPPYDFSLGDLPDKYRHIIGPGHIVRRHLEKD
VLLPWLNPSQRCDFFLKRSLTVG--------GYMGEDAVAEAHSVPDG------------
FYMMDYDMWCRFRFATKNLHAVAVEATRLILNSRDSEALLVQYFGLPKELHLQLRRSFET
IPSMCGRFDFGYDGKEIIMLAYNCDSSAAMLECGDTQEKFARHYGVELGTSTGSFLYSRI
ANYFNCLIQNEFLCPHHKIVHFMIDDDDEERYTALYVMNAAESAGFRTKLCVKLSGFRFG
STTGEVDRDASPTERRSVVDLENEEVLLVWKTWAWDTVLRQYVEQRTQQGHGVSTKPTLS
DILLNEHIRVLEPLWKAVTGSKAILPFMYAAAPHHSNMVPASFYRTKEIISAPYLTKPVN
GRSGKSMTMYDTGEDPEAVAAAPHTAAAPVLGRSISAVLFDDAPAGTYRVPFDNIQENLT
ERLFDSVVVYQSRVFLTRYEKKYSPIFCGWNVGGEFGGVIVREENFNNTKLSSLVIPSRV
VRQHIPLHAMQESTTSGEV/...*


--
Dr. Sergio Garay
Facultad de Bioquimica y Cs. Biológicas
Universidad Nacional del Litoral
Santa Fe - Argentina
C.C. 242 - Ciudad Universitaria - C.P. S3000ZAA
Argentina
Ph. +54 (342) 4575-213
Fax. +54 (342) 4575-221