cdanielmachado / framed

framed: a metabolic modeling package for python
http://framed.readthedocs.io/
Other
25 stars 10 forks source link

Objective function should be defined in ConstraintBasedModel #12

Closed phantomas1234 closed 11 years ago

phantomas1234 commented 11 years ago

Then we don't have to pass it through all kinds of function calls

kaizhuang commented 11 years ago

This was discussed when we first built it. The model does not technically include the objective function because the objective function is a part of analysis method (eg FBA, MOMA). So it is conceptually incorrect to put an objective function in the model class

Sent from my iPhone

On Nov 9, 2013, at 12:10 PM, Nikolaus Sonnenschein notifications@github.com wrote:

Then we don't have to pass it through all kinds of function calls

— Reply to this email directly or view it on GitHub.

cdanielmachado commented 11 years ago

I agree with both perspectives. Although I would like to make the models objective-agnostic at first, I think it would be important to implement this because:

I will implement this as soon as possible.

kaizhuang commented 11 years ago

the current option is to use the detect_biomass_reaction() method, which is not a very elegant way to do it (and it is not generalizable to models that may not have a biomass reaction)

Why don’t we just add a biomass_rxn attribute instead of an objective function?

we can look at the objective coefficients as the representation of our current knowledge on the "biological objective" of the cell, not as the objective of the simulation method (which may be different)

from our current knowledge of the cell, it is clear that the “biological objective" clearly varies with the organism, its environment, and its survival strategy.
many species implement futile cycles and crabtree effects etc that clearly does not maximise growth rate. similarly, one organism would use one objective when grown by itself, then use another objective when grown in a co-culture.

given that even for wild type E. coli there are several good objective function candidates (Schuetz and Sauer has a few papers pointing this out), it makes me uncomfortable to include a set objective function in the model.

I think one way to do this is to add an biomass_rxn or biomass_rxn_id attribute that is generated automatically or by hand when we make the model. Then have the maximisation of the biomass rxn flux as the default objective for FBA. This would also make writing other objective functions that works with the biomass reaction easier without using the detect_biomass_reaction() function.

I will implement this as soon as possible.

Let me know when you have done this in a branch. I’ll 100% sure it breaks the dFBA code and several other things I wrote because I remember using the detect_biomass_reaction() method several times.

Kai

On 09 Nov 2013, at 19:39, Daniel Machado notifications@github.com wrote:

I agree with both perspectives. Although I would like to make the models objective-agnostic at first, I think it would be important to implement this because:

the current option is to use the detect_biomass_reaction() method, which is not a very elegant way to do it (and it is not generalizable to models that may not have a biomass reaction)

we can look at the objective coefficients as the representation of our current knowledge on the "biological objective" of the cell, not as the objective of the simulation method (which may be different)

I will implement this as soon as possible.

— Reply to this email directly or view it on GitHub.

cdanielmachado commented 11 years ago

Solved :)

Here are the details: