changeset 1:b8242cf18cc0 draft

"planemo upload commit 2f1af427fa4c4f2aad53ab94c4cdb51456c66019-dirty"
author tduigou
date Wed, 09 Feb 2022 16:05:48 +0000
parents 98d925a75257
children d5c53a916005
files rpcompletion.xml test-data/rp_001_0001.xml test-data/rp_001_0006.xml test-data/rp_001_0011.xml test-data/rp_002_0001.xml test-data/rp_002_0011.xml test-data/rp_002_0021.xml test-data/rp_003_0001.xml test-data/rp_003_0131.xml test-data/rp_003_0261.xml
diffstat 10 files changed, 657 insertions(+), 654 deletions(-) [+]
line wrap: on
line diff
--- a/rpcompletion.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/rpcompletion.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -1,7 +1,10 @@
-<tool id="rpCompletion" name="Complete Reactions" version="5.9.2">
+<tool id="rpcompletion" name="Complete Reactions" version="@TOOL_VERSION@" profile="19.09">
     <description>From the output of RP2Paths and RetroPath2.0, generate SBML unique and complete (with cofactors) pathways with mono-component reactions</description>
+    <macros>
+        <token name="@TOOL_VERSION@">5.12.1</token>
+    </macros>
     <requirements>
-        <requirement type="package" version="5.9.2">rptools</requirement>
+        <requirement type="package" version="@TOOL_VERSION@">rptools</requirement>
     </requirements>
     <stdio>
         <exit_code range="1" level="fatal" description="Could not Xref compartment_id" />
@@ -84,7 +87,7 @@
 Version
 ----------
 
-5.9.2
+5.12.1
 
 Authors
 -------
--- a/test-data/rp_001_0001.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_001_0001.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,78 +23,6 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4" id="MNXM8975" name="MNXM8975" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
-                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
       <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -131,6 +59,60 @@
           </rdf:RDF>
         </annotation>
       </species>
+      <species metaid="_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4" id="MNXM8975" name="MNXM8975" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
+                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
       <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -149,19 +131,37 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -310,8 +310,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -323,11 +323,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
-          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="TARGET_0000000001"/>
-          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
+          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -339,8 +339,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM8975"/>
-          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM24"/>
         </groups:listOfMembers>
       </groups:group>
@@ -353,9 +353,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="MNXM11"/>
-          <groups:member groups:idRef="MNXM132"/>
+          <groups:member groups:idRef="MNXM83"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_001_0006.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_001_0006.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,96 +23,6 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a" id="MNXM36" name="MNXM36" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4" id="MNXM8975" name="MNXM8975" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
-                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
       <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -149,6 +59,42 @@
           </rdf:RDF>
         </annotation>
       </species>
+      <species metaid="_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4" id="MNXM8975" name="MNXM8975" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
+                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
       <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -167,6 +113,60 @@
           </rdf:RDF>
         </annotation>
       </species>
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a" id="MNXM36" name="MNXM36" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
     </listOfSpecies>
     <listOfParameters>
       <parameter metaid="dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91" sboTerm="SBO:0000625" id="BRS_FBC_999999" value="999999" units="mmol_per_gDW_per_hr" constant="true"/>
@@ -310,8 +310,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -323,11 +323,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
-          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="TARGET_0000000001"/>
-          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
+          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -339,9 +339,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM36"/>
           <groups:member groups:idRef="MNXM8975"/>
-          <groups:member groups:idRef="MNXM11"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_58b3b59284e0d918d6d3f3bcadc2d757726da7594cd899cad4e745836ac967a3" groups:id="rp_sink_species" groups:kind="collection">
@@ -353,9 +353,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="MNXM11"/>
-          <groups:member groups:idRef="MNXM132"/>
+          <groups:member groups:idRef="MNXM83"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_001_0011.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_001_0011.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,60 +23,6 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
-                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
       <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -113,19 +59,37 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
-                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
+                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -149,19 +113,55 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
+                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -310,8 +310,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -323,11 +323,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
-          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="TARGET_0000000001"/>
-          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
+          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -353,9 +353,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM132"/>
           <groups:member groups:idRef="MNXM11"/>
-          <groups:member groups:idRef="MNXM132"/>
+          <groups:member groups:idRef="MNXM83"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_002_0001.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_002_0001.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,19 +23,19 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
+                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
+                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -59,19 +59,19 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -95,24 +95,6 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
-                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
-                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
       <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -149,19 +131,37 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -313,8 +313,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -326,11 +326,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
+          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="MNXM100"/>
+          <groups:member groups:idRef="CMPD_0000000001"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="TARGET_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="MNXM100"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -342,8 +342,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM8975"/>
-          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM24"/>
         </groups:listOfMembers>
       </groups:group>
@@ -356,9 +356,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM100"/>
           <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="MNXM100"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_002_0011.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_002_0011.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,37 +23,19 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a" id="MNXM36" name="MNXM36" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
+            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
+            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
+                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
+                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -77,24 +59,6 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
       <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -113,24 +77,6 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
-                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
-                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
       <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -167,6 +113,60 @@
           </rdf:RDF>
         </annotation>
       </species>
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a" id="MNXM36" name="MNXM36" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
     </listOfSpecies>
     <listOfParameters>
       <parameter metaid="dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91" sboTerm="SBO:0000625" id="BRS_FBC_999999" value="999999" units="mmol_per_gDW_per_hr" constant="true"/>
@@ -313,8 +313,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -326,11 +326,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
+          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="MNXM100"/>
+          <groups:member groups:idRef="CMPD_0000000001"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="TARGET_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="MNXM100"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -342,9 +342,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM36"/>
           <groups:member groups:idRef="MNXM8975"/>
-          <groups:member groups:idRef="MNXM11"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_58b3b59284e0d918d6d3f3bcadc2d757726da7594cd899cad4e745836ac967a3" groups:id="rp_sink_species" groups:kind="collection">
@@ -356,9 +356,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM100"/>
           <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="MNXM100"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_002_0021.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_002_0021.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,37 +23,19 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
+                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
+                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -77,19 +59,55 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
+            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
+            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb" id="MNXM35" name="MNXM35" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
-                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
-                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
+                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -113,55 +131,37 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
-                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb" id="MNXM35" name="MNXM35" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -313,8 +313,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -326,11 +326,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
+          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="MNXM100"/>
+          <groups:member groups:idRef="CMPD_0000000001"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="TARGET_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="MNXM100"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -356,9 +356,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM100"/>
           <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="MNXM100"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_003_0001.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_003_0001.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,19 +23,19 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
+                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
+                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -59,6 +59,60 @@
           </rdf:RDF>
         </annotation>
       </species>
+      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
+                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
+                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
       <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -77,19 +131,19 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
-                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -113,60 +167,6 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
-                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
-                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
-                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
     </listOfSpecies>
     <listOfParameters>
       <parameter metaid="dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91" sboTerm="SBO:0000625" id="BRS_FBC_999999" value="999999" units="mmol_per_gDW_per_hr" constant="true"/>
@@ -351,8 +351,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -364,11 +364,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
+          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="CMPD_0000000001"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="MNXM34"/>
-          <groups:member groups:idRef="CMPD_0000000001"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -380,8 +380,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM8975"/>
-          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM24"/>
         </groups:listOfMembers>
       </groups:group>
@@ -394,9 +394,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="MNXM34"/>
           <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM34"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_003_0131.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_003_0131.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,6 +23,96 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
+      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
+                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
+                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4" id="MNXM8975" name="MNXM8975" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
+                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
+                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
       <species metaid="_04b973bebf0de87c9fe23384ce8fd1fef71a33cbb0b827ade48cd364bf14a23a" id="MNXM36" name="MNXM36" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -59,60 +149,6 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4" id="MNXM8975" name="MNXM8975" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2f4b2d21d00b43a266620e821de533b08c3e42ff09ca008f915ca4400eb7d8c4">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002" id="TARGET_0000000001" name="TARGET_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_6817bb5f7133f50744b232330f1f3009343f785b8f77602ce5f44cdd9458f002">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])=C([H])C([H])=C(C([H])=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H56/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,15-22,25-32H,13-14,23-24H2,1-10H3"/>
-                <brsynth:inchikey value="OAIJSZIZWZSQBC-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
       <species metaid="_10a025d408ecc91b5894e1d66d8a31d96e4ac530a63de61f99720be74086a29f" id="MNXM34" name="(2E,6E)-farnesyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
@@ -131,42 +167,6 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
-                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
-                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46" id="CMPD_0000000001" name="CMPD_0000000001" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#b0098569a07f786a6e9b2294639668cd4ee564dd642a38bdf429c4c6bb560b46">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]C(=C([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C40H64/c1-33(2)19-13-23-37(7)27-17-31-39(9)29-15-25-35(5)21-11-12-22-36(6)26-16-30-40(10)32-18-28-38(8)24-14-20-34(3)4/h11-12,19-22,27-30H,13-18,23-26,31-32H2,1-10H3"/>
-                <brsynth:inchikey value="YVLPJIGOMTXXLP-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
     </listOfSpecies>
     <listOfParameters>
       <parameter metaid="dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91" sboTerm="SBO:0000625" id="BRS_FBC_999999" value="999999" units="mmol_per_gDW_per_hr" constant="true"/>
@@ -351,8 +351,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -364,11 +364,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
+          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="CMPD_0000000001"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="MNXM34"/>
-          <groups:member groups:idRef="CMPD_0000000001"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -380,9 +380,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM36"/>
           <groups:member groups:idRef="MNXM8975"/>
-          <groups:member groups:idRef="MNXM11"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_58b3b59284e0d918d6d3f3bcadc2d757726da7594cd899cad4e745836ac967a3" groups:id="rp_sink_species" groups:kind="collection">
@@ -394,9 +394,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="MNXM34"/>
           <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM34"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>
--- a/test-data/rp_003_0261.xml	Tue Nov 23 13:45:45 2021 +0000
+++ b/test-data/rp_003_0261.xml	Wed Feb 09 16:05:48 2022 +0000
@@ -23,37 +23,19 @@
       </compartment>
     </listOfCompartments>
     <listOfSpecies>
-      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
+            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
-                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
-              </brsynth:brsynth>
-            </rdf:BRSynth>
-          </rdf:RDF>
-        </annotation>
-      </species>
-      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
-        <annotation>
-          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <bqbiol:is>
-                <rdf:Bag/>
-              </bqbiol:is>
-            </rdf:Description>
-            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
-              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
-                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
+                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
+                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
+                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -77,37 +59,37 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_10a025d408ecc91b5894e1d66d8a31d96e4ac530a63de61f99720be74086a29f" id="MNXM34" name="(2E,6E)-farnesyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_10a025d408ecc91b5894e1d66d8a31d96e4ac530a63de61f99720be74086a29f">
+            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_10a025d408ecc91b5894e1d66d8a31d96e4ac530a63de61f99720be74086a29f">
+            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
-                <brsynth:inchi value="InChI=1S/C15H28O7P2/c1-13(2)7-5-8-14(3)9-6-10-15(4)11-12-21-24(19,20)22-23(16,17)18/h7,9,11H,5-6,8,10,12H2,1-4H3,(H,19,20)(H2,16,17,18)"/>
-                <brsynth:inchikey value="VWFJDQUYCIWHTN-UHFFFAOYSA-N"/>
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1" id="MNXM11" name="diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb" id="MNXM35" name="MNXM35" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
+            <rdf:Description rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#a6e267be12defb7184259624f5adc519108c6c6adfe6be13f64b649567cb6df1">
+            <rdf:BRSynth rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles value="O=P(O)(O)OP(=O)(O)O"/>
-                <brsynth:inchi value="InChI=1S/H4O7P2/c1-8(2,3)7-9(4,5)6/h(H2,1,2,3)(H2,4,5,6)"/>
-                <brsynth:inchikey value="XPPKVPWEQAFLFU-UHFFFAOYSA-N"/>
+                <brsynth:smiles/>
+                <brsynth:inchi/>
+                <brsynth:inchikey/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -131,37 +113,55 @@
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb" id="MNXM35" name="MNXM35" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0" id="MNXM83" name="isopentenyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
+            <rdf:Description rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_53be86b11fa13c25dcb440bba6ef77b51b257a3674e6b2a0b88d272dc0a014cb">
+            <rdf:BRSynth rdf:about="#_47d72a86d31940edf1cc42c7a7361a7a96211dc2a6679326b8ad27a7e216ada0">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])([H])C(=C([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C5H12O7P2/c1-5(2)3-4-11-14(9,10)12-13(6,7)8/h1,3-4H2,2H3,(H,9,10)(H2,6,7,8)"/>
+                <brsynth:inchikey value="NUHSROFQTUXZQQ-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
         </annotation>
       </species>
-      <species metaid="_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39" id="MNXM24" name="MNXM24" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+      <species metaid="_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858" id="CMPD_0000000003" name="CMPD_0000000003" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
         <annotation>
           <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
-            <rdf:Description rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:Description rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
               <bqbiol:is>
                 <rdf:Bag/>
               </bqbiol:is>
             </rdf:Description>
-            <rdf:BRSynth rdf:about="#_61841f05183ff06dbe77a0e01f6d73d7a890997d823ac18d9fd56bac3d4bcc39">
+            <rdf:BRSynth rdf:about="#_2c27bb432be6149f648dcec0e702fd9bdf6449fb9f730bd86eeb0b63b93d8858">
               <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
-                <brsynth:smiles/>
-                <brsynth:inchi/>
-                <brsynth:inchikey/>
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C20H36O7P2/c1-17(2)9-6-10-18(3)11-7-12-19(4)13-8-14-20(5)15-16-26-29(24,25)27-28(21,22)23/h9,11,13,15H,6-8,10,12,14,16H2,1-5H3,(H,24,25)(H2,21,22,23)"/>
+                <brsynth:inchikey value="OINNEUNVOZHBOX-UHFFFAOYSA-N"/>
+              </brsynth:brsynth>
+            </rdf:BRSynth>
+          </rdf:RDF>
+        </annotation>
+      </species>
+      <species metaid="_10a025d408ecc91b5894e1d66d8a31d96e4ac530a63de61f99720be74086a29f" id="MNXM34" name="(2E,6E)-farnesyl diphosphate" compartment="c" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#_10a025d408ecc91b5894e1d66d8a31d96e4ac530a63de61f99720be74086a29f">
+              <bqbiol:is>
+                <rdf:Bag/>
+              </bqbiol:is>
+            </rdf:Description>
+            <rdf:BRSynth rdf:about="#_10a025d408ecc91b5894e1d66d8a31d96e4ac530a63de61f99720be74086a29f">
+              <brsynth:brsynth xmlns:brsynth="http://brsynth.eu">
+                <brsynth:smiles value="[H]OP(=O)(O[H])OP(=O)(O[H])OC([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])C([H])([H])C([H])=C(C([H])([H])[H])C([H])([H])[H]"/>
+                <brsynth:inchi value="InChI=1S/C15H28O7P2/c1-13(2)7-5-8-14(3)9-6-10-15(4)11-12-21-24(19,20)22-23(16,17)18/h7,9,11H,5-6,8,10,12H2,1-4H3,(H,19,20)(H2,16,17,18)"/>
+                <brsynth:inchikey value="VWFJDQUYCIWHTN-UHFFFAOYSA-N"/>
               </brsynth:brsynth>
             </rdf:BRSynth>
           </rdf:RDF>
@@ -351,8 +351,8 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="CMPD_0000000001"/>
-          <groups:member groups:idRef="CMPD_0000000003"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_564fce39b23c6cf87d12dc2c612448384fd2cd980fe3fc07829e2ef802645579" groups:id="rp_trunk_species" groups:kind="collection">
@@ -364,11 +364,11 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="CMPD_0000000003"/>
+          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="CMPD_0000000001"/>
           <groups:member groups:idRef="MNXM83"/>
-          <groups:member groups:idRef="TARGET_0000000001"/>
+          <groups:member groups:idRef="CMPD_0000000003"/>
           <groups:member groups:idRef="MNXM34"/>
-          <groups:member groups:idRef="CMPD_0000000001"/>
         </groups:listOfMembers>
       </groups:group>
       <groups:group metaid="_9e3154173c97366b3980dd1642e1e35d0bdfc3274abc744e89ecb518bcd48378" groups:id="rp_completed_species" groups:kind="collection">
@@ -394,9 +394,9 @@
           </rdf:RDF>
         </annotation>
         <groups:listOfMembers>
-          <groups:member groups:idRef="MNXM34"/>
           <groups:member groups:idRef="MNXM11"/>
           <groups:member groups:idRef="MNXM83"/>
+          <groups:member groups:idRef="MNXM34"/>
         </groups:listOfMembers>
       </groups:group>
     </groups:listOfGroups>