MDAnalysis

What is MDAnalysis

MDAnalysis is a python package that was developed to track trajectories from molecular dynamic simulations. It is primarily used in post-processing for out group and as such is only seen in the KPrepFunction.py There are many uses for this package. Feel free to in cooperate it into your scripts as it has many functions. At the time of writing MDAnalysis was only recently introduced to the group and its full capability is still being explored.

Installing MDAnalysis

This package is not well-supported by the supercomputer and as such requires special attention to install. In our experience, other computers do not have the same challenges as it does on FSL (and it is untested on Watt), so we refer you to the MDAnalysis website to install locally onto your PC. The duration of this section explains the process for installation on FSL.

To ensure installation is done properly, it is our recommendation that you use a dedicated virtualenv for MDAnalysis. Because Python 3.6 is default, it is thus recommended that you use python 3.7 for this procedure as it is likely to not already have other packages on it, or if you do install other packages you are less likely to interfere with the MDAnalysis set-up. If there is stuff already installed in ~/.local/lib/python3.7/site-packages, I would uninstall it.

To install MDAnalysis:

  1. $module purge
  2. $module load python/3.7 gcc/8
    • This unloads all default python modules and loads the proper python version AND proper gcc compiler
  3. $pip uninstall MDAnalysis
    • Only do this step if MDAnalysis was improperly installed previously
  4. $pip install --user --global-option=build_ext --global-option="-L$LD_RUN_PATH -R$LD_RUN_PATH -I$CPATH" MDAnalysis
    • This step installs MDAnalysis using the proper installation pathways.

You will know installation was done correctly if you are able to "import MDAnalysis" within python.

Notes

A few things to note. Firstly, because MDAnalysis was installed in python3.7, this means that anything using MDAnalysis MUST be run in python3.7. KPrep was written to use any version of python 3 and should not have any issues running in 3.6 or 3.7 Secondly as time goes on and updates to MDAnalysis or FSL changes, this method may become obsolete. For reference the procedure was initially established under the rcsupport ticket 7983. All relevant information should be recorded there.