One of the new features in the latest version of MOE from Chemical Computing Group is the Listener. The MOE socket listener provides an alternative to MOE/web for executing functions remotely on a running instance of MOE. These special functions must follow a naming convention in which each name is prefixed by the string listen_. Furthermore, each such function is permitted only a single argument in the form of a tagged vector. It is the responsibility of the function author to validate the number and type of arguments, and any other constraints. The function should simply exit with an error if called with invalid arguments. Once such functions are loaded into an instance of MOE and the listener is activated, they can be executed from a web browser or any other application by providing an appropriately constructed URL.

The listenfunctions must be loaded into a running instance of MOE using the SVL load command before they can be called. To make use of these functions, the listener (i.e. server) must first be started. This is accomplished using the SVL listenport command from the SVL command window.

Unfortunately the documentation is very sparse but you need to note that the listener provides little or no feedback other than “OK”.

Any HTTP client may be used to make the requests, e.g. a web browser, wget, or even a custom application. MOE will respond with HTTP/1.0 200 OK followed by the text OK if the request was processed and understood, or an error if the request was malformed or invalid. If the request was valid but the URL was not in the form described above (for example no exec) or the function itself exits with an error, an error window will pop up within MOE; note that in such cases, OK will still be returned to the HTTP client.

To demonstrate what sort of thing is possible I’m making use of a piece of SVL taken from a demo created by CCG. there are two listen_functions.

The SVL Script

Scientific Vector Language is a high-performance programming language built into the MOE Molecular Operating Environment. SVL is an embedded language; that is, its compiler and run-time environment are an integral part of MOE. SVL serves as the command, macro, scripting, and high-performance computing language of MOE. SVL Exchange is a repository of programs and code samples written in the Scientific Vector Language (SVL) by users and developers and is a great place to get started.

This version of the SVL script has been annotated by Simon Grimshaw of CCG to aid understanding of how it works. It provides the functionality to download from PDB structures from the rcsb Protein Data Bankhowever it could be modified to download from an in house database. The script also the functionality to create 3D structures from SMILES strings and do the alignment.

You can download the SVL script here moecustomlistener.svl.zip

The Vortex scripts

One of the very little publicised features available in Vortex is the ability to run context dependent scripts, these scripts execute a specific function dependent on the cursor selection. So selecting one field will execute one script, whilst selecting another will execute a different script. These scripts need to be stored in the “context” folder which is inside the “Vortex_Add-ons” folder.

If we now read in an sdf file that includes a column with the PDB codes for the crystal structure of a protein associated with a particular ligand, and then right-click on the PDB entry we get a drop down menu that allows you to navigate to the desired Vortex script as shown below.

The script will download the associated PDB structures from the rcsb Protein Data Bank, put them into a database then start the browser. It may take a few seconds to download the structure; this does rely on MOE having the right proxy settings to access the internet (use the Java console to set them). You can now transfer this to MOE and amend the display to highlight the ligand.

The MOEflexalign script takes the SMILES string of the selected row generates a 3D structure and does a one-shot flexalign between the ligand in the system in MOE, and the incoming ligand.

It is probably easier to see this in action, if it appears rather small click on the YouTube icon in the bottom right corner of the video.

The MoeGetPDB Vortex script

The first part of the script finds the column labelled “PDB” and then gets the pdb code. We then get all the variables needed by MOE and pass them to the “getrcsb” listener 

You can download the script here MOEGetPDB.vpy.zip

The FlexAlign Vortex script

This script follows a similar format, we first identify the structure column and then get the SMILES string of the selected molecule, we then get all the variables needed by MOE and pass them to the showlig_smiles listener . 

You can download the script here

Page Updated 27 September 2013

Related Posts