Ejemplo n.º 1
0
 def test_in_vitro_basic(self):
     met1 = Metabolite('met1')
     met2 = Metabolite('met2')
     cytosol = Cytosol()
     cond1 = PresentEntity(met1, cytosol)
     cond2 = PresentEntity(met2, cytosol)
     r1 = Reaction('r1', [cond1], [cond2])
     self.oracle = Oracle(None, [], [r1], None, [], [], [])
     expD = ExperimentDescription(ReconstructionActivity('r1'), [])
     out = self.oracle.execute_in_vitro_exp(expD)
     self.assertEqual(out.outcome, 'true')
Ejemplo n.º 2
0
    def setUp(self):
        # models:
        self.g1 = Gene('g1')
        self.p1 = Protein('p1')
        self.met1 = Metabolite('met1')
        self.met2 = Metabolite('met2')
        self.cplx1 = Complex('cplx1')
        self.cytosol = Cytosol()

        self.cond1 = PresentEntity(self.met1, self.cytosol)
        self.cond2 = PresentEntity(self.met2, self.cytosol)
        self.cond3 = PresentEntity(self.p1, self.cytosol)
        self.cond4 = PresentEntity(self.cplx1, self.cytosol)

        self.growth = Growth('growth', [self.cond2])
        self.growth.reversibility = False
        self.r1 = Reaction('r1', [self.cond1], [self.cond2])
        self.r2 = Reaction('r2', [self.cond3], [self.cond4])
        self.r1.reversibility = False
        self.r2.reversibility = False

        self.entities = [self.g1, self.p1, self.met1, self.met2, self.cplx1]
        self.compartments = [self.cytosol]
        self.activities = [self.growth, self.r1, self.r2]
        self.setup_conds = [self.cond1, self.cond3]

        self.mod1 = Model('m0', self.setup_conds, [self.growth, self.r1], [])
        self.mod2 = Model('m1', self.setup_conds, [self.growth, self.r2], [])

        # cost_module:
        self.cost_model = CostModel(self.entities, self.compartments,
                                    self.activities, self.setup_conds)
        self.cost_model.set_all_basic_costs_to_1()
        self.cost_model.calculate_derived_costs(self.activities)
        self.cost_model.remove_None_valued_elements()

        # known results (one exp, both models consistent)
        self.exd = exp_repr.ExperimentDescription(
            exp_repr.DetectionEntity('met1'), [])
        self.res = exp_repr.Result('res1', self.exd, 'true')
        self.exp = exp_repr.Experiment('exp1', [self.res])

        # archive
        self.arch = Archive()
        self.arch.working_models = [self.mod1, self.mod2]
        self.arch.known_results = [self.exp]
        self.arch.mnm_compartments = self.compartments
        self.arch.mnm_entities = self.entities
        self.arch.mnm_activities = self.activities

        # exp module
        self.exp_module = ExperimentModule(self.arch, self.cost_model, False)
Ejemplo n.º 3
0
 def test_in_vitro_enz(self):
     met1 = Metabolite('met1')
     met2 = Metabolite('met2')
     cytosol = Cytosol()
     cond1 = PresentEntity(met1, cytosol)
     cond2 = PresentEntity(met2, cytosol)
     cond_enz = PresentCatalyst(cytosol)
     r1 = Reaction('r1', [cond1, cond_enz], [cond2])
     enz = Protein('p1', properties=[Catalyses(r1)])
     self.oracle = Oracle(None, [enz], [r1], None, [], [], [])
     expD = ExperimentDescription(ReconstructionEnzReaction('r1', 'p1'), [])
     out = self.oracle.execute_in_vitro_exp(expD)
     self.assertEqual(out.outcome, 'true')
Ejemplo n.º 4
0
 def test_in_vitro_basic_SLOPPY_ORACLE_WITH_FLIP(self):
     met1 = Metabolite('met1')
     met2 = Metabolite('met2')
     cytosol = Cytosol()
     cond1 = PresentEntity(met1, cytosol)
     cond2 = PresentEntity(met2, cytosol)
     r1 = Reaction('r1', [cond1], [cond2])
     self.oracle = SloppyOracle(None, [], [r1],
                                None, [], [], [],
                                error_parameter=1.00)
     expD = ExperimentDescription(ReconstructionActivity('r1'), [])
     out = self.oracle.execute_in_vitro_exp(expD)
     self.assertEqual(out.outcome, 'false')
Ejemplo n.º 5
0
 def test_in_vitro_transp(self):
     met1 = Metabolite('met1')
     met2 = Metabolite('met2')
     cytosol = Cytosol()
     cond1 = PresentEntity(met1, cytosol)
     cond2 = PresentEntity(met2, cytosol)
     cond_trp = PresentTransporter(cytosol)
     r1 = Reaction('r1', [cond1, cond_trp], [cond2])
     transp = Protein('p1', properties=[Transports(r1)])
     self.oracle = Oracle(None, [transp], [r1], None, [], [], [])
     expD = ExperimentDescription(
         ReconstructionTransporterRequired('r1', 'p1'), [])
     out = self.oracle.execute_in_vitro_exp(expD)
     self.assertEqual(out.outcome, 'true')
Ejemplo n.º 6
0
 def __init__(self):
     self.compartments = [
         CellMembrane(),
         Cytosol(),
         EndoplasmicReticulum(),
         ERMembrane(),
         Medium(),
         GolgiApparatus(),
         GolgiMembrane(),
         LipidParticle(),
         MitochInnerMembrane(),
         MitochMatrix(),
         Nucleus(),
         PeroxisomalMembrane(),
         Peroxisome(),
         VacuolarMembrane(),
         Vacuole()
     ]
Ejemplo n.º 7
0
    def setUp(self):
        self.g1 = Gene('g1')
        self.p1 = Protein('p1')
        self.met1 = Metabolite('met1')
        self.met2 = Metabolite('met2')
        self.cplx1 = Complex('cplx1')
        self.cytosol = Cytosol()

        self.cond1 = PresentEntity(self.met1, self.cytosol)
        self.cond2 = PresentEntity(self.met2, self.cytosol)
        self.cond3 = PresentEntity(self.p1, self.cytosol)
        self.cond4 = PresentEntity(self.cplx1, self.cytosol)

        self.growth = Growth('growth', [self.cond2])
        self.r1 = Reaction('r1', [self.cond1], [self.cond2])
        self.r2 = Reaction('r2', [self.cond3], [self.cond4])

        self.entities = [self.g1, self.p1, self.met1, self.met2, self.cplx1]
        self.compartments = [self.cytosol]
        self.activities = [self.growth, self.r1, self.r2]
        self.setup_conds = [self.cond1, self.cond3]
        self.model = CostModel(self.entities, self.compartments,
                               self.activities, self.setup_conds)
Ejemplo n.º 8
0
    def setUp(self):
        self.g1 = Gene('g1')
        self.p1 = Protein('p1')
        self.met1 = Metabolite('met1')
        self.met2 = Metabolite('met2')
        self.cplx1 = Complex('cplx1')
        self.cytosol = Cytosol()

        self.cond1 = PresentEntity(self.met1, self.cytosol)
        self.cond2 = PresentEntity(self.met2, self.cytosol)
        self.cond3 = PresentEntity(self.p1, self.cytosol)
        self.cond4 = PresentEntity(self.cplx1, self.cytosol)

        self.growth = Growth('growth', [self.cond2])
        self.growth.reversibility = False
        self.r1 = Reaction('r1', [self.cond1], [self.cond2])
        self.r2 = Reaction('r2', [self.cond3], [self.cond4])
        self.r1.reversibility = False
        self.r2.reversibility = False

        self.entities = [self.g1, self.p1, self.met1, self.met2, self.cplx1]
        self.compartments = [self.cytosol]
        self.activities = [self.growth, self.r1, self.r2]
        self.setup_conds = [self.cond1, self.cond3]

        self.mod1 = Model('m0', self.setup_conds, [self.growth, self.r1], [])
        self.mod2 = Model('m1', self.setup_conds, [self.growth, self.r2], [])

        self.archive = Archive()
        self.archive.working_models.update([self.mod1, self.mod2])
        self.archive.mnm_compartments = list(self.compartments)
        self.archive.mnm_entities = list(self.entities)
        self.archive.mnm_activities = list(self.activities)

        self.oracle = Oracle(self.archive, [], [], self.mod1, self.entities,
                             self.compartments, self.activities)