Molecular Dynamics Using Python: Analysis with MDAnalysis Library

Verified

Added on  2023/05/30

|8
|1651
|112
AI Summary
This article discusses Molecular Dynamics simulation and analysis using Python with MDAnalysis library. It covers installation guide, required packages, methods and a new approach for geometrical calculation. The article also provides references for further reading.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Molecular Dynamics Using Python

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Introduction
Molecular Dynamics is a method or technique which is a subject of simulation for the study
related to physical movement of atom and more precisely particles.Those particles are interacted
freely with others while wandering. At that interaction, a force is exerted among the particles and
potential energies of them are being calculated by interatomic barrier (McGibbon et al., 2015,
pp.1528-1532). In this case the orbital path of molecules are determined by solving the
Newtonian equations of motion numerically (Mou et al., 2015, pp.2697-2706).
Document Page
MDAnalysis Library:
The analysis of Molecular Dynamics is done using Python with help and implementation of
MDAnalysis library. This specific library is used to analyze the trajectories of Molecular
Dynamics simulation in many different formats. It has the capability to choose atom suitably for
analysis and visualization (Gowers et al., 2016, pp. 98-105).
Installation Guide for MDAnalysis:
In a recent work, Jupyter Notebook via Anaconda Navigator is used for quick simulation. The
updated version of this library can be installed in Anaconda cloud or by “conda” installation with
the following query (Rajendiran and Durrant, 2018, pp.748-755).
condaconfig --add channels conda-forge
conda update --yes conda
MDAnalysis support both Python3.x and Python2.x. For this installation the environment should
be created as follows:
conda create --yes -n mdaenvpython=3.6
Finally, after creating the environment, the following code test the environment:
conda install --yes -n mdaenvMDAnalysisMDAnalysisTests
At the next step, the environment will be activated:
source activate mdaenv
New Approach:
Document Page
In this paper a new model is initiated for the analysis of geometrical calculation for the atom
trajectory with due analysis by imposing new methods. Here the analysis is done for the
following parameters:
Calculation of angle
Generating the intermolecular exclusion
Derive velocity
Analysis of force field
Calculate the inter atomic force
Calculate Coordinate of interaction
Determination of temperate generated on interaction
Storing data in a trajectory file and on requirement open it
With the new approach, the molecular dynamic analysis is performed (Khan et al., 2018, pp.173-
185)
Required packages:
sys:This provides supportfor functions,constants and methods of the Python interpreter.
dirsupports with available constants, functions and methods and help function provides valuable
detail information (Sega et al., 2018).
argparse:This acts as aparser for command line options.It is used by programmer to depicts user
friendly command line phrases and interconnections.
toy_md_integrate:This is used for the making of integration while the atoms are interacting each
other and also for the particles.
toy_md_params:This is used for the calculations of different parameters for the molecular
friction.

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
toy_md_force_field:This package is used for the calculations of the force field where the forces
are generated by molecular interaction. Notably while interaction, a force field is generated
which follows for further interaction of molecules.
toy_md_files:While analysis, it is required to store the data generated in interaction. This
package store the result set and as per requirement it supports the fetching of those data.
toy_md_forces:It helps for the calculations of forces generated at the time of interaction.
Notably, toy_md_force_field package deals with the force field and toy_md_forces deals with
only the forces generated during interaction period (Araújo et al., 2017).
Required Methods:
parseArguments():This is the method of the main program which is executed by fo=irst calling
the constructor for argparse and with value taken as the parameter by add_argument(). While
taking and sending the parameters as arguments, it will check for the coordinate value, parameter
value and forcefield value and here is a provision for wrong precision.
read_pdb(): This method is written in the modatom.py module. It is taking a file name as
argument namely, args.coordinates where the coordinate, atom name and all the required
parameters are available. By fetching those data it redirects to the main function where those
value are taken in [box, coords, atomnm, resnm, resnr, elem, conect]. Now, while fetching
operation is done it will check whether the data or any parameter is available in the file or not, if
available, it fetches otherwise it make the file to close using try-finally block (Gowers et al.,
2016, pp. 98-105).
write_pdb_frame(): It is again written in modatom.py module. This function is utilized to store
the stuffs like outputfile, step, box, coords, atomnm, resnm, resnr, elem like parameters.
Actually, when the parameters are written and they are stored successfully, they can be fetched
by reading the file.
Document Page
test_pdb(): The third function is this written in modatom.py module. In this section, the
parameters [box, coords, atomnm, resnm, resnr, elem, conect] are fetched from koko.pdb and in
the second case, the variable outputfile holds the data of water2.pdb which is open in write-
mode. Now the theoutputfile is written and stored y passing argument of the file name along with
the other parameters mentioned in this function.
check_parameters():This method is attached in modpara.py module. This is employed to check
the parameters required for the main analysis by taking arguments like md_params&filename.In
the necessary List, the parameters like number of steps, time step, temperature, output frequency
are stored for checking the availability of the parameters (Gowers et al., 2016, pp. 98-105).
read_parameters():This function is written in modpara.py module and takes arguments of
filename and a Boolean parameter check which if true, the read operation will be performed. In
this function, the file read command open() is incorporated which takes the filename as argument
by a utf-8 encoding format. The technique is applied for reading the parameter is to split the long
string in the file by finding ‘#’.
Now returning to the main section, all the value that are taken in form of parameters till
discussed. There is a file consisting the output of the simulation labeled as outcoords which is
fetched as attribute calling as args.outcoords and this file is finally written using
write_pdb_frame(). In the mean time of the analysis, force, coordinates, temperature and
Lambda_T is cbeing calculated.
Force is calculated using the package from toy_md_force_field&toy_md_forces
[ epotential, forces ] = calculate_forces(box, coords, elem, conect, exclude, ff )
Coordinates is calculated using toy_md_integrate package
[ ekinetic, coords, velocities ] = integrate(box, coords, velocities, forces,
masses, float(md_params["time-step"]), lambda_T)
Computation of Temperature is done by toy_md_util&toy_md_params
get_temperature(len(coords), ekinetic)
Document Page
Calculation of Lmbda_T is done using toy_md_util&toy_md_params
compute_lambda_T(T,float(md_params["temperature"]),float(md_params["time-
step"]),float(md_params["tau-T"]))

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
References:
Araújo, A., Gibali, A., Kyprianou, A., Antoniou, E., Bustamante, M.D., Kaminski, Y.,
Okrasinski, W., Benham, G., Riseth, A.N., Morosanu, C. and Porumbel, I., 2017. Increasing the
Creativity of ENGINO Toy Sets and Generating Automatic Building Instructions.
Gowers, R.J., Linke, M., Barnoud, J., Reddy, T.J., Melo, M.N., Seyler, S.L., Dotson, D.L.,
Domanski, J., Buchoux, S., Kenney, I.M. and Beckstein, O., 2016, July. MDAnalysis: a Python
package for the rapid analysis of molecular dynamics simulations. In Proceedings of the 15th
Python in Science Conference (pp. 98-105). SciPy.
Khan, I., Ansari, I.A., Singh, P., Dass, J.F.P. and Khan, F., 2018. Identification and
characterization of functional single nucleotide polymorphisms (SNPs) in Axin 1 gene: a
molecular dynamics approach. Cell biochemistry and biophysics, 76(1-2), pp.173-185.
McGibbon, R.T., Beauchamp, K.A., Harrigan, M.P., Klein, C., Swails, J.M., Hernández, C.X.,
Schwantes, C.R., Wang, L.P., Lane, T.J. and Pande, V.S., 2015. MDTraj: a modern open library
for the analysis of molecular dynamics trajectories. Biophysical journal, 109(8), pp.1528-1532.
Mou, Y., Huang, P.S., Thomas, L.M. and Mayo, S.L., 2015. Using molecular dynamics
simulations as an aid in the prediction of domain swapping of computationally designed protein
variants. Journal of molecular biology, 427(16), pp.2697-2706.
Rajendiran, N. and Durrant, J.D., 2018. Pyrite: A blender plugin for visualizing molecular
dynamics simulations using industry‐standard rendering techniques. Journal of computational
chemistry, 39(12), pp.748-755.
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]