-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Here are a few hints on the way I program this plugin.
Since this is plugin of a python based software, the use of a python script is kind of mandatory. The other mandatory thing is the python version : 2.7.X, there is nothing I can do about that. I wish the developers of Pymol switch to python 3.X (which is currently experimental on Pymol 2.0.X). I started this program as a simple python script, and while discovering python programming I extended the capacity and usability of the plugin and hopefully its quality of programming. Since I have been working for several years on this pet project, their might be some unequal quality of programming.
I used to use home-brew on my mac with the latest possible versions of all required libs and python. Now I use MacPorts, since home-brew is broken. There was in September 2017 a release of QT based Pymol available directly from Pymol main website, it is free to use as far as I can see.
I have been influenced by Objective-C programming, so, I am trying to apply MVC pattern wherever it makes sens. I am trying to have as little as possible dependences towards Pymol, since this plugin might be usable on similar softwares and that Pymol is still under active development and I can not guess its evolution especially regarding its API. Of course, decoupling interfaces and engine is mandatory (at least try).
Here is a global view of the architecture:
- The base class is the Constraint i.e. a value that indicates a quantified relationship between atoms (I used named tuples for those). It contains the atoms involved in the relationship, the value(s) and a way to check whether or not this value is the one in the molecular structure. Constraints can be of different types, such as distances and angles, and from different origins more or less directly from experiments (NOE, H-Bonds, dihedral angles, residual dipolar couplings ...). As of now, only NOEs$ are supported. H-bonds would probably not require so much additional work.
- All constraints related to a specific molecular structure are gathered into a ConstraintSetManager class. It is basically a tuple (or a list) which provides access to the constraints and global information on them.
- The NMRCore is the "central station" where everything go through (loading, displaying mostly).
- The command line interface. This was the initial way of interacting with the plugin. It is still maintained since it is quite easy to use.
- The graphical interface. Based on Tk. Allow easy and clear interactions (I hope). The main interface is organized in submodules that I call Panels. I added a special viewer module to interact with the constraints once they are displayed. A challenge to come is to switch from Tk to QT !