Skip to content

Scripting VLifeMDS

by V Ganesh on August 11th, 2011

Scripting in VLifeMDS has been a frequent request from user community.  Though earlier versions had limited scripting abilities, with version 4.0 refresh, we have introduced full support for user scripts. With this, users have the flexibility of easily performing repetitive tasks, connecting modules in new ways or even writing entirely new applications based on VLifeMDS platform.

Quick Takes

• VLifeMDS uses Python for scripting purposes. Python is a relatively easily language to learn and is in use by many in the Scientific community. For a biggner’s guide to using Python refere to ‘Byte of Python’ by C. H. Swaroop available at: [External Link: ]

• For more information on Python and using it see: [External Link: ]

• For Linux and Windows to access the interactive scripting console.

• For Linux pure command line support is also available and is accessible using: <> <command line arguments to script>

• Current implementation of scripting doesnot support GUI / Graphics manipulations.

Hello MDS!

The easiest way to try scripting in VLifeMDS is to use the interactive scripting console. This is accessible from Tools -> Scripting Console menu. The scripting console provides an interactive prompt which accepts Python commands.

To use MDS functionality with in the scripting console, one is required to use the ‘mds” package as follows:

>>> import mds
>>> mds.helloMDS()

The above command will print a welcome string. To get the current version of VLifeMDS use:

>>> mds.getMDSVersion()

Following screenshot gives an idea of the interaction with the scripting console on Ubuntu:

VLifeMDS scripting console


Low level functions

The scripting functionality allows a user of VLifeMDS to use many low level functionalities. These fuctionalities basically deal with manipulating molecule objects. For instance, to read a molecule file one can use the following:

>>> mol = mds.readMolecule("path-to-supported-molecule-format")

In the above code snippet, the variable ‘mol’ captures the molecule object that MDS internally uses. Note that if the file you are trying to read is not supported or has format problem, an exception is thrown. The good thing about scripting is that, if a file format is not supported, one can write a custom reader and generate a runtime molecule object that can can then be used with other MDS functions. More on this in upcoming posts.


Module level functions

Highlevel module functions allow one to perform common functionalities in VLifeMDS without using the GUI. In this way, one gets more flexibility to the way these functionalities may be used. Examples of this include computing energy, energy minimization, conformation generation, 2D to 3D conversion etc. For instance, to compute energy of a molecule read previously one may use:

>>> print mds.computeEnergy(mol)

This will print the energy of the molecule computed using default parameters. One can change optional parameters to suite ones needs. Say one needs the energy to be computed using MMFF force field, rather than the default UFF, the following modification to the above script can be used:

>>> print mds.computeEnergy(mol, FF=mds.FF.MMFF)  


Also see

You can also check out a short technical whitepaper downloadable from here: [Molecular modeling scripting whitepaper]


Follow up

Scripting VLifeMDS will be a regular coulumn in this blog. In subsequent posts, I will provide varying examples of how you can tap into the power and flexibility offered by writing scripts for VLifeMDS.

Happy scripting and stay tuned!


V Ganesh

I am software architect at VLife Sciences. I enjoy working with interfacing of science and technology. To know more about me drop in @ my personal blog:

More Posts - Website

From → Scripting, VLifeMDS

  1. Refer to the recently (July 24-29, 2011) workshop at N.E.H.U., Shillong in which V-Life Sciences were resource materials.

    I have made a request for the details of the weight factors used in the descriptor space for the Pharmacophore modeling.


    Department of Chemistry
    North Eastern Hill University
    SHILLONG 793022

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

Follow Me