{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Required\n", "* forcefield\n", "* initial pdb\n", "* installed gromacs\n", "* installed MDAnalysis" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import MDAnalysis as mda\n", "from MDAnalysis.analysis import align\n", "from MDAnalysis.analysis.rms import rmsd\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Trimming h2a and h2b as it was performed in [JMB](https://linkinghub.elsevier.com/retrieve/pii/S0022283615006956)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/armeev/miniconda3/envs/mdanalysis/lib/python3.6/site-packages/MDAnalysis/topology/guessers.py:72: UserWarning: Failed to guess the mass for the following atom types: MN\n", " warnings.warn(\"Failed to guess the mass for the following atom types: {}\".format(atom_type))\n" ] } ], "source": [ "nucl=mda.Universe(\"1kx5.pdb\")\n", "dimer=nucl.select_atoms(\"(segid C and resid 12:119) or (segid D and resid 26:200 )\")\n", "dimer.write(\"h2a_h2b_tr.pdb\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Performing PDB2GMX" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "%%bash --out out --err err\n", "source /usr/local/gromacs/bin/GMXRC\n", "mkdir GMX_system\n", "cd GMX_system\n", "ln -s ../charmm36-jul2017.ff/ .\n", "gmx pdb2gmx -f ../h2a_h2b_tr.pdb -o init.pdb -p topol.top \\\n", "-i posre.itp -water tip3p -ff charmm36-jul2017\n", "\n", "gmx editconf -bt cubic -d 2 -c -f init.pdb -o init_box.pdb" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Out:\n", " turning H bonds into constraints...\n", "turning H bonds into constraints...\n", "Analysing residue names:\n", "There are: 205 Protein residues\n", "Analysing Protein...\n", "This run will generate roughly 0 Mb of data\n", "\n", "Err:\n", " :-) GROMACS - gmx grompp, 2018.3 (-:\n", "\n", " GROMACS is written by:\n", " Emile Apol Rossen Apostolov Paul Bauer Herman J.C. Berendsen\n", " Par Bjelkmar Aldert van Buuren Rudi van Drunen Anton Feenstra \n", " Gerrit Groenhof Aleksei Iupinov Christoph Junghans Anca Hamuraru \n", " Vincent Hindriksen Dimitrios Karkoulis Peter Kasson Jiri Kraus \n", " Carsten Kutzner Per Larsson Justin A. Lemkul Viveca Lindahl \n", " Magnus Lundborg Pieter Meulenhoff Erik Marklund Teemu Murtola \n", " Szilard Pall Sander Pronk Roland Schulz Alexey Shvetsov \n", " Michael Shirts Alfons Sijbers Peter Tieleman Teemu Virolainen \n", " Christian Wennberg Maarten Wolf \n", " and the project leaders:\n", " Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel\n", "\n", "Copyright (c) 1991-2000, University of Groningen, The Netherlands.\n", "Copyright (c) 2001-2017, The GROMACS development team at\n", "Uppsala University, Stockholm University and\n", "the Royal Institute of Technology, Sweden.\n", "check out http://www.gromacs.org for more information.\n", "\n", "GROMACS is free software; you can redistribute it and/or modify it\n", "under the terms of the GNU Lesser General Public License\n", "as published by the Free Software Foundation; either version 2.1\n", "of the License, or (at your option) any later version.\n", "\n", "GROMACS: gmx grompp, version 2018.3\n", "Executable: /usr/local/gromacs/bin/gmx\n", "Data prefix: /usr/local/gromacs\n", "Working dir: /home/armeev/Projects/Modelling/MolModEdu/MDanalysis\n", "Command line:\n", " gmx grompp -f Protocols/minimization.mdp -c GMX_system/init_box.pdb -p GMX_system/topol.top -o GMX_run/minimization.tpr -r GMX_system/init_box.pdb\n", "\n", "Setting the LD random seed to -667031372\n", "Generated 97877 of the 97903 non-bonded parameter combinations\n", "Generating 1-4 interactions: fudge = 1\n", "Generated 64492 of the 97903 1-4 parameter combinations\n", "Excluding 3 bonded neighbours molecule type 'Protein_chain_C'\n", "Excluding 3 bonded neighbours molecule type 'Protein_chain_D'\n", "\n", "NOTE 1 [file topol.top, line 47]:\n", " System has non-zero total charge: 21.000000\n", " Total charge should normally be an integer. See\n", " http://www.gromacs.org/Documentation/Floating_Point_Arithmetic\n", " for discussion on how close it should be to an integer.\n", " \n", "\n", "\n", "Removing all charge groups because cutoff-scheme=Verlet\n", "Number of degrees of freedom in T-Coupling group rest is 8197.00\n", "\n", "NOTE 2 [file Protocols/minimization.mdp]:\n", " You are using a plain Coulomb cut-off, which might produce artifacts.\n", " You might want to consider using PME electrostatics.\n", "\n", "\n", "\n", "There were 2 notes\n", "\n", "GROMACS reminds you: \"You Look Better Upside Down\" (Throwing Muses)\n", "\n", " :-) GROMACS - gmx mdrun, 2018.3 (-:\n", "\n", " GROMACS is written by:\n", " Emile Apol Rossen Apostolov Paul Bauer Herman J.C. Berendsen\n", " Par Bjelkmar Aldert van Buuren Rudi van Drunen Anton Feenstra \n", " Gerrit Groenhof Aleksei Iupinov Christoph Junghans Anca Hamuraru \n", " Vincent Hindriksen Dimitrios Karkoulis Peter Kasson Jiri Kraus \n", " Carsten Kutzner Per Larsson Justin A. Lemkul Viveca Lindahl \n", " Magnus Lundborg Pieter Meulenhoff Erik Marklund Teemu Murtola \n", " Szilard Pall Sander Pronk Roland Schulz Alexey Shvetsov \n", " Michael Shirts Alfons Sijbers Peter Tieleman Teemu Virolainen \n", " Christian Wennberg Maarten Wolf \n", " and the project leaders:\n", " Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel\n", "\n", "Copyright (c) 1991-2000, University of Groningen, The Netherlands.\n", "Copyright (c) 2001-2017, The GROMACS development team at\n", "Uppsala University, Stockholm University and\n", "the Royal Institute of Technology, Sweden.\n", "check out http://www.gromacs.org for more information.\n", "\n", "GROMACS is free software; you can redistribute it and/or modify it\n", "under the terms of the GNU Lesser General Public License\n", "as published by the Free Software Foundation; either version 2.1\n", "of the License, or (at your option) any later version.\n", "\n", "GROMACS: gmx mdrun, version 2018.3\n", "Executable: /usr/local/gromacs/bin/gmx\n", "Data prefix: /usr/local/gromacs\n", "Working dir: /home/armeev/Projects/Modelling/MolModEdu/MDanalysis\n", "Command line:\n", " gmx mdrun -deffnm GMX_run/minimization\n", "\n", "Reading file GMX_run/minimization.tpr, VERSION 2018.3 (single precision)\n", "Using 1 MPI thread\n", "Using 8 OpenMP threads \n", "\n", "\n", "Steepest Descents:\n", " Tolerance (Fmax) = 1.00000e+02\n", " Number of steps = 5000\n", "\n", "writing lowest energy coordinates.\n", "\n", "Steepest Descents converged to Fmax < 100 in 1677 steps\n", "Potential Energy = -1.8213428e+04\n", "Maximum force = 9.6151176e+01 on atom 2201\n", "Norm of force = 8.3892308e+00\n", "\n", "GROMACS reminds you: \"Everybody has a plan until they get punched in the mouth\" (Mike Tyson)\n", "\n", "\n" ] } ], "source": [ "print('Out:\\n',out)\n", "print('Err:\\n',err)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "%%bash --out out --err err\n", "source /usr/local/gromacs/bin/GMXRC\n", "mkdir GMX_run\n", "gmx grompp -f Protocols/minimization.mdp -c GMX_system/init_box.pdb -p GMX_system/topol.top \\\n", "-o GMX_run/minimization.tpr -r GMX_system/init_box.pdb\n", "gmx mdrun -deffnm GMX_run/minimization" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Out:\n", " turning H bonds into constraints...\n", "turning H bonds into constraints...\n", "Analysing residue names:\n", "There are: 205 Protein residues\n", "Analysing Protein...\n", "This run will generate roughly 0 Mb of data\n", "\n", "Err:\n", " :-) GROMACS - gmx grompp, 2018.3 (-:\n", "\n", " GROMACS is written by:\n", " Emile Apol Rossen Apostolov Paul Bauer Herman J.C. Berendsen\n", " Par Bjelkmar Aldert van Buuren Rudi van Drunen Anton Feenstra \n", " Gerrit Groenhof Aleksei Iupinov Christoph Junghans Anca Hamuraru \n", " Vincent Hindriksen Dimitrios Karkoulis Peter Kasson Jiri Kraus \n", " Carsten Kutzner Per Larsson Justin A. Lemkul Viveca Lindahl \n", " Magnus Lundborg Pieter Meulenhoff Erik Marklund Teemu Murtola \n", " Szilard Pall Sander Pronk Roland Schulz Alexey Shvetsov \n", " Michael Shirts Alfons Sijbers Peter Tieleman Teemu Virolainen \n", " Christian Wennberg Maarten Wolf \n", " and the project leaders:\n", " Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel\n", "\n", "Copyright (c) 1991-2000, University of Groningen, The Netherlands.\n", "Copyright (c) 2001-2017, The GROMACS development team at\n", "Uppsala University, Stockholm University and\n", "the Royal Institute of Technology, Sweden.\n", "check out http://www.gromacs.org for more information.\n", "\n", "GROMACS is free software; you can redistribute it and/or modify it\n", "under the terms of the GNU Lesser General Public License\n", "as published by the Free Software Foundation; either version 2.1\n", "of the License, or (at your option) any later version.\n", "\n", "GROMACS: gmx grompp, version 2018.3\n", "Executable: /usr/local/gromacs/bin/gmx\n", "Data prefix: /usr/local/gromacs\n", "Working dir: /home/armeev/Projects/Modelling/MolModEdu/MDanalysis\n", "Command line:\n", " gmx grompp -f Protocols/minimization.mdp -c GMX_system/init_box.pdb -p GMX_system/topol.top -o GMX_run/minimization.tpr -r GMX_system/init_box.pdb\n", "\n", "Setting the LD random seed to -667031372\n", "Generated 97877 of the 97903 non-bonded parameter combinations\n", "Generating 1-4 interactions: fudge = 1\n", "Generated 64492 of the 97903 1-4 parameter combinations\n", "Excluding 3 bonded neighbours molecule type 'Protein_chain_C'\n", "Excluding 3 bonded neighbours molecule type 'Protein_chain_D'\n", "\n", "NOTE 1 [file topol.top, line 47]:\n", " System has non-zero total charge: 21.000000\n", " Total charge should normally be an integer. See\n", " http://www.gromacs.org/Documentation/Floating_Point_Arithmetic\n", " for discussion on how close it should be to an integer.\n", " \n", "\n", "\n", "Removing all charge groups because cutoff-scheme=Verlet\n", "Number of degrees of freedom in T-Coupling group rest is 8197.00\n", "\n", "NOTE 2 [file Protocols/minimization.mdp]:\n", " You are using a plain Coulomb cut-off, which might produce artifacts.\n", " You might want to consider using PME electrostatics.\n", "\n", "\n", "\n", "There were 2 notes\n", "\n", "GROMACS reminds you: \"You Look Better Upside Down\" (Throwing Muses)\n", "\n", " :-) GROMACS - gmx mdrun, 2018.3 (-:\n", "\n", " GROMACS is written by:\n", " Emile Apol Rossen Apostolov Paul Bauer Herman J.C. Berendsen\n", " Par Bjelkmar Aldert van Buuren Rudi van Drunen Anton Feenstra \n", " Gerrit Groenhof Aleksei Iupinov Christoph Junghans Anca Hamuraru \n", " Vincent Hindriksen Dimitrios Karkoulis Peter Kasson Jiri Kraus \n", " Carsten Kutzner Per Larsson Justin A. Lemkul Viveca Lindahl \n", " Magnus Lundborg Pieter Meulenhoff Erik Marklund Teemu Murtola \n", " Szilard Pall Sander Pronk Roland Schulz Alexey Shvetsov \n", " Michael Shirts Alfons Sijbers Peter Tieleman Teemu Virolainen \n", " Christian Wennberg Maarten Wolf \n", " and the project leaders:\n", " Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel\n", "\n", "Copyright (c) 1991-2000, University of Groningen, The Netherlands.\n", "Copyright (c) 2001-2017, The GROMACS development team at\n", "Uppsala University, Stockholm University and\n", "the Royal Institute of Technology, Sweden.\n", "check out http://www.gromacs.org for more information.\n", "\n", "GROMACS is free software; you can redistribute it and/or modify it\n", "under the terms of the GNU Lesser General Public License\n", "as published by the Free Software Foundation; either version 2.1\n", "of the License, or (at your option) any later version.\n", "\n", "GROMACS: gmx mdrun, version 2018.3\n", "Executable: /usr/local/gromacs/bin/gmx\n", "Data prefix: /usr/local/gromacs\n", "Working dir: /home/armeev/Projects/Modelling/MolModEdu/MDanalysis\n", "Command line:\n", " gmx mdrun -deffnm GMX_run/minimization\n", "\n", "Reading file GMX_run/minimization.tpr, VERSION 2018.3 (single precision)\n", "Using 1 MPI thread\n", "Using 8 OpenMP threads \n", "\n", "\n", "Steepest Descents:\n", " Tolerance (Fmax) = 1.00000e+02\n", " Number of steps = 5000\n", "\n", "writing lowest energy coordinates.\n", "\n", "Steepest Descents converged to Fmax < 100 in 1677 steps\n", "Potential Energy = -1.8213428e+04\n", "Maximum force = 9.6151176e+01 on atom 2201\n", "Norm of force = 8.3892308e+00\n", "\n", "GROMACS reminds you: \"Everybody has a plan until they get punched in the mouth\" (Mike Tyson)\n", "\n", "\n" ] } ], "source": [ "print('Out:\\n',out)\n", "print('Err:\\n',err)" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "%%bash --out out --err err\n", "source /usr/local/gromacs/bin/GMXRC\n", "gmx grompp -f Protocols/equilibration_vac.mdp -c GMX_run/minimization.gro -p GMX_system/topol.top \\\n", "-o GMX_run/equilibration.tpr -r GMX_system/init_box.pdb -v\n", "gmx mdrun -deffnm GMX_run/equilibration" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print('Out:\\n',out)\n", "print('Err:\\n',err)" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [], "source": [ "%%bash --out out --err err\n", "source /usr/local/gromacs/bin/GMXRC\n", "gmx grompp -f Protocols/production_vac.mdp -c GMX_run/equilibration.gro -p GMX_system/topol.top \\\n", "-o GMX_run/production.tpr -t GMX_run/equilibration.cpt -r GMX_system/init_box.pdb -v\n", "gmx mdrun -deffnm GMX_run/production" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print('Out:\\n',out)\n", "print('Err:\\n',err)" ] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:mdanalysis]", "language": "python", "name": "conda-env-mdanalysis-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.6" } }, "nbformat": 4, "nbformat_minor": 2 }