PNNL-CompBio / CONCERTO

Continuous integration and validation for genome-scale metabolic model consortia
Apache License 2.0
3 stars 3 forks source link

write test to ensure that rhodo can excrete each metabolite in Pavlo's list under sucrose conditions #27

Closed JamesPino closed 1 year ago

JamesPino commented 1 year ago

Have core of concept (below), just need to get excel file, convert to bigg_id (which we have conversion), and create test.

Assume rhodo model is loaded as rt.

def change_carbon_get_exchanges(old_carbon_source='EX_glc__D_e', new_carbon_source='EX_xyl__D_e'):
    df = []
    with rt:
        med = rt.medium
        med[old_carbon_source] = 0
        med[new_carbon_source] = 1
        rt.medium = med
        rt.optimize()
        for r in rt.boundary:
            if not np.isclose(r.flux, 0):
                metab = '|'.join([i.id for i in r.metabolites])
                df.append([r, r.flux, metab])
    df = pd.DataFrame(df, columns=['rxn', 'flux', 'metab'])
    df.sort_values('flux', ascending=False, inplace=True)
    return df
djinnome commented 1 year ago

The concern about this function is that even if a metabolite is capable of being secreted with this model under that nutrient condition, it doesn't mean that it will be if its only objective is to grow.. Since we have observations of external metabolites in the media, it may make more sense to run a sequence of optimizations where we iteratively set some positive lower bound on the export reaction for each metabolite. If the metabolite does not exist in the model, or if the model is infeasible under the lower bound constraint, then the metabolite cannot be excreted by the model in that nutrient condition. Otherwise, it can be.

vladpetyuk commented 1 year ago

same as #45