Ejemplo n.º 1
0
    def test_gapfill_exclude_addition(self):
        core = set(self.model.reactions) - {'rxn_4'}
        blocked = {Compound('D'), Compound('E')}
        exclude = {'rxn_4'}

        with self.assertRaises(GapFillError):
            gapfill(self.model, core, blocked, exclude, self.solver,
                    epsilon=0.1)
Ejemplo n.º 2
0
    def test_gapfill_exclude_reversal(self):
        self.model.database.set_reaction('rxn_4', parse_reaction('D => C'))
        core = set(self.model.reactions)
        blocked = {Compound('D'), Compound('E')}
        exclude = {'rxn_4'}

        with self.assertRaises(GapFillError):
            gapfill(self.model, core, blocked, exclude, self.solver,
                    epsilon=0.1)
Ejemplo n.º 3
0
    def test_gapfill_add_reaction(self):
        core = set(self.model.reactions) - {'rxn_4'}
        blocked = {Compound('D'), Compound('E')}

        add, rev = gapfill(self.model, core, blocked, self.solver)
        self.assertEqual(set(rev), set())
        self.assertEqual(set(add), {'rxn_4'})
Ejemplo n.º 4
0
    def test_gapfill_reverse_reaction(self):
        self.model.database.set_reaction('rxn_4', parse_reaction('|D| => |C|'))
        core = set(self.model.reactions)
        blocked = {Compound('D'), Compound('E')}

        add, rev = gapfill(self.model, core, blocked, self.solver)
        self.assertEqual(set(rev), {'rxn_4'})
        self.assertEqual(set(add), set())
Ejemplo n.º 5
0
    def test_gapfill_reverse_reaction_not_allowed(self):
        self.model.database.set_reaction('rxn_4', parse_reaction('|D| => |C|'))
        core = set(self.model.reactions)
        blocked = {Compound('D'), Compound('E')}

        with self.assertRaises(GapFillError):
            add, rev = gapfill(
                self.model, core, blocked, {}, self.solver, epsilon=0.1)
Ejemplo n.º 6
0
    def test_gapfill_reverse_reaction(self):
        self.model.database.set_reaction('rxn_4', parse_reaction('|D| => |C|'))
        core = set(self.model.reactions)
        blocked = {Compound('D'), Compound('E')}

        add, rev = gapfill(
            self.model, core, blocked, {}, self.solver, epsilon=0.1,
            allow_bounds_expansion=True)
        self.assertEqual(set(rev), {'rxn_4'})
        self.assertEqual(set(add), set())