test_class.file: singa-simulation/src/test/java/bio/singa/simulation/export/format/FormatReactionEquationTest.java
test_class.identifier: FormatReactionEquationTest
test_case.body: @Test
      void testDynamicReactionFormat() {
          Simulation simulation = new Simulation();
  
          RateConstant scaling = RateConstant.create(1.0)
                  .forward().firstOrder()
                  .timeUnit(MINUTE)
                  .evidence(new Evidence(PREDICTION, "Unit Scaling", "Scales the velocity to the corresponding unit"))
                  .build();
  
          MichaelisConstant km = new MichaelisConstant(Quantities.getQuantity(20, MICRO_MOLE_PER_LITRE), Evidence.NO_EVIDENCE);
  
          Reaction reaction = ReactionBuilder.staticReactants(simulation)
                  // derived from v = kCat*E*S/(kM+s), where kCat has is a pseudo first order rate derived from regression
                  // the scaling parameter determines the unit of the equation
                  .kineticLaw("(1/((p01/cATPuM)^p02+(p03/cGAuM)^p04))*us*cAC6*(cATP/(kM+cATP))")
                  // matlab regression
                  .referenceParameter("p01", 6.144e5)
                  .referenceParameter("p02", 0.3063)
                  .referenceParameter("p03", 1.196)
                  .referenceParameter("p04", 1.153)
                  .referenceParameter("us", scaling)
                  .referenceParameter("kM", UnitRegistry.scale(km.getContent()).getValue().doubleValue())
                  .referenceParameter("cATPuM", new Reactant(SimpleEntity.create("ATP").build(), CATALYTIC, MICRO_MOLE_PER_LITRE))
                  .referenceParameter("cGAuM", new Reactant(SimpleEntity.create("GAT").build(), CATALYTIC, MICRO_MOLE_PER_LITRE))
                  .referenceParameter("cAC6", new Reactant(SimpleEntity.create("AC6").build(), CATALYTIC, MEMBRANE))
                  .referenceParameter("cATP", new Reactant(SimpleEntity.create("ATP").build(), SUBSTRATE))
                  .referenceParameter(new Reactant(SimpleEntity.create("CAMP").build(), PRODUCT))
                  .identifier("Adenylate Cyclase Reaction")
                  .build();
  
          assertEquals("\\ch{ATP -> [ ATP, GAT, AC 6  ] CAMP}", FormatReactionEquation.formatTex(reaction).get(0));
      }
test_case.class_method_signature: FormatReactionEquationTest.testDynamicReactionFormat()
test_case.full_signature: @Test void testDynamicReactionFormat()
test_case.identifier: testDynamicReactionFormat
test_case.invocations: build evidence timeUnit firstOrder forward create getQuantity build identifier referenceParameter referenceParameter referenceParameter referenceParameter referenceParameter referenceParameter referenceParameter referenceParameter referenceParameter referenceParameter referenceParameter kineticLaw staticReactants doubleValue getValue scale getContent build create build create build create build create build create assertEquals get formatTex
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDynamicReactionFormat()
focal_class.declarator: texPrefix = "\\ch{"
focal_class.modifier: private static
focal_class.original_string: private static String texPrefix = "\\ch{";
focal_class.type: String
focal_class.var_name: texPrefix
focal_class.declarator: texSuffix = "}"
focal_class.modifier: private static
focal_class.original_string: private static String texSuffix = "}";
focal_class.type: String
focal_class.var_name: texSuffix
focal_class.declarator: reversibleArrow = "<=>"
focal_class.modifier: private static
focal_class.original_string: private static String reversibleArrow = "<=>";
focal_class.type: String
focal_class.var_name: reversibleArrow
focal_class.declarator: irreversibleArrow = "->"
focal_class.modifier: private static
focal_class.original_string: private static String irreversibleArrow = "->";
focal_class.type: String
focal_class.var_name: irreversibleArrow
focal_class.declarator: caralystFormatting = "[ %s ] "
focal_class.modifier: private static
focal_class.original_string: private static String caralystFormatting = "[ %s ] ";
focal_class.type: String
focal_class.var_name: caralystFormatting
focal_class.declarator: michaelisMentenASCIITemplate = "%s - %s -> %s}"
focal_class.modifier: private static
focal_class.original_string: private static String michaelisMentenASCIITemplate = "%s - %s -> %s}";
focal_class.type: String
focal_class.var_name: michaelisMentenASCIITemplate
focal_class.declarator: irreversibleASCIITemplate = "%s -> %s"
focal_class.modifier: private static
focal_class.original_string: private static String irreversibleASCIITemplate = "%s -> %s";
focal_class.type: String
focal_class.var_name: irreversibleASCIITemplate
focal_class.declarator: reversibleASCIITemplate = "%s <=> %s"
focal_class.modifier: private static
focal_class.original_string: private static String reversibleASCIITemplate = "%s <=> %s";
focal_class.type: String
focal_class.var_name: reversibleASCIITemplate
focal_class.file: singa-simulation/src/main/java/bio/singa/simulation/export/format/FormatReactionEquation.java
focal_class.identifier: FormatReactionEquation
focal_class.class_method_signature: FormatReactionEquation.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: FormatReactionEquation.formatReactantSet(ReactantSet reactantSet, boolean isReversible)
focal_class.full_signature: private static String formatReactantSet(ReactantSet reactantSet, boolean isReversible)
focal_class.identifier: formatReactantSet
focal_class.modifiers: private static
focal_class.parameters: (ReactantSet reactantSet, boolean isReversible)
focal_class.return: String
focal_class.signature: String formatReactantSet(ReactantSet reactantSet, boolean isReversible)
focal_class.class_method_signature: FormatReactionEquation.formatReactantSet(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.full_signature: private static String formatReactantSet(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.identifier: formatReactantSet
focal_class.modifiers: private static
focal_class.parameters: (List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.return: String
focal_class.signature: String formatReactantSet(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, boolean isReversible)
focal_class.class_method_signature: FormatReactionEquation.formatReactantsTex(Collection<Reactant> reactants, String delimiter)
focal_class.full_signature: private static String formatReactantsTex(Collection<Reactant> reactants, String delimiter)
focal_class.identifier: formatReactantsTex
focal_class.modifiers: private static
focal_class.parameters: (Collection<Reactant> reactants, String delimiter)
focal_class.return: String
focal_class.signature: String formatReactantsTex(Collection<Reactant> reactants, String delimiter)
focal_class.class_method_signature: FormatReactionEquation.formatReactantTex(Reactant reactant)
focal_class.full_signature: private static String formatReactantTex(Reactant reactant)
focal_class.identifier: formatReactantTex
focal_class.modifiers: private static
focal_class.parameters: (Reactant reactant)
focal_class.return: String
focal_class.signature: String formatReactantTex(Reactant reactant)
focal_class.class_method_signature: FormatReactionEquation.mapTopologyToString(CellTopology topology)
focal_class.full_signature: private static String mapTopologyToString(CellTopology topology)
focal_class.identifier: mapTopologyToString
focal_class.modifiers: private static
focal_class.parameters: (CellTopology topology)
focal_class.return: String
focal_class.signature: String mapTopologyToString(CellTopology topology)
focal_class.class_method_signature: FormatReactionEquation.formatASCII(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.full_signature: public static String formatASCII(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.identifier: formatASCII
focal_class.modifiers: public static
focal_class.parameters: (List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.return: String
focal_class.signature: String formatASCII(List<Reactant> substrates, List<Reactant> products, List<Reactant> catalysts, KineticLaw law)
focal_class.class_method_signature: FormatReactionEquation.formatASCII(Reaction reaction)
focal_class.full_signature: public static String formatASCII(Reaction reaction)
focal_class.identifier: formatASCII
focal_class.modifiers: public static
focal_class.parameters: (Reaction reaction)
focal_class.return: String
focal_class.signature: String formatASCII(Reaction reaction)
focal_class.class_method_signature: FormatReactionEquation.formatSectionReactantsASCII(Collection<Reactant> reactants, String delimiter)
focal_class.full_signature: private static String formatSectionReactantsASCII(Collection<Reactant> reactants, String delimiter)
focal_class.identifier: formatSectionReactantsASCII
focal_class.modifiers: private static
focal_class.parameters: (Collection<Reactant> reactants, String delimiter)
focal_class.return: String
focal_class.signature: String formatSectionReactantsASCII(Collection<Reactant> reactants, String delimiter)
focal_class.class_method_signature: FormatReactionEquation.formatSectionReactantASCII(Reactant reactant)
focal_class.full_signature: private static String formatSectionReactantASCII(Reactant reactant)
focal_class.identifier: formatSectionReactantASCII
focal_class.modifiers: private static
focal_class.parameters: (Reactant reactant)
focal_class.return: String
focal_class.signature: String formatSectionReactantASCII(Reactant reactant)
focal_method.body: public static List<String> formatTex(Reaction reaction) {
          List<String> resultingStrings = new ArrayList<>();
          boolean isReversible = reaction.getKineticLaw() instanceof ReversibleKineticLaw;
          if (reaction.getReactantBehavior() instanceof RuleBasedReactantBehavior) {
              List<ReactantSet> reactantSets = reaction.getReactantBehavior().getReactantSets();
              for (ReactantSet reactantSet : reactantSets) {
                  resultingStrings.add(formatReactantSet(reactantSet, isReversible));
              }
          } else {
              resultingStrings.add(formatReactantSet(reaction.getReactantBehavior().getSubstrates(),
                      reaction.getReactantBehavior().getProducts(),
                      reaction.getReactantBehavior().getCatalysts(),
                      isReversible));
          }
          return resultingStrings;
      }
focal_method.class_method_signature: FormatReactionEquation.formatTex(Reaction reaction)
focal_method.full_signature: public static List<String> formatTex(Reaction reaction)
focal_method.identifier: formatTex
focal_method.invocations: getKineticLaw getReactantBehavior getReactantSets getReactantBehavior add formatReactantSet add formatReactantSet getSubstrates getReactantBehavior getProducts getReactantBehavior getCatalysts getReactantBehavior
focal_method.modifiers: public static
focal_method.parameters: (Reaction reaction)
focal_method.return: List<String>
focal_method.signature: List<String> formatTex(Reaction reaction)