May 19 2017

PyGrunn: looking at molecules using python - Jonathan Barnoud

published by Reinout van Rees
in blog Reinout van Rees' weblog
original entryPyGrunn: looking at molecules using python - Jonathan Barnoud

pygrunn python

(One of my summaries of a talk at the 2017 PyGrunn conference).

He researches at fat molecules. He applies simulation to molecules. F = m * a (+ some much more elaborate formulas). With an elaborate simulation, he was able to explain some of the properties of fat (using a "jupyter" notebook).

His (python) workflow? First you need to prepare the simulation. He did have (of did build) a simulation engine. The preparation takes text files with the following info:

  • Topology.
  • Initial coordinates.
  • Simulation parameters.

Those text files are prepared and fed to the simulation engine. What comes out is a trajectory (a file with the position and direction and speed of every single molecure for all timesteps).

The next step is analysis. A problem here is that various simulation engines export different formats.... Similar problem with the input, btw...

Luckily we've got python. And for python there are a huge amount of libraries. Including "MDAnalysis" (http://www.mdanalysis.org/) , a library that can use these trajectory files. The output: python numpy arrays. Nice! This way you can use the entire python scientific stack (numpy, scipy, etc) with all its power.

Numpy? Made for matrices. So you can work with your entire data set. Or you can filter, mask or slice your data.

Thanks to these tools, he can experiment with the data in a comfortable way. And make plots.

But... movies with the 3D simulation are better! So: https://github.com/arose/nglview . His molecules are moving around. He can even place a graph nearby and bind the timeline in the graph and the 3D visualization together. It is all python!

A problem he had was his directory structure. Lots of directories with simulation config files with different settings. A mess. So: http://datreant.org/ , "persistent, pythonic trees for heterogeneous data".

Summary:

  • Python is awesome.
  • Jupyter is awesome too.
  • The python science stack is awesome as well.
  • Each field develops awesome tools based on the above.
https://abload.de/img/screenshot2017-05-13a1jzx1.png

Photo explanation: just a nice unrelated picture from the my work-in-progress german model railway

Dutch note: python+django programmeren in hartje Utrecht bij de oude gracht? Watersector, dus veel data en geo. Leuk! Nelen&Schuurmans is op zoek. Stuur mij maar een mailtje, want de vacaturetekst staat nog niet online :-)

Tag cloud


Social Sharing

Feeds