test_class.file: singa-simulation/src/test/java/bio/singa/simulation/export/format/FormatReactionKineticsTest.java
test_class.identifier: FormatReactionKineticsTest
test_case.body: @Test
      void testMichaelisMentenFormat() {
          Simulation simulation = new Simulation();
  
          MichaelisConstant michaelisConstant = new MichaelisConstant(Quantities.getQuantity(9.0e-3, MOLE_PER_LITRE), Evidence.NO_EVIDENCE);
          TurnoverNumber turnoverNumber = new TurnoverNumber(76, new ProductUnit<>(ONE.divide(MINUTE)), Evidence.NO_EVIDENCE);
  
          ChemicalEntity substrate = SimpleEntity.create("A").build();
          ChemicalEntity product1 = SimpleEntity.create("B").build();
          ChemicalEntity product2 = SimpleEntity.create("C").build();
          ChemicalEntity enzyme = SimpleEntity.create("E").build();
  
          Reaction reaction = ReactionBuilder.staticReactants(simulation)
                  .addSubstrate(substrate)
                  .addCatalyst(enzyme)
                  .addProduct(product1)
                  .addProduct(product2)
                  .michaelisMenten()
                  .michaelisConstant(michaelisConstant)
                  .turnover(turnoverNumber)
                  .build();
  
          assertEquals("$\\frac{k_{\\text{cat}} \\cdot [\\text{E}] \\cdot [\\text{A}]}{K_m \\cdot [\\text{A}]}$", FormatReactionKinetics.formatTex(reaction).get(0));
      }
test_case.class_method_signature: FormatReactionKineticsTest.testMichaelisMentenFormat()
test_case.full_signature: @Test void testMichaelisMentenFormat()
test_case.identifier: testMichaelisMentenFormat
test_case.invocations: getQuantity divide build create build create build create build create build turnover michaelisConstant michaelisMenten addProduct addProduct addCatalyst addSubstrate staticReactants assertEquals get formatTex
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMichaelisMentenFormat()
focal_class.declarator: michaelisMentenTemplate = "$\\frac{k_{\\text{cat}} \\cdot [\\text{%s}] \\cdot [\\text{%s}]}{K_m \\cdot [\\text{%s}]}$"
focal_class.modifier: private static final
focal_class.original_string: private static final String michaelisMentenTemplate = "$\\frac{k_{\\text{cat}} \\cdot [\\text{%s}] \\cdot [\\text{%s}]}{K_m \\cdot [\\text{%s}]}$";
focal_class.type: String
focal_class.var_name: michaelisMentenTemplate
focal_class.file: singa-simulation/src/main/java/bio/singa/simulation/export/format/FormatReactionKinetics.java
focal_class.identifier: FormatReactionKinetics
focal_class.class_method_signature: FormatReactionKinetics.formatTex(Reaction reaction)
focal_class.full_signature: public static List<String> formatTex(Reaction reaction)
focal_class.identifier: formatTex
focal_class.modifiers: public static
focal_class.parameters: (Reaction reaction)
focal_class.return: List<String>
focal_class.signature: List<String> formatTex(Reaction reaction)
focal_class.class_method_signature: FormatReactionKinetics.formatReversibleKinetics(List<Reactant> substrates, List<Reactant> products)
focal_class.full_signature: private static String formatReversibleKinetics(List<Reactant> substrates, List<Reactant> products)
focal_class.identifier: formatReversibleKinetics
focal_class.modifiers: private static
focal_class.parameters: (List<Reactant> substrates, List<Reactant> products)
focal_class.return: String
focal_class.signature: String formatReversibleKinetics(List<Reactant> substrates, List<Reactant> products)
focal_class.class_method_signature: FormatReactionKinetics.formatIrreversibleKinetics(List<Reactant> substrates)
focal_class.full_signature: private static String formatIrreversibleKinetics(List<Reactant> substrates)
focal_class.identifier: formatIrreversibleKinetics
focal_class.modifiers: private static
focal_class.parameters: (List<Reactant> substrates)
focal_class.return: String
focal_class.signature: String formatIrreversibleKinetics(List<Reactant> substrates)
focal_class.class_method_signature: FormatReactionKinetics.formatMichaelisMentenKinetics(String substrate, String enzyme)
focal_class.full_signature: private static String formatMichaelisMentenKinetics(String substrate, String enzyme)
focal_class.identifier: formatMichaelisMentenKinetics
focal_class.modifiers: private static
focal_class.parameters: (String substrate, String enzyme)
focal_class.return: String
focal_class.signature: String formatMichaelisMentenKinetics(String substrate, String enzyme)
focal_class.class_method_signature: FormatReactionKinetics.formatReactants(Collection<Reactant> reactants)
focal_class.full_signature: private static String formatReactants(Collection<Reactant> reactants)
focal_class.identifier: formatReactants
focal_class.modifiers: private static
focal_class.parameters: (Collection<Reactant> reactants)
focal_class.return: String
focal_class.signature: String formatReactants(Collection<Reactant> reactants)
focal_class.class_method_signature: FormatReactionKinetics.formatSectionReactant(Reactant reactant)
focal_class.full_signature: private static String formatSectionReactant(Reactant reactant)
focal_class.identifier: formatSectionReactant
focal_class.modifiers: private static
focal_class.parameters: (Reactant reactant)
focal_class.return: String
focal_class.signature: String formatSectionReactant(Reactant reactant)
focal_method.body: public static List<String> formatTex(Reaction reaction) {
          List<String> resultingStrings = new ArrayList<>();
          if (reaction.getReactantBehavior() instanceof RuleBasedReactantBehavior) {
              List<ReactantSet> reactantSets = reaction.getReactantBehavior().getReactantSets();
              for (ReactantSet reactantSet : reactantSets) {
                  String kineticsString;
                  if (reaction.getKineticLaw() instanceof ReversibleKineticLaw) {
                      kineticsString = formatReversibleKinetics(reactantSet.getSubstrates(),reactantSet.getProducts());
                  } else if (reaction.getKineticLaw() instanceof IrreversibleKineticLaw) {
                      kineticsString = formatIrreversibleKinetics(reactantSet.getSubstrates());
                  } else if (reaction.getKineticLaw() instanceof MichaelisMentenKineticLaw) {
                      String substrate = reactantSet.getSubstrates().iterator().next().getEntity().getIdentifier();
                      String enzyme = reactantSet.getCatalysts().iterator().next().getEntity().getIdentifier();
                      kineticsString = formatMichaelisMentenKinetics(substrate, enzyme);
                  } else {
                      kineticsString = "";
                  }
                  resultingStrings.add(kineticsString);
              }
          } else {
              String kineticsString;
              if (reaction.getKineticLaw() instanceof ReversibleKineticLaw) {
                  kineticsString = formatReversibleKinetics(reaction.getReactantBehavior().getSubstrates(),reaction.getReactantBehavior().getProducts());
              } else if (reaction.getKineticLaw() instanceof IrreversibleKineticLaw) {
                  kineticsString = formatIrreversibleKinetics(reaction.getReactantBehavior().getSubstrates());
              } else if (reaction.getKineticLaw() instanceof MichaelisMentenKineticLaw) {
                  String substrate = reaction.getReactantBehavior().getSubstrates().iterator().next().getEntity().getIdentifier();
                  String enzyme = reaction.getReactantBehavior().getCatalysts().iterator().next().getEntity().getIdentifier();
                  kineticsString = formatMichaelisMentenKinetics(substrate, enzyme);
              } else {
                  kineticsString = "";
              }
              resultingStrings.add(kineticsString);
          }
          return resultingStrings;
      }
focal_method.class_method_signature: FormatReactionKinetics.formatTex(Reaction reaction)
focal_method.full_signature: public static List<String> formatTex(Reaction reaction)
focal_method.identifier: formatTex
focal_method.invocations: getReactantBehavior getReactantSets getReactantBehavior getKineticLaw formatReversibleKinetics getSubstrates getProducts getKineticLaw formatIrreversibleKinetics getSubstrates getKineticLaw getIdentifier getEntity next iterator getSubstrates getIdentifier getEntity next iterator getCatalysts formatMichaelisMentenKinetics add getKineticLaw formatReversibleKinetics getSubstrates getReactantBehavior getProducts getReactantBehavior getKineticLaw formatIrreversibleKinetics getSubstrates getReactantBehavior getKineticLaw getIdentifier getEntity next iterator getSubstrates getReactantBehavior getIdentifier getEntity next iterator getCatalysts getReactantBehavior formatMichaelisMentenKinetics add
focal_method.modifiers: public static
focal_method.parameters: (Reaction reaction)
focal_method.return: List<String>
focal_method.signature: List<String> formatTex(Reaction reaction)