ShinyWater: A Shiny app for molecular dynamics simulation and visualization of water-based systems

Raymond Atta-Fynn
Posted on Aug 24, 2019


Data science techniques and tools are rapidly expanding, and thanks to the advent of high performance computing, they have now reached levels of realism whereby the can be made an integral part of computational materials modeling. The major goals of computational materials modeling are: (i) interpret experimental data (i.e. play a supporting role with experiment playing the leading role); (ii) make predictions on the applicability and functionalities of materials and discover new materials. More specifically as it relates to data science, machine learning can be combined with traditional computational modeling methods to enhance the prediction of exotic material properties and aid in the discovery of new materials design as well as materials tailored to have specific properties.

This project is not a traditional data science exercise whereby one analyzes and dissects pre-collected data; in this project, data is generated via molecular modeling and subsequently analyzed.  This project represents the infant stage of a grand overarching goal: build an integrated  machine learning and materials modeling system. In this regard, a shiny application was developed for molecular modeling of pure water and metal ions immersed in water (that is, hydrated metal ions). The choice of water was quite simple: water is ubiquitous in nature; it influences nearly every aspect of natural processes, ranging from biological processes to chemical processes.  In addition, the hydration shell a metal ion (which is the geometric arrangement of water molecules around the ion)  is a fundamental property that determines, to a great extent,the ion’s physical and chemical properties in water.


Features of the App

Twenty five systems, comprising a pure water system and twenty four metal ions ions in water, are available to simulate. The user can simulate up to 256 water molecules. The app can perform three key simulation tasks: (i) build an initial atomistic geometry for a chosen system; (ii) perform geometry optimization by minimizing the total energy of the system with respect to the atomic positions using the steepest descent or the conjugate gradient algorithm; (iii) perform molecular dynamics in the canonical (NVT) and micro-canonical (NVE) ensembles. The Nose-Hoover thermostat, which is used to control  temperature in the NVT simulation, was implemented in the app. There is also a fourth option to perform dynamics followed geometry optimization.

Three rigid models for liquid water are available in the app: (i) SPC/E model;  (ii) TIP3P model; (iii) TIP4P_eW model. The interaction between the water molecules and the ion is governed by the modified Lennard potential; the parameters for the potential were taken from a recent article in the Journal of Physical Chemistry B  [link to article:].

The user has the option to save the data from the simulations and subsequently study the properties of the system and perform other analysis. 

Using the App

The app is located at (click on it to see the app). However only one feature is active in the app: the user can build initial atomistic geometries and visualize the atomic geometry in a ball-and-stick format as well as the oxygen-oxygen radial distribution function; the corresponding R script for the current app is located at The figure below shows a depiction of the model of solvated Al3+ ion.

Fig 1: Snapshot of initial model generation of Al3+ ion solvated by 20 water molecules.


The geometry optimization and molecular dynamics features have been disabled due primarily to performance reasons.   Unfortunately, R doesn't perform well for medium (150-200 atoms) to large systems (300-1000 atoms). The routines are being re-written for optimal performance. After the speed has been significantly improved, the user should be able to  visualize the dynamical motion of the atoms and molecules as the simulation proceeds. The full app will also be designed to compute properties of the system/material, and the correctness of the property can be assessed by comparing it with experiment.


Conclusions and future work

The goal of this app was to give the user a simplified tool for quick modeling and visualization of materials. The app is in its infant stages; it can currently build the initial, unrefined atomistic model for water and solvated ions. Once the scripts which control the dynamics of the system have been optimized for fast performance, the molecular dynamics aspect of the app will be fully  functional and aid the material science community with a range of choices for materials modeling. Machine capabilities via R will also be introduced so that the user may train and test molecular modeling data.



About Author

Raymond Atta-Fynn

Raymond Atta-Fynn

I am a Theoretical Condensed Matter Physicist with several years of research experience. My goal is to employ my computational physics skills in Data Science.
View all posts by Raymond Atta-Fynn >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp