Release 0.19.0, 0.19.1, 0.19.2

A new version of MDAnalysis has been released! Or rather, three new releases in quick succession, so we just talk about all of them in a single post.

This version brings a multitude of fixes, deprecations, and new features including exciting additions from one of our two 2018 Google Summer of Code students (other cool new features from GSOC2018 will be unveiled in the next release…) and one NSF REU student as well as full Windows support. Some highlights are given below, whilst the release notes list all the changes in this version.

GSoC 2018: Capped Distance Searches

GSoC student Ayush Suhane (@ayushsuhane) worked on integrating faster distance search algorithms (such as the grid search in the new MDAnalysis.lib.nsgrid neighbor search library and periodic KDTrees) for limited distance searches. His work improved many distance search based analysis methods like the calculation of radial distribution functions. There are now two new low-level functions MDAnalysis.lib.distances.capped_distance and MDAnalysis.lib.distances.self_capped_distance, which find all pairwise distances between particles up to a given maximum distance. By specifying a maximum distance to the search, it is possible to optimize the search, leading to greatly improved performance especially in larger systems.

For example to find all contacts between oxygen and hydrogen up to 5.0 Å

from MDAnalysisTests.datafiles import PSF, DCD
import MDAnalysis as mda
from MDAnalysis.lib.distances import capped_distance

u = mda.Universe(PSF, DCD)

oxy = u.select_atoms('name O*')
hyd = u.select_atoms('name H*')

idx, dists = capped_distance(oxy.positions, hyd.positions, box=u.dimensions, max_cutoff=5.0)

Unlike distance_array, which returns a matrix of every pairwise distance, here a sparse representation is returned, where idx is a (n, 2) array of the indices of the atoms and dists is the distance between these atoms.

For full details on the implementation of this and the expected performance improvements see Ayush’s post on faster distance search algorithms.

Analysis improvements

NSF REU student Henry Mull implemented a new analysis module MDAnalysis.analysis.dihedrals which includes analysis classes for

Ramachandran plot

Irfan Alibay improved the density_from_Universe() function, which now allows the user to exactly specify the region in which a density should be calculated. In this way, it becomes easier to calculate densities on identical grids for different simulations so that these densities can be compared more easily.

Shujie Fan added site specific radial distribution function analysis. The InterRDF_s() function calculates the radial distribution function relative to a single or a few particles (a “site”). The function helps with the analysis of the coordination of ions and ligands in binding sites of proteins or other biomolecules, for instance, the distribution of oxygen ligand atoms around sodium ions. Importantly, many of these sites can be computed at the same time, which improves performance because the most time consuming part of almost all analysis tasks, the loading of the trajectory data from disk into memory, only has to be done once, and then multiple computations can be performed with the data in memory.

Windows support

Since 0.19.2, Windows is fully supported under Python 3.4+ (Python 2.7 is not officially supported because of technical difficulties, which we decided not to address because of limited developer time and the fact that Python 3 is now the recommended version of Python).

For Windows we recommend the conda installation. If you want to install with pip or from source then you will need the full Microsoft developer environment with Microsoft Visual C++ 14.0.

Improvements to file readers

Miscellaneous performance improvements


This release brings a few new deprecations as the package heads towards a final API:

Author statistics

Altogether this represents the work of 16 contributors from around the world, and featured the work of five new contributors:

Upgrading to MDAnalysis version 0.19.x

To get all these features run either conda update -c conda-forge mdanalysis or pip install --upgrade MDAnalysis.

— The MDAnalysis Team