def ko_etfl(model):
    growth = dict()
    gene_ko_config(model)
    model.solver.configuration.timeout = 14400

    model.growth_reaction.lower_bound = 0.1 * max_growth
    # Gene essentiality is a feasibility problem
    # /!\ Also, integer 0 will get the reaction number 0 !
    # We need to use optlang's symbolic 0
    model.objective = optlang.symbolics.Zero

    for g in tqdm(model.genes):
        with model as model:

            if gene_has_associated_enzyme(model, g):
                ret = ko_gene(model, g.id)
                if ret is None:
                    # There is no translation associated to this gene
                    model.logger.warning('There is no translation associated '
                                         'to this gene: {}'.format(g.id))
                    continue
            else:
                # default to GPR KO
                model.genes.get_by_id(g.id).knock_out()
                ret = safe_optim(model)

            growth[g.id] = ret

    model.growth_reaction.lower_bound = 0
    return growth
def ko_etfl(model):
    growth = dict()
    gene_ko_config(model)
    model.growth_reaction.lower_bound = 0.1 * max_growth
    model.objective = 0  # Gene essentiality is a feasibility problem

    for g in tqdm(model.genes):
        with model as model:
            ret = ko_gene(model, g.id)
            if ret is None:
                # There is no translation associated to this gene
                model.logger.warning('There is no translation associated '
                                     'to this gene: {}'.format(g.id))
                continue

            growth[g.id] = ret

    model.growth_reaction.lower_bound = 0
    return growth
Esempio n. 3
0
def test_configs(request):
    model = json_loads_model(request.config.cache.get('small_etfl', None))
    standard_solver_config(model)
    gene_ko_config(model)
    growth_uptake_config(model)