MDANSE: An Interactive Analysis Environment for ... - ACS Publications

Publication Date (Web): December 27, 2016 ... The MDANSE software—Molecular Dynamics Analysis of Neutron Scattering Experiments—is presented. ... ...
2 downloads 12 Views 7MB Size
Application Note pubs.acs.org/jcim

MDANSE: An Interactive Analysis Environment for Molecular Dynamics Simulations G. Goret, B. Aoun, and E. Pellegrini* Computing for Science Group, Institut Laue-Langevin, 71 avenue des Martyrs, 38042 Grenoble, France S Supporting Information *

ABSTRACT: The MDANSE softwareMolecular Dynamics Analysis of Neutron Scattering Experimentsis presented. It is an interactive application for postprocessing molecular dynamics (MD) simulations. Given the widespread use of MD simulations in material and biomolecular sciences to get a better insight for experimental techniques such as thermal neutron scattering (TNS), the development of MDANSE has focused on providing a user-friendly, interactive, graphical user interface for analyzing many trajectories in the same session and running several analyses simultaneously independently of the interface. This first version of MDANSE already proposes a broad range of analyses, and the application has been designed to facilitate the introduction of new analyses in the framework. All this makes MDANSE a valuable tool for extracting useful information from trajectories resulting from a wide range of MD codes.



highlight two examples: nMoldyn2 and Sassena.3 The situation for TNS, compared to other experimental techniques, is unique since TNS can only be performed at large scale research infrastructures (nuclear reactors and spallation sources) which draw in thousands of visiting scientists each year. Central facilities provide scientific services to academic users and focus the need for efficient, user-friendly software. In this context, based at a central facility, the Institut Laue-Langevin (ILL), we have developed the MDANSE softwareMolecular Dynamics Analysis of Neutron Scattering Experimentswhich is a Python4 application for postprocessing MD simulations. It focuses clearly on providing a user-friendly graphical user interface (GUI) allowing the analyses to be started from but run independently of the interface thanks to its complete separation with the functional code. In addition, MDANSE has been specifically designed to facilitate the development of new analyses and a large number of these are available in this first version of MDANSE. In this way, MDANSE aims to serve MD simulations of all kinds covering the whole spectrum of systems investigated by TNS. Refs 5−12 illustrate the range of applications supported by MDANSE. In this application note, the MDANSE GUI is presented first followed then by a test case showing the use of MDANSE in script mode.

INTRODUCTION MD simulations have become essential to make the link between experiment and theory. This was recognized by two Nobel prizes for chemistry awarded to Pople and Kohn in 1998 and to Karplus, Levitt, and Warshel in 2013 for their contributions to the foundations for today’s powerful software used to understand and predict chemical and molecular processes. MD simulations are now widely used to provide atomistic models of dynamics and, combined with experimental techniques such as TNS, is a powerful tool for both soft and hard condensed matter. Indeed, TNS measures time and space correlations of atomic positions1 on a time and space scales that ranges respectively from subpicoseconds to about tenth of nanoseconds and from 1 Å to a tenth of a nanometer. These time and space scales are also covered by molecular dynamics simulations and both techniques can be considered as complementary. In TNS, the neutron−target interaction can be described by Fermi’s pseudopotential, which has zero range on the length scales under consideration. This potential is centered on the atomic nuclei of the targets which are thus considered as pointlike particles and the measured differential scattering cross-section can be expressed in terms of time correlation functions of the time−space Fourier transformed radial distribution function. The latter can be obtained easily from MD simulations, enabling a direct comparison between simulated and measured neutron scattering intensities. In that context, validating simulations against experimental data requires software for processing the output from simulations in experimental observables. For TNS data, we © 2016 American Chemical Society

Received: September 21, 2016 Published: December 27, 2016 1

DOI: 10.1021/acs.jcim.6b00571 J. Chem. Inf. Model. 2017, 57, 1−5

Application Note

Journal of Chemical Information and Modeling

Figure 1. Snapshot of the MDANSE GUI showing (1) an atomistic view of the simulated system, (2) the multiple trajectory data sets, (3) the available analyses for the simulated system, and (4) the job monitor panel, which also has a Python console and a logger.



GRAPHICAL USER INTERFACE One of the main features of MDANSE is the graphical interface that allows to visualize a trajectory, interact with it prior to running an analysis or display 2D or 3D data resulting from analyses in a user-friendly and integrated way. Working Environment. The main window is divided into four panels (numbered from 1 to 4 on Figure 1). Panel 1 is the MDANSE workspace where all the actions take place via a drag and drop mechanism of data and their related actions (e.g., viewing and animating a trajectory, running an analysis). Panel 2 is the data panel that displays all the loaded data into the current MDANSE session. Dragging data from this panel and dropping it onto the workspace creates a tab that serves as a container for all subsequent actions related to this data. Dropping an action on this tab will automatically pop up its related GUI (e.g., widget, dialogue, viewer). Panel 3 is the plugins panel that contains all the actions related to the widget currently on focus in the workspace. This panel is dynamically updated each time the user selects a widget on the workspace. For example, a typical workflow for MDANSE would be the

following. (A) The user loads a trajectory. It is displayed in the data panel (2). (B) Data is dragged and dropped into the workspace. That creates a tab in the workspace waiting for further actions which are displayed in the plugins panel (1). (C) The user drags and drops the molecular viewer plugin into the previously created tab. The molecular viewer widget pops up in the tab showing the molecular contents of the trajectory. (D) The user animates the trajectory by dragging and dropping the animation panel into the molecular viewer. Finally, Panel 4 contains various widgets related to the current MDANSE session. It contains a logger of the application, a python console giving command line access to the MDANSE framework interactively and a job manager, showing the status of the running jobs. A large number of jobs can be launched and run simultaneously in a MDANSE session and, since the jobs run independently of the interface, they will continue to run after the session is closed. While software for visualizing MD is widely available, the trajectory visualizer has been included here specifically for two aspects of analyzing MD trajectories. Analyses are often performed on selected atoms 2

DOI: 10.1021/acs.jcim.6b00571 J. Chem. Inf. Model. 2017, 57, 1−5

Application Note

Journal of Chemical Information and Modeling

Figure 2. Plotter GUI showing (top left) the loaded data file and its contents, (bottom left) a 2D snapshot of a scattering function, and (right) the 3D view of the scattering function.

Figure 3. MDANSE properties editor which gives access to the elements database.

The blue cloud in Panel 1, Figure 1 shows the volume visited by one water molecule during the MDit is the result of the molecular trace analysis (see Panel 3). 2D/3D Plotter. In the workflow of MDANSE, once analyses have finished, an output file containing the results is written. A key feature of MDANSE is that the output file contains many data sets. In addition to the requested content (e.g., total

rather than the whole system and it can be very practical to be able to select the atoms interactively with the mouse. This functionality is enriched by being able to record the selection in a Python script which can be edited if necessary and reused. Second, it can be very convenient and revealing to superimpose the trajectory of one or more molecules on the whole molecular model in order, for example, to understand diffusion pathways. 3

DOI: 10.1021/acs.jcim.6b00571 J. Chem. Inf. Model. 2017, 57, 1−5

Application Note

Journal of Chemical Information and Modeling

Figure 4. Script used to run the VACF analysis.

experimental conditions. TNS cross sections are isotope dependent and, typically, molecules are specifically deuterated to modify their scattering power. When analyzing MD simulations it is therefore crucial to be able to substitute hydrogen with deuterium. Deuterium is already foreseen in the properties table and other isotopes can be added as required.

scattering function), all partial functions (e.g., partial scattering functions) are also saved since they are needed to produce the requested result and may be time-consuming to recalculate. Similarly, if frequency functions are requested, the corresponding time domain functions, prior to being Fourier transformed, are also saved so that they can subsequently be Fourier transformed with, for example, a different resolution (window) function, if necessary. To interpret properly this content, we have provided an integrated plotting application adapted to all the dimensions of the output data which produces publication quality figures for the classic rendering types. The 1D and 2D data can be plotted as lines and images in single or multiple windows. To enhance the possibility of cross comparison, multiple 1D data sets can be plotted in the same figure and slices from different 2D data sets can be merged easily into one plot. Units conversions are also handle automatically. For data with higher dimensionality several plotting modes can be used (1) the image elevation mode (see Figure 2) displays 2D data as 3D colored landscape, (2) the scalar-field mode displays 3D densities as a field of combined gradient of color and transparency, and (3) the iso-surface mode is another way to plot 3D densities represented as a transparent surface going through all points with the same intensity. The molecular trace, mentioned above, is an example of the iso-surface mode. The plotter also includes the possibility of taking 2D slices through the data. Properties Editor. Most of the quantities proposed by MDANSE can be weighted by using specific properties (e.g., atomic weight, (inc)coherent scattering lengths). In MDANSE, the list of properties is easily extendable, which opens the use of MDANSE to non-neutron experimental techniques (e.g., X-ray scattering, infrared and RMN spectroscopy). The properties editor allows the modification of the database of element properties which therefore allows the user to freely tune the weighting scheme (see Figure 3). In addition, new atom types (isotopes) can be added, in order to match specific



TEST CASE: VELOCITY AUTOCORRELATION FUNCTION This first release of MDANSE proposes a broad range of analyses and trajectory converters from standard MD packages. Moreover, the application has been designed to introduce easily new analyses in the framework. The reader is referred to the Supporting Information section for a comprehensive list of the trajectory converters and analyses available in the current version of MDANSE and technical details about its implementation. The GUI being completely separated from the scientific kernel, the latter can be accessed in script mode. A test case will illustrate this usage: the Velocity AutoCorrelation Function (VACF) which is one of the most used analyses of MDANSE. The VACF is a standard quantity used in physical chemistry to describe the dynamics of a molecular system. It is defined as Cvv(t ) ≐

1 Nα



∑ Cvv;αα(t ) α=1

(1)

where Nα is the number of atoms of the system and Cvv;αα(t) is the VACF of atom α defined as Cvv; αα(t ) ≐

1 ⟨vα(0) ·vα(t )⟩ 3

(2)

with its numerical counterpart defined, for time interval k·Δt where Δt is the time between two MD selected frames, as 4

DOI: 10.1021/acs.jcim.6b00571 J. Chem. Inf. Model. 2017, 57, 1−5

Application Note

Journal of Chemical Information and Modeling Cvv ; αα(k·Δt ) =

1 N−k

Notes

N−k

The authors declare no competing financial interest. MDANSE source code is hosted and managed on the ILL GitLab13 repository manager available at https://code.ill.fr/ scientific-software/mdanse. MDANSE is operating system agnostic (Windows, Linux-ubuntu, and OSX), and packages can be found at www.mdanse.org (under construction).

∑ ωα(vα(i)·vα(i + k)) i=0

(3)

where N is the number of MD steps, vα(i) and vα(i + k) are respectively the velocities of atom α at MD steps i and i + k and ωα is a property used to weight the velocity of atom α (e.g., atomic weight). Interestingly, the VACF of an isotropic system is related to the incoherent dynamic structure factor, measured in TNS, through the following equation limq → 0

ω2 :(q, ω) = G(ω) q2



ACKNOWLEDGMENTS G.G. and B.A. were supported by the Agence Nationale de la Recherche (ANR) (contract No. ANR-2010-COSI-001-01). The authors are grateful to Gerald Kneller and Konrad Hinsen for a fruitful collaboration on nMoldyn3 and their constructive advices concerning MDANSE, Miguel Gonzalez for the scientific support, Jamie Hall, Fabien Pinet, and Yannick Raoul for their contributions to the build server, and Mark Johnson for his helpful comments on the manuscript.

(4)

where ω is the frequency, q is the length of the wave vector transfer, and G(ω) is the so-called density of states defined as the Fourier transform of the VACF and is actually computed in this way in MDANSE. Figure 4 shows a Python script to setup and run a VACF analysis in script mode. It is generated by MDANSE using the mdanse --js vacf command. As can be seen from this script, the parameters of the analysis are provided using a standard Python dictionary.





CONCLUSION AND PERSPECTIVES MDANSE has been developed in response to the growing need to use MD and analyze it, effectively as part of the data analysis of TNS experiments. Compared to other codes which may have similar functionality, one of the main goals of MDANSE has been to enhance the user experience. This has guided the design of the GUI, the inclusion of the molecular viewer to facilitate analyses and allow qualitatively new analyses like the molecular trace, the level of sophistication developed for the plotter and the management of many, simultaneous calculations launched from the interface. Another design goal of MDANSE concerned the internal architecture of the code in order to facilitate the inclusion of new analyses. This goal has been achieved as illustrated by the large number of analyses already available in MDANSE. While serving more MD codes and integrating more analyses is an obvious perspective for MDANSE, we also plan to benefit from the design of MDANSE to integrate combined MD and instrument simulations by linking McStas,11 neutron ray-tracing functionality to MDANSE. In this way, MDANSE will underpin complete, virtual TNS experiments, including the effects of instrument optics, multiple scattering, and sample environments that will help guide and optimize very costly TNS experiments.



ASSOCIATED CONTENT

* Supporting Information S

The Supporting Information is available free of charge on the ACS Publications website at DOI: 10.1021/acs.jcim.6b00571. List of the trajectory converters and analyses currently implemented in MDANSE and technical details about the application (PDF)



REFERENCES

(1) Squires, G. L. Introduction to the theory of thermal neutron scattering; Cambridge university press, 2012. (2) Hinsen, K.; Pellegrini, E.; Stachura, S.; Kneller, G. R. nMoldyn 3: using Task Farming for a Parallel Spectroscopy-Oriented Analysis of Molecular Dynamics Simulations. J. Comput. Chem. 2012, 33, 2043− 2048. (3) Lindner, B.; Smith, J. C. Sassena-X-Ray and Neutron Scattering Calculated from Molecular Dynamics Trajectories using Massively Parallel Computers. Comput. Phys. Commun. 2012, 183, 1491−1501. (4) van Rossum, G. Python. https://www.python.org (accessed December 24, 2016). (5) Venturi, G.; Formisano, F.; Cuello, G.; Johnson, M.; Pellegrini, E.; Bafile, U.; Guarini, E. Structure of Liquid n-Hexane. J. Chem. Phys. 2009, 131, 34508. (6) Bousige, C.; Rols, S.; Cambedouzou, J.; Verberck, B.; Pekker, S.; Kováts, É; Durkó, G.; Jalsovsky, I.; Pellegrini, É; Launois, P. Lattice Dynamics of a Rotor-Stator Molecular Crystal: Fullerene-Cubane C60 C8 H8. Phys. Rev. B: Condens. Matter Mater. Phys. 2010, 82, 195413. (7) Parsons, A.; Ahmed, I.; Rudd, C.; Cuello, G.; Pellegrini, E.; Richard, D.; Johnson, M. Neutron Scattering and ab initio Molecular Dynamics Study of Cross-Linking in Biomedical Phosphate Glasses. J. Phys.: Condens. Matter 2010, 22, 485403. (8) Russo, D.; Teixeira, J.; Kneller, L.; Copley, J. R.; Ollivier, J.; Perticaroli, S.; Pellegrini, E.; Gonzalez, M. A. Vibrational Density of States of Hydration Water at Biomolecular Sites: Hydrophobicity Promotes Low Density Amorphous Ice Behavior. J. Am. Chem. Soc. 2011, 133, 4882−4888. (9) Stadler, A. M.; Pellegrini, E.; Johnson, M.; Fitter, J.; Zaccai, G. Dynamics-Stability Relationships in Apo- and Holomyoglobin: a Combined Neutron Scattering and Molecular Dynamics Simulations Study. Biophys. J. 2012, 102, 351−359. (10) Russo, D.; Gonzalez, M. A.; Pellegrini, E.; Combet, J.; Ollivier, J.; Teixeira, J. Evidence of Dynamical Constraints imposed by Water Organization around a Bio-Hydrophobic Interface. J. Phys. Chem. B 2013, 117, 2829−2836. (11) Farhi, E.; Ferran, G.; Haeck, W.; Pellegrini, E.; Calzavara, Y. Light and Heavy Water Dynamic Structure Factor for Neutron Transport Codes. J. Nucl. Sci. Technol. (Abingdon, U. K.) 2015, 52, 844−856. (12) Aoun, B.; Sharma, V.; Pellegrini, E.; Mitra, S.; Johnson, M.; Mukhopadhyay, R. S. Structure and Dynamics of Ionic Micelles: MD Simulation and Neutron Scattering Study. J. Phys. Chem. B 2015, 119, 5079−5086. (13) Zaporozhets, D. gitlab. https://about.gitlab.com (accessed December 24, 2016).

AUTHOR INFORMATION

Corresponding Author

*E-mail: [email protected]. Phone: +33(0)476207198. ORCID

E. Pellegrini: 0000-0002-8639-0155 5

DOI: 10.1021/acs.jcim.6b00571 J. Chem. Inf. Model. 2017, 57, 1−5