Code Monkey home page Code Monkey logo

mdanse's Introduction

MDANSE

Molecular Dynamics Analysis for Neutron Scattering Experiments

MDANSE is a Python application designed for computing neutron observables from molecular dynamics (MD) trajectories. The results can be directly compared with neutron scattering experiments, particularly inelastic and quasi-elastic neutron scattering spectroscopies.

To do this, it interfaces with a variety of MD simulation software such as CASTEP, VASP, DMOL, Gromacs, DL_POLY, CHARMM, LAMMPS, PBD, DFTB etc., and provides both a graphical user interface (GUI) and a command line interface.

This project is built on the development published previously:
G. Goret, B. Aoun, E. Pellegrini, "MDANSE: An Interactive Analysis Environment for Molecular Dynamics Simulations", J Chem Inf Model. 57(1):1-5 (2017).

Version information

This is the development version of MDANSE. The main difference compared to the previous version is the transition from Python 2 to Python 3, and from wxWidgets to Qt. The previous version, formerly in the 'develop' branch, can now be found in the legacy branch.

The current version of MDANSE is currently still at the alpha stage. You can help it advance to the beta stage by reporting problems you experience while using MDANSE.

Quick start: installation

We recommend that you install MDANSE in a Python virtual environment. You can create a virtual environment named mdanse_env by typing

python3 -m venv mdanse_env

To activate your virtual environment, type

source mdanse_env/bin/activate

in a bash console, or

mdanse_end/Scripts/activate.bat

if you are using cmd.exe on Windows.

While your virtual environment is active, you can install MDANSE:

pip install MDANSE MDANSE_GUI

and start the graphical interface by typing

mdanse_gui

The typical workflow of MDANSE:

  1. Convert a trajectory from the file format generated by an MD simulation software into the MDANSE trajectory format,
  2. Load the converted trajectory into MDANSE,
  3. Perform an analysis,
  4. Check the results with the plotter.

The most complete user documentation of MDANSE can be found on our Read the Docs page. At the same time, it is still possible to access the original MDANSE User Guide.

Other information including example scripts can be found on the MDANSE website

What can MDANSE do?

Firstly, MDANSE can interface with MD simulation software. It does this by providing converters for different file formats into an .MDT file (HDF format), which is then used for all calculations. The following MD packages are supported:

  • CASTEP
  • CHARMM
  • DFTB
  • Discover
  • DL_POLY
  • DMol
  • Forcite
  • Gromacs
  • LAMMPS
  • NAMD
  • PDB
  • VASP
  • XPLOR
  • ASE

The converted trajectory can then be loaded into MDANSE, where it can be visualised via the Molecular Viewer and animated. Various trajectory variables (positions, velocities, and forces) can also be plotted for each particle. Then, various properties can be calculated, which can be compared with neutron (or, for some analysis types, with X-ray) experimental data, or used as a prediction of results of a potential experiment. The following properties can be computed:

Dynamics
  • Angular correlation
  • Density of states
  • Mean Square Displacement
  • Order parameter
  • Position Autocorrelation Function
  • Velocity Autocorrelation Function
Infrared
  • Dipole Autocorrelation Function
  • Infrared
Scattering
  • Current correlation function
  • Dynamic Coherent Structure Factor
  • Dynamic Incoherent Structure Factor
  • Elastic Incoherent Structure Factor
  • Gaussian Dynamic Incoherent Structure Factor
  • Neutron Dynamic Total Structure Factor
Structural
  • Area Per Molecule
  • Coordination Number
  • Density Profile
  • Eccentricity
  • Molecular Trace
  • Pair Distribution Function
  • Root Mean Square Deviation
  • Root Mean Square Fluctuation
  • Radius of Gyration
  • Solvent Accessible Surface
  • Spatial Density
  • Static Structure Factor
  • Voronoi (volume per atom)
  • X-Ray Static Structure Factor
Thermodynamics
  • Density
  • Temperature

Each of these analyses can be controlled using a number of parameters. For example, the user can select a subset of trajectory frames or a subset of atoms on which to perform the calculation, or specified atoms can be substituted with different elements/isotopes. Finally, their results can be saved in an MDA file (HDF5 format), or a set of DAT files (text format), and those can then be plotted directly in MDANSE.

More detailed information on how MDANSE works, what it can do, and the science can all be found on our Read the Docs page.

Citing MDANSE

If you used MDANSE in your research, please cite the following paper:

MDANSE: An Interactive Analysis Environment for Molecular Dynamics Simulations. G. Goret, B. Aoun, E. Pellegrini. J Chem Inf Model. (2017) 57(1):1-5.

License

MDANSE is licensed under GPL-3.0. See LICENSE for more information.

Acknowledgements

MDANSE started as a fork of version 3 of the nMOLDYN program. nMOLDYN was originally developed by Gerald Kneller in 1995 and subsequently also by Konrad Hinsen, Tomasz Rog, Krzysztof Murzyn, Slawomir Stachura, and Eric Pellegrini. MDANSE includes most of the code of nMOLDYN3, and also code from the libraries MMTK, ScientificPython and MDTraj.

For more information see:

nMoldyn 3: Using task farming for a parallel spectroscopy-oriented analysis of molecular dynamics simulations. K. Hinsen, E. Pellegrini, S. Stachura, G.R. Kneller J. Comput. Chem. (2012) 33:2043-2048 [https://doi.org/10.1002/jcc.23035][https://doi.org/10.1002/jcc.23035].

We are grateful to all the people who have helped in some way or another to improve nMOLDYN and/or MDANSE along those years. Apart from the main developers mentioned above, we would like to acknowledge explicitly the contributions done in the past by Bachir Aoun, Vania Calandrini, Paolo Calligari, Gael Goret, Remi Perenon and Rastislav Turanyi.

The MDANSE project is supported by Ada Lovelace Centre, ISIS Neutron and Muon Source, Science and Technology Facilities Council, UKRI, and the Institut Laue-Langevin (Grenoble, France). Past financial support from the French Agence Nationale de la Recherche (ANR) through contracts No. ANR-2010-COSI-001-01 and ANR-06-CIS6-012-01, and the Horizon 2020 Framework Programme of the European Union under project number 654000 is also acknowledged.

Joining the project

MDANSE is currently maintained and developed by software developers from ISIS and ILL, but we are fully open to new collaborators who would like to contribute code, documentation, tutorials or usage examples. If you want to join the project contact:

Dr. Sanghamitra Mukhopadhyay ([email protected])
ISIS Neutron and Muon Source
Rutherford Appleton Laboratory
Didcot, UK

Software Inquiries

For questions or contributions related to the software, please contact:

Dr. Maciej Bartkowiak ([email protected])
ISIS Neutron and Muon Source
Rutherford Appleton Laboratory
Didcot, UK

mdanse's People

Contributors

chicheng45 avatar eurydice76 avatar franzlang avatar gonzalezma avatar khinsen avatar mark-johnson-1966 avatar mbartkowiakstfc avatar perenon avatar rastislavturanyi avatar sanghamitra-mukhopadhyay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mdanse's Issues

ENHANCEMENT: Creating an app for running a job

It could be useful to have, in the same spirit than mdanse_plotter, an app say mdanse_job which allows to display directly an analysis. I do not know currently whether the job framework can be detached to a independent frame. I will investigate.

investigation: replacing MMTK with Mosaic

MMTK is a python2-only module, and so it cannot be used as-is when MDANSE is rewritten in python 3. One way to handle this is to replace it with another module which works with python 3. One such module is Mosaic. This package was developed to adhere with principles of reproducible research, which makes it suitable for use in scientific programs. However, it only works with XML, PDB, and its own HDF5 file formats. Therefore, all existing converters would have to be rewritten to convert into one of these (currently they convert to .nc).

Another possible issue with Mosaic is that the package is considered complete and is at this point only maintained. Thus, no new features are to be expected, and support for it might be slower, potentially making it difficult if in the future we want to update MDANSE to work with the latest version of numpy or python (Mosaic does currently work with python 3.9 and numpy 1.21.2).

investigation: python2 to python3 requirements

As of 1st January 2020 Python 2 is no longer officially supported: https://www.python.org/doc/sunset-python-2/
However, the current code is Python 2. Investigate and document what parts of the code and its dependencies have to be changed/updated/replaced to enable the code to transferred to Python 3.
Create corresponding issues for all parts of the code and any dependencies that need to be updated.

BUG: PDF total are calculated incorrectly

When one of the PDF functions evaluates to 0 at all r-values (e.g. intramolecular PDF for water oxygens), the total PDFs calculated from these constituents also evaluate to 0 at all r-values:
image
image
image

This is incorrect and very unhelpful. Instead, the totals should evaluate to a non-zero value, like they do in nMOLDYN:
image
image
image

ENHANCEMENT: Increase the default size of the variable box in 2D/3D Plotter

At the moment, the variable box in 2D/3D Plotter is only large enough to fit one row by default, which makes selecting a variable tedious, especially in analyses with lots of variables like PDF. Therefore, the default size should be increased at the file box's expense.

Furthermore, the only way to change the size of the variable box is to resize the whole Plotter window. Manual resizing of these boxes should be implemented. This would work similarly to how the various panels in the main window can be resized.

ENHANCEMENT: Create a way to transform S(Q, ω) into S(Q, E)

In my discussions at NMSUM, one of the issues that was expressed to me is that often the scattering function S is of greater interest as a function of energy rather than of frequency. This is not a major problem, but it does add a layer of difficulty to data interpretation, and so removing this would be a nice quality-of-life change.

There are two ways in which I think this could be achieved:

  • Change the DSF analyses to create new outputs, or
  • Add a feature to the 2D/3D Plotter that allows for not only unit conversion, but also a limited physical quantity conversion.

BUG: New element and New property in Elements database editor not working

In Elements database editor, when clicking on 'New element' or 'New property' in the Database menu, following error is thrown:

C:\Program Files\MDANSE\lib\site-packages\mdanse-1.5.0-py2.7-win-amd64.egg\MDANSE\GUI\ElementsDatabaseEditor.py -- 412 -- on_add_property -- d = NewPropertyDialog(self,title="Add property",size=(400,160))
C:\Program Files\MDANSE\lib\site-packages\mdanse-1.5.0-py2.7-win-amd64.egg\MDANSE\GUI\ElementsDatabaseEditor.py -- 185 -- __init__ -- subsizer.AddGrowableCol(1)
C:\Program Files\MDANSE\lib\site-packages\wx-3.0-msw\wx\_core.py -- 15368 -- AddGrowableCol -- return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
                                 
PyAssertionError: C++ assertion "!m_cols || idx < (size_t)m_cols" failed at ..\..\src\common\sizer.cpp(1980) in wxFlexGridSizer::AddGrowableCol(): invalid column index

This has been confirmed with the latest MDANSE build on Windows 10 and Ubuntu 21.

ENHANCEMENT: Change default name of output files

Currently, the default name of output files of all analysis is output_<trajectory> where is the name of the trajectory file. This default name is highly undescriptive, requiring to be changed every time an analysis is performed because if it is not, the file will simply get overwritten. A better name would be <trajectory>_<analysis> where is an abbreviated name of the analysis performed. Even better, MDANSE could also check if the default file name already exists, and if it does, add (1) etc at the end to prevent overwriting.

ENHANCEMENT: Use netcdf4

As agreed, MDANSE should be detached from ScientificPython and MMTK sooner or later (see protos branch for a putative repacement candidate). To do so, we should rely on netcdf4 library instead of Scientific.IO.NetCDF which use a C extension nearly impossible to port to python 3. The API is nearly the same than the one of Scientific but it has the advantage of being pip-installable on python 2 and 3.

ENHANCEMENT: Create more granular plotting options for trajectory variables

Currently, the plotting of variables in MMTK NetCDF trajectories is far from useful, as documented in #34. All the variables in these trajectories do not have the 'Axis' parameter, which determines what the data is plotted against. Many of these variable also do not provide any meaningful information (e.g. the plot of time against time etc.). Yet others are, however, so packed with information as to be indecipherable. This latter category includes configuration, velocities, and gradients. The 3D plot which plots all the x,y,z components for every atom at every time-step into one graph is too dense to be useful. However, parts of this dataset contain very valuable information.

Therefore, the plotting options for MMTK NetCDF trajectories should be greatly expanded. This should include the following options and possibly more:

  • plot the components of coordinates/velocities/gradients of particular atoms against time
  • plot coordinates/velocities/gradients of particular atoms against time

All of this has arisen from the discussions in #34, but if anyone has further ideas for what would be good to be able to be plotted, please share!

investigation: dependencies and requirements

investigate and understand what python packages/modules the current MDANSE code depends on. this includes:

From this create:

  • documentation about any non-standard/custom dependencies, e.g. how MDANSE depends on the custom scipy and mmtk module.
  • separate issues if we need to fork/clone the scipy/mmtk modules from the ILL gitlab pages
  • a requirements.txt file capturing the required "standard" python modules

BUG: Fix velocity reading into CASTEP converter

Specific implementation of #27 for the CASTEP converter, except in this case the reading and saving of velocities and gradients from md files is already supported. However, this data is for some reason inaccessible once the created NetCDF file is loaded into MDANSE.

BUG: CASTEP converter aborted with ValueError

Any attempt to use CASTEP converter results in the job being immediately aborted with the following traceback:

`/tmp/MDANSE_t111_11539_pmym4c.py1RhWIr -- 22 -- <module> -- castep.run(parameters,status=True)
/home/t1113120/mdanse/venv/lib/python2.7/site-packages/MDANSE/Framework/Jobs/IJob.py -- 325 -- run -- raise JobError(self,tb)
/home/t1113120/mdanse/venv/lib/python2.7/site-packages/MDANSE/Framework/Jobs/IJob.py -- 46 -- __init__ -- tback = traceback.extract_stack()

Traceback (most recent call last):
  File "/home/t1113120/mdanse/venv/lib/python2.7/site-packages/MDANSE/Framework/Jobs/IJob.py", line 317, in run
    IJob._runner[mode](self)
  File "/home/t1113120/mdanse/venv/lib/python2.7/site-packages/MDANSE/Framework/Jobs/IJob.py", line 222, in _run_monoprocessor
    idx, x = self.run_step(index)
  File "/home/t1113120/mdanse/venv/lib/python2.7/site-packages/MDANSE/Framework/Jobs/Castep.py", line 166, in run_step
    timeStep, basisVectors, config = self._castepFile.read_step(index)
  File "/home/t1113120/mdanse/venv/lib/python2.7/site-packages/MDANSE/Framework/Jobs/Castep.py", line 95, in read_step
    timeStep = float(self['instance'].read(self._frameInfo["time_step"][1]))
ValueError: invalid literal for float(): -2.1452054585523738E+003   -2.1450825970441829E+003    1.1970561243732634E-001  <-- E`

BUG: 2D/2D Plotter on MacOS 11 creates blank new windows after the first

This bug has been observed only on MacOS 11 (with M1 chip); it does not occur on Windows 10.

In 2D/3D Plotter, when something is plotted by clicking on the 'Plot in new window' button, everything works properly. However, when this button is clicked once again (and for all uses thereafter), the second window is created, but it is blank:
image
This affects the line and image plotters only, with elevation working correctly.

Nevertheless, this issue is not unresolvable; after clicking on either of these buttons at the bottom image and then clicking anywhere in the blank window, the image reappears. Similarly, changing anything in the 'Configure subplots' window accessible via image button, or changing anything in the settings accessible via right-clicking the window also restores the plot.

The following is the Logger output, which may or may not be relevant:

2021-11-12 09:09:47 - ERROR    - vtk/wx/wxVTKRenderWindowInteractor.pyo -- 378 -- OnPaint -- None
                                 wx/_gdi.pyo -- 5122 -- __init__ -- None
                                 
                                 PyAssertionError: C++ assertion "window->MacGetCGContextRef() != NULL" failed at /Users/chris.barker/miniconda/conda-bld/work/wxPython-src-3.0.2.0/src/osx/carbon/dcclient.cpp(195) in wxPaintDCImpl(): using wxPaintDC without being in a native paint event
2021-11-12 09:09:58 - ERROR    - vtk/wx/wxVTKRenderWindowInteractor.pyo -- 378 -- OnPaint -- None
                                 wx/_gdi.pyo -- 5122 -- __init__ -- None
                                 
                                 PyAssertionError: C++ assertion "window->MacGetCGContextRef() != NULL" failed at /Users/chris.barker/miniconda/conda-bld/work/wxPython-src-3.0.2.0/src/osx/carbon/dcclient.cpp(195) in wxPaintDCImpl(): using wxPaintDC without being in a native paint event

ENHANCEMENT: Improve 'simple help' readability

Firstly, when simple help is opened from the help menu, the window that opens is very small. Secondly, the opened text is all plain, which makes it difficult to read it as well as to quickly find relevant information. Fixing this should improve the user experience but shouldn't take much effort.

create UML diagrams for the software

investigate the structure of the MDANSE code and create a set of static UML diagrams, e.g. class diagrams, to document and represent the structure of the software.

BUG: Plotter1D uses strings where they should be floats

Firstly, either the yMin or the yMax value used by Plotter1D (line plotter) can in some circumstances end up being a string, which prevents it from being used in mathematical operations, throwing an error. This error makes autofit unfunctional (even when used manually), and prevents users from setting the bounds of axes in the Axes Settings.

Traceback:

/opt/mdanse/lib/python2.7/site-packages/MDANSE/GUI/Plugins/PlotterPlugin.py -- 278 -- on_plot -- Plotter.plot(data, self.selectedVar)
/opt/mdanse/lib/python2.7/site-packages/MDANSE/GUI/Plugins/Plotter1D.py -- 448 -- plot -- self.on_auto_fit()
/opt/mdanse/lib/python2.7/site-packages/MDANSE/GUI/Plugins/Plotter1D.py -- 333 -- on_auto_fit -- self.Ymax=  yMax + 0.05*(yMax-yMin)

TypeError: unsupported operand type(s) for -: 'numpy.string_' and 'float'

How to reproduce:

  1. Convert a trajectory using the Box Translated Trajectory plugin
  2. Open the resulting .nc file in 2D/3D Plotter
  3. From variables select description
  4. Select Plotter should be line
  5. Plot in new window

Secondly, changing Modulation in the above graph results in the following error:

/opt/mdanse/lib/python2.7/site-packages/MDANSE/GUI/Plugins/Plotter1D.py -- 255 -- on_offset -- self.add_offset(AddFactor)
/opt/mdanse/lib/python2.7/site-packages/MDANSE/GUI/Plugins/Plotter1D.py -- 311 -- add_offset -- line.set_ydata( (idx+1)*offset +y  )

TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')

BUG: Tests/FunctionalTests/Jobs/AllTests.py cannot be run

When attempting to run Tests/FunctionalTests/Jobs/AllTests.py, it fails with the following traceback:

Traceback (most recent call last):
  File "C:/Users/dni83241/Documents/MDANSE/MDANSE/Tests/FunctionalTests/Jobs/AllTests.py", line 36, in <module>
    run_test()
  File "C:/Users/dni83241/Documents/MDANSE/MDANSE/Tests/FunctionalTests/Jobs/AllTests.py", line 31, in run_test
    if not unittest.TextTestRunner(verbosity=2).run(suite()).wasSuccessful():
  File "C:/Users/dni83241/Documents/MDANSE/MDANSE/Tests/FunctionalTests/Jobs/AllTests.py", line 27, in suite
    test_suite.addTests(m.suite())
AttributeError: 'module' object has no attribute 'suite'

Repairing this is crucial to automating the testing process.

BUG: Conversions that convert velocities generate unexpected and broken variables in NetCDF trajectory

When trajectory conversion is performed using a converter that can convert velocities on a file that contain velocities, the following variables exist in the resulting NetCDF trajectory:

  • description
  • box_size
  • step
  • time
  • configuration
  • velocities
  • temperature
  • kinetic_energy

The first 6 are expected and should indeed appear, however, temperature and kinetic energy are often not even present in the initial trajectory, and there is no code in MDANSE that parses them even if they were, so they should not appear in the NetCDF trajectory. Even worse, these two unexpected variables are broken: when plotted, there is no x-axis variable, only units of au, which makes no sense. The data itself appears approximately correct, as can be seen below (unexpected graph above, actual temperature calculation using the same trajectory below)
image
image

create and test compilation/installation instructions

create and test instructions to compile the software and run the existing tests. a decent starting point might be these instructions sent by Remi Perenon, one of the developers at the ILL:

  1. Install dependencies first. Cython pyro and numpy are required for non-GUI use. Wx and vtk must be added if you want to use GUI.
  2. Then, you must install modified versions of Scientific-python (https://code.ill.fr/scientific-software/scientific-python) and MMTK (https://code.ill.fr/scientific-software/mmtk). Installation should be fine with git clone - python setup.py build - sudo python setup.py install. Be careful, no netcdf error should appear in your MMTK installation log.
  3. Install mdanse from source (https://code.ill.fr/scientific-software/mdanse) as previously
  4. Unit tests and dependencies tests can be launched from /Tests/UnitTests or /Tests/DependenciesTests,

and/or these specific instructions which have been used to install MDANSE on the ISIS Data Analysis as a Service platform (https://isis.analysis.stfc.ac.uk/), which runs CentOS 7 machines:

#install python2-pip, wxPython and netcdf headers and dependencies
yum install -y python2-pip wxPython wxBASE wxGTK wxGTK-gl wxGTK-media python2-matplotlib-wx netcdf-devel
#upgrade pip
pip install pip --upgrade
#install virtualenv for python2
pip install virtualenv
#create virtualenv for mdanse at /opt/mdanse
python -m virtualenv /opt/mdanse/
#install python dependencies for mdanse
/opt/mdanse/bin/python -m pip install cython pyro numpy vtk matplotlib
#copy over python2 packages for wxPython and matplotlib-wx backend into virtualenv
#the needed files can be identified via
#repoquery -l wxPython; and; repoquery -l python2-matplotlib-wx
cp -R /usr/lib64/python2.7/site-packages/wx* /opt/mdanse/lib64/python2.7/site-packages/
cp -R /usr/lib/python2.7/site-packages/wxPython_common-2.8.12.0-py2.7.egg-info /opt/mdanse/lib/python2.7/site-packages/
#note the '\cp' is not a type in the following
\cp -R /usr/lib64/python2.7/site-packages/matplotlib/backends/* /opt/mdanse/lib64/python2.7/site-packages/matplotlib/backends/
#export path to netcdf.h header file so the following modules to be installed know where to look for it
export NETCDF_HEADER_FILE_PATH=/usr/include/
#get and build custom-version of scientific python module into the virtualenv
cd
git clone https://code.ill.fr/scientific-software/scientific-python.git
cd scientific-python/
/opt/mdanse/bin/python setup.py build
/opt/mdanse/bin/python setup.py install
#get and build custom-version of MMTK python module into the virtualenv
cd
git clone https://code.ill.fr/scientific-software/mmtk.git
cd mmtk/
/opt/mdanse/bin/python setup.py build
/opt/mdanse/bin/python setup.py install
#get and build MDANSE python module into the virtualenv
cd
git clone https://code.ill.fr/scientific-software/mdanse.git
cd mdanse/
/opt/mdanse/bin/python setup.py build
/opt/mdanse/bin/python setup.py install
#run the gui via
/opt/mdanse/bin/mdanse_gui
#activate the virtualenv via
source /opt/mdanse/bin/activate
#logo at /opt/mdanse/conf_/Doc/mdanse_logo.png

ENHANCEMENT: Implement TRR reading into Gromacs converter

Specific implementation of #27 for Gromacs converter.

Currently, MDANSE is able to convert only XTC files from Gromacs simulations. However, these files do not contain velocity data since they are highly compressed. A Gromacs file format which does contain this and other information is TRR, but it is not currently implemented in MDANSE. Given that multiple analyses require velocity data, it would be useful to remedy this. The C and cython files for TRR parsing already do exist within MDANSE, since they were taken from MDTraj code along with those for XTC parsing, so all that is required is to write code in python within the main codebase to wrap and utilise these classes as well as create a complimentary GUI.

BUG: Normalisation does not work with GACF and PACF

Attempting to run general autocorrelation function or position autocorrelation function with the 'Normalise' box ticked results in job failure with the following traceback:

Traceback (most recent call last):
  File "C:\Program Files\MDANSE\lib\site-packages\MDANSE\Framework\Jobs\IJob.py", line 319, in run
    self.finalize()
  File "C:\Program Files\MDANSE\lib\site-packages\MDANSE\Framework\Jobs\GeneralAutoCorrelationFunction.py", line 112, in finalize
    for element in self.configuration['atom_selection']['n_atoms_per_element'].keys():
KeyError: 'n_atoms_per_element'

However, normalisation works with VACF.

Furthermore, only when this bug is encountered in GACF, starting any analysis afterwards causes it not to show up in the Jobs tab unless it fails. If it fails, it does show up as normal, though only after it fails, but otherwise there are no issues with it. However, if the analysis does succeed, it does not show up in the Jobs tab at all, while the output file is created. Restarting MDANSE fixes this display issue.

ENHANCEMENT: Prototype for porting MDANSE to python3

@sanghamitra-mukhopadhyay @RastislavTuranyi @gonzalezma After weeks of thinking and working I could finally write a prototype for porting MDANSE to python 3. To do so, I wrote from scratch the class of ChemicalSystem which is made of either Atom, AtomCluster, Molecule, PeptideChain or NucleotideChain. Those classes uses definitions of Atom, Residue; Nucleotide and Molecule stored in YAML files that I built on that occasion. The ChemicalSystem class is the light equivalent of the so-called Universe in MMTK. As such the ChemicalSystem keeps the full molecular hierarchy that you find in real system such as peptidic or nucleotidic chains. Based on this and using some parts of the MMTK PDB reader, I could derive a new PDB reader which seems OK when tried with a few PDB files. It is perhaps less universal than the one of MMTK but it has the advantage of fulfilling exactly our needs. The tricky part was to serialize a ChemicalSystem to an HDF5 file. To do so, I wrote some helper classes H5Atom, H5Molecule, H5Residue ... which are used through a recursive algorithm. This allows to store the chemical contents to HDF5. I also wrote from scratch a Trajectory class which represents a trajectory in memory. It reads the trajectory in HDF5 and builds from there a ChemicalSystem alongside with its configuration (coordinates, unit_cell, velocities ...). All the code is in Protos directory. Many work remains to do and that design can be improved but we finally have a good starting point for porting mdanse to python 3 by getting rid of MMTK and ScientificPython. To summarize:

- no more dependency on ScientificPython and MMTK
- no more dependency on python2
- trajectories stored in HDF5 format
- uses of YAML files to define the building blocks of a `ChemicalSystem`

investigation: dependency on ILL mmtk module

investigate what parts of the code depend on the custom mmtk module released by the ILL (https://code.ill.fr/scientific-software/mmtk) that the MDANSE code currently requires. also gain an understanding of and document why we could or could not use the "standard" mmtk module (https://github.com/khinsen/mmtk). if required: create issues for the different parts of the code that need to be updated so that we can use the standard mmtk module. note that we might want to not spend the time to update the code use the standard mmtk module as it is only available in python 2. here is a separate issue to investigate removing this dependency altogether: #7.

ENHANCEMENT: include more information in Data Info

Currently, the Data Info window contains the following information:

  • Path to the trajectory
  • Number of steps
  • Universe
  • Direct cell
  • Reciprocal cell
  • Molecules

This is all useful, but there is other information that would be useful to know about a given trajectory/analysis results. So far, I have thought about the following data to add, but if anyone has any suggestions, please share!

  • variables stored in the trajectory

investigation: replacing MMTK with MDAnalysis

MMTK is a python2-only module, and so it cannot be used as-is when MDANSE is rewritten in python 3. One way to handle this is to replace it with another module whose development is not ceased and works with python 3. One such module is MDAnalysis. One of its advantages is that it is capable of reading a variety of formats, potentially allowing MDANSE to drop the classes that convert various file formats into the format required by MMTK.

STYLING: inconsistent use of single or double quotes for strings throughout all the code

The strings throughout the code sometimes use single quote, sometimes use double quotes. This is of course just styling, but we should decide which format to use once for all and stick on it from now. I have not any strong opinion on which format to use between single and double quotes. Perhaps we should have a look at the one that is the more used in the code and select this as the reference.

Add information on how to contribute

Given that this repo has been public for a while and that it is not just me and Sanghamitra working here, I think it is a high time to decide guidelines for contributing to this repo, and then write this information down somewhere. Essentially, this repo's Community Standards, which are fairly barren right now, should be populated, especially:

  • Contributing
  • Issue template
  • PR template

Further, it would be good to decide standards of code quality, such as the inconsistent quotes, as noted in #52.

BUG: the rbt produces wrong NetCDF variables

At the very end of finalize method of RBT analysis, the writing of QUATERNIONS, COM and FIT is buggy. Indeed the NetCDF variables should be written inside the loop with the comp index.

ENHANCEMENT: Add instrument resolutions of specific instruments

Another thing that was brought to me during NMSUM. Currently, the only way to input an instrument resolution to MDANSE analyses is by manually typing in the parameters of the Gaussian. This is often not trivial, especially for external users who do not have this information at hand, and so might have to contact an instrument scientist or do extensive searches. Overall, this wastes everyone's time and makes for a bad user experience.

Therefore, a drop-down box should be implemented that allows users to select a specific instrument, the resolution of which would be automatically filled in, similar to how it is in Mantid.

ENHANCEMENT: Add a way to change a default input/output file paths and names

Currently, the default paths to and file names of input and output files, as well as python scripts when being saved, are overly general and so have to be changed manually every time an analysis/conversion is performed. Improving these default values is being addressed in #41, but giving control to the users to set their own default paths could further improve usability.

In terms of GUI, Sanghamitra has suggested that there should be a new, dedicated window for this purpose, which would be accessed from the File menu in the MaindFrame.

ENHANCEMENT: Calculate RDF and TCF inside PairDistributionFunction class

The theory background file inside MDANSE currently mentions that when PDF is calculated, RDF and TCF are calculated simultaneously. However, this is not the case in the current implementation. Still, these two properties are scientifically important, and were calculated together with PDF in nMOLDYN, the predecessor to MDANSE. The reason for including them inside PDF rather than creating separate classes is that to obtain RDF and TCF, PDF is multiplied by a specific value (more details in theory background).

BUG: Sometimes, opening an analysis that uses atom selection fails

Sometimes, attempting to open any analysis that uses atom selection from the Plugins panel fails with the following:
image
This can happen suddenly while using MDANSE, wherein analyses that worked until that point suddenly start throwing the above error, or from the start (exact trigger conditions to be investigated). This has so far been observed on Windows 10 and on CentOS7, where MDANSE has been built according to the instructions in #8 . Restarting MDANSE fixes the issue.

ENHANCEMENT: Implement velocity reading into trajectory converters

Currently, MDANSE saves velocities into NetCDF file only when converting from DL POLY files. However, trajectories generated with other software also contain velocity data, which is not being saved. Because of this, interpolation has to be used when computing functions that depend on velocities, and current correlation function cannot be computed at all since it does not implement interpolation. Therefore, the following steps should be undertaken:

  1. Check which trajectories contain velocity data.
  2. Extend the relevant converters to save velocities.

investigation: requirements for removing mmtk dependency

The mmtk module that MDANSE depends upon is only available for python 2 (e.g. see the documentation here:http://dirac.cnrs-orleans.fr/MMTK.html). investigate and document what is required to remove this dependency and create separate issues for any parts of the MDANSE code that need to be updated/changed.
A separate issue (#6) exists to investigate what would be required to move from a custom version of mmtk provided by the ILL to the standard version of the modules; such a move might be deemed pointless depending of the outcome of this investigation.

create workflow documentation/diagram(s)

Understand the work flow of the MDANSE program and create workflow documentation/diagram(s) for it. It should be understandable for beginners of the technique.

ENHANCEMENT: Add abstraction for plotter data

Quite soon, we will have to deal with hdf5 file in MDANSE. However, it would be good if the plotter could handle both NetCDF and HDF files transparently. To do so we have to add a layer of abstraction around the data passed to the plotter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.