From 0a1539c61acfb6f0f23b759f5b58bf29b50c1c39 Mon Sep 17 00:00:00 2001
From: unknown <david.hoksza@gmail.com>
Date: Mon, 21 Oct 2019 14:33:46 +0200
Subject: [PATCH] report html pages

---
 talent/graphics.py                            |   4 +-
 talent/layout.py                              |  16 +-
 .../F007-inos-SBGNv02_p1_2.sbgn               | 355 +++---------------
 .../F007-inos-SBGNv02_p1_3.sbgn               | 174 +++------
 .../F007-inos-SBGNv02_p1_4.sbgn               | 168 +++------
 tests/mrm/scripts/report_ins.py               |  27 +-
 tests/mrm/scripts/report_ins_merge.py         |  35 ++
 tests/mrm/scripts/run_insert.sh               |   5 +-
 8 files changed, 230 insertions(+), 554 deletions(-)
 create mode 100644 tests/mrm/scripts/report_ins_merge.py

diff --git a/talent/graphics.py b/talent/graphics.py
index 6bfdcd6..a908917 100644
--- a/talent/graphics.py
+++ b/talent/graphics.py
@@ -59,9 +59,7 @@ class utils:
     @staticmethod
     def is_more_horizontal(v: np.ndarray) -> bool:
         v_norm = utils.normalize(v)
-        return v_norm[0] > v_norm[1]
-
-
+        return abs(v_norm[0]) > abs(v_norm[1])
 
 
 
diff --git a/talent/layout.py b/talent/layout.py
index c74563e..c0b6ee0 100644
--- a/talent/layout.py
+++ b/talent/layout.py
@@ -308,9 +308,9 @@ def lay_out_reaction_center(g: nx.MultiGraph, r_id: str, known_connecting_s_ids:
                 dir = np.array([1, 1])
             else:
                 if gr.utils.is_more_horizontal(current_dir):
-                    dir = np.array([1, 0])
+                    dir = np.array([1, 0]) if current_dir[0] > 0 else np.array([-1, 0])
                 else:
-                    dir = np.array([0, 1])
+                    dir = np.array([0, 1]) if current_dir[1] > 0 else np.array([0, -1])
 
             center = get_center(s_id_pos, dir)
 
@@ -430,7 +430,13 @@ def get_layout_cc_strategies(g_res: nx.MultiGraph, tgt: rg.ReactionGraph, _cc: L
             cn_ids_aux = set(gu.get_connecting_nodes(g_res, not_laid_r_id, r_id)).difference(known_connecting_s_ids)
             cn_ids = []
             for cn_id in cn_ids_aux:
-                if not gu.get_predicted_layout(g_res, cn_id).is_copied():
+                cn_lt = gu.get_predicted_layout(g_res, cn_id)
+                if cn_lt.is_copied():
+                    # If the node is copied from template it is the connecting species at the boundary of a reaction which
+                    # was inserted and the position of the connecting species was transferred from template. In such case, we
+                    # simply keep the position
+                    cn_poss[cn_id] = [cn_lt.get_center()]
+                else:
                     cn_ids.append(cn_id)
             cn_poss = {**cn_poss, **get_pos_for_species(g_res, r_id, cn_ids, known_connecting_s_ids)}
 
@@ -445,6 +451,7 @@ def get_layout_cc_strategies(g_res: nx.MultiGraph, tgt: rg.ReactionGraph, _cc: L
                 cn_average_poss[id] = []
             cn_average_poss[id].append(sum(comb)/len(comb))
 
+    assert len(cn_average_poss) > 0
     for r_id in not_laid_boundary_r:
         cc.remove(r_id)
 
@@ -549,6 +556,9 @@ def pick_best_strategy(g_res, strategies: List[StrategyType]) -> int:
             for r2 in rects_g:
                 if r1.intersects_rectangle(r2):
                     cnt +=1
+            for l in lines_g:
+                if r1.intersects_line(l):
+                    cnt += 1
 
         lines: List[gr.Line] = get_lines(g_res, r_id_used)
         for l1 in lines:
diff --git a/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_2.sbgn b/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_2.sbgn
index e500582..4bbcf84 100644
--- a/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_2.sbgn
+++ b/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_2.sbgn
@@ -1,59 +1,9 @@
 <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
 <sbgn xmlns="http://sbgn.org/libsbgn/0.2">
   <map language="process description">
-    <extension>
-      <renderInformation 
-        xmlns="http://www.sbml.org/sbml/level3/version1/render/version1" id="renderInformation" programName="sbgnviz" programVersion="4.2.0" backgroundColor="#000000">
-        <listOfColorDefinitions>
-          <colorDefinition id="color_1" value="#ffffff7f"/>
-          <colorDefinition id="color_2" value="#555555"/>
-          <colorDefinition id="color_3" value="#ffffffff"/>
-        </listOfColorDefinitions>
-        <listOfBackgroundImages/>
-        <listOfStyles>
-          <style id="nodeffffff0.55553.2514normalnormalHelvetica" idList="glyph_n0 glyph_n1 glyph_n3">
-            <g fontSize="14" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="3.25" fill="color_1"/>
-          </style>
-          <style id="nodeffffff0.55551.2511normalnormalHelvetica" idList="glyph_n0_n19">
-            <g fontSize="11" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="1.25" fill="color_1"/>
-          </style>
-          <style id="nodeffffff15551.2511normalnormalHelvetica" idList="glyph_n0_n19_n0_n19_n0 glyph_n0_n19_n0_n19_n1 glyph_n0_n0 glyph_n0_n1 glyph_n0_n2 glyph_n0_n3 glyph_n0_n4 glyph_n0_n5 glyph_n0_n6 glyph_n0_n7 glyph_n0_n8 glyph_n0_n9 glyph_n0_n10 glyph_n0_n11 glyph_n0_n12 glyph_n0_n13 glyph_n0_n14 glyph_n0_n15 glyph_n0_n16 glyph_n0_n17 glyph_n0_n18 glyph_n0_n20 glyph_n0_n21 glyph_n1_n0 glyph_n1_n1 glyph_n1_n2 glyph_n1_n3 glyph_n1_n4 glyph_n1_n5 glyph_n1_n6 glyph_n1_n7 glyph_n3_n1 glyph_n3_n2">
-            <g fontSize="11" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="1.25" fill="color_3"/>
-          </style>
-          <style id="nodeffffff15551.25" idList="glyph_n5 glyph_n6 glyph_n7 glyph_n8 glyph_n9 glyph_n10 glyph_n11 glyph_n12 glyph_n13 glyph_n14 glyph_n15 glyph_n16 glyph_n17 glyph_n18 glyph_n19 glyph_n20 glyph_n21 glyph_n22 glyph_n23 glyph_n24 glyph_n25">
-            <g stroke="color_2" strokeWidth="1.25" fill="color_3"/>
-          </style>
-          <style id="edge5551.25" idList="arc_e40 arc_e54 arc_e38 arc_e57 arc_e56 arc_e55 arc_e39 arc_e53 arc_e52 arc_e32 arc_e50 arc_e36 arc_e42 arc_e33 arc_e46 arc_e45 arc_e44 arc_e43 arc_e41 arc_e35 arc_e58 arc_e37 arc_e34 arc_e3 arc_e4 arc_e5 arc_e6 arc_e7 arc_e8 arc_e9 arc_e10 arc_e11 arc_e12 arc_e13 arc_e14 arc_e15 arc_e16 arc_e17 arc_e18 arc_e19 arc_e20 arc_e21 arc_e22 arc_e23 arc_e24 arc_e25 arc_e26 arc_e27 arc_e28 arc_e29 arc_e30 arc_e31">
-            <g stroke="color_2" strokeWidth="1.25"/>
-          </style>
-        </listOfStyles>
-      </renderInformation>
-      <mapProperties>
-        <compoundPadding>10</compoundPadding>
-        <extraCompartmentPadding>14</extraCompartmentPadding>
-        <extraComplexPadding>10</extraComplexPadding>
-        <arrowScale>1.25</arrowScale>
-        <showComplexName>true</showComplexName>
-        <dynamicLabelSize>regular</dynamicLabelSize>
-        <inferNestingOnLoad>false</inferNestingOnLoad>
-        <fitLabelsToNodes>false</fitLabelsToNodes>
-        <fitLabelsToInfoboxes>false</fitLabelsToInfoboxes>
-        <recalculateLayoutOnComplexityManagement>true</recalculateLayoutOnComplexityManagement>
-        <rearrangeOnComplexityManagement>true</rearrangeOnComplexityManagement>
-        <animateOnDrawingChanges>true</animateOnDrawingChanges>
-        <adjustNodeLabelFontSizeAutomatically>false</adjustNodeLabelFontSizeAutomatically>
-        <enablePorts>true</enablePorts>
-        <allowCompoundNodeResize>false</allowCompoundNodeResize>
-        <mapColorScheme>black_white</mapColorScheme>
-        <defaultInfoboxHeight>12</defaultInfoboxHeight>
-        <defaultInfoboxWidth>8</defaultInfoboxWidth>
-        <mapName>Pathway #sbgn-network-container-0</mapName>
-        <mapDescription/>
-      </mapProperties>
-    </extension>
     <glyph id="glyph_n0" class="compartment">
       <label text="CYTOSOL"/>
-      <bbox x="59.41666666666674" y="484.44666000000007" w="1523.2083333333333" h="397.6783399999999"/>
+      <bbox x="59.41666666666674" y="483.94666000000007" w="1523.2083333333333" h="398.1783399999999"/>
     </glyph>
     <glyph id="glyph_n0_n19" class="complex" compartmentRef="glyph_n0">
       <bbox x="999.375" y="491.0716600000001" w="88.25" h="115.87499999999989"/>
@@ -368,425 +318,224 @@
       <port id="glyph_n24_port_n24.1" x="889.3162" y="526.25745"/>
       <port id="glyph_n24_port_n24.2" x="937.3162" y="526.25745"/>
     </glyph>
-    <glyph id="glyph_n25" class="process">
-      <bbox x="731" y="291.75308" w="24" h="24"/>
-      <port id="glyph_n25_port_n25.1" x="719" y="303.75308"/>
-      <port id="glyph_n25_port_n25.2" x="767" y="303.75308"/>
-    </glyph>
+    <arc id="arc_e31" class="consumption" source="glyph_n0_n5" target="glyph_n15_port_n15.1">
+      <start x="1232.1882204882183" y="590.8911653661637"/>
+      <end x="1315.625" y="635"/>
+    </arc>
     <arc id="arc_e40" class="consumption" source="glyph_n0_n9" target="glyph_n20_port_n20.1">
-      <glyph id="arc_e40_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="374.5" y="790"/>
+      <start x="374.625" y="790"/>
       <end x="443.625" y="790"/>
     </arc>
     <arc id="arc_e54" class="production" source="glyph_n19_port_n19.1" target="glyph_n0_n13">
-      <glyph id="arc_e54_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="105" y="649.625"/>
-      <end x="105" y="691.375"/>
+      <end x="105" y="691.25"/>
     </arc>
     <arc id="arc_e38" class="consumption" source="glyph_n0_n7" target="glyph_n18_port_n18.1">
-      <glyph id="arc_e38_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1381" y="556"/>
+      <start x="1381" y="556.375"/>
       <end x="1381" y="364.625"/>
     </arc>
     <arc id="arc_e57" class="logic arc" source="glyph_n1_n0" target="glyph_n6_port_n6.2">
-      <glyph id="arc_e57_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="133.9806849101867" y="1012.14746"/>
+      <start x="133.68148841507158" y="1012.27246"/>
       <end x="219.625" y="1050"/>
     </arc>
     <arc id="arc_e56" class="production" source="glyph_n5_port_n5.1" target="glyph_n1_n0">
-      <glyph id="arc_e56_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="80.375" y="885"/>
-      <end x="105" y="963.02246"/>
+      <end x="105" y="962.89746"/>
     </arc>
     <arc id="arc_e55" class="consumption" source="glyph_n0_n13" target="glyph_n5_port_n5.2">
-      <glyph id="arc_e55_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="105" y="740.5"/>
+      <start x="109.375" y="740.625"/>
       <end x="129.625" y="885"/>
     </arc>
     <arc id="arc_e39" class="consumption" source="glyph_n0_n8" target="glyph_n21_port_n21.1">
-      <glyph id="arc_e39_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="811.5" y="795"/>
+      <start x="811.625" y="795"/>
       <end x="831.375" y="795"/>
     </arc>
     <arc id="arc_e53" class="consumption" source="glyph_n0_n11" target="glyph_n19_port_n19.2">
-      <glyph id="arc_e53_card" class="cardinality">
+      <glyph id="arc_e53_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="99" y="549.625" w="12" h="19"/>
       </glyph>
-      <start x="105" y="555.5"/>
+      <start x="105" y="555.625"/>
       <end x="105" y="600.375"/>
     </arc>
     <arc id="arc_e52" class="production" source="glyph_n22_port_n22.1" target="glyph_n0_n11">
-      <glyph id="arc_e52_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="210.375" y="535"/>
-      <end x="148.625" y="535"/>
+      <end x="148.75" y="535"/>
     </arc>
     <arc id="arc_e32" class="consumption" source="glyph_n0_n10" target="glyph_n16_port_n16.1">
-      <glyph id="arc_e32_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1267.1873857784744" y="845.0301493188784"/>
+      <start x="1267.77594224247" y="845.3342368252761"/>
       <end x="1151" y="809.625"/>
     </arc>
     <arc id="arc_e50" class="catalysis" source="glyph_n0_n20" target="glyph_n16">
-      <glyph id="arc_e50_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1086.5" y="785"/>
+      <start x="1086.625" y="788.0654761904761"/>
       <end x="1135.5625" y="785"/>
     </arc>
     <arc id="arc_e36" class="consumption" source="glyph_n3_n1" target="glyph_n17_port_n17.2">
-      <glyph id="arc_e36_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1151" y="111.04313000000002"/>
+      <start x="1151" y="110.66813000000002"/>
       <end x="1151" y="315.375"/>
     </arc>
     <arc id="arc_e42" class="production" source="glyph_n21_port_n21.2" target="glyph_n0_n15">
-      <glyph id="arc_e42_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="880.625" y="795"/>
       <end x="899.25" y="795"/>
     </arc>
     <arc id="arc_e33" class="catalysis" source="glyph_n0_n19" target="glyph_n15">
-      <glyph id="arc_e33_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1093.125" y="566.2507577171717"/>
+      <start x="1093.75" y="566.4679063030303"/>
       <end x="1275.7355919834201" y="629.69656861637"/>
     </arc>
     <arc id="arc_e46" class="consumption" source="glyph_n0_n16" target="glyph_n24_port_n24.1">
-      <glyph id="arc_e46_card" class="cardinality">
+      <glyph id="arc_e46_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="875.8659189624218" y="633.2580040430594" w="12" h="19"/>
       </glyph>
-      <start x="880.4029634651961" y="679.5"/>
+      <start x="880.4298108033985" y="679.375"/>
       <end x="888.6912" y="526.25745"/>
     </arc>
     <arc id="arc_e45" class="consumption" source="glyph_n0_n18" target="glyph_n24_port_n24.1">
-      <glyph id="arc_e45_card" class="cardinality">
+      <glyph id="arc_e45_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="846.5224299999994" y="506.7574632359739" w="12" h="19"/>
       </glyph>
-      <start x="834.5" y="526.2574698169736"/>
+      <start x="834.625" y="526.2574697855446"/>
       <end x="888.6912" y="526.25745"/>
     </arc>
     <arc id="arc_e44" class="production" source="glyph_n24_port_n24.2" target="glyph_n0_n19">
-      <glyph id="arc_e44_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="937.9412" y="526.25745"/>
-      <end x="990.7966575892949" y="539.7984044178227"/>
+      <end x="990.1716575892949" y="539.6891756293712"/>
     </arc>
     <arc id="arc_e43" class="production" source="glyph_n23_port_n23.1" target="glyph_n0_n10">
-      <glyph id="arc_e43_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="1441" y="809.625"/>
-      <end x="1335.61164329561" y="843.3399831756444"/>
+      <end x="1335.0484828886244" y="843.6517326866542"/>
     </arc>
     <arc id="arc_e41" class="production" source="glyph_n20_port_n20.2" target="glyph_n0_n14">
-      <glyph id="arc_e41_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="394.375" y="790"/>
       <end x="465.25" y="790"/>
     </arc>
     <arc id="arc_e35" class="production" source="glyph_n17_port_n17.1" target="glyph_n0_n6">
-      <glyph id="arc_e35_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="1151" y="364.625"/>
-      <end x="1151" y="652.875"/>
+      <end x="1151" y="653.25"/>
     </arc>
     <arc id="arc_e58" class="consumption" source="glyph_n0_n12" target="glyph_n22_port_n22.2">
-      <glyph id="arc_e58_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="301.1816" y="535"/>
+      <start x="301.0566" y="535"/>
       <end x="259.625" y="535"/>
     </arc>
     <arc id="arc_e37" class="production" source="glyph_n18_port_n18.2" target="glyph_n3_n2">
-      <glyph id="arc_e37_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="1381" y="315.375"/>
-      <end x="1381" y="114.16813000000002"/>
+      <end x="1381" y="113.79313000000002"/>
     </arc>
     <arc id="arc_e34" class="catalysis" source="glyph_n0_n21" target="glyph_n23">
-      <glyph id="arc_e34_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1500.5" y="785"/>
+      <start x="1500.375" y="785"/>
       <end x="1456.4375" y="785"/>
     </arc>
     <arc id="arc_e3" class="necessary stimulation" source="glyph_n6_port_n6.1" target="glyph_n7">
-      <glyph id="arc_e3_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="134.375" y="1050"/>
       <end x="177" y="1121.21"/>
     </arc>
     <arc id="arc_e4" class="logic arc" source="glyph_n1_n1" target="glyph_n6_port_n6.2">
-      <glyph id="arc_e4_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="221.64331879984607" y="1007.14746"/>
+      <start x="221.51309513399147" y="1007.27246"/>
       <end x="219.625" y="1050"/>
     </arc>
     <arc id="arc_e5" class="production" source="glyph_n7_port_n7.2" target="glyph_n1_n2">
-      <glyph id="arc_e5_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="201.625" y="1136.6475"/>
-      <end x="280.375" y="1136.6475"/>
+      <end x="280.25" y="1136.6475"/>
     </arc>
     <arc id="arc_e6" class="consumption" source="glyph_n1_n3" target="glyph_n7_port_n7.1">
-      <glyph id="arc_e6_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="135.625" y="1136.6475"/>
       <end x="152.375" y="1136.6475"/>
     </arc>
     <arc id="arc_e7" class="production" source="glyph_n8_port_n8.2" target="glyph_n1_n5">
-      <glyph id="arc_e7_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="605.5291" y="1112.0225"/>
-      <end x="717.375" y="1136.6475"/>
+      <end x="717.25" y="1136.6475"/>
     </arc>
     <arc id="arc_e8" class="consumption" source="glyph_n1_n4" target="glyph_n8_port_n8.1">
-      <glyph id="arc_e8_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="559.625" y="1136.6475"/>
       <end x="605.5291" y="1161.2725"/>
     </arc>
     <arc id="arc_e9" class="necessary stimulation" source="glyph_n9_port_n9.1" target="glyph_n8">
-      <glyph id="arc_e9_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="605.5291" y="1092.625"/>
       <end x="605.5291" y="1108.8975"/>
     </arc>
     <arc id="arc_e10" class="logic arc" source="glyph_n1_n6" target="glyph_n9_port_n9.2">
-      <glyph id="arc_e10_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="650.172418799846" y="1007.14746"/>
+      <start x="650.0421951339914" y="1007.27246"/>
       <end x="605.5291" y="1007.375"/>
     </arc>
     <arc id="arc_e11" class="logic arc" source="glyph_n1_n7" target="glyph_n9_port_n9.2">
-      <glyph id="arc_e11_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="560.5278905944418" y="1007.14746"/>
+      <start x="560.6591582200177" y="1007.27246"/>
       <end x="605.5291" y="1007.375"/>
     </arc>
     <arc id="arc_e12" class="consumption" source="glyph_n0_n0" target="glyph_n10_port_n10.1">
-      <glyph id="arc_e12_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="259.625" y="695"/>
       <end x="304.375" y="695"/>
     </arc>
     <arc id="arc_e13" class="necessary stimulation" source="glyph_n0_n9" target="glyph_n10">
-      <glyph id="arc_e13_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="329" y="761.5"/>
+      <start x="329" y="769.375"/>
       <end x="329" y="710.4375"/>
     </arc>
     <arc id="arc_e14" class="production" source="glyph_n10_port_n10.2" target="glyph_n0_n1">
-      <glyph id="arc_e14_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="353.625" y="695"/>
-      <end x="495.375" y="695"/>
+      <end x="495.25" y="695"/>
     </arc>
     <arc id="arc_e15" class="consumption" source="glyph_n0_n1" target="glyph_n12_port_n12.2">
-      <glyph id="arc_e15_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="539" y="715.5"/>
+      <start x="539" y="715.625"/>
       <end x="563.625" y="885"/>
     </arc>
     <arc id="arc_e16" class="consumption" source="glyph_n1_n2" target="glyph_n11_port_n11.1">
-      <glyph id="arc_e16_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="329" y="1108.1475"/>
       <end x="304.375" y="885"/>
     </arc>
     <arc id="arc_e17" class="production" source="glyph_n11_port_n11.2" target="glyph_n0_n9">
-      <glyph id="arc_e17_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="353.625" y="885"/>
-      <end x="329" y="813.625"/>
+      <end x="329" y="813.75"/>
     </arc>
     <arc id="arc_e18" class="production" source="glyph_n12_port_n12.1" target="glyph_n1_n7">
-      <glyph id="arc_e18_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="514.375" y="885"/>
-      <end x="539" y="963.02246"/>
+      <end x="539" y="962.89746"/>
     </arc>
     <arc id="arc_e19" class="production" source="glyph_n13_port_n13.2" target="glyph_n0_n16">
-      <glyph id="arc_e19_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="766" y="675.375"/>
-      <end x="832.375" y="700"/>
+      <end x="832.25" y="700"/>
     </arc>
     <arc id="arc_e20" class="production" source="glyph_n14_port_n14.2" target="glyph_n0_n8">
-      <glyph id="arc_e20_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="790.625" y="885"/>
-      <end x="766" y="818.625"/>
+      <end x="766" y="818.75"/>
     </arc>
     <arc id="arc_e21" class="consumption" source="glyph_n0_n17" target="glyph_n13_port_n13.1">
-      <glyph id="arc_e21_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="710.01495" y="700"/>
       <end x="766" y="724.625"/>
     </arc>
     <arc id="arc_e22" class="necessary stimulation" source="glyph_n0_n8" target="glyph_n13">
-      <glyph id="arc_e22_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="766" y="766.5"/>
+      <start x="766" y="774.375"/>
       <end x="766" y="727.75"/>
     </arc>
     <arc id="arc_e23" class="consumption" source="glyph_n1_n5" target="glyph_n14_port_n14.1">
-      <glyph id="arc_e23_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="766" y="1108.1475"/>
       <end x="741.375" y="885"/>
     </arc>
     <arc id="arc_e24" class="production" source="glyph_n16_port_n16.2" target="glyph_n0_n6">
-      <glyph id="arc_e24_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="1151" y="760.375"/>
-      <end x="1151" y="697.125"/>
+      <end x="1151" y="696.75"/>
     </arc>
     <arc id="arc_e25" class="production" source="glyph_n16_port_n16.2" target="glyph_n0_n2">
-      <glyph id="arc_e25_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="1151" y="760.375"/>
-      <end x="1076.19273354446" y="732.634913481122"/>
+      <end x="1075.818260026928" y="732.3727820188498"/>
     </arc>
     <arc id="arc_e26" class="production" source="glyph_n15_port_n15.2" target="glyph_n0_n4">
-      <glyph id="arc_e26_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="1266.375" y="635"/>
-      <end x="1402.4440945264332" y="664.7184252070489"/>
+      <end x="1402.8638813343491" y="664.8303683558264"/>
     </arc>
     <arc id="arc_e27" class="production" source="glyph_n15_port_n15.2" target="glyph_n0_n7">
-      <glyph id="arc_e27_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
       <start x="1266.375" y="635"/>
-      <end x="1354.9982292983689" y="592.3345138010874"/>
+      <end x="1355.3802384138837" y="592.0798410574109"/>
     </arc>
     <arc id="arc_e28" class="consumption" source="glyph_n0_n3" target="glyph_n23_port_n23.2">
-      <glyph id="arc_e28_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1515.2448470917323" y="726.385647032843"/>
+      <start x="1515.5988322906753" y="726.1061850336773"/>
       <end x="1441" y="760.375"/>
     </arc>
     <arc id="arc_e29" class="consumption" source="glyph_n0_n4" target="glyph_n23_port_n23.2">
-      <glyph id="arc_e29_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1441" y="694"/>
+      <start x="1441" y="693.625"/>
       <end x="1441" y="760.375"/>
     </arc>
     <arc id="arc_e30" class="consumption" source="glyph_n0_n6" target="glyph_n15_port_n15.1">
-      <glyph id="arc_e30_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1185.89995943138" y="665.0285830196058"/>
-      <end x="1315.625" y="635"/>
-    </arc>
-    <arc id="arc_e31" class="consumption" source="glyph_n0_n5" target="glyph_n15_port_n15.1">
-      <glyph id="arc_e31_card" class="cardinality">
-        <label text="0"/>
-        <bbox x="0" y="0" w="0" h="0"/>
-      </glyph>
-      <start x="1232.5512449481157" y="591.1634337110868"/>
+      <start x="1185.4777587314252" y="665.1492117910213"/>
       <end x="1315.625" y="635"/>
     </arc>
   </map>
diff --git a/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_3.sbgn b/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_3.sbgn
index 8fedfc6..31739ae 100644
--- a/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_3.sbgn
+++ b/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_3.sbgn
@@ -1,56 +1,6 @@
 <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
 <sbgn xmlns="http://sbgn.org/libsbgn/0.2">
   <map language="process description">
-    <extension>
-      <renderInformation 
-        xmlns="http://www.sbml.org/sbml/level3/version1/render/version1" id="renderInformation" programName="sbgnviz" programVersion="4.2.0" backgroundColor="#000000">
-        <listOfColorDefinitions>
-          <colorDefinition id="color_1" value="#ffffff7f"/>
-          <colorDefinition id="color_2" value="#555555"/>
-          <colorDefinition id="color_3" value="#ffffffff"/>
-        </listOfColorDefinitions>
-        <listOfBackgroundImages/>
-        <listOfStyles>
-          <style id="nodeffffff0.55555553.2514normalnormalHelvetica" idList="glyph_n0 glyph_n1 glyph_n3">
-            <g fontSize="14" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="3.25" fill="color_1"/>
-          </style>
-          <style id="nodeffffff0.55555551.2511normalnormalHelvetica" idList="glyph_n0_n19">
-            <g fontSize="11" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="1.25" fill="color_1"/>
-          </style>
-          <style id="nodeffffff15555551.2511normalnormalHelvetica" idList="glyph_n0_n19_n0_n19_n0 glyph_n0_n19_n0_n19_n1 glyph_n0_n0 glyph_n0_n2 glyph_n0_n3 glyph_n0_n4 glyph_n0_n5 glyph_n0_n6 glyph_n0_n7 glyph_n0_n8 glyph_n0_n9 glyph_n0_n10 glyph_n0_n11 glyph_n0_n12 glyph_n0_n13 glyph_n0_n15 glyph_n0_n16 glyph_n0_n17 glyph_n0_n18 glyph_n0_n20 glyph_n0_n21 glyph_n1_n0 glyph_n1_n1 glyph_n1_n2 glyph_n1_n3 glyph_n1_n4 glyph_n1_n5 glyph_n1_n6 glyph_n1_n7 glyph_n3_n1 glyph_n3_n2">
-            <g fontSize="11" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="1.25" fill="color_3"/>
-          </style>
-          <style id="nodeffffff15555551.25" idList="glyph_n5 glyph_n6 glyph_n7 glyph_n8 glyph_n9 glyph_n10 glyph_n11 glyph_n13 glyph_n14 glyph_n15 glyph_n16 glyph_n17 glyph_n18 glyph_n19 glyph_n21 glyph_n22 glyph_n23 glyph_n24">
-            <g stroke="color_2" strokeWidth="1.25" fill="color_3"/>
-          </style>
-          <style id="edge5555551.25" idList="arc_e22 arc_e26 arc_e54 arc_e38 arc_e57 arc_e56 arc_e55 arc_e39 arc_e53 arc_e52 arc_e32 arc_e50 arc_e36 arc_e42 arc_e33 arc_e46 arc_e45 arc_e44 arc_e43 arc_e29 arc_e27 arc_e28 arc_e35 arc_e23 arc_e25 arc_e58 arc_e37 arc_e34 arc_e3 arc_e4 arc_e5 arc_e6 arc_e7 arc_e8 arc_e9 arc_e10 arc_e11 arc_e12 arc_e13 arc_e30 arc_e31 arc_e16 arc_e17 arc_e24 arc_e19 arc_e20 arc_e21">
-            <g stroke="color_2" strokeWidth="1.25"/>
-          </style>
-        </listOfStyles>
-      </renderInformation>
-      <mapProperties>
-        <compoundPadding>10</compoundPadding>
-        <extraCompartmentPadding>14</extraCompartmentPadding>
-        <extraComplexPadding>10</extraComplexPadding>
-        <arrowScale>1.25</arrowScale>
-        <showComplexName>true</showComplexName>
-        <dynamicLabelSize>regular</dynamicLabelSize>
-        <inferNestingOnLoad>false</inferNestingOnLoad>
-        <fitLabelsToNodes>false</fitLabelsToNodes>
-        <fitLabelsToInfoboxes>false</fitLabelsToInfoboxes>
-        <recalculateLayoutOnComplexityManagement>true</recalculateLayoutOnComplexityManagement>
-        <rearrangeOnComplexityManagement>true</rearrangeOnComplexityManagement>
-        <animateOnDrawingChanges>true</animateOnDrawingChanges>
-        <adjustNodeLabelFontSizeAutomatically>false</adjustNodeLabelFontSizeAutomatically>
-        <enablePorts>true</enablePorts>
-        <allowCompoundNodeResize>false</allowCompoundNodeResize>
-        <mapColorScheme>black_white</mapColorScheme>
-        <defaultInfoboxHeight>12</defaultInfoboxHeight>
-        <defaultInfoboxWidth>8</defaultInfoboxWidth>
-        <mapName>Pathway #sbgn-network-container-0</mapName>
-        <mapDescription/>
-      </mapProperties>
-    </extension>
     <glyph id="glyph_n0" class="compartment">
       <label text="CYTOSOL"/>
       <bbox x="59.41666666666674" y="483.84666000000016" w="1523.2083333333333" h="398.27833999999984"/>
@@ -74,9 +24,6 @@
         </glyph>
       </glyph>
     </glyph>
-    <glyph id="glyph_n0_n0" class="source and sink" compartmentRef="glyph_n0">
-      <bbox x="219" y="675" w="40" h="40"/>
-    </glyph>
     <glyph id="glyph_n0_n2" class="simple chemical" compartmentRef="glyph_n0">
       <label text="fumarate"/>
       <bbox x="1011" y="697" w="80" h="36"/>
@@ -286,11 +233,6 @@
       <port id="glyph_n9_port_n9.1" x="605.5291" y="1092"/>
       <port id="glyph_n9_port_n9.2" x="605.5291" y="1008"/>
     </glyph>
-    <glyph id="glyph_n10" class="process">
-      <bbox x="317" y="683" w="24" h="24"/>
-      <port id="glyph_n10_port_n10.1" x="305" y="695"/>
-      <port id="glyph_n10_port_n10.2" x="353" y="695"/>
-    </glyph>
     <glyph id="glyph_n11" class="process">
       <bbox x="317" y="873" w="24" h="24"/>
       <port id="glyph_n11_port_n11.1" x="305" y="885"/>
@@ -351,60 +293,68 @@
       <port id="glyph_n24_port_n24.1" x="889.3162" y="526.25745"/>
       <port id="glyph_n24_port_n24.2" x="937.3162" y="526.25745"/>
     </glyph>
+    <arc id="arc_e24" class="production" source="glyph_n16_port_n16.2" target="glyph_n0_n6">
+      <start x="1151" y="760.375"/>
+      <end x="1151" y="696.75"/>
+    </arc>
+    <arc id="arc_e19" class="production" source="glyph_n13_port_n13.2" target="glyph_n0_n16">
+      <start x="766" y="675.375"/>
+      <end x="832.25" y="700"/>
+    </arc>
     <arc id="arc_e22" class="necessary stimulation" source="glyph_n0_n8" target="glyph_n13">
-      <start x="766" y="774.5"/>
+      <start x="766" y="774.375"/>
       <end x="766" y="727.75"/>
     </arc>
     <arc id="arc_e26" class="production" source="glyph_n15_port_n15.2" target="glyph_n0_n4">
       <start x="1266.375" y="635"/>
-      <end x="1402.4440945264332" y="664.7184252070489"/>
+      <end x="1402.8638813343491" y="664.8303683558264"/>
     </arc>
     <arc id="arc_e54" class="production" source="glyph_n19_port_n19.1" target="glyph_n0_n13">
       <start x="105" y="649.625"/>
-      <end x="105" y="691.375"/>
+      <end x="105" y="691.25"/>
     </arc>
     <arc id="arc_e38" class="consumption" source="glyph_n0_n7" target="glyph_n18_port_n18.1">
-      <start x="1381" y="556"/>
+      <start x="1381" y="556.375"/>
       <end x="1381" y="364.625"/>
     </arc>
     <arc id="arc_e57" class="logic arc" source="glyph_n1_n0" target="glyph_n6_port_n6.2">
-      <start x="133.9806849101867" y="1012.14746"/>
+      <start x="133.68148841507158" y="1012.27246"/>
       <end x="219.625" y="1050"/>
     </arc>
     <arc id="arc_e56" class="production" source="glyph_n5_port_n5.1" target="glyph_n1_n0">
       <start x="80.375" y="885"/>
-      <end x="105" y="963.02246"/>
+      <end x="105" y="962.89746"/>
     </arc>
     <arc id="arc_e55" class="consumption" source="glyph_n0_n13" target="glyph_n5_port_n5.2">
-      <start x="105" y="740.5"/>
+      <start x="109.375" y="740.625"/>
       <end x="129.625" y="885"/>
     </arc>
     <arc id="arc_e39" class="consumption" source="glyph_n0_n8" target="glyph_n21_port_n21.1">
-      <start x="811.5" y="795"/>
+      <start x="811.625" y="795"/>
       <end x="831.375" y="795"/>
     </arc>
     <arc id="arc_e53" class="consumption" source="glyph_n0_n11" target="glyph_n19_port_n19.2">
-      <glyph id="arc_e53_card" class="cardinality">
+      <glyph id="arc_e53_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="99" y="549.625" w="12" h="19"/>
       </glyph>
-      <start x="105" y="555.5"/>
+      <start x="105" y="555.625"/>
       <end x="105" y="600.375"/>
     </arc>
     <arc id="arc_e52" class="production" source="glyph_n22_port_n22.1" target="glyph_n0_n11">
       <start x="210.375" y="535"/>
-      <end x="148.625" y="535"/>
+      <end x="148.75" y="535"/>
     </arc>
     <arc id="arc_e32" class="consumption" source="glyph_n0_n10" target="glyph_n16_port_n16.1">
-      <start x="1267.1873857784744" y="845.0301493188784"/>
+      <start x="1267.77594224247" y="845.3342368252761"/>
       <end x="1151" y="809.625"/>
     </arc>
     <arc id="arc_e50" class="catalysis" source="glyph_n0_n20" target="glyph_n16">
-      <start x="1086.5" y="785"/>
+      <start x="1086.625" y="788.0654761904761"/>
       <end x="1135.5625" y="785"/>
     </arc>
     <arc id="arc_e36" class="consumption" source="glyph_n3_n1" target="glyph_n17_port_n17.2">
-      <start x="1151" y="111.04313000000002"/>
+      <start x="1151" y="110.66813000000002"/>
       <end x="1151" y="315.375"/>
     </arc>
     <arc id="arc_e42" class="production" source="glyph_n21_port_n21.2" target="glyph_n0_n15">
@@ -412,48 +362,48 @@
       <end x="899.25" y="795"/>
     </arc>
     <arc id="arc_e33" class="catalysis" source="glyph_n0_n19" target="glyph_n15">
-      <start x="1093.725" y="566.459220359596"/>
+      <start x="1093.85" y="566.5026500767677"/>
       <end x="1275.7355919834201" y="629.69656861637"/>
     </arc>
     <arc id="arc_e46" class="consumption" source="glyph_n0_n16" target="glyph_n24_port_n24.1">
-      <glyph id="arc_e46_card" class="cardinality">
+      <glyph id="arc_e46_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="875.8659189624218" y="633.2580040430594" w="12" h="19"/>
       </glyph>
-      <start x="880.4029634651961" y="679.5"/>
+      <start x="880.4298108033985" y="679.375"/>
       <end x="888.6912" y="526.25745"/>
     </arc>
     <arc id="arc_e45" class="consumption" source="glyph_n0_n18" target="glyph_n24_port_n24.1">
-      <glyph id="arc_e45_card" class="cardinality">
+      <glyph id="arc_e45_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="846.5224299999994" y="506.7574632359739" w="12" h="19"/>
       </glyph>
-      <start x="834.5" y="526.2574698169736"/>
+      <start x="834.625" y="526.2574697855446"/>
       <end x="888.6912" y="526.25745"/>
     </arc>
     <arc id="arc_e44" class="production" source="glyph_n24_port_n24.2" target="glyph_n0_n19">
       <start x="937.9412" y="526.25745"/>
-      <end x="990.1966575892949" y="539.6935447809093"/>
+      <end x="990.0716575892949" y="539.671699023219"/>
     </arc>
     <arc id="arc_e43" class="production" source="glyph_n23_port_n23.1" target="glyph_n0_n10">
       <start x="1441" y="809.625"/>
-      <end x="1335.61164329561" y="843.3399831756444"/>
+      <end x="1335.0484828886244" y="843.6517326866542"/>
     </arc>
     <arc id="arc_e29" class="consumption" source="glyph_n0_n4" target="glyph_n23_port_n23.2">
-      <start x="1441" y="694"/>
+      <start x="1441" y="693.625"/>
       <end x="1441" y="760.375"/>
     </arc>
     <arc id="arc_e27" class="production" source="glyph_n15_port_n15.2" target="glyph_n0_n7">
       <start x="1266.375" y="635"/>
-      <end x="1354.9982292983689" y="592.3345138010874"/>
+      <end x="1355.3802384138837" y="592.0798410574109"/>
     </arc>
     <arc id="arc_e28" class="consumption" source="glyph_n0_n3" target="glyph_n23_port_n23.2">
-      <start x="1515.2448470917323" y="726.385647032843"/>
+      <start x="1515.5988322906753" y="726.1061850336773"/>
       <end x="1441" y="760.375"/>
     </arc>
     <arc id="arc_e35" class="production" source="glyph_n17_port_n17.1" target="glyph_n0_n6">
       <start x="1151" y="364.625"/>
-      <end x="1151" y="652.875"/>
+      <end x="1151" y="653.25"/>
     </arc>
     <arc id="arc_e23" class="consumption" source="glyph_n1_n5" target="glyph_n14_port_n14.1">
       <start x="766" y="1108.1475"/>
@@ -461,18 +411,18 @@
     </arc>
     <arc id="arc_e25" class="production" source="glyph_n16_port_n16.2" target="glyph_n0_n2">
       <start x="1151" y="760.375"/>
-      <end x="1076.19273354446" y="732.634913481122"/>
+      <end x="1075.818260026928" y="732.3727820188498"/>
     </arc>
     <arc id="arc_e58" class="consumption" source="glyph_n0_n12" target="glyph_n22_port_n22.2">
-      <start x="301.1816" y="535"/>
+      <start x="301.0566" y="535"/>
       <end x="259.625" y="535"/>
     </arc>
     <arc id="arc_e37" class="production" source="glyph_n18_port_n18.2" target="glyph_n3_n2">
       <start x="1381" y="315.375"/>
-      <end x="1381" y="114.16813000000002"/>
+      <end x="1381" y="113.79313000000002"/>
     </arc>
     <arc id="arc_e34" class="catalysis" source="glyph_n0_n21" target="glyph_n23">
-      <start x="1500.5" y="785"/>
+      <start x="1500.375" y="785"/>
       <end x="1456.4375" y="785"/>
     </arc>
     <arc id="arc_e3" class="necessary stimulation" source="glyph_n6_port_n6.1" target="glyph_n7">
@@ -480,12 +430,12 @@
       <end x="177" y="1121.21"/>
     </arc>
     <arc id="arc_e4" class="logic arc" source="glyph_n1_n1" target="glyph_n6_port_n6.2">
-      <start x="221.64331879984607" y="1007.14746"/>
+      <start x="221.51309513399147" y="1007.27246"/>
       <end x="219.625" y="1050"/>
     </arc>
     <arc id="arc_e5" class="production" source="glyph_n7_port_n7.2" target="glyph_n1_n2">
       <start x="201.625" y="1136.6475"/>
-      <end x="280.375" y="1136.6475"/>
+      <end x="280.25" y="1136.6475"/>
     </arc>
     <arc id="arc_e6" class="consumption" source="glyph_n1_n3" target="glyph_n7_port_n7.1">
       <start x="135.625" y="1136.6475"/>
@@ -493,7 +443,7 @@
     </arc>
     <arc id="arc_e7" class="production" source="glyph_n8_port_n8.2" target="glyph_n1_n5">
       <start x="605.5291" y="1112.0225"/>
-      <end x="717.375" y="1136.6475"/>
+      <end x="717.25" y="1136.6475"/>
     </arc>
     <arc id="arc_e8" class="consumption" source="glyph_n1_n4" target="glyph_n8_port_n8.1">
       <start x="559.625" y="1136.6475"/>
@@ -504,27 +454,27 @@
       <end x="605.5291" y="1108.8975"/>
     </arc>
     <arc id="arc_e10" class="logic arc" source="glyph_n1_n6" target="glyph_n9_port_n9.2">
-      <start x="650.172418799846" y="1007.14746"/>
+      <start x="650.0421951339914" y="1007.27246"/>
       <end x="605.5291" y="1007.375"/>
     </arc>
     <arc id="arc_e11" class="logic arc" source="glyph_n1_n7" target="glyph_n9_port_n9.2">
-      <start x="560.5278905944418" y="1007.14746"/>
+      <start x="560.6591582200177" y="1007.27246"/>
       <end x="605.5291" y="1007.375"/>
     </arc>
-    <arc id="arc_e12" class="consumption" source="glyph_n0_n0" target="glyph_n10_port_n10.1">
-      <start x="259.625" y="695"/>
-      <end x="304.375" y="695"/>
+    <arc id="arc_e20" class="production" source="glyph_n14_port_n14.2" target="glyph_n0_n8">
+      <start x="790.625" y="885"/>
+      <end x="766" y="818.75"/>
     </arc>
-    <arc id="arc_e13" class="necessary stimulation" source="glyph_n0_n9" target="glyph_n10">
-      <start x="329" y="769.5"/>
-      <end x="329" y="710.4375"/>
+    <arc id="arc_e21" class="consumption" source="glyph_n0_n17" target="glyph_n13_port_n13.1">
+      <start x="710.01495" y="700"/>
+      <end x="766" y="724.625"/>
     </arc>
     <arc id="arc_e30" class="consumption" source="glyph_n0_n6" target="glyph_n15_port_n15.1">
-      <start x="1185.89995943138" y="665.0285830196058"/>
+      <start x="1185.4777587314252" y="665.1492117910213"/>
       <end x="1315.625" y="635"/>
     </arc>
     <arc id="arc_e31" class="consumption" source="glyph_n0_n5" target="glyph_n15_port_n15.1">
-      <start x="1232.5512449481157" y="591.1634337110868"/>
+      <start x="1232.1882204882183" y="590.8911653661637"/>
       <end x="1315.625" y="635"/>
     </arc>
     <arc id="arc_e16" class="consumption" source="glyph_n1_n2" target="glyph_n11_port_n11.1">
@@ -533,23 +483,7 @@
     </arc>
     <arc id="arc_e17" class="production" source="glyph_n11_port_n11.2" target="glyph_n0_n9">
       <start x="353.625" y="885"/>
-      <end x="329" y="813.625"/>
-    </arc>
-    <arc id="arc_e24" class="production" source="glyph_n16_port_n16.2" target="glyph_n0_n6">
-      <start x="1151" y="760.375"/>
-      <end x="1151" y="697.125"/>
-    </arc>
-    <arc id="arc_e19" class="production" source="glyph_n13_port_n13.2" target="glyph_n0_n16">
-      <start x="766" y="675.375"/>
-      <end x="832.375" y="700"/>
-    </arc>
-    <arc id="arc_e20" class="production" source="glyph_n14_port_n14.2" target="glyph_n0_n8">
-      <start x="790.625" y="885"/>
-      <end x="766" y="818.625"/>
-    </arc>
-    <arc id="arc_e21" class="consumption" source="glyph_n0_n17" target="glyph_n13_port_n13.1">
-      <start x="710.01495" y="700"/>
-      <end x="766" y="724.625"/>
+      <end x="329" y="813.75"/>
     </arc>
   </map>
 </sbgn>
\ No newline at end of file
diff --git a/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_4.sbgn b/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_4.sbgn
index ecaf505..1fe1585 100644
--- a/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_4.sbgn
+++ b/tests/mrm/data/F007-inos-SBGNv02/F007-inos-SBGNv02_p1_4.sbgn
@@ -1,59 +1,9 @@
 <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
 <sbgn xmlns="http://sbgn.org/libsbgn/0.2">
   <map language="process description">
-    <extension>
-      <renderInformation 
-        xmlns="http://www.sbml.org/sbml/level3/version1/render/version1" id="renderInformation" programName="sbgnviz" programVersion="4.2.0" backgroundColor="#000000">
-        <listOfColorDefinitions>
-          <colorDefinition id="color_1" value="#ffffff7f"/>
-          <colorDefinition id="color_2" value="#555555"/>
-          <colorDefinition id="color_3" value="#ffffffff"/>
-        </listOfColorDefinitions>
-        <listOfBackgroundImages/>
-        <listOfStyles>
-          <style id="nodeffffff0.55555553.2514normalnormalHelvetica" idList="glyph_n0 glyph_n1 glyph_n3">
-            <g fontSize="14" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="3.25" fill="color_1"/>
-          </style>
-          <style id="nodeffffff0.55555551.2511normalnormalHelvetica" idList="glyph_n0_n19">
-            <g fontSize="11" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="1.25" fill="color_1"/>
-          </style>
-          <style id="nodeffffff15555551.2511normalnormalHelvetica" idList="glyph_n0_n19_n0_n19_n0 glyph_n0_n19_n0_n19_n1 glyph_n0_n0 glyph_n0_n2 glyph_n0_n3 glyph_n0_n4 glyph_n0_n5 glyph_n0_n6 glyph_n0_n7 glyph_n0_n8 glyph_n0_n9 glyph_n0_n10 glyph_n0_n11 glyph_n0_n12 glyph_n0_n13 glyph_n0_n15 glyph_n0_n16 glyph_n0_n17 glyph_n0_n18 glyph_n0_n20 glyph_n0_n21 glyph_n1_n0 glyph_n1_n1 glyph_n1_n2 glyph_n1_n3 glyph_n3_n1 glyph_n3_n2">
-            <g fontSize="11" fontFamily="Helvetica" fontWeight="normal" fontStyle="normal" stroke="color_2" strokeWidth="1.25" fill="color_3"/>
-          </style>
-          <style id="nodeffffff15555551.25" idList="glyph_n5 glyph_n6 glyph_n7 glyph_n10 glyph_n11 glyph_n13 glyph_n15 glyph_n16 glyph_n17 glyph_n18 glyph_n19 glyph_n21 glyph_n22 glyph_n23 glyph_n24">
-            <g stroke="color_2" strokeWidth="1.25" fill="color_3"/>
-          </style>
-          <style id="edge5555551.25" idList="arc_e13 arc_e22 arc_e17 arc_e24 arc_e30 arc_e19 arc_e21 arc_e16 arc_e26 arc_e54 arc_e38 arc_e57 arc_e56 arc_e55 arc_e39 arc_e53 arc_e52 arc_e32 arc_e50 arc_e36 arc_e42 arc_e33 arc_e46 arc_e45 arc_e44 arc_e43 arc_e29 arc_e27 arc_e28 arc_e35 arc_e12 arc_e25 arc_e58 arc_e37 arc_e34 arc_e3 arc_e4 arc_e5 arc_e6 arc_e31">
-            <g stroke="color_2" strokeWidth="1.25"/>
-          </style>
-        </listOfStyles>
-      </renderInformation>
-      <mapProperties>
-        <compoundPadding>10</compoundPadding>
-        <extraCompartmentPadding>14</extraCompartmentPadding>
-        <extraComplexPadding>10</extraComplexPadding>
-        <arrowScale>1.25</arrowScale>
-        <showComplexName>true</showComplexName>
-        <dynamicLabelSize>regular</dynamicLabelSize>
-        <inferNestingOnLoad>false</inferNestingOnLoad>
-        <fitLabelsToNodes>false</fitLabelsToNodes>
-        <fitLabelsToInfoboxes>false</fitLabelsToInfoboxes>
-        <recalculateLayoutOnComplexityManagement>true</recalculateLayoutOnComplexityManagement>
-        <rearrangeOnComplexityManagement>true</rearrangeOnComplexityManagement>
-        <animateOnDrawingChanges>true</animateOnDrawingChanges>
-        <adjustNodeLabelFontSizeAutomatically>false</adjustNodeLabelFontSizeAutomatically>
-        <enablePorts>true</enablePorts>
-        <allowCompoundNodeResize>false</allowCompoundNodeResize>
-        <mapColorScheme>black_white</mapColorScheme>
-        <defaultInfoboxHeight>12</defaultInfoboxHeight>
-        <defaultInfoboxWidth>8</defaultInfoboxWidth>
-        <mapName>Pathway #sbgn-network-container-0</mapName>
-        <mapDescription/>
-      </mapProperties>
-    </extension>
     <glyph id="glyph_n0" class="compartment">
       <label text="CYTOSOL"/>
-      <bbox x="59.41666666666674" y="483.84666000000016" w="1523.2083333333333" h="398.27833999999984"/>
+      <bbox x="59.41666666666674" y="483.94666000000007" w="1523.2083333333333" h="398.1783399999999"/>
     </glyph>
     <glyph id="glyph_n0_n19" class="complex" compartmentRef="glyph_n0">
       <bbox x="999.375" y="491.0716600000001" w="88.25" h="115.87499999999989"/>
@@ -74,9 +24,6 @@
         </glyph>
       </glyph>
     </glyph>
-    <glyph id="glyph_n0_n0" class="source and sink" compartmentRef="glyph_n0">
-      <bbox x="219" y="675" w="40" h="40"/>
-    </glyph>
     <glyph id="glyph_n0_n2" class="simple chemical" compartmentRef="glyph_n0">
       <label text="fumarate"/>
       <bbox x="1011" y="697" w="80" h="36"/>
@@ -253,11 +200,6 @@
       <port id="glyph_n7_port_n7.1" x="153" y="1136.6475"/>
       <port id="glyph_n7_port_n7.2" x="201" y="1136.6475"/>
     </glyph>
-    <glyph id="glyph_n10" class="process">
-      <bbox x="317" y="683" w="24" h="24"/>
-      <port id="glyph_n10_port_n10.1" x="305" y="695"/>
-      <port id="glyph_n10_port_n10.2" x="353" y="695"/>
-    </glyph>
     <glyph id="glyph_n11" class="process">
       <bbox x="317" y="873" w="24" h="24"/>
       <port id="glyph_n11_port_n11.1" x="305" y="885"/>
@@ -313,29 +255,37 @@
       <port id="glyph_n24_port_n24.1" x="889.3162" y="526.25745"/>
       <port id="glyph_n24_port_n24.2" x="937.3162" y="526.25745"/>
     </glyph>
-    <arc id="arc_e13" class="necessary stimulation" source="glyph_n0_n9" target="glyph_n10">
-      <start x="329" y="769.5"/>
-      <end x="329" y="710.4375"/>
+    <arc id="arc_e4" class="logic arc" source="glyph_n1_n1" target="glyph_n6_port_n6.2">
+      <start x="221.51309513399147" y="1007.27246"/>
+      <end x="219.625" y="1050"/>
+    </arc>
+    <arc id="arc_e5" class="production" source="glyph_n7_port_n7.2" target="glyph_n1_n2">
+      <start x="201.625" y="1136.6475"/>
+      <end x="280.25" y="1136.6475"/>
+    </arc>
+    <arc id="arc_e6" class="consumption" source="glyph_n1_n3" target="glyph_n7_port_n7.1">
+      <start x="135.625" y="1136.6475"/>
+      <end x="152.375" y="1136.6475"/>
     </arc>
     <arc id="arc_e22" class="necessary stimulation" source="glyph_n0_n8" target="glyph_n13">
-      <start x="766" y="774.5"/>
+      <start x="766" y="774.375"/>
       <end x="766" y="727.75"/>
     </arc>
     <arc id="arc_e17" class="production" source="glyph_n11_port_n11.2" target="glyph_n0_n9">
       <start x="353.625" y="885"/>
-      <end x="329" y="813.625"/>
+      <end x="329" y="813.75"/>
     </arc>
     <arc id="arc_e24" class="production" source="glyph_n16_port_n16.2" target="glyph_n0_n6">
       <start x="1151" y="760.375"/>
-      <end x="1151" y="697.125"/>
+      <end x="1151" y="696.75"/>
     </arc>
     <arc id="arc_e30" class="consumption" source="glyph_n0_n6" target="glyph_n15_port_n15.1">
-      <start x="1185.89995943138" y="665.0285830196058"/>
+      <start x="1185.4777587314252" y="665.1492117910213"/>
       <end x="1315.625" y="635"/>
     </arc>
     <arc id="arc_e19" class="production" source="glyph_n13_port_n13.2" target="glyph_n0_n16">
       <start x="766" y="675.375"/>
-      <end x="832.375" y="700"/>
+      <end x="832.25" y="700"/>
     </arc>
     <arc id="arc_e21" class="consumption" source="glyph_n0_n17" target="glyph_n13_port_n13.1">
       <start x="710.01495" y="700"/>
@@ -347,54 +297,54 @@
     </arc>
     <arc id="arc_e26" class="production" source="glyph_n15_port_n15.2" target="glyph_n0_n4">
       <start x="1266.375" y="635"/>
-      <end x="1402.4440945264332" y="664.7184252070489"/>
+      <end x="1402.8638813343491" y="664.8303683558264"/>
     </arc>
     <arc id="arc_e54" class="production" source="glyph_n19_port_n19.1" target="glyph_n0_n13">
       <start x="105" y="649.625"/>
-      <end x="105" y="691.375"/>
+      <end x="105" y="691.25"/>
     </arc>
     <arc id="arc_e38" class="consumption" source="glyph_n0_n7" target="glyph_n18_port_n18.1">
-      <start x="1381" y="556"/>
+      <start x="1381" y="556.375"/>
       <end x="1381" y="364.625"/>
     </arc>
     <arc id="arc_e57" class="logic arc" source="glyph_n1_n0" target="glyph_n6_port_n6.2">
-      <start x="133.9806849101867" y="1012.14746"/>
+      <start x="133.68148841507158" y="1012.27246"/>
       <end x="219.625" y="1050"/>
     </arc>
     <arc id="arc_e56" class="production" source="glyph_n5_port_n5.1" target="glyph_n1_n0">
       <start x="80.375" y="885"/>
-      <end x="105" y="963.02246"/>
+      <end x="105" y="962.89746"/>
     </arc>
     <arc id="arc_e55" class="consumption" source="glyph_n0_n13" target="glyph_n5_port_n5.2">
-      <start x="105" y="740.5"/>
+      <start x="109.375" y="740.625"/>
       <end x="129.625" y="885"/>
     </arc>
     <arc id="arc_e39" class="consumption" source="glyph_n0_n8" target="glyph_n21_port_n21.1">
-      <start x="811.5" y="795"/>
+      <start x="811.625" y="795"/>
       <end x="831.375" y="795"/>
     </arc>
     <arc id="arc_e53" class="consumption" source="glyph_n0_n11" target="glyph_n19_port_n19.2">
-      <glyph id="arc_e53_card" class="cardinality">
+      <glyph id="arc_e53_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="99" y="549.625" w="12" h="19"/>
       </glyph>
-      <start x="105" y="555.5"/>
+      <start x="105" y="555.625"/>
       <end x="105" y="600.375"/>
     </arc>
     <arc id="arc_e52" class="production" source="glyph_n22_port_n22.1" target="glyph_n0_n11">
       <start x="210.375" y="535"/>
-      <end x="148.625" y="535"/>
+      <end x="148.75" y="535"/>
     </arc>
     <arc id="arc_e32" class="consumption" source="glyph_n0_n10" target="glyph_n16_port_n16.1">
-      <start x="1267.1873857784744" y="845.0301493188784"/>
+      <start x="1267.77594224247" y="845.3342368252761"/>
       <end x="1151" y="809.625"/>
     </arc>
     <arc id="arc_e50" class="catalysis" source="glyph_n0_n20" target="glyph_n16">
-      <start x="1086.5" y="785"/>
+      <start x="1086.625" y="788.0654761904761"/>
       <end x="1135.5625" y="785"/>
     </arc>
     <arc id="arc_e36" class="consumption" source="glyph_n3_n1" target="glyph_n17_port_n17.2">
-      <start x="1151" y="111.04313000000002"/>
+      <start x="1151" y="110.66813000000002"/>
       <end x="1151" y="315.375"/>
     </arc>
     <arc id="arc_e42" class="production" source="glyph_n21_port_n21.2" target="glyph_n0_n15">
@@ -402,88 +352,72 @@
       <end x="899.25" y="795"/>
     </arc>
     <arc id="arc_e33" class="catalysis" source="glyph_n0_n19" target="glyph_n15">
-      <start x="1093.725" y="566.459220359596"/>
+      <start x="1093.75" y="566.4679063030303"/>
       <end x="1275.7355919834201" y="629.69656861637"/>
     </arc>
     <arc id="arc_e46" class="consumption" source="glyph_n0_n16" target="glyph_n24_port_n24.1">
-      <glyph id="arc_e46_card" class="cardinality">
+      <glyph id="arc_e46_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="875.8659189624218" y="633.2580040430594" w="12" h="19"/>
       </glyph>
-      <start x="880.4029634651961" y="679.5"/>
+      <start x="880.4298108033985" y="679.375"/>
       <end x="888.6912" y="526.25745"/>
     </arc>
     <arc id="arc_e45" class="consumption" source="glyph_n0_n18" target="glyph_n24_port_n24.1">
-      <glyph id="arc_e45_card" class="cardinality">
+      <glyph id="arc_e45_card" class="stoichiometry">
         <label text="2"/>
-        <bbox x="0" y="0" w="0" h="0"/>
+        <bbox x="846.5224299999994" y="506.7574632359739" w="12" h="19"/>
       </glyph>
-      <start x="834.5" y="526.2574698169736"/>
+      <start x="834.625" y="526.2574697855446"/>
       <end x="888.6912" y="526.25745"/>
     </arc>
     <arc id="arc_e44" class="production" source="glyph_n24_port_n24.2" target="glyph_n0_n19">
       <start x="937.9412" y="526.25745"/>
-      <end x="990.1966575892949" y="539.6935447809093"/>
+      <end x="990.1716575892949" y="539.6891756293712"/>
     </arc>
     <arc id="arc_e43" class="production" source="glyph_n23_port_n23.1" target="glyph_n0_n10">
       <start x="1441" y="809.625"/>
-      <end x="1335.61164329561" y="843.3399831756444"/>
+      <end x="1335.0484828886244" y="843.6517326866542"/>
     </arc>
     <arc id="arc_e29" class="consumption" source="glyph_n0_n4" target="glyph_n23_port_n23.2">
-      <start x="1441" y="694"/>
+      <start x="1441" y="693.625"/>
       <end x="1441" y="760.375"/>
     </arc>
     <arc id="arc_e27" class="production" source="glyph_n15_port_n15.2" target="glyph_n0_n7">
       <start x="1266.375" y="635"/>
-      <end x="1354.9982292983689" y="592.3345138010874"/>
+      <end x="1355.3802384138837" y="592.0798410574109"/>
     </arc>
     <arc id="arc_e28" class="consumption" source="glyph_n0_n3" target="glyph_n23_port_n23.2">
-      <start x="1515.2448470917323" y="726.385647032843"/>
+      <start x="1515.5988322906753" y="726.1061850336773"/>
       <end x="1441" y="760.375"/>
     </arc>
     <arc id="arc_e35" class="production" source="glyph_n17_port_n17.1" target="glyph_n0_n6">
       <start x="1151" y="364.625"/>
-      <end x="1151" y="652.875"/>
+      <end x="1151" y="653.25"/>
     </arc>
-    <arc id="arc_e12" class="consumption" source="glyph_n0_n0" target="glyph_n10_port_n10.1">
-      <start x="259.625" y="695"/>
-      <end x="304.375" y="695"/>
+    <arc id="arc_e31" class="consumption" source="glyph_n0_n5" target="glyph_n15_port_n15.1">
+      <start x="1232.1882204882183" y="590.8911653661637"/>
+      <end x="1315.625" y="635"/>
     </arc>
     <arc id="arc_e25" class="production" source="glyph_n16_port_n16.2" target="glyph_n0_n2">
       <start x="1151" y="760.375"/>
-      <end x="1076.19273354446" y="732.634913481122"/>
+      <end x="1075.818260026928" y="732.3727820188498"/>
     </arc>
     <arc id="arc_e58" class="consumption" source="glyph_n0_n12" target="glyph_n22_port_n22.2">
-      <start x="301.1816" y="535"/>
+      <start x="301.0566" y="535"/>
       <end x="259.625" y="535"/>
     </arc>
     <arc id="arc_e37" class="production" source="glyph_n18_port_n18.2" target="glyph_n3_n2">
       <start x="1381" y="315.375"/>
-      <end x="1381" y="114.16813000000002"/>
+      <end x="1381" y="113.79313000000002"/>
     </arc>
     <arc id="arc_e34" class="catalysis" source="glyph_n0_n21" target="glyph_n23">
-      <start x="1500.5" y="785"/>
+      <start x="1500.375" y="785"/>
       <end x="1456.4375" y="785"/>
     </arc>
     <arc id="arc_e3" class="necessary stimulation" source="glyph_n6_port_n6.1" target="glyph_n7">
       <start x="134.375" y="1050"/>
       <end x="177" y="1121.21"/>
     </arc>
-    <arc id="arc_e4" class="logic arc" source="glyph_n1_n1" target="glyph_n6_port_n6.2">
-      <start x="221.64331879984607" y="1007.14746"/>
-      <end x="219.625" y="1050"/>
-    </arc>
-    <arc id="arc_e5" class="production" source="glyph_n7_port_n7.2" target="glyph_n1_n2">
-      <start x="201.625" y="1136.6475"/>
-      <end x="280.375" y="1136.6475"/>
-    </arc>
-    <arc id="arc_e6" class="consumption" source="glyph_n1_n3" target="glyph_n7_port_n7.1">
-      <start x="135.625" y="1136.6475"/>
-      <end x="152.375" y="1136.6475"/>
-    </arc>
-    <arc id="arc_e31" class="consumption" source="glyph_n0_n5" target="glyph_n15_port_n15.1">
-      <start x="1232.5512449481157" y="591.1634337110868"/>
-      <end x="1315.625" y="635"/>
-    </arc>
   </map>
 </sbgn>
\ No newline at end of file
diff --git a/tests/mrm/scripts/report_ins.py b/tests/mrm/scripts/report_ins.py
index bce121a..b9f7437 100644
--- a/tests/mrm/scripts/report_ins.py
+++ b/tests/mrm/scripts/report_ins.py
@@ -1,18 +1,31 @@
 import argparse
 import glob
+import os
 import re
 
 def main(dir_name: str):
-    tgt_name = re.sub(r'/$', '', dir_name)
-    tgt_name = re.sub(r'[\/]*/', '', tgt_name)
-    tmptgt_path = "{}../../svg/{}".format(dir_name, tgt_name)
+    tgt_name = re.match(r'.*[\\/](.*)[\\/].*', dir_name).group(1)
+    tmptgt_path = "../../../svg/{}".format(tgt_name)
+    tgt_orig_path = "{}/{}.sbgn.svg".format(tmptgt_path, tgt_name)
 
     with open("{}/report.html".format(dir_name), "w") as f:
-        f.write("<html><head><\head><body>")
+        f.write("<html><head><style>"                
+                ".item {width: 500px; float: left; padding-right: 100px} "
+                ".group {clear: left}"
+                "</style></head><body>")
+
+        for f_path in glob.glob("{}/*.svg".format(dir_name)):
+            f_name = os.path.basename(f_path)
+
+            tmp_name = re.match(r'.*from--(.*)-c.*', f_name).group(1)
+            tmp_path = "{}/{}.svg".format(tmptgt_path, tmp_name)
+            f.write('<div class="group">'
+                        '<div class="group-header">{}</div>'                    
+                        '<div class="item tgt-pred"><img src="{}"></div>'
+                        '<div class="item tgt-orig"><img src="{}"></div>'
+                        '<div class="item tmp"><img src="{}"></div>'
+                    '</div>'.format(tmp_name, f_name, tgt_orig_path, tmp_path))
 
-        for f_name in glob.glob("{}/*.svg".format(dir_name)):
-            tmp_name =
-            print(f_name)
         f.write("</body></html>")
         f.close()
 
diff --git a/tests/mrm/scripts/report_ins_merge.py b/tests/mrm/scripts/report_ins_merge.py
new file mode 100644
index 0000000..bc03845
--- /dev/null
+++ b/tests/mrm/scripts/report_ins_merge.py
@@ -0,0 +1,35 @@
+import argparse
+import glob
+import os
+import re
+
+def main(dir_name: str):
+
+    with open("{}/report.html".format(dir_name), "w") as f:
+        f.write("<html><head><style>"                
+                ".item {width: 500px; float: left; padding-right: 100px} "
+                ".group {clear: left}"
+                "</style></head><body>")
+
+        print('dir_name', dir_name)
+        for report_path in glob.glob("{}/**/report.html".format(dir_name)):
+            path = re.match(r'(.*)[/\\].*', report_path.replace(dir_name, "")).group(1)
+            with open(report_path, "r") as report_file:
+                report = report_file.read()
+                content = re.match(r'.*<body>(.*)</body>.*', report).group(1)
+                content = content.replace('src="', 'src="{}/'.format(path))
+                f.write(content)
+
+        f.write("</body></html>")
+        f.close()
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser()
+
+
+    parser.add_argument("-i", "--input",
+                        required=True,
+                        help="Path to directory with results")
+    args = parser.parse_args()
+
+    main(args.input)
\ No newline at end of file
diff --git a/tests/mrm/scripts/run_insert.sh b/tests/mrm/scripts/run_insert.sh
index 018727c..8b95d84 100644
--- a/tests/mrm/scripts/run_insert.sh
+++ b/tests/mrm/scripts/run_insert.sh
@@ -28,6 +28,9 @@ for dir in `ls -d ${TEST_ROOT}/sbml/*`; do
     for pkl in `ls -1 ${out_dir}/*.pkl`; do
         echo "Exporting " $pkl
         ${PYTHON} ${TALENT_UTILS}/export.py -i $pkl -f svg > ${pkl}.svg
-
     done
+
+    python3 report_ins.py -i ${out_dir}
 done
+
+python3 report_ins_merge.py -i ${TEST_ROOT}/pred/ins/
-- 
GitLab