<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>lennard-jone potential on Everyday Is A School Day</title>
    <link>https://www.kenkoonwong.com/tags/lennard-jone-potential/</link>
    <description>Recent content in lennard-jone potential on Everyday Is A School Day</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 07 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.kenkoonwong.com/tags/lennard-jone-potential/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Learning Amino Acids Part 1: Non-Polar Amino Acids, Rodrigues Rotation, and Lennard-Jones Potential</title>
      <link>https://www.kenkoonwong.com/blog/aa1/</link>
      <pubDate>Sun, 07 Jun 2026 00:00:00 +0000</pubDate>
      
      <guid>https://www.kenkoonwong.com/blog/aa1/</guid>
      <description>&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/kePrint/kePrint.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/lightable/lightable.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/kePrint/kePrint.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/lightable/lightable.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;link href=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/htmltools-fill/fill.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/htmlwidgets/htmlwidgets.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/plotly-binding/plotly.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/typedarray/typedarray.min.js&#34;&gt;&lt;/script&gt;
&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/jquery/jquery.min.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/crosstalk/css/crosstalk.min.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/crosstalk/js/crosstalk.min.js&#34;&gt;&lt;/script&gt;
&lt;link href=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/plotly-htmlwidgets-css/plotly-htmlwidgets.css&#34; rel=&#34;stylesheet&#34; /&gt;
&lt;script src=&#34;https://www.kenkoonwong.com/blog/aa1/index_files/plotly-main/plotly-latest.min.js&#34;&gt;&lt;/script&gt;
&lt;blockquote&gt;
&lt;p&gt;🧬 Back to basics! Learning non-polar amino acids, what zwitterions actually are, and dipping into the applied math — Rodrigues rotation and Lennard-Jones potential. Slowly building toward optimal phi/psi!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2 id=&#34;motivations&#34;&gt;Motivations
  &lt;a href=&#34;#motivations&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;We’ve explored quite a bit lately in molecular dynamic simulation and then 
&lt;a href=&#34;https://www.kenkoonwong.com/blog/haddock/#covr&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;protein-protein docking&lt;/a&gt; as well the last time. There is still so much to learn. I’ve decided to go back to basics, revisiting our old friends amino acids and try to understand the natural properties behind each one and see if that will make more sense in the future when we’re exploring more. While making notes for myself of all the amino acids, I’ll also try to understand some of the basic math behind the structures. Are you ready !? Lol, I’m not, but let’s go anyway! 🤣&lt;/p&gt;




&lt;h2 id=&#34;objectives&#34;&gt;Objectives:
  &lt;a href=&#34;#objectives&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;#aa&#34;&gt;Amino Acids&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;#nonpolar&#34;&gt;Non-polar&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#rodriguez&#34;&gt;Rodriguez Rotation Formula&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#lj&#34;&gt;Lennard-Jone Potential Enegery&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;#stretch&#34;&gt;Bond Stretch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#angle&#34;&gt;Bond Angle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#torsion&#34;&gt;Proper dihedral&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#nonbond&#34;&gt;Non-bonded&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#calc&#34;&gt;Calculating LJ&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#opportunities&#34;&gt;Opportunities For Improvement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;#lessons&#34;&gt;Lessons Learnt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;amino-acids&#34;&gt;Amino Acids
  &lt;a href=&#34;#amino-acids&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Amino acids are the building blocks of proteins, each sharing a common backbone: a central α-carbon bonded to an amino group (–NH₂), a carboxyl group (–COOH), a hydrogen atom, and a variable side chain (R group) that defines each amino acid’s identity and chemistry.&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;feature.png&#34; alt=&#34;image&#34; width=&#34;100%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;




&lt;h2 id=&#34;non-polar-amino-acids&#34;&gt;Non-polar amino acids
  &lt;a href=&#34;#non-polar-amino-acids&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Non-polar amino acids have hydrophobic side chains — they avoid water and tend to cluster in the interior of folded proteins, forming the hydrophobic core that drives protein stability. Understanding each one’s shape and bulk is directly relevant to how they pack, how they constrain backbone flexibility, and how substitutions affect enzyme active sites.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;library&lt;/span&gt;(tibble)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;library&lt;/span&gt;(kableExtra)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;aa_nonpolar &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;tribble&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;aa,  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;aa3,  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;name,           &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;functional_group,  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;smiles_sidechain,    &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;charge_ph7, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;mw_da, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;pka,     &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;md_note,                                                                                &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;main_function,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;G&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Gly&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Glycine&amp;#34;&lt;/span&gt;,       &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;H (none)&amp;#34;&lt;/span&gt;,         &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;[H]&amp;#34;&lt;/span&gt;,                &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;75.03&lt;/span&gt;,  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Minimal VDW radius; unrestricted phi/psi; near-zero excluded volume&amp;#34;&lt;/span&gt;,                  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Conformational flexibility; tight turns; active site geometry&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;A&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Ala&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Alanine&amp;#34;&lt;/span&gt;,       &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Methyl&amp;#34;&lt;/span&gt;,           &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C&amp;#34;&lt;/span&gt;,                  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;89.09&lt;/span&gt;,  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Low steric perturbation; high alpha-helix propensity in force fields&amp;#34;&lt;/span&gt;,                 &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Helix former; hydrophobic core; alanine-scanning mutagenesis&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;V&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Val&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Valine&amp;#34;&lt;/span&gt;,        &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Isopropyl&amp;#34;&lt;/span&gt;,        &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;CC(C)&amp;#34;&lt;/span&gt;,              &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;117.15&lt;/span&gt;, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Beta-branching restricts psi; favors extended beta-sheet; large gamma-carbons&amp;#34;&lt;/span&gt;,        &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Beta-sheet core; hydrophobic packing; sickle-cell HbS Glu6Val&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;L&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Leu&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Leucine&amp;#34;&lt;/span&gt;,       &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Isobutyl&amp;#34;&lt;/span&gt;,         &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;CCC(C)C&amp;#34;&lt;/span&gt;,            &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;131.17&lt;/span&gt;, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Flexible chi2; common rotamers at -65/-65 and -65/175; high hydrophobic SASA&amp;#34;&lt;/span&gt;,         &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Hydrophobic core; leucine zippers; most abundant non-polar in proteomes&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;I&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Ile&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Isoleucine&amp;#34;&lt;/span&gt;,    &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;sec-Butyl&amp;#34;&lt;/span&gt;,        &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;CCC(C)&amp;#34;&lt;/span&gt;,             &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;131.17&lt;/span&gt;, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Beta-branching + gamma-branch; most restricted chi1/chi2; large buried SASA&amp;#34;&lt;/span&gt;,          &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Hydrophobic core; beta-barrel interiors; transmembrane helices&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;P&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Pro&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Proline&amp;#34;&lt;/span&gt;,       &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Pyrrolidine ring&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C1CCNC1&amp;#34;&lt;/span&gt;,             &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;115.13&lt;/span&gt;, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Fixed phi ~-60; no backbone NH donor; cis/trans isomerism at Xaa-Pro bond&amp;#34;&lt;/span&gt;,            &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Helix breaker; beta-turns; collagen Gly-Pro-X repeats&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;F&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Phe&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Phenylalanine&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Benzyl&amp;#34;&lt;/span&gt;,           &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Cc1ccccc1&amp;#34;&lt;/span&gt;,          &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;165.19&lt;/span&gt;, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Rigid aromatic ring; pi-pi stacking and cation-pi in MD energy decomposition&amp;#34;&lt;/span&gt;,         &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Hydrophobic core; aromatic clusters; ligand binding pockets&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;W&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Trp&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Tryptophan&amp;#34;&lt;/span&gt;,    &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Indolylmethyl&amp;#34;&lt;/span&gt;,    &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Cc1c[nH]c2ccccc12&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;204.23&lt;/span&gt;, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Indole NH can H-bond; amphipathic at membrane interface; strong 280nm absorbance&amp;#34;&lt;/span&gt;,     &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Membrane anchoring; fluorescence probe; ligand binding; rarest standard AA&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;M&amp;#34;&lt;/span&gt;,  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Met&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Methionine&amp;#34;&lt;/span&gt;,    &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Thioether&amp;#34;&lt;/span&gt;,        &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;CCSC&amp;#34;&lt;/span&gt;,               &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Neutral&amp;#34;&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;149.20&lt;/span&gt;, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;NA_real_&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Flexible sulfur geometry; oxidizable to sulfoxide in long MD runs; check reactive FF&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;Translation initiation; hydrophobic core; redox sensing&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;aa_nonpolar &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  dplyr&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;::&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;select&lt;/span&gt;(aa&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;mw_da) &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;kbl&lt;/span&gt;()
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;aa&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;aa3&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;name&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;functional_group&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;smiles_sidechain&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;charge_ph7&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;mw_da&lt;/p&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;G&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Gly&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Glycine&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;H (none)&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;[H]&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;75.03&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Ala&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Alanine&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Methyl&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;89.09&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;V&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Val&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Valine&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Isopropyl&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;CC(C)&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;117.15&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;L&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Leu&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Leucine&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Isobutyl&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;CCC(C)C&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;131.17&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;I&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Ile&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Isoleucine&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;sec-Butyl&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;CCC(C)&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;131.17&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;P&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Pro&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Proline&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Pyrrolidine ring&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;C1CCNC1&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;115.13&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;F&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Phe&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Phenylalanine&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Benzyl&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Cc1ccccc1&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;165.19&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;W&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Trp&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Tryptophan&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Indolylmethyl&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Cc1c[nH]c2ccccc12&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;204.23&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;M&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Met&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Methionine&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Thioether&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;CCSC&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Neutral&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:right;&#34;&gt;
&lt;p&gt;149.20&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;aa_nonpolar &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  dplyr&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;::&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;select&lt;/span&gt;(aa,aa3,md_note,main_function) &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;kbl&lt;/span&gt;()
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;aa&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;aa3&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;md_note&lt;/p&gt;
&lt;/th&gt;
&lt;th style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;main_function&lt;/p&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;G&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Gly&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Minimal VDW radius; unrestricted phi/psi; near-zero excluded volume&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Conformational flexibility; tight turns; active site geometry&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;A&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Ala&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Low steric perturbation; high alpha-helix propensity in force fields&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Helix former; hydrophobic core; alanine-scanning mutagenesis&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;V&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Val&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Beta-branching restricts psi; favors extended beta-sheet; large gamma-carbons&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Beta-sheet core; hydrophobic packing; sickle-cell HbS Glu6Val&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;L&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Leu&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Flexible chi2; common rotamers at -65/-65 and -65/175; high hydrophobic SASA&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Hydrophobic core; leucine zippers; most abundant non-polar in proteomes&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;I&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Ile&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Beta-branching + gamma-branch; most restricted chi1/chi2; large buried SASA&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Hydrophobic core; beta-barrel interiors; transmembrane helices&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;P&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Pro&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Fixed phi ~-60; no backbone NH donor; cis/trans isomerism at Xaa-Pro bond&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Helix breaker; beta-turns; collagen Gly-Pro-X repeats&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;F&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Phe&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Rigid aromatic ring; pi-pi stacking and cation-pi in MD energy decomposition&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Hydrophobic core; aromatic clusters; ligand binding pockets&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;W&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Trp&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Indole NH can H-bond; amphipathic at membrane interface; strong 280nm absorbance&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Membrane anchoring; fluorescence probe; ligand binding; rarest standard AA&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;M&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Met&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Flexible sulfur geometry; oxidizable to sulfoxide in long MD runs; check reactive FF&lt;/p&gt;
&lt;/td&gt;
&lt;td style=&#34;text-align:left;&#34;&gt;
&lt;p&gt;Translation initiation; hydrophobic core; redox sensing&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Claude generated most of the above information. We’ll add onto the md_note section as we encounter certain things during our MD sims.&lt;/p&gt;




&lt;h3 id=&#34;whats-zwitterion&#34;&gt;What’s Zwitterion?
  &lt;a href=&#34;#whats-zwitterion&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;A zwitterion is a molecule that has both positive and negative charges but is overall electrically neutral. In amino acids, the amino group (–NH₂) can accept a proton to become positively charged (–NH₃⁺), while the carboxyl group (–COOH) can lose a proton to become negatively charged (–COO⁻). At physiological pH (~7.4), most amino acids exist as zwitterions, with the amino group protonated and the carboxyl group deprotonated. This dual charge allows amino acids to interact with both polar and non-polar environments, contributing to their solubility in water and their ability to form various interactions in proteins.&lt;/p&gt;




&lt;h3 id=&#34;what-does-non-polar-actually-mean&#34;&gt;What Does Non-polar Actually Mean?
  &lt;a href=&#34;#what-does-non-polar-actually-mean&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;It is worth clarifying what “non-polar” actually refers exclusively to the side chain (R group) — specifically that it consists largely of carbon and hydrogen bonds with no net dipole and no ionizable groups, making it hydrophobic and largely indifferent to water. It says nothing about the backbone, which is the same for all amino acids and always carries polar bonds (C=O, N–H). In fact, as mentioned above, all amino acids including non-polar ones exist as zwitterions at physiological pH — a property that comes entirely from the backbone, not the side chain.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note to self: All amino acids’ backbones are zwitterions; the R-side chain determines polarity and hydrophobicity. Also, net charge neutral == overall charges equals zero, does not mean the molecule is non-polar.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2 id=&#34;rodriguez-rotation-formula&#34;&gt;Rodriguez Rotation Formula
  &lt;a href=&#34;#rodriguez-rotation-formula&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;
&lt;a href=&#34;https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Rodrigues’ rotation formula&lt;/a&gt; is a method for rotating a 3D vector in space around a specified axis by a given angle. The formula is expressed as:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;\(v_{rotation} = v.\cos(\theta) + \sin(\theta)(k \times v) + (1 - \cos(\theta))(k(k \cdot v))\)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;where &lt;code&gt;v&lt;/code&gt; is the original vector, &lt;code&gt;k&lt;/code&gt; is the unit vector along the axis of rotation, and &lt;code&gt;θ&lt;/code&gt; is the angle of rotation in radians.&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;https://upload.wikimedia.org/wikipedia/commons/6/69/Rodrigues_rotation_formula_animation.gif?utm_source=en.wikipedia.org&amp;utm_campaign=parser&amp;utm_content=thumbnail_unscaled&#34; alt=&#34;image&#34; width=&#34;60%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;
&lt;p&gt;This formula apparently is very popular in computer graphics and robotics, but I can see how it can be useful in molecular dynamics as well when we want to rotate a molecule or a part of it around an axis. Especially when we want to estimate the least energy conformation of a molecule. The direction application of this formula in amino acid sequence would be in rearranging the atoms based on &lt;code&gt;phi&lt;/code&gt; and &lt;code&gt;psi&lt;/code&gt; which are the angles of rotations around the &lt;code&gt;N-Cα&lt;/code&gt; and &lt;code&gt;Cα-C&lt;/code&gt; bonds of the amino acid backbone, respectively. By applying Rodrigues’ rotation formula, we can calculate the new positions of the atoms in the amino acid after rotating them by the specified angles, allowing us to explore different conformations of the molecule. How I remember which angle is which is &lt;code&gt;Nancy Phi&lt;/code&gt; (sounds like some detective show and also N-&amp;gt;C) and &lt;code&gt;C C Psi&lt;/code&gt; (All with S sound, also Carbon to carbon). We’ll leave the hand calculation until next time, but let’s learn how to rotate a coordinate based on an axis with Rodriguez!&lt;/p&gt;
&lt;p&gt;Below I’ll write the code first, then explain. Please feel free to use your mouse to hover over the plotly object and check out the coordinates.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;library&lt;/span&gt;(plotly)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;library&lt;/span&gt;(pracma)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#998;font-style:italic&#34;&gt;#### Let&amp;#39;s start simple&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;x1 &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#099&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#099&#34;&gt;0&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;x2 &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt;,&lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt;,&lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;x3 &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt;,&lt;span style=&#34;color:#099&#34;&gt;2&lt;/span&gt;,&lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rodrigues &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;function&lt;/span&gt;(v, k, theta) {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  k &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; k &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;/&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sqrt&lt;/span&gt;(&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sum&lt;/span&gt;(k^2))
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;cos&lt;/span&gt;(theta)&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt;v &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sin&lt;/span&gt;(theta)&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt;pracma&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;::&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;cross&lt;/span&gt;(k, v) &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;+&lt;/span&gt; (&lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;cos&lt;/span&gt;(theta))&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sum&lt;/span&gt;(k&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt;v)&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt;k
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;k &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; x2 &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;-&lt;/span&gt; x1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;v &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; x3 &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;-&lt;/span&gt; x1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;result &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;rodrigues&lt;/span&gt;(v,k,&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;pi&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;2&lt;/span&gt;) &lt;span style=&#34;color:#998;font-style:italic&#34;&gt;#notice this, pi/2 == 90 degrees&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pts &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;data.frame&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  x &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(x1[1],x2[1],x3[1]),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  y &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(x1[2],x2[2],x3[2]),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  z &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(x1[3],x2[3],x3[3]),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  label &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;x1&amp;#34;&lt;/span&gt;,&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;x2&amp;#34;&lt;/span&gt;,&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;x3&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pts_rs &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;data.frame&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  x &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(x1[1],x2[1],result[1]),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  y &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(x1[2],x2[2],result[2]),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  z &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(x1[3],x2[3],result[3]),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  label &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;x1&amp;#34;&lt;/span&gt;,&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;x2&amp;#34;&lt;/span&gt;,&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;x3_new&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;plot_ly&lt;/span&gt;() &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;add_trace&lt;/span&gt;(data&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;pts, x&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;x, y&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;y, z&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;z,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            type&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;scatter3d&amp;#34;&lt;/span&gt;, mode&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;lines+markers+text&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            text&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;label,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            marker&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;list&lt;/span&gt;(size&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;8&lt;/span&gt;, color&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;blue&amp;#34;&lt;/span&gt;, opacity&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.5&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            line&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;list&lt;/span&gt;(width&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;4&lt;/span&gt;, color&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;blue&amp;#34;&lt;/span&gt;, dash&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;solid&amp;#34;&lt;/span&gt;)) &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;add_trace&lt;/span&gt;(data&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;pts_rs, x&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;x, y&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;y, z&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;z,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            type&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;scatter3d&amp;#34;&lt;/span&gt;, mode&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;lines+markers+text&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            text&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=~&lt;/span&gt;label,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            marker&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;list&lt;/span&gt;(size&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;8&lt;/span&gt;, color&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;red&amp;#34;&lt;/span&gt;, opacity&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.5&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            line&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;list&lt;/span&gt;(width&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;4&lt;/span&gt;, color&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;red&amp;#34;&lt;/span&gt;, dash&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;dash&amp;#34;&lt;/span&gt;))
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;plotly html-widget html-fill-item&#34; id=&#34;htmlwidget-1&#34; style=&#34;width:672px;height:480px;&#34;&gt;&lt;/div&gt;
&lt;script type=&#34;application/json&#34; data-for=&#34;htmlwidget-1&#34;&gt;{&#34;x&#34;:{&#34;visdat&#34;:{&#34;1559871fbb946&#34;:[&#34;function () &#34;,&#34;plotlyVisDat&#34;],&#34;155984540dd20&#34;:[&#34;function () &#34;,&#34;data&#34;],&#34;1559825758365&#34;:[&#34;function () &#34;,&#34;data&#34;]},&#34;cur_data&#34;:&#34;1559825758365&#34;,&#34;attrs&#34;:{&#34;155984540dd20&#34;:{&#34;alpha_stroke&#34;:1,&#34;sizes&#34;:[10,100],&#34;spans&#34;:[1,20],&#34;x&#34;:{},&#34;y&#34;:{},&#34;z&#34;:{},&#34;type&#34;:&#34;scatter3d&#34;,&#34;mode&#34;:&#34;lines+markers+text&#34;,&#34;text&#34;:{},&#34;marker&#34;:{&#34;size&#34;:8,&#34;color&#34;:&#34;blue&#34;,&#34;opacity&#34;:0.5},&#34;line&#34;:{&#34;width&#34;:4,&#34;color&#34;:&#34;blue&#34;,&#34;dash&#34;:&#34;solid&#34;},&#34;inherit&#34;:true},&#34;1559825758365&#34;:{&#34;alpha_stroke&#34;:1,&#34;sizes&#34;:[10,100],&#34;spans&#34;:[1,20],&#34;x&#34;:{},&#34;y&#34;:{},&#34;z&#34;:{},&#34;type&#34;:&#34;scatter3d&#34;,&#34;mode&#34;:&#34;lines+markers+text&#34;,&#34;text&#34;:{},&#34;marker&#34;:{&#34;size&#34;:8,&#34;color&#34;:&#34;red&#34;,&#34;opacity&#34;:0.5},&#34;line&#34;:{&#34;width&#34;:4,&#34;color&#34;:&#34;red&#34;,&#34;dash&#34;:&#34;dash&#34;},&#34;inherit&#34;:true}},&#34;layout&#34;:{&#34;margin&#34;:{&#34;b&#34;:40,&#34;l&#34;:60,&#34;t&#34;:25,&#34;r&#34;:10},&#34;scene&#34;:{&#34;xaxis&#34;:{&#34;title&#34;:&#34;x&#34;},&#34;yaxis&#34;:{&#34;title&#34;:&#34;y&#34;},&#34;zaxis&#34;:{&#34;title&#34;:&#34;z&#34;}},&#34;hovermode&#34;:&#34;closest&#34;,&#34;showlegend&#34;:true},&#34;source&#34;:&#34;A&#34;,&#34;config&#34;:{&#34;modeBarButtonsToAdd&#34;:[&#34;hoverclosest&#34;,&#34;hovercompare&#34;],&#34;showSendToCloud&#34;:false},&#34;data&#34;:[{&#34;x&#34;:[0,1,1],&#34;y&#34;:[0,1,2],&#34;z&#34;:[0,1,1],&#34;type&#34;:&#34;scatter3d&#34;,&#34;mode&#34;:&#34;lines+markers+text&#34;,&#34;text&#34;:[&#34;x1&#34;,&#34;x2&#34;,&#34;x3&#34;],&#34;marker&#34;:{&#34;color&#34;:&#34;blue&#34;,&#34;size&#34;:8,&#34;opacity&#34;:0.5,&#34;line&#34;:{&#34;color&#34;:&#34;rgba(31,119,180,1)&#34;}},&#34;line&#34;:{&#34;color&#34;:&#34;blue&#34;,&#34;width&#34;:4,&#34;dash&#34;:&#34;solid&#34;},&#34;error_y&#34;:{&#34;color&#34;:&#34;rgba(31,119,180,1)&#34;},&#34;error_x&#34;:{&#34;color&#34;:&#34;rgba(31,119,180,1)&#34;},&#34;frame&#34;:null},{&#34;x&#34;:[0,1,0.75598306414370775],&#34;y&#34;:[0,1,1.3333333333333337],&#34;z&#34;:[0,1,1.9106836025229594],&#34;type&#34;:&#34;scatter3d&#34;,&#34;mode&#34;:&#34;lines+markers+text&#34;,&#34;text&#34;:[&#34;x1&#34;,&#34;x2&#34;,&#34;x3_new&#34;],&#34;marker&#34;:{&#34;color&#34;:&#34;red&#34;,&#34;size&#34;:8,&#34;opacity&#34;:0.5,&#34;line&#34;:{&#34;color&#34;:&#34;rgba(255,127,14,1)&#34;}},&#34;line&#34;:{&#34;color&#34;:&#34;red&#34;,&#34;width&#34;:4,&#34;dash&#34;:&#34;dash&#34;},&#34;error_y&#34;:{&#34;color&#34;:&#34;rgba(255,127,14,1)&#34;},&#34;error_x&#34;:{&#34;color&#34;:&#34;rgba(255,127,14,1)&#34;},&#34;frame&#34;:null}],&#34;highlight&#34;:{&#34;on&#34;:&#34;plotly_click&#34;,&#34;persistent&#34;:false,&#34;dynamic&#34;:false,&#34;selectize&#34;:false,&#34;opacityDim&#34;:0.20000000000000001,&#34;selected&#34;:{&#34;opacity&#34;:1},&#34;debounce&#34;:0},&#34;shinyEvents&#34;:[&#34;plotly_hover&#34;,&#34;plotly_click&#34;,&#34;plotly_selected&#34;,&#34;plotly_relayout&#34;,&#34;plotly_brushed&#34;,&#34;plotly_brushing&#34;,&#34;plotly_clickannotation&#34;,&#34;plotly_doubleclick&#34;,&#34;plotly_deselect&#34;,&#34;plotly_afterplot&#34;,&#34;plotly_sunburstclick&#34;],&#34;base_url&#34;:&#34;https://plot.ly&#34;},&#34;evals&#34;:[],&#34;jsHooks&#34;:[]}&lt;/script&gt;
&lt;p&gt;So with the above, we want to start off with 3 points, x1, x2, x3. they all represent their xyz coordinates.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Funny thing is, xyz coordinate here is different from what I learnt xyz as. I’ve always thought x is horizontal, y is vertical and z is depth. But in this case, x is depth, y is horizontal and z is vertical. I guess it depends on how you look at it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then we want to rotate x3 around the axis defined by x1 and x2 by 90 degrees (pi/2 radians). The &lt;code&gt;rodrigues&lt;/code&gt; function takes in the vector &lt;code&gt;v&lt;/code&gt; (which is the vector from x1 to x3), the axis &lt;code&gt;k&lt;/code&gt; (which is the vector from x1 to x2), and the angle &lt;code&gt;theta&lt;/code&gt; (which is pi/2). It returns the new coordinates of x3 after rotation.&lt;/p&gt;
&lt;p&gt;Finally, we plot the original points and the rotated point using &lt;code&gt;plotly&lt;/code&gt;. The original points are in blue, and the rotated point is in red. You can hover over the points to see their coordinates.&lt;/p&gt;
&lt;p&gt;Now if we were to maneuver the 3d plot and align both x1 and x2 into a dot, we can clearly see that it moved 90 degrees anti-clockwise!&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;dot.png&#34; alt=&#34;image&#34; width=&#34;60%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;
&lt;p&gt;Now there is a pretty cool rule to know where the rotation should occur anti-clockwise vs clockwise is by using your hand !!! Remember this from high school?&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;https://cdn1.byjus.com/wp-content/uploads/2021/09/Angular-Velocity.png&#34; alt=&#34;image&#34; width=&#34;60%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;
&lt;p&gt;It would be really cool to derive the above formula. There are a lot of videos that have done this. I’m still trying to conceptualize it, let’s leave that for another blog! It sounds interesting and may be a good exercise, especially when we’re venturing into 3d spaces.&lt;/p&gt;




&lt;h2 id=&#34;lennard-jones-potential-energy&#34;&gt;Lennard-Jones Potential Energy
  &lt;a href=&#34;#lennard-jones-potential-energy&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The Lennard-Jones potential energy formula is a mathematical model used to describe the interaction between a pair of neutral atoms or molecules. It is given by the equation:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;\(V(r) = 4\epsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \left( \frac{\sigma}{r} \right)^6 \right]\)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;\(V(r)\)&lt;/code&gt; is the potential energy as a function of the distance &lt;code&gt;\(r\)&lt;/code&gt; between the two particles.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\(\epsilon\)&lt;/code&gt; is the depth of the potential well, representing the strength of the attractive interaction.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\(\sigma\)&lt;/code&gt; is the finite distance at which the inter-particle potential is zero, representing the effective diameter of the particles.&lt;/li&gt;
&lt;li&gt;The term &lt;code&gt;\(\left( \frac{\sigma}{r} \right)^{12}\)&lt;/code&gt; represents the repulsive part of the potential, which dominates at short distances due to the Pauli exclusion principle.&lt;/li&gt;
&lt;li&gt;The term &lt;code&gt;\(\left( \frac{\sigma}{r} \right)^6\)&lt;/code&gt; represents the attractive part of the potential, which dominates at longer distances due to van der Waals forces.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Lennard-Jones potential is widely used in molecular dynamics simulations to model the interactions between non-bonded atoms or molecules, particularly in the context of van der Waals forces. It helps to predict the behavior of particles in a system, such as their equilibrium positions and the energy landscape of molecular interactions.&lt;/p&gt;
&lt;p&gt;Wow there are a bunch of terms and word above! I’m getting dizzy just to keep track of what is what. Let’s push through this. To use the above formula, we’d have to have some understanding of the parameters &lt;code&gt;epsilon&lt;/code&gt; and &lt;code&gt;sigma&lt;/code&gt;. These parameters are typically derived from experimental data or quantum mechanical calculations and are specific to the types of atoms or molecules involved in the interaction. Where to get these parameters? 
&lt;a href=&#34;https://raw.githubusercontent.com/openbabel/openbabel/refs/heads/master/data/gaff.dat&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Here you go - openbabel:: gaff.dat&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When you opened &lt;code&gt;gaff.dat&lt;/code&gt; there are bunch of numbers! Let’s find the numbers that are meaningful for us. All the below are separated by new lines as you scroll down.&lt;/p&gt;




&lt;h3 id=&#34;bond-stretch&#34;&gt;Bond Stretch
  &lt;a href=&#34;#bond-stretch&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The column names should be: &lt;code&gt;type  mass(g/mol)  polarizability(Å³)  source&lt;/code&gt;&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;stretch.png&#34; alt=&#34;image&#34; width=&#34;100%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;




&lt;h3 id=&#34;bond-angle&#34;&gt;Bond Angle
  &lt;a href=&#34;#bond-angle&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The column names should be: &lt;code&gt;types   K       r0       source    count   rmsd&lt;/code&gt;&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;angle.png&#34; alt=&#34;image&#34; width=&#34;100%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;




&lt;h3 id=&#34;proper-dihedral&#34;&gt;Proper Dihedral
  &lt;a href=&#34;#proper-dihedral&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The column names should be: &lt;code&gt;types      div  barrier  phase   periodicity&lt;/code&gt;&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;torsion.png&#34; alt=&#34;image&#34; width=&#34;100%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;




&lt;h3 id=&#34;non-bonded&#34;&gt;Non-bonded
  &lt;a href=&#34;#non-bonded&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The column names should be: &lt;code&gt;type  R*(Å)   ε(kcal/mol)&lt;/code&gt;&lt;/p&gt;
&lt;p align=&#34;center&#34;&gt;
&lt;img src=&#34;nonbond.png&#34; alt=&#34;image&#34; width=&#34;100%&#34; height=&#34;auto&#34;&gt;
&lt;/p&gt;
&lt;p&gt;We are purely interested in the &lt;code&gt;non-bonded&lt;/code&gt; section where R* is our &lt;code&gt;sigma = R* × 2 / 2^(1/6)&lt;/code&gt; and ε is our &lt;code&gt;epsilon&lt;/code&gt;. With the above parameters, we can then calculate the Lennard-Jones potential energy between any two atoms in a molecule. Let’s do a simple calculation for ethanol.&lt;/p&gt;




&lt;h3 id=&#34;calculating-lj&#34;&gt;Calculating LJ
  &lt;a href=&#34;#calculating-lj&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;library&lt;/span&gt;(tidyverse)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;library&lt;/span&gt;(igraph)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# Coordinates (x, y, z) in Angstroms, according to pubchem ethanol molecule&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;coords &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;rbind&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  O   &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;( &lt;span style=&#34;color:#099&#34;&gt;-1.1712&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.2997&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.0000&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  C2  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;( &lt;span style=&#34;color:#099&#34;&gt;-0.0463&lt;/span&gt;,  &lt;span style=&#34;color:#099&#34;&gt;-0.5665&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.0000&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  C1  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(  &lt;span style=&#34;color:#099&#34;&gt;1.2175&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.2668&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.0000&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H4  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;( &lt;span style=&#34;color:#099&#34;&gt;-0.0958&lt;/span&gt;,  &lt;span style=&#34;color:#099&#34;&gt;-1.2120&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.8819&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H5  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;( &lt;span style=&#34;color:#099&#34;&gt;-0.0952&lt;/span&gt;,  &lt;span style=&#34;color:#099&#34;&gt;-1.1938&lt;/span&gt;,  &lt;span style=&#34;color:#099&#34;&gt;-0.8946&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H1  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(  &lt;span style=&#34;color:#099&#34;&gt;2.1050&lt;/span&gt;,  &lt;span style=&#34;color:#099&#34;&gt;-0.3720&lt;/span&gt;,  &lt;span style=&#34;color:#099&#34;&gt;-0.0177&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H2  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(  &lt;span style=&#34;color:#099&#34;&gt;1.2426&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.9307&lt;/span&gt;,  &lt;span style=&#34;color:#099&#34;&gt;-0.8704&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H3  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(  &lt;span style=&#34;color:#099&#34;&gt;1.2616&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.9052&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.8886&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H6  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;( &lt;span style=&#34;color:#099&#34;&gt;-1.1291&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.8364&lt;/span&gt;,   &lt;span style=&#34;color:#099&#34;&gt;0.8099&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# AMBER GAFF parameters (sigma Å, epsilon kcal/mol)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Rstar_to_sigma &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;function&lt;/span&gt;(Rstar) &lt;span style=&#34;color:#099&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt; Rstar &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;/&lt;/span&gt; &lt;span style=&#34;color:#099&#34;&gt;2&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;^&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;6&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sigma &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  C1&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.9080&lt;/span&gt;), C2&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.9080&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  O&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.7210&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H1&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.4870&lt;/span&gt;), H2&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.4870&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H3&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.4870&lt;/span&gt;), H4&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.4870&lt;/span&gt;),
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H5&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;Rstar_to_sigma&lt;/span&gt;(&lt;span style=&#34;color:#099&#34;&gt;1.4870&lt;/span&gt;), H6&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.0000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;epsilon &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;c&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  C1&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.1094&lt;/span&gt;, C2&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.1094&lt;/span&gt;, O&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.2104&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H1&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.0157&lt;/span&gt;, H2&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.0157&lt;/span&gt;, H3&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.0157&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  H4&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.0157&lt;/span&gt;, H5&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.0157&lt;/span&gt;, H6&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#099&#34;&gt;0.0000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# Bonds &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;bonds &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;tribble&lt;/span&gt;(
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;from, &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;~&lt;/span&gt;to,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C1&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C2&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C2&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;O&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;O&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;H6&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C1&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;H1&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C1&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;H2&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C1&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;H3&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C2&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;H4&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;C2&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;H5&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# count bonds between two atoms&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;g &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;graph_from_data_frame&lt;/span&gt;(bonds, directed &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;FALSE&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;g_dist &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;distances&lt;/span&gt;(g)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# LJ function&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;lj &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;function&lt;/span&gt;(r, eps, sig) &lt;span style=&#34;color:#099&#34;&gt;4&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt; eps &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt; ((sig&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;/&lt;/span&gt;r)^12 &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;-&lt;/span&gt; (sig&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;/&lt;/span&gt;r)^6)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# Loop all pairs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;atoms &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;rownames&lt;/span&gt;(coords)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pairs &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;combn&lt;/span&gt;(atoms, &lt;span style=&#34;color:#099&#34;&gt;2&lt;/span&gt;, simplify&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;FALSE&lt;/span&gt;) &lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# combn so we don&amp;#39;t repeat&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;total_V &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;vector&lt;/span&gt;(mode &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;numeric&amp;#34;&lt;/span&gt;, length &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;length&lt;/span&gt;(pairs)) 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;for &lt;/span&gt;(i in &lt;span style=&#34;color:#099&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;length&lt;/span&gt;(pairs)) {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# each pair&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  p &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; pairs[[i]]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  from &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; p[1]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  to &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; p[2]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  num_bond &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; g_dist[from, to]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;if &lt;/span&gt;(num_bond &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span style=&#34;color:#099&#34;&gt;2&lt;/span&gt;) next                   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# params needed for LJ&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  r   &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sqrt&lt;/span&gt;(&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sum&lt;/span&gt;((coords[from,] &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;-&lt;/span&gt; coords[to,])^2))
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  sig &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; (sigma[from] &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;+&lt;/span&gt; sigma[to]) &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;/&lt;/span&gt; &lt;span style=&#34;color:#099&#34;&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  eps &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sqrt&lt;/span&gt;(epsilon[from] &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt; epsilon[to])
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# scale if num bond is 3 (4 atoms)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  scale &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;if &lt;/span&gt;(num_bond &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#099&#34;&gt;3&lt;/span&gt;) &lt;span style=&#34;color:#099&#34;&gt;0.5&lt;/span&gt; else &lt;span style=&#34;color:#099&#34;&gt;1.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#998;font-style:italic&#34;&gt;# LJ calc&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  V &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; scale &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;lj&lt;/span&gt;(r, eps, sig)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;cat&lt;/span&gt;(from, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;-&amp;#34;&lt;/span&gt;, to, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34; num of bonds=&amp;#34;&lt;/span&gt;, num_bond, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34; r=&amp;#34;&lt;/span&gt;, r, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34; V=&amp;#34;&lt;/span&gt;, V, &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;\n&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  total_V[i] &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;-&lt;/span&gt; V
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## O - H1  num of bonds= 3  r= 3.344395  V= -0.02733269 
## O - H2  num of bonds= 3  r= 2.642383  V= 0.110613 
## O - H3  num of bonds= 3  r= 2.659841  V= 0.09535471 
## C1 - H6  num of bonds= 3  r= 2.546942  V= 0 
## H4 - H1  num of bonds= 3  r= 2.521587  V= 0.01461147 
## H4 - H2  num of bonds= 3  r= 3.074579  V= -0.007593085 
## H4 - H3  num of bonds= 3  r= 2.514978  V= 0.01576022 
## H4 - H6  num of bonds= 3  r= 2.295394  V= 0 
## H5 - H1  num of bonds= 3  r= 2.507028  V= 0.01720963 
## H5 - H2  num of bonds= 3  r= 2.510736  V= 0.01652426 
## H5 - H3  num of bonds= 3  r= 3.070262  V= -0.007612401 
## H5 - H6  num of bonds= 3  r= 2.845344  V= 0 
## H1 - H6  num of bonds= 4  r= 3.550289  V= 0 
## H2 - H6  num of bonds= 4  r= 2.908137  V= 0 
## H3 - H6  num of bonds= 4  r= 2.392984  V= 0
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;cat&lt;/span&gt;(&lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;\nTotal V_LJ:&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#900;font-weight:bold&#34;&gt;sum&lt;/span&gt;(total_V), &lt;span style=&#34;color:#d14&#34;&gt;&amp;#34;kcal/mol\n&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## 
## Total V_LJ: 0.2275351 kcal/mol
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Alright, the above we basically were trying to calculate all pairwise atoms that is more than 3 bonds (if it’s exactly 3 bonds, we scale it by half). Alright, now that we know how to do that on simple molecular, next time we can use this to minimize on as we’re seeking optimal phi and psi!&lt;/p&gt;




&lt;h2 id=&#34;opportunities-for-improvement&#34;&gt;Opportunities For Improvement
  &lt;a href=&#34;#opportunities-for-improvement&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Derive Rodriguez Rotation formula&lt;/li&gt;
&lt;li&gt;put both Rodriguez rotation formula and LJ calculation into action to find the optimal phi and psi of amino acid sequence of a protein!&lt;/li&gt;
&lt;li&gt;need to include secondary/tertiary structure interactions too&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;lessons-learnt&#34;&gt;Lessons learnt
  &lt;a href=&#34;#lessons-learnt&#34;&gt;&lt;svg class=&#34;anchor-symbol&#34; aria-hidden=&#34;true&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;refreshed on rotation and vectors&lt;/li&gt;
&lt;li&gt;learnt rodriguez rotation formula&lt;/li&gt;
&lt;li&gt;learnt LJ formula&lt;/li&gt;
&lt;li&gt;learnt what gaff.dat actually contains.&lt;/li&gt;
&lt;li&gt;learnt about phi and psi and what they actually mean.&lt;/li&gt;
&lt;li&gt;learnt about net charge == total charge; polar vs non-polar is R-chain dependent.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you like this article:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;please feel free to send me a 
&lt;a href=&#34;https://www.kenkoonwong.com/blog/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;comment or visit my other blogs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;please feel free to follow me on 
&lt;a href=&#34;https://bsky.app/profile/kenkoonwong.bsky.social&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;BlueSky&lt;/a&gt;, 
&lt;a href=&#34;https://twitter.com/kenkoonwong/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;twitter&lt;/a&gt;, 
&lt;a href=&#34;https://github.com/kenkoonwong/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;GitHub&lt;/a&gt; or 
&lt;a href=&#34;https://rstats.me/@kenkoonwong&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Mastodon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;if you would like collaborate please feel free to 
&lt;a href=&#34;https://www.kenkoonwong.com/contact/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;contact me&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
  </channel>
</rss>