Task: Fixed error using AMOEBA 2018 with RNA (openmm/openmm#3313)

org: openmm
repo: openmm
pr_number: 3313
issue_title: Fixed error using AMOEBA 2018 with RNA
issue_body: Fixes #3305.
resolved_issues: number: 3305
title: AMOEBA RNA forcefield cannot match bonding arrangement in PDB
body: Hi @peastman,

Great job finishing the 2018 AMOEBA, and I also just wanted to say thanks a million for including the nucleic acids in there.

I'm running into this error with the following inputs:

ValueError: No template found for residue 1 (RU5).  The set of atoms matches RU5, but the bonds are different.  Perhaps the chain is missing a terminal group?

This one was built using the sequence command in LEAP. I've also had the same error when I use NAB and then loadpdb in LEAP to make an input PDB. The chain should not be missing a terminal group, because the 5'  end does indeed have the 5' uracil cap on this end (resname RU5).

[rna_ext.pdb.zip](https://github.com/openmm/openmm/files/7437108/rna_ext.pdb.zip)

By the way, I'm using
`forcefield = ForceField('amoeba2018.xml')`


## IMPORTANT INSTRUCTIONS

1. If you edit a python file, you MUST run 'make PythonInstall' inside the build directory
2. If you edit a c++ file, you MUST run 'make -j4 && make install" inside the build directory

Reference solution:
fix_patch: diff --git a/devtools/forcefield-scripts/residuesFinal.xml b/devtools/forcefield-scripts/residuesFinal.xml
index 7fb0398466..80b8e3e3a0 100644
--- a/devtools/forcefield-scripts/residuesFinal.xml
+++ b/devtools/forcefield-scripts/residuesFinal.xml
@@ -2030,7 +2030,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="P" to="O1P"/>
   <Bond from="P" to="O2P"/>
@@ -2100,7 +2100,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="P" to="O1P"/>
@@ -2170,7 +2170,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="H5T" to="O5'"/>
   <Bond from="O5'" to="C5'"/>
@@ -2236,7 +2236,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="H5T" to="O5'"/>
@@ -2304,7 +2304,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="P" to="O1P"/>
   <Bond from="P" to="O2P"/>
@@ -2369,7 +2369,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="P" to="O1P"/>
@@ -2434,7 +2434,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="H5T" to="O5'"/>
   <Bond from="O5'" to="C5'"/>
@@ -2495,7 +2495,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="H5T" to="O5'"/>
@@ -2563,7 +2563,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="P" to="O1P"/>
   <Bond from="P" to="O2P"/>
@@ -2635,7 +2635,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="P" to="O1P"/>
@@ -2707,7 +2707,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="H5T" to="O5'"/>
   <Bond from="O5'" to="C5'"/>
@@ -2775,7 +2775,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="H5T" to="O5'"/>
@@ -2843,7 +2843,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="P" to="O1P"/>
   <Bond from="P" to="O2P"/>
@@ -2906,7 +2906,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="P" to="O1P"/>
@@ -2969,7 +2969,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Bond from="H5T" to="O5'"/>
   <Bond from="O5'" to="C5'"/>
@@ -3028,7 +3028,7 @@
   <Atom name="C2'" tinkerLookupName="C2*"/>
   <Atom name="H2'" tinkerLookupName="H2*"/>
   <Atom name="O2'" tinkerLookupName="O2*"/>
-  <Atom name="HO2'" tinkerLookupName="H2*"/>
+  <Atom name="HO2'" tinkerLookupName="HO*"/>
   <Atom name="O3'" tinkerLookupName="O3*"/>
   <Atom name="H3T" tinkerLookupName="H3T"/>
   <Bond from="H5T" to="O5'"/>
diff --git a/wrappers/python/openmm/app/data/amoeba2018.xml b/wrappers/python/openmm/app/data/amoeba2018.xml
index 38b4f038e9..0951b06807 100644
--- a/wrappers/python/openmm/app/data/amoeba2018.xml
+++ b/wrappers/python/openmm/app/data/amoeba2018.xml
@@ -1,7 +1,7 @@
 <ForceField>
  <Info>
   <Source>amoebabio18.prm</Source>
-  <DateGenerated>2021-11-02</DateGenerated>
+  <DateGenerated>2021-11-04</DateGenerated>
   <Reference>Yue Shi, Zhen Xia, Jiajing Zhang, Robert Best, Chuanjie Wu, Jay W. Ponder, and Pengyu Ren. Polarizable Atomic Multipole-Based AMOEBA Force Field for Proteins. Journal of Chemical Theory and Computation, 9(9):4046–4063, 2013.</Reference>
   <Reference>Changsheng Zhang, Chao Lu, Zhifeng Jing, Chuanjie Wu, Jean-Philip Piquemal, Jay W Ponder, and Pengyu Ren. AMOEBA Polarizable Atomic Multipole Force Field for Nucleic Acids. Journal of Chemical Theory and Computation, 14(4):2084-2108, 2018.</Reference>
  </Info>
@@ -4325,7 +4325,7 @@
    <Atom name="H61" type="260" />
    <Atom name="H62" type="260" />
    <Atom name="H8" type="258" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="257" />
    <Atom name="N3" type="256" />
    <Atom name="N6" type="253" />
@@ -4398,7 +4398,7 @@
    <Atom name="H61" type="260" />
    <Atom name="H62" type="260" />
    <Atom name="H8" type="258" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="257" />
    <Atom name="N3" type="256" />
    <Atom name="N6" type="253" />
@@ -4471,7 +4471,7 @@
    <Atom name="H61" type="260" />
    <Atom name="H62" type="260" />
    <Atom name="H8" type="258" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="257" />
    <Atom name="N3" type="256" />
    <Atom name="N6" type="253" />
@@ -4539,7 +4539,7 @@
    <Atom name="H61" type="260" />
    <Atom name="H62" type="260" />
    <Atom name="H8" type="258" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="257" />
    <Atom name="N3" type="256" />
    <Atom name="N6" type="253" />
@@ -4604,7 +4604,7 @@
    <Atom name="H5'" type="325" />
    <Atom name="H5''" type="325" />
    <Atom name="H6" type="271" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="261" />
    <Atom name="N3" type="268" />
    <Atom name="N4" type="264" />
@@ -4672,7 +4672,7 @@
    <Atom name="H5'" type="325" />
    <Atom name="H5''" type="325" />
    <Atom name="H6" type="271" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="261" />
    <Atom name="N3" type="268" />
    <Atom name="N4" type="264" />
@@ -4740,7 +4740,7 @@
    <Atom name="H5''" type="325" />
    <Atom name="H5T" type="327" />
    <Atom name="H6" type="271" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="261" />
    <Atom name="N3" type="268" />
    <Atom name="N4" type="264" />
@@ -4803,7 +4803,7 @@
    <Atom name="H5''" type="325" />
    <Atom name="H5T" type="327" />
    <Atom name="H6" type="271" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="261" />
    <Atom name="N3" type="268" />
    <Atom name="N4" type="264" />
@@ -4865,7 +4865,7 @@
    <Atom name="H5'" type="325" />
    <Atom name="H5''" type="325" />
    <Atom name="H8" type="286" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="277" />
    <Atom name="N2" type="278" />
    <Atom name="N3" type="283" />
@@ -4940,7 +4940,7 @@
    <Atom name="H5'" type="325" />
    <Atom name="H5''" type="325" />
    <Atom name="H8" type="286" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="277" />
    <Atom name="N2" type="278" />
    <Atom name="N3" type="283" />
@@ -5015,7 +5015,7 @@
    <Atom name="H5''" type="325" />
    <Atom name="H5T" type="327" />
    <Atom name="H8" type="286" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="277" />
    <Atom name="N2" type="278" />
    <Atom name="N3" type="283" />
@@ -5085,7 +5085,7 @@
    <Atom name="H5''" type="325" />
    <Atom name="H5T" type="327" />
    <Atom name="H8" type="286" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="277" />
    <Atom name="N2" type="278" />
    <Atom name="N3" type="283" />
@@ -5151,7 +5151,7 @@
    <Atom name="H5'" type="325" />
    <Atom name="H5''" type="325" />
    <Atom name="H6" type="310" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="304" />
    <Atom name="N3" type="303" />
    <Atom name="O1P" type="344" />
@@ -5217,7 +5217,7 @@
    <Atom name="H5'" type="325" />
    <Atom name="H5''" type="325" />
    <Atom name="H6" type="310" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="304" />
    <Atom name="N3" type="303" />
    <Atom name="O1P" type="344" />
@@ -5283,7 +5283,7 @@
    <Atom name="H5''" type="325" />
    <Atom name="H5T" type="327" />
    <Atom name="H6" type="310" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="304" />
    <Atom name="N3" type="303" />
    <Atom name="O2" type="308" />
@@ -5344,7 +5344,7 @@
    <Atom name="H5''" type="325" />
    <Atom name="H5T" type="327" />
    <Atom name="H6" type="310" />
-   <Atom name="HO2'" type="317" />
+   <Atom name="HO2'" type="321" />
    <Atom name="N1" type="304" />
    <Atom name="N3" type="303" />
    <Atom name="O2" type="308" />
diff --git a/wrappers/python/openmm/app/data/amoeba2018_gk.xml b/wrappers/python/openmm/app/data/amoeba2018_gk.xml
index 9c1a5e23ea..8c65b3b865 100644
--- a/wrappers/python/openmm/app/data/amoeba2018_gk.xml
+++ b/wrappers/python/openmm/app/data/amoeba2018_gk.xml
@@ -1,7 +1,7 @@
 <ForceField>
  <Info>
   <Source>amoebabio18.prm</Source>
-  <DateGenerated>2021-11-02</DateGenerated>
+  <DateGenerated>2021-11-04</DateGenerated>
   <Reference>Yue Shi, Zhen Xia, Jiajing Zhang, Robert Best, Chuanjie Wu, Jay W. Ponder, and Pengyu Ren. Polarizable Atomic Multipole-Based AMOEBA Force Field for Proteins. Journal of Chemical Theory and Computation, 9(9):4046–4063, 2013.</Reference>
   <Reference>Rae A. Corrigan, Guowei Qi, Andrew C. Thiel, Jack R. Lynn, Brandon D. Walker, Thomas L. Casavant, Louis Lagardere, Jean-Philip Piquemal, Jay W. Ponder, Pengyu Ren, and Michael J. Schnieders. Implicit Solvents for the Polarizable Atomic Multipole AMOEBA Force Field. Journal of Chemical Theory and Computation, 17(4):2323-2341, 2021.</Reference>
  </Info>