{"id":5028,"date":"2025-06-26T13:35:43","date_gmt":"2025-06-26T04:35:43","guid":{"rendered":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/?p=5028"},"modified":"2025-06-26T13:37:05","modified_gmt":"2025-06-26T04:37:05","slug":"conformational-search-of-small-molecules-using-gromacs","status":"publish","type":"post","link":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/en\/2025\/06\/26\/conformational-search-of-small-molecules-using-gromacs\/","title":{"rendered":"Conformational Search of Small Molecules Using GROMACS"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"397\" src=\"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-1024x397.png\" alt=\"\" class=\"wp-image-370\" srcset=\"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-1024x397.png 1024w, https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-300x116.png 300w, https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-768x297.png 768w, https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-360x139.png 360w, https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch.png 1420w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Using the simulated annealing method in GROMACS, a conformational search of small molecules is performed in vacuum.<br>This tutorial assumes that you are using a GROMACS version from the 2025 series together with AmberTools 25.<\/p>\n\n\n\n<p>Updated on June 26, 2025.<\/p>\n\n\n\n<ul style=\"list-style-type: square;\">\n<li>OS: macOS Sequoia 15.5, Chip: Apple M4, RAM: 16 GB\uff0e<\/li>\n<li>AmberTools 25<\/li>\n<li>GROMACS 2025.1<\/li>\n<li>VMD 1.9.4a57-arm64-Rev12<\/li>\n<\/ul>\n\n\n\n<p>(Published as a static page on October 17, 2016. Converted to a blog post and updated on June 26, 2025.)<\/p>\n\n\n\n<p><strong>Note:<\/strong> The method described below performs simulations in vacuum using force field parameters optimized for aqueous environments. It is not intended for accurate simulations but rather for generating a variety of conformations. Typically, Monte Carlo methods as implemented in software like Spartan or Macromodel are used for such conformational search. This tutorial explores whether a similar goal can be achieved using the free software GROMACS. Details such as the temperature settings, heating\/cooling schedule, and simulation duration for simulated annealing have not been thoroughly optimized.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Building a small molecule<\/h2>\n\n\n\n<p>First, use <a href=\"https:\/\/avogadro.cc\/\" title=\"\">Avogadro<\/a> to build the 3D structure of a small molecule. In this tutorial, the example used is indolactam-V (ILV), a 9-membered ring lactam (<a href=\"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILV.mol2_.txt\" title=\"ilv-mol2\">ILV.mol2<\/a>). While the GAFF force field is designed for use with the TIP3P water model, this tutorial performs calculations in vacuum, since the goal is to generate conformations by overcoming energy barriers (and vacuum calculations are also faster).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Preparing the small molecule topology<\/h2>\n\n\n\n<p>Use <strong>Antechamber<\/strong>, which is included in <strong><a href=\"https:\/\/ambermd.org\/AmberTools.php\" title=\"\">AmberTools<\/a><\/strong> (freely distributed; <a href=\"https:\/\/qiita.com\/Ag_smith\/items\/9526142858f8ea5248c1\" title=\"\">installation instructions for macOS 15 available<\/a>).<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ antechamber -fi mol2 -fo prepi -i ILV.mol2 -o ILV.prep -c bcc -at gaff2 -rn ILV\n$ parmchk2 -i ILV.prep -o ILV.frcmod -f prepi -s gaff2\n$ tleap\n&gt; source leaprc.gaff2\n&gt; loadamberprep ILV.prep\n&gt; loadamberparams ILV.frcmod\n&gt; mol = loadpdb NEWPDB.PDB\n&gt; saveamberparm mol ILV.prmtop ILV.inpcrd\n&gt; quit\n<\/pre><\/div>\n\n\n<p>You can run <strong>tleap<\/strong> by saving and executing the script shown below.<br><code class=\"\" data-line=\"\">tleap.in<\/code><\/p>\n\n\n\n<pre class=\"prettyprint\">source leaprc.gaff2\nloadamberprep ILV.prep\nloadamberparams ILV.frcmod\nmol = loadpdb NEWPDB.PDB\nsaveamberparm mol ILV.prmtop ILV.inpcrd\nquit<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ tleap -s -f tleap.in &gt; tleap.out\n<\/pre><\/div>\n\n\n<p>Next, use <strong>ParmEd<\/strong>, also included with AmberTools, to convert the Amber-format files into GROMACS format.<\/p>\n\n\n\n<p>Run the following script (<code class=\"\" data-line=\"\">ambergromacs.py<\/code>).<\/p>\n\n\n\n<pre class=\"prettyprint\">import parmed as pmd\n# Load AMBER format\namber = pmd.load_file(&#39;ILV.prmtop&#39;,xyz=&#39;ILV.inpcrd&#39;)\n# Save a GROMACS topology and GRO files\namber.save(&#39;gromacs.top&#39;)\namber.save(&#39;gromacs.gro&#39;)<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ $AMBERHOME\/miniconda\/bin\/python .\/ambergromacs.py\n<\/pre><\/div>\n\n\n<p>This will generate <code class=\"\" data-line=\"\">gromacs.top<\/code> and <code class=\"\" data-line=\"\">gromacs.gro<\/code>.<\/p>\n\n\n\n<p><strong>Note<\/strong>: The topology generated by <strong>Antechamber<\/strong> may sometimes result in a total atomic charge that deviates from zero. In such cases, open the GROMACS <code class=\"\" data-line=\"\">.top<\/code> file in a text editor and manually adjust the atomic charges to ensure the total is zero. Usually, the charge deviation is small and can be evenly distributed across all atoms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Running simulated annealing protocol<\/h2>\n\n\n\n<p>Preparing mdp file for a test run (sa5cycles.mdp).<\/p>\n\n\n\n<p><span style=\"font-weight: bold;\">sa5cycles.mdp<\/span><\/p>\n\n\n\n<pre class=\"prettyprint\">; Run parameters\nintegrator\t= md\t\t; leap-frog integrator\nnsteps\t\t= 25000\t\t; 1 * 25000 = 25 ps; 5 cycles\ndt\t\t= 0.001\t\t; 1 fs\n; Output control\nnstxout\t\t= 100\t\t; save coordinates every 0.2 ps\nnstvout\t\t= 100\t\t; save velocities every 0.2 ps\nnstenergy\t= 100\t\t; save energies every 0.2 ps\nnstlog\t\t= 100\t\t; update log file every 0.2 ps\n; Bond parameters\ncontinuation\t= no\t\t; first dynamics run\nconstraint_algorithm = lincs\t; holonomic constraints \nconstraints\t= all-bonds\t; all bonds (even heavy atom-H bonds) constrained\ncomm_mode       = angular\nlincs_iter\t= 1\t\t; accuracy of LINCS\nlincs_order\t= 4\t\t; also related to accuracy\nlincs-warnangle = 90\n; Neighborsearching\ncutoff-scheme   = Verlet\t\npbc\t\t= xyz\n; Temperature coupling is on\ntcoupl\t\t= V-rescale\t; modified Berendsen thermostat\ntc-grps\t\t= Other\t; two coupling groups - more accurate\ntau_t\t\t= 0.1\t; time constant, in ps\nref_t\t\t= 300 \t; reference temperature, one for each group, in K\n; Velocity generation\n; SIMULATED ANNEALING CONTROL\nannealing       =  periodic\nannealing_npoints  = 6\nannealing_time  = 0 1 2 3 4 5\nannealing_temp  = 1500 1500 1500 100 0 0\n<\/pre>\n\n\n\n<p>Generate .tpr file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ gmx editconf -f gromacs.gro -bt cubic -d 1 -o box.gro\n$ gmx grompp -f sa5cycles.mdp -c box.gro -p gromacs.top -o sa_test.tpr -maxwarn 1\n<\/pre><\/div>\n\n\n<p>Run test simulation.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ gmx mdrun -v -deffnm sa_test -ntmpi 1 -ntomp 1\n<\/pre><\/div>\n\n\n<p>Check if the temperature is changing as intended using <code class=\"\" data-line=\"\">gmx energy<\/code>.<\/p>\n\n\n\n<pre class=\"prettyprint\">$ gmx energy -f sa_test.edr -o temperature.xvg\n$ xmgrace temperature.xvg # brew install grace<\/pre>\n\n\n\n<p>Type \u201c12 0\u201d and enter.<br>Visualize temperature.xvg file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ xmgrace temperature.xvg\n<\/pre><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"232\" src=\"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/temperature-300x232.png\" alt=\"temperature\" class=\"wp-image-393\" srcset=\"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/temperature-300x232.png 300w, https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/temperature-768x593.png 768w, https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/temperature-349x270.png 349w, https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/temperature.png 792w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n<\/div>\n\n\n<p>Once you have confirmed that simulated annealing has been done properly (see right figure), run <strong>100 cycles<\/strong> of simulated annealing. Save both structure and energy at each cycle (see <code class=\"\" data-line=\"\">sa.mdp<\/code>).<br><span style=\"font-weight: bold;\">sa.mdp<\/span><\/p>\n\n\n\n<pre class=\"prettyprint\">; Run parameters\nintegrator\t= md\t\t; leap-frog integrator\nnsteps\t\t= 500000        ; 1 * 500000 = 500 ps; 100 cycles\ndt\t\t= 0.001\t\t; 1 fs\n; Output control\nnstxout\t\t= 5000\t\t; save coordinates every 0.2 ps\nnstvout\t\t= 5000\t\t; save velocities every 0.2 ps\nnstenergy\t= 5000\t\t; save energies every 0.2 ps\nnstlog\t\t= 5000\t\t; update log file every 0.2 ps\n; Bond parameters\ncontinuation\t= no\t\t; first dynamics run\nconstraint_algorithm = lincs\t; holonomic constraints \nconstraints\t= all-bonds\t; all bonds (even heavy atom-H bonds) constrained\ncomm_mode       = angular\nlincs_iter\t= 1\t\t; accuracy of LINCS\nlincs_order\t= 4\t\t; also related to accuracy\nlincs-warnangle = 90\n; Neighborsearching\ncutoff-scheme   = Verlet\t\npbc\t\t= xyz\n; Temperature coupling is on\ntcoupl\t\t= V-rescale\t; modified Berendsen thermostat\ntc-grps\t\t= Other\t; two coupling groups - more accurate\ntau_t\t\t= 0.1\t; time constant, in ps\nref_t\t\t= 300 \t; reference temperature, one for each group, in K\n; Velocity generation\n; SIMULATED ANNEALING CONTROL\nannealing       =  periodic\nannealing_npoints  = 6\nannealing_time  = 0 1 2 3 4 5\nannealing_temp  = 1500 1500 1500 100 0 0\n<\/pre>\n\n\n\n<p><strong>Caution<\/strong>: At sufficiently high temperatures, molecules with carbon\u2013carbon double bonds may undergo <strong><em>cis<\/em>\u2013<em>trans<\/em> isomerization<\/strong>.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ gmx grompp -f sa.mdp -c box.gro -p gromacs.top -o sa.tpr -maxwarn 1\n$ gmx mdrun -v -deffnm sa -ntmpi 1 -ntomp 1\n<\/pre><\/div>\n\n\n<p>The calculation will finish in about 7 seconds.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: \u7d50\u679c\u306e\u89e3\u6790<\/h2>\n\n\n\n<p>Although GROMACS includes the <code class=\"\" data-line=\"\">g_cluster<\/code> tool, this tutorial uses a <a href=\"https:\/\/github.com\/luisico\/clustering\" title=\"\">VMD extension for clustering<\/a>.<br>Download and extract <strong>Clustering 2.0<\/strong>. Copy the directory to an appropriate location and add the following line to your <code class=\"\" data-line=\"\">~\/.vmdrc<\/code> file:\uff0e<\/p>\n\n\n\n<pre class=\"prettyprint\">menu main on\nset auto_path &#91;linsert $auto_path 0 {location of clustering plugin}&#93;\nvmd_install_extension clustering clustering &#34;WMC PhysBio&#47;Clustering&#34;<\/pre>\n\n\n\n<p>Start <strong>VMD<\/strong> and load the trajectory from the simulated annealing run.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code command-line language-bash\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ vmd sa.gro sa.trr # vmd: aliased to \/Applications\/VMD 1.9.4a57-arm64-Rev12.app\/Contents\/vmd\/vmd_MACOSXARM64\n<\/pre><\/div>\n\n\n<p>Go to <strong>Extensions \u2192 Analysis \u2192 RMSD Trajectory Tool<\/strong>.<br>Change the selection from <code class=\"\" data-line=\"\">protein<\/code> to <code class=\"\" data-line=\"\">resname ILV<\/code>, and click the <strong>Align<\/strong> button to align all frames to the initial structure.<\/p>\n\n\n\n<p>Next, go to <strong>Extensions \u2192 WMC PhysBio \u2192 Clustering<\/strong> to perform clustering analysis.<br>Set the selection to <code class=\"\" data-line=\"\">resname ILV<\/code>, uncheck <strong>noh<\/strong>, and set <strong>num<\/strong> to 20.<br>Change the <strong>Cutoff<\/strong> under <strong>Use measure cluster<\/strong> from 1 to 0.9. Click <strong>Calculate<\/strong>\u2014clusters will be color-coded and displayed at the bottom. Analyze the results visually.<\/p>\n<p><strong data-start=\"904\" data-end=\"911\">Indolactam-V (ILV)<\/strong> exists in solution as a mixture of two stable conformers (<em>cis<\/em>-amide and <em>trans<\/em>-amide types), and both signals are observed in NMR spectra. The clusters that appeared multiple times during the simulation are as follows (conformers are classified using <a href=\"http:\/\/dx.doi.org\/10.1021\/jo00049a020\">Itai\u2019s nomenclature<\/a>):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cluster 0 (23):<\/strong> Sofa conformer with <em>trans<\/em>-amide. Matches the NMR spectrum. <em>This is the initial structure.<\/em><\/li>\n\n\n\n<li><strong>Cluster 1 (11):<\/strong> Sofa conformer. Differs from Cluster 0 in the conformation of the isopropyl group at position 12.<\/li>\n\n\n\n<li><strong>Cluster 2 (5):<\/strong> Sofa conformer. Essentially the same as Cluster 0, differing only in the conformation of the hydroxymethyl group.<\/li>\n\n\n\n<li><strong>Cluster 3 (5):<\/strong> <em>r<\/em>&#8211;<em>Cis<\/em>-sofa conformer. Not observed in NMR.<\/li>\n\n\n\n<li><strong>Cluster 4 (4):<\/strong> Twist conformer with <em>cis<\/em>-amide. Matches the NMR spectrum.<\/li>\n\n\n\n<li><strong>Cluster 5 (2):<\/strong> <em>r<\/em>&#8211;<em>Trans<\/em>-fold conformer.<\/li>\n<\/ul>\n\n\n\n<p>If stable conformers cannot be clearly identified, consider comparing energies using different force fields or molecular orbital (MO) calculations. It is also possible to use multiple conformers for docking simulations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using the simulated annealing  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":370,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uag_custom_page_level_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_locale":"en_US","_original_post":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/?p=5016","footnotes":""},"categories":[5],"tags":[],"class_list":["post-5028","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-5","en-US"],"aioseo_notices":[],"uagb_featured_image_src":{"full":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch.png",1420,550,false],"thumbnail":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-150x150.png",150,150,true],"medium":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-300x116.png",300,116,true],"medium_large":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-768x297.png",768,297,true],"large":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch-1024x397.png",800,310,true],"1536x1536":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch.png",1420,550,false],"2048x2048":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch.png",1420,550,false],"onepress-blog-small":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch.png",300,116,false],"onepress-small":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch.png",480,186,false],"onepress-medium":["https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp\/wp-content\/uploads\/2016\/10\/ILVconformationseyecatch.png",640,248,false]},"uagb_author_info":{"display_name":"RCY","author_link":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/author\/charlesy\/"},"uagb_comment_info":0,"uagb_excerpt":"Using the simulated annealing ...","_links":{"self":[{"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/posts\/5028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/comments?post=5028"}],"version-history":[{"count":2,"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/posts\/5028\/revisions"}],"predecessor-version":[{"id":5034,"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/posts\/5028\/revisions\/5034"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/media\/370"}],"wp:attachment":[{"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/media?parent=5028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/categories?post=5028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ag.kagawa-u.ac.jp\/charlesy\/wp-json\/wp\/v2\/tags?post=5028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}