Hi,
I have a question concerning code semantics. To me it seems to address the heart of similar questions I've read on the list, too.
If a derived class (see http://www.salilab.org/modeller/manual/node27.html for instance) has a method defining additional restraints, how, having no conventional __init__-method of the base class called, do I know in advance that a method is called? I never saw something like
a.special_restraints(aln)
in the examples. (BTW, where does 'aln' come from? special_restraints() requires this parameter, but it does not get defined in the code.)
My scripts follow the example code, but I've also run into problems occasionally, not knowing how I can actually play with the examples sticking to pythonic coding.
So, my question(s) can be summarized as: Is there any node in the manual describing the MODELLER-Python interface, particularly a list of methods invoked upon deriving a class? If not, would you accept this as a 'documentation request'? (If this is documented somewhere already, please excuse my ignorance.)
Thanks Christian
Christian Meesters wrote: > If a derived class (see > http://www.salilab.org/modeller/manual/node27.html for instance) has a > method defining additional restraints, how, having no conventional > __init__-method of the base class called, do I know in advance that a > method is called?
All of these methods are documented in the manual with examples. If you want to see where the methods are called from, you'd need to look at the actual definition of the base class. But the base class is just Python code, so you can just look those Python files directly - there's nothing secret about them. You can look at the actual files in the modlib/modeller/ directory, use your Python's interpreter's help() function on them, or feed them into a documentation engine like epydoc if you so desire.
> method is called? I never saw something like > > a.special_restraints(aln) > > in the examples. (BTW, where does 'aln' come from? special_restraints() > requires this parameter, but it does not get defined in the code.)
The manual would be far too verbose if we were to put in the full Python code of the base classes, and IMHO it would be confusing for most users. 'aln' is defined in the base class, of course - see the modlib/modeller/automodel/automodel.py file in this case. The methods themselves are described in the reference section - special_restraints() at http://www.salilab.org/modeller/9v2/manual/node66.html for example.
Ben Webb, Modeller Caretaker
participants (2)
-
Christian Meesters
-
Modeller Caretaker