def test_equation_double_stoichiometry(self):
        """ Test Equation. """
        eq_string = '3.0 atp + 2.0 phos + ki <-> 16.98 tet'
        eq = Equation(eq_string)
        self.assertTrue(eq.reversible)

        test_res = eq_string.replace('<->', REV_SEP)
        self.assertEqual(eq.toString(), test_res)
Exemple #2
0
    def test_equation_2(self):
        """ Test Equation. """
        eq_string = 'e__h2oM <-> c__h2oM'
        eq = Equation(eq_string)
        self.assertTrue(eq.reversible)

        test_res = eq_string.replace('<->', REV_SEP)
        self.assertEqual(eq.to_string(), test_res)
Exemple #3
0
    def test_equation_double_stoichiometry(self):
        """ Test Equation. """
        eq_string = '3.0 atp + 2.0 phos + ki <-> 16.98 tet'
        eq = Equation(eq_string)
        self.assertTrue(eq.reversible)

        test_res = eq_string.replace('<->', REV_SEP)
        self.assertEqual(eq.to_string(), test_res)
Exemple #4
0
def test_equation_double_stoichiometry() -> None:
    """ Test Equation. """
    eq_string = "3.0 atp + 2.0 phos + ki <-> 16.98 tet"
    eq = Equation(eq_string)
    assert eq.reversible

    test_res = eq_string.replace("<->", REV_SEP)
    assert eq.to_string() == test_res
    def test_equation_2(self):
        """ Test Equation. """
        eq_string = 'e__h2oM <-> c__h2oM'
        eq = Equation(eq_string)
        self.assertTrue(eq.reversible)

        test_res = eq_string.replace('<->', REV_SEP)
        self.assertEqual(eq.toString(), test_res)
Exemple #6
0
def test_equation_2() -> None:
    """ Test Equation. """
    eq_string = "e__h2oM <-> c__h2oM"
    eq = Equation(eq_string)
    assert eq.reversible

    test_res = eq_string.replace("<->", REV_SEP)
    assert eq.to_string() == test_res
Exemple #7
0
 def test_equation_examples(self):
     equations = [
         '1.0 S1 + 2 S2 => 2.0 P1 + 2 P2 [M1, M2]',
         'c__gal1p => c__gal + c__phos',
         'e__h2oM <-> c__h2oM',
         '3 atp + 2.0 phos + ki <-> 16.98 tet',
         'c__gal1p => c__gal + c__phos [c__udp, c__utp]',
         'A_ext => A []',
         '=> cit',
         'acoa =>',
     ]
     for eq_str in equations:
         eq = Equation(eq_str)
         assert eq
Exemple #8
0
def test_equation_examples() -> None:
    equations = [
        "1.0 S1 + 2 S2 => 2.0 P1 + 2 P2 [M1, M2]",
        "c__gal1p => c__gal + c__phos",
        "e__h2oM <-> c__h2oM",
        "3 atp + 2.0 phos + ki <-> 16.98 tet",
        "c__gal1p => c__gal + c__phos [c__udp, c__utp]",
        "A_ext => A []",
        "=> cit",
        "acoa =>",
    ]
    for eq_str in equations:
        eq = Equation(eq_str)
        assert eq
Exemple #9
0
    def __init__(
        self,
        sid,
        equation,
        formula=None,
        pars=None,
        rules=None,
        name=None,
        compartment=None,
        fast=False,
        reversible=None,
        sboTerm=None,
        metaId=None,
        annotations=None,
        notes=None,
        lowerFluxBound=None,
        upperFluxBound=None,
        uncertainties=None,
        port=None,
    ):
        super(Reaction, self).__init__(
            sid=sid,
            name=name,
            sboTerm=sboTerm,
            metaId=metaId,
            annotations=annotations,
            notes=notes,
            port=port,
            uncertainties=uncertainties,
        )
        if pars is None:
            pars = list()
        if rules is None:
            rules = list()

        self.equation = Equation(equation)
        self.compartment = compartment
        self.reversible = reversible
        self.pars = pars
        self.rules = rules
        self.formula = formula
        if formula is not None:
            self.formula = Formula(*formula)
        self.fast = fast
        self.lowerFluxBound = lowerFluxBound
        self.upperFluxBound = upperFluxBound
Exemple #10
0
def test_equation_empty_modifier() -> None:
    """ Test Equation. """
    eq_string = "A_ext => A []"
    eq = Equation(eq_string)
    assert len(eq.modifiers) == 0
Exemple #11
0
def test_equation_modifier() -> None:
    """ Test Equation. """
    eq_string = "c__gal1p => c__gal + c__phos [c__udp, c__utp]"
    eq = Equation(eq_string)
    assert eq.to_string(modifiers=True) == eq_string
Exemple #12
0
def test_equation_1() -> None:
    """ Test Equation. """
    eq_string = "c__gal1p => c__gal + c__phos"
    eq = Equation(eq_string)
    assert eq.to_string() == eq_string
Exemple #13
0
 def test_equation_no_products(self):
     """ Test Equation. """
     eq_string = 'B => '
     eq = Equation(eq_string)
     test_res = eq_string.replace('=>', IRREV_SEP)
     self.assertEqual(eq.to_string(), test_res)
Exemple #14
0
 def test_equation_empty_modifier(self):
     """ Test Equation. """
     eq_string = 'A_ext => A []'
     eq = Equation(eq_string)
     self.assertEqual(len(eq.modifiers), 0)
Exemple #15
0
 def test_equation_modifier(self):
     """ Test Equation. """
     eq_string = 'c__gal1p => c__gal + c__phos [c__udp, c__utp]'
     eq = Equation(eq_string)
     self.assertEqual(eq.to_string(modifiers=True), eq_string)
Exemple #16
0
 def test_equation_1(self):
     """ Test Equation. """
     eq_string = 'c__gal1p => c__gal + c__phos'
     eq = Equation(eq_string)
     self.assertEqual(eq.to_string(), eq_string)
Exemple #17
0
def test_equation_no_reactants():
    """ Test Equation. """
    eq_string = " => A"
    eq = Equation(eq_string)
    test_res = eq_string.replace("=>", IRREV_SEP)
    assert eq.to_string() == test_res
 def test_equation_no_products(self):
     """ Test Equation. """
     eq_string = 'B => '
     eq = Equation(eq_string)
     test_res = eq_string.replace('=>', IRREV_SEP)
     self.assertEqual(eq.toString(), test_res)
 def test_equation_modifier(self):
     """ Test Equation. """
     eq_string = 'c__gal1p => c__gal + c__phos [c__udp, c__utp]'
     eq = Equation(eq_string)
     self.assertEqual(eq.toString(modifiers=True), eq_string)
Exemple #20
0
def test_equation_no_products() -> None:
    """ Test Equation. """
    eq_string = "B => "
    eq = Equation(eq_string)
    test_res = eq_string.replace("=>", IRREV_SEP)
    assert eq.to_string() == test_res
 def test_equation_1(self):
     """ Test Equation. """
     eq_string = 'c__gal1p => c__gal + c__phos'
     eq = Equation(eq_string)
     self.assertEqual(eq.toString(), eq_string)