Hi folks,
I'm looking to generate a model with a disulfide constraint as well as loop refinement. I am still getting my head around the python scripts. In the old top files, one could do multiple things in the single top file. I can't seem to get past this issue with the python scripts. I can run things separately but I am at a loss trying to combine them. I seem to be stuck with
a = loopmodel(env,....
vs
a = MyModel (having defined the disulfide patch
Could someone help or direct me to the write web page. Is this the process to actually run two separate cripts (generate disulfide then run loop refinement?
Many thanks in advance
An example script would be awesome
J
_________________________________
Joel Tyndall, PhD
Senior Lecturer in Medicinal Chemistry National School of Pharmacy University of Otago PO Box 56 Dunedin 9054 New Zealand http://www.researcherid.com/rid/C-2803-2008
Pukeka Matua Te Kura Taiwhanga Putaiao Te Whare Wananga o Otago Pouaka Poutapeta 56 Otepoti 9054 Aotearoa
Ph / Waea +64 3 4797293 Fax / Waeawhakaahua +64 3 4797034
Hello Joel,
I'll send you something that I think is exactly what you want. Check the MyModel.py.
I use two scripts to model my stuff when I want to define my custom restraints. I use two scripts because parallel processing just doesn't like putting everything in one script, don't ask me why :x
The first is build_model.py and it's basically the main script that modeller uses. It has a few extra features but don't mind them.
The important lines are:
(number 11) from MyModel import MyModel
(number 123) a = MyModel(env,
This just imports and uses the MyModel class defined in the second script: MyModel.py. That second one has what you need. Basically it defines a new class:
class MyModel(loopmodel):
that inherits from loopmodel instead of automodel. It then has a function called special_patches that includes my restraints. That includes disulfide bridges:
self.patch(residue_type='DISU', residues=(self.residues['981:B'], self.residues['984:B']))
Take a look at the scripts and if you have any doubt just call back :)
Regards! João [ .. ] Rodrigues
(Blog) http://doeidoei.wordpress.com (MSN) always_asleep_@hotmail.com (Skype) rodrigues.jglm
On Mon, Nov 9, 2009 at 7:00 PM, Joel Tyndall joel.tyndall@otago.ac.nzwrote:
> Hi folks, > > > > I’m looking to generate a model with a disulfide constraint as well as loop > refinement. I am still getting my head around the python scripts. In the old > top files, one could do multiple things in the single top file. I can’t seem > to get past this issue with the python scripts. I can run things separately > but I am at a loss trying to combine them. I seem to be stuck with > > > > a = loopmodel(env,.... > > > > vs > > > > a = MyModel (having defined the disulfide patch > > > > Could someone help or direct me to the write web page. Is this the process > to actually run two separate cripts (generate disulfide then run loop > refinement? > > > > Many thanks in advance > > > > An example script would be awesome > > > > J > > > > _________________________________ > > Joel Tyndall, PhD > > Senior Lecturer in Medicinal Chemistry > National School of Pharmacy > University of Otago > PO Box 56 Dunedin 9054 > New Zealand > http://www.researcherid.com/rid/C-2803-2008 > > Pukeka Matua > Te Kura Taiwhanga Putaiao > Te Whare Wananga o Otago > Pouaka Poutapeta 56 Otepoti 9054 > Aotearoa > > Ph / Waea +64 3 4797293 > Fax / Waeawhakaahua +64 3 4797034 > > > > _______________________________________________ > modeller_usage mailing list > modeller_usage@salilab.org > https://salilab.org/mailman/listinfo/modeller_usage > >
João Rodrigues wrote: > I use two scripts to model my stuff when I want to define my custom > restraints. I use two scripts because parallel processing just doesn't > like putting everything in one script, don't ask me why :x
Parallel processing relies on Python's "pickle" module to send objects from one machine to another, and "pickle" only works on "classes that are defined at the top level of a module": http://www.python.org/doc/2.3.5/lib/node65.html
This means that any object you want to use in a parallel run must be defined in a module, i.e. it can't be in your main script but you must say something like "from mymodel import MyModel" in the script to get the MyModel class from the mymodel.py module.
Ben Webb, Modeller Caretaker
Mystery solved then. Thanks!
Regards!
João [ .. ] Rodrigues
(Blog) http://doeidoei.wordpress.com (MSN) always_asleep_@hotmail.com (Skype) rodrigues.jglm
Joel Tyndall wrote: > I’m looking to generate a model with a disulfide constraint as well as > loop refinement. I am still getting my head around the python scripts. > In the old top files, one could do multiple things in the single top > file. I can’t seem to get past this issue with the python scripts. I can > run things separately but I am at a loss trying to combine them.
The Python scripts can do everything the TOP scripts did (plus a lot more, of course). Where in a TOP script you would redefine a function with a specific name (e.g. select_atoms) in Python you subclass automodel or loopmodel and override the method with the same name.
> I seem to be stuck with > > a = loopmodel(env,.... > > vs > > a = MyModel (having defined the disulfide patch
Just have MyModel subclass loopmodel rather than automodel (i.e. "class MyModel(loopmodel)") then you can use MyModel in exactly the same way as loopmodel, and get your disulfide patch at the same time as loop refinement.
> Could someone help or direct me to the write web page.
http://salilab.org/modeller/9v7/manual/node24.html
Just replace the class MyModel(automodel): line with class MyModel(loopmodel):
You can then set a.loop.starting_model etc. as in regular loop modeling.
> Is this the > process to actually run two separate cripts (generate disulfide then run > loop refinement?
No, the two can most certainly be combined.
Ben Webb, Modeller Caretaker
participants (3)
-
Joel Tyndall
-
João Rodrigues
-
Modeller Caretaker