Home

Awesome

License Version Changelog Travis Build Status

MDsrv is a simple server that enables remote access to coordinate trajectories from molecular dynamics simulations. It can be used together with the NGL Viewer (http://github.com/arose/ngl) to interactively view trajectories of molecular complexes in a web-browser, either within a local network or from anywhere over the internet.

See it in action:

Features

Table of contents

Documentation

Detailed information concerning the installation, deployment, usage and scripting examples can be found at the documentation.

Installation

From PyPI:

pip install mdsrv

From conda: conda config --add channels conda-forge conda install -c ngl mdsrv

MDsrv depends on MDtraj. Please ensure that this is installed correctly and functional.

Running

The mdsrv command starts a local server and opens a browser window with the web application.

To use a custom configuration file

mdsrv --cfg my_conf.cfg

Load a topology and trajectory at startup

mdsrv struc.gro traj.xtc

For more options, please consult the documentation

Configuration file

Optional. Copy/rename the sample app.cfg file. It allows e.g. setting data_dir data directories that will be accessible through the web server and to define access restrictions.

Deployment

The Apache Webserver can used to run the server via mod_wsgi. First make sure you have everything required installed:

sudo apt-get install apache2 libapache2-mod-wsgi

Then you need to create a wsgi configuration file to be referenced in the Apache configuration. There is an example named mdsrv.wsgi.sample in the root directory of this package. Also, a snippet showing how the configuration for Apache should look like can be found in the apache.config.sample file.

Finally, to restart apache issue

sudo /etc/init.d/apache2 restart

More information can be found at the documentation.

RESTful API

The RESTful API is the interface through which the web application gets all data but it may be also used to access the served trajectory data from other applications.

You can retrieve information about directory content (e.g. name of sub-directory, file name, file size), number of frames and frame coordinates.

For more information, please visit the documentation.

NGL browser support

The NGL Viewer requires your browser to support WebGL. To see if your browser supports WebGL and what you might need to do to activate it, visit the Get WebGL page.

Generally, WebGL is available in recent browser versions of Mozilla Firefox (>29) or Google Chrome (>27). The Internet Explorer supports WebGL only since version 11. The Safari Browser since version 8 (though WebGL can be activated in earlier version: first enable the Develop menu in Safari’s Advanced preferences, then secondly in the now visible Develop menu enable WebGL).

See also this page for details on which graphics card drivers are supported by the browsers.

WebGL draft extensions: For a smoother appearance of cylinders and spheres your browser needs to have the EXT_frag_depth extension available. The WebGL Report should list the extension if active. If not, you can enable WebGL draft extensions in your browser following these instructions:

Acknowledgments

Thanks to code from MDAnalysis (http://www.mdanalysis.org/) there is random access to xtc/trr trajectory files via indexing and seeking capabilities added to the libxdrfile2 library.

Funding sources:

Cite

When using MGsrv please cite: