Dear Modeller Collegues, After sticking for a long time to the old TOP language, I am trying to switch to Python because I need to use some of the high-end Modeller features such as dope_loopmodel. Here is my problem : I want to refine several loops in an existing model using dope_loopmodel. Some of the loops have disulfide bridges with the rest of the model or between themselves (the disulfides do not exist in the template). A previous case of using restraints or patches in loop refinement already appeared in the discussion list but there, loopmodel was used on the fly after automodel so that the redefined patches and restraints automodel subclasses were active during loop refinement. What happens when one uses only loopmodel or dope_loopmodel to refine an existing model ? I suppose it is possible to import patches subclasses from automodel. I tried to fiddle but got nowhere. Could somebody help me ? To make myself clear, I am pasting below an example (on one loop) of what I was doing with the old TOP language (it worked, at least computationally). Thanks in advance for your help. Best regards. Michel
M. Seigneuret wrote: > A previous case of using restraints or patches in loop refinement > already appeared in the discussion list but there, loopmodel was used > on the fly after automodel so that the redefined patches and restraints > automodel subclasses were active during loop refinement. > What happens when one uses only loopmodel or dope_loopmodel to refine an > existing model ? I suppose it is possible to import patches subclasses > from automodel. I tried to fiddle but got nowhere. Could somebody help me ?
It works in just the same way. loopmodel is a derived class of automodel, so everything you can do in automodel can also be done in loopmodel (it doesn't make any difference whether you build models and refine the loops in one go, or just use loopmodel to refine the loops of an existing model). See the example at http://salilab.org/modeller/9v3/manual/node34.html
It should be straightforward to modify this example to also override the special_patches routine. In your case, your TOP script would translate to something like:
from modeller import * from modeller.automodel import *
env = environ()
class MyLoop(loopmodel): def select_loop_atoms(self): return selection(self.residue_range('59:', '61:')) def special_patches(self): self.patch(residue_type='DISU', residues=(self.residues['41'], self.residues['60']))
m = MyLoop(env, inimodel='mod2f.B99990002.pdb', sequence='mod2134') m.loop.starting_model = 20 m.loop.ending_model = 30 m.loop.md_level = refine.very_fast m.make()
Ben Webb, Modeller Caretaker
Thanks. Unfortunately, the script stopped after a few seconds. Nothing special in the log (except that it was short), but this at the command prompt:
'import site' failed; use -v for traceback Traceback (most recent call last): File "model-loop.py, line 21, in ? m.make() File "C:\Program Files\Modeller9v3\modlib\modeller\automodel\loopmodel.py", line 31, in make self.build_seq(self.inimodel, 1) File "C:\Program Files\Modeller9v3\modlib\modeller\automodel\loopmodel.py", line 118, in build_seq self.create_loop_topology File "C:\Program Files\Modeller9v3\modlib\modeller\automodel\loopmodel.py", line 104, in create_loop_topology self.special_patches(aln) TypeError: special_patches() takes exactly 1 argument (2 given)
Strange. It seems to complain that special_patches has 2 arguments instead of 1, while it has actually 1 in your script and 2 in the manual examples. Thanks again for your help. Michel
Modeller Caretaker a écrit :
> It should be straightforward to modify this example to also override the > special_patches routine. In your case, your TOP script would translate > to something like: > > from modeller import * > from modeller.automodel import * > > env = environ() > > class MyLoop(loopmodel): > def select_loop_atoms(self): > return selection(self.residue_range('59:', '61:')) > def special_patches(self): > self.patch(residue_type='DISU', > residues=(self.residues['41'], > self.residues['60'])) > > m = MyLoop(env, > inimodel='mod2f.B99990002.pdb', > sequence='mod2134') > m.loop.starting_model = 20 > m.loop.ending_model = 30 > m.loop.md_level = refine.very_fast > m.make() >
M. Seigneuret wrote: > Unfortunately, the script stopped after a few seconds. Nothing special > in the log (except that it was short), but this at the command prompt: ... > TypeError: special_patches() takes exactly 1 argument (2 given) > > Strange. It seems to complain that special_patches has 2 arguments > instead of 1, while it has actually 1 in your script and 2 in the manual > examples.
What's strange about that? It just means that my example was wrong. ;) It should say
def special_patches(self, aln):
of course, just as in the manual. If in doubt, trust the manual examples. They are tested - quick examples in emails are not.
Ben Webb, Modeller Caretaker
participants (2)
-
M. Seigneuret
-
Modeller Caretaker