From 4fbcf27369058a441bf2e57a8a20886d1fcbae24 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Wed, 7 Feb 2018 17:08:29 +0100
Subject: [PATCH] parsing of reaction type from SBO term added

---
 .../sbml/reaction/SBOTermReactionType.java    |  68 ++++++++++
 .../sbml/reaction/SbmlReactionParser.java     |  11 +-
 .../sbml/reaction/SbmlReactionParserTest.java | 119 ++++++++++++++++++
 .../testFiles/small/reaction/dissociation.xml |  43 +++++++
 .../reaction/heterodimer_association.xml      |  43 +++++++
 .../reaction/known_transition_omitted.xml     |  39 ++++++
 .../small/reaction/negative_influence.xml     |  39 ++++++
 .../small/reaction/positive_influence.xml     |  39 ++++++
 .../small/reaction/state_transition.xml       |  39 ++++++
 .../small/reaction/transcription.xml          |  39 ++++++
 .../testFiles/small/reaction/translation.xml  |  39 ++++++
 .../testFiles/small/reaction/transport.xml    |  39 ++++++
 .../testFiles/small/reaction/truncation.xml   |  43 +++++++
 .../reaction/unknown_negative_influence.xml   |  39 ++++++
 .../reaction/unknown_positive_influence.xml   |  39 ++++++
 .../small/reaction/unknown_transition.xml     |  39 ++++++
 .../layout/ApplySimpleLayoutModelCommand.java |   5 -
 17 files changed, 715 insertions(+), 7 deletions(-)
 create mode 100644 converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SBOTermReactionType.java
 create mode 100644 converter-sbml/testFiles/small/reaction/dissociation.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/heterodimer_association.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/known_transition_omitted.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/negative_influence.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/positive_influence.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/state_transition.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/transcription.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/translation.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/transport.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/truncation.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/unknown_negative_influence.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/unknown_positive_influence.xml
 create mode 100644 converter-sbml/testFiles/small/reaction/unknown_transition.xml

diff --git a/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SBOTermReactionType.java b/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SBOTermReactionType.java
new file mode 100644
index 0000000000..73422774e9
--- /dev/null
+++ b/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SBOTermReactionType.java
@@ -0,0 +1,68 @@
+package lcsb.mapviewer.converter.model.sbml.reaction;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction;
+import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
+import lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction;
+import lcsb.mapviewer.model.map.reaction.type.TranslationReaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.reaction.type.TruncationReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction;
+
+public enum SBOTermReactionType {
+  STATE_TRANSITION(StateTransitionReaction.class, new String[] { "SBO:0000176" }), //
+  TRANSCRIPTION(TranscriptionReaction.class, new String[] { "SBO:0000183" }), //
+  TRANSLATION(TranslationReaction.class, new String[] { "SBO:0000184" }), //
+  TRANSPORT(TransportReaction.class, new String[] { "SBO:0000185" }), //
+  KNOWN_TRANSITION_OMITTED(KnownTransitionOmittedReaction.class, new String[] { "SBO:0000205" }), //
+  UNKNOWN_TRANSITION(UnknownTransitionReaction.class, new String[] { "SBO:0000396" }), //
+  HETERODIMER_ASSOCIATION(HeterodimerAssociationReaction.class, new String[] { "SBO:0000177" }), //
+  DISSOCIATION(DissociationReaction.class, new String[] { "SBO:0000180" }), //
+  TRUNCATION(TruncationReaction.class, new String[] { "SBO:0000178" }), //
+  POSITIVE_INFLUENCE(PositiveInfluenceReaction.class, new String[] { "SBO:0000171" }), //
+  UNKNOWN_POSITIVE_INFLUENCE(UnknownPositiveInfluenceReaction.class, new String[] { "SBO:0000170" }), //
+  NEGATIVE_INFLUENCE(NegativeInfluenceReaction.class, new String[] { "SBO:0000407" }), //
+  UNKNOWN_NEGATIVE_INFLUENCE(UnknownNegativeInfluenceReaction.class, new String[] { "SBO:0000169" }), //
+  ;
+
+  private static Logger logger = Logger.getLogger(SBOTermReactionType.class);
+  private Set<String> sboTerms = new HashSet<>();
+  Class<? extends Reaction> clazz;
+
+  private SBOTermReactionType(Class<? extends Reaction> clazz, String[] inputSboTerms) {
+    this.clazz = clazz;
+    for (String string : inputSboTerms) {
+      sboTerms.add(string);
+    }
+  }
+
+  public static Class<? extends Reaction> getTypeSBOTerm(String sboTerm) {
+    if (sboTerm == null || sboTerm.isEmpty()) {
+      return StateTransitionReaction.class;
+    }
+    Class<? extends Reaction> result = null;
+    for (SBOTermReactionType term : values()) {
+      for (String string : term.sboTerms) {
+        if (string.equalsIgnoreCase(sboTerm)) {
+          result = term.clazz;
+        }
+      }
+    }
+    if (result == null) {
+      logger.warn("Don't know how to handle SBOTerm " + sboTerm + " for modifier");
+      result = StateTransitionReaction.class;
+    }
+    return result;
+  }
+}
diff --git a/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParser.java b/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParser.java
index d92ca8f6ea..876a08866d 100644
--- a/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParser.java
+++ b/converter-sbml/src/main/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParser.java
@@ -49,7 +49,6 @@ import lcsb.mapviewer.model.map.reaction.Reactant;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.reaction.ReactionNode;
 import lcsb.mapviewer.model.map.reaction.SplitOperator;
-import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
 import lcsb.mapviewer.model.map.species.Element;
 import lcsb.mapviewer.model.map.species.Species;
 import lcsb.mapviewer.modelutils.map.ElementUtils;
@@ -277,7 +276,7 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
   }
 
   protected Reaction parse(org.sbml.jsbml.Reaction sbmlReaction, Model sbmlModel) throws InvalidInputDataExecption {
-    Reaction reaction = new StateTransitionReaction();
+    Reaction reaction = new Reaction();
     assignBioEntityData(sbmlReaction, reaction);
     reaction.setIdReaction(sbmlReaction.getId());
     reaction.setReversible(sbmlReaction.isReversible());
@@ -305,6 +304,14 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
       }
     }
 
+    try {
+      Class<? extends Reaction> reactionClass = SBOTermReactionType.getTypeSBOTerm(sbmlReaction.getSBOTermID());
+      reaction = reactionClass.getConstructor(Reaction.class).newInstance(reaction);
+    } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
+        | NoSuchMethodException | SecurityException e) {
+      throw new InvalidInputDataExecption("Problem with creating reaction", e);
+    }
+
     return reaction;
   }
 
diff --git a/converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParserTest.java b/converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParserTest.java
index ac66ea7393..54c80dd5d3 100644
--- a/converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParserTest.java
+++ b/converter-sbml/src/test/java/lcsb/mapviewer/converter/model/sbml/reaction/SbmlReactionParserTest.java
@@ -17,6 +17,19 @@ import lcsb.mapviewer.model.map.modifier.Inhibition;
 import lcsb.mapviewer.model.map.modifier.UnknownCatalysis;
 import lcsb.mapviewer.model.map.modifier.UnknownInhibition;
 import lcsb.mapviewer.model.map.reaction.Reaction;
+import lcsb.mapviewer.model.map.reaction.type.DissociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction;
+import lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction;
+import lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction;
+import lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction;
+import lcsb.mapviewer.model.map.reaction.type.TranslationReaction;
+import lcsb.mapviewer.model.map.reaction.type.TransportReaction;
+import lcsb.mapviewer.model.map.reaction.type.TruncationReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction;
+import lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction;
 
 public class SbmlReactionParserTest {
   Logger logger = Logger.getLogger(SbmlReactionParserTest.class);
@@ -54,4 +67,110 @@ public class SbmlReactionParserTest {
     assertTrue(reaction.getModifiers().iterator().next() instanceof UnknownInhibition);
   }
 
+  @Test
+  public void testParseStateTransition() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/state_transition.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof StateTransitionReaction);
+  }
+
+  @Test
+  public void testParseTranscription() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/transcription.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof TranscriptionReaction);
+  }
+
+  @Test
+  public void testParseTranslation() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/translation.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof TranslationReaction);
+  }
+
+  @Test
+  public void testParseTransport() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/transport.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof TransportReaction);
+  }
+
+  @Test
+  public void testParseKnownTransitionOmitted() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser
+        .createModel(new ConverterParams().filename("testFiles/small/reaction/known_transition_omitted.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof KnownTransitionOmittedReaction);
+  }
+
+  @Test
+  public void testParseUnknownTransition() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/unknown_transition.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof UnknownTransitionReaction);
+  }
+
+  @Test
+  public void testParseHeterodimerAssociation() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser
+        .createModel(new ConverterParams().filename("testFiles/small/reaction/heterodimer_association.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof HeterodimerAssociationReaction);
+  }
+
+  @Test
+  public void testParseDissociation() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/dissociation.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof DissociationReaction);
+  }
+
+  @Test
+  public void testParseTruncation() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/truncation.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof TruncationReaction);
+  }
+
+  @Test
+  public void testParsePositiveInfluence() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/positive_influence.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof PositiveInfluenceReaction);
+  }
+
+  @Test
+  public void testParseUnknownPositiveInfluence() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/unknown_positive_influence.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof UnknownPositiveInfluenceReaction);
+  }
+
+  @Test
+  public void testParseNegativeInfluence() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/negative_influence.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof NegativeInfluenceReaction);
+  }
+
+  @Test
+  public void testParseUnknownNegativeInfluence() throws FileNotFoundException, InvalidInputDataExecption {
+    Model model = parser.createModel(new ConverterParams().filename("testFiles/small/reaction/unknown_negative_influence.xml"));
+    Reaction reaction = model.getReactions().iterator().next();
+    assertNotNull(reaction);
+    assertTrue(reaction instanceof UnknownNegativeInfluenceReaction);
+  }
+
 }
diff --git a/converter-sbml/testFiles/small/reaction/dissociation.xml b/converter-sbml/testFiles/small/reaction/dissociation.xml
new file mode 100644
index 0000000000..3a6e465b74
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/dissociation.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s3" name="nm3">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000180">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+          <speciesReference species="s3" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/heterodimer_association.xml b/converter-sbml/testFiles/small/reaction/heterodimer_association.xml
new file mode 100644
index 0000000000..153808834a
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/heterodimer_association.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s3" name="nm3">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000177">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+          <speciesReference species="s3" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/known_transition_omitted.xml b/converter-sbml/testFiles/small/reaction/known_transition_omitted.xml
new file mode 100644
index 0000000000..b3c07de153
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/known_transition_omitted.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000205">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/negative_influence.xml b/converter-sbml/testFiles/small/reaction/negative_influence.xml
new file mode 100644
index 0000000000..c904475c05
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/negative_influence.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000407">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/positive_influence.xml b/converter-sbml/testFiles/small/reaction/positive_influence.xml
new file mode 100644
index 0000000000..cc1ec867cd
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/positive_influence.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000171">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/state_transition.xml b/converter-sbml/testFiles/small/reaction/state_transition.xml
new file mode 100644
index 0000000000..94523f26af
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/state_transition.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000176">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/transcription.xml b/converter-sbml/testFiles/small/reaction/transcription.xml
new file mode 100644
index 0000000000..c62c80a68f
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/transcription.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000183">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/translation.xml b/converter-sbml/testFiles/small/reaction/translation.xml
new file mode 100644
index 0000000000..2b4d3e608f
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/translation.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000184">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/transport.xml b/converter-sbml/testFiles/small/reaction/transport.xml
new file mode 100644
index 0000000000..e6d472a8ba
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/transport.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000185">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/truncation.xml b/converter-sbml/testFiles/small/reaction/truncation.xml
new file mode 100644
index 0000000000..a5f534cdb5
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/truncation.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s3" name="nm3">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000178">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+          <speciesReference species="s3" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/unknown_negative_influence.xml b/converter-sbml/testFiles/small/reaction/unknown_negative_influence.xml
new file mode 100644
index 0000000000..1b7814dde8
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/unknown_negative_influence.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000169">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/unknown_positive_influence.xml b/converter-sbml/testFiles/small/reaction/unknown_positive_influence.xml
new file mode 100644
index 0000000000..07ff49b799
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/unknown_positive_influence.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000170">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/converter-sbml/testFiles/small/reaction/unknown_transition.xml b/converter-sbml/testFiles/small/reaction/unknown_transition.xml
new file mode 100644
index 0000000000..23f488a66b
--- /dev/null
+++ b/converter-sbml/testFiles/small/reaction/unknown_transition.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
+  <model id="TestGEN">
+    <annotation/>
+    <listOfCompartments>
+      <compartment constant="true" id="cell" name="cell" sboTerm="SBO:0000290" size="1">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
+            <rdf:Description rdf:about="#">
+              <bqbiol:isVersionOf>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="urn:miriam:obo.go:GO:0005623"/>
+                </rdf:Bag>
+              </bqbiol:isVersionOf>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </compartment>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species compartment="cell" initialConcentration="1" id="s1" name="nm1">
+        <annotation/>
+      </species>
+      <species compartment="cell" initialConcentration="1" id="s2" name="nm2">
+        <annotation/>
+      </species>
+    </listOfSpecies>
+    <listOfReactions>
+      <reaction id="re1" sboTerm="SBO:0000396">
+        <listOfReactants>
+          <speciesReference species="s1" stoichiometry="1"/>
+        </listOfReactants>
+        <listOfProducts>
+          <speciesReference species="s2" stoichiometry="1"/>
+        </listOfProducts>
+      </reaction>
+    </listOfReactions>
+  </model>
+</sbml>
\ No newline at end of file
diff --git a/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java b/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java
index 9d89405b3b..aa636b4fb7 100644
--- a/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java
+++ b/model-command/src/main/java/lcsb/mapviewer/commands/layout/ApplySimpleLayoutModelCommand.java
@@ -30,8 +30,6 @@ import lcsb.mapviewer.model.map.reaction.Product;
 import lcsb.mapviewer.model.map.reaction.Reactant;
 import lcsb.mapviewer.model.map.reaction.Reaction;
 import lcsb.mapviewer.model.map.reaction.SplitOperator;
-import lcsb.mapviewer.model.map.reaction.type.TwoProductReactionInterface;
-import lcsb.mapviewer.model.map.reaction.type.TwoReactantReactionInterface;
 import lcsb.mapviewer.model.map.species.Complex;
 import lcsb.mapviewer.model.map.species.Element;
 import lcsb.mapviewer.model.map.species.Species;
@@ -206,9 +204,6 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand {
   }
 
   private void modifyReaction(Reaction reaction) {
-    if (reaction instanceof TwoReactantReactionInterface || reaction instanceof TwoProductReactionInterface) {
-      throw new NotImplementedException();
-    }
     for (AbstractNode node : reaction.getOperators()) {
       reaction.removeNode(node);
     }
-- 
GitLab