cobratoolbox icon indicating copy to clipboard operation
cobratoolbox copied to clipboard

essentialRxnsTasks in checkMetabolicTasks gives wrong results due to minimizeModelFlux design

Open Bastien-N opened this issue 1 year ago • 2 comments

Good afternoon,

It recently came to my attention that there is an issue with the design of minimizeModelFlux. Indeed, by default when no value is provided for its osenseStr parameter, it will be set to the value of model.osenseStr if it exists.

However, most models (at least all that I have encountered before) have model.osenseStr = "max". This causes minimizeModelFlux to, by default, maximize the flux through models. In the context of essentialRxnsTasks, this causes a very high number of reactions to be flagged as essential. This is easily fixed by changing model.osenseStr or by setting the argument in the function to "min", however due to the name of the function it feels like an confusing behavior. In addition, the function description does indicate that the default is 'max', which is actually not technically true because if the function is called as "minimizeModelFlux(model, [])", or if model.osenseStr does not exist, osenseStr is set to "min".

An important consequence is that, when using checkMetabolicTasks to find essential reactions, the results are inaccurate if the model used as input has model.osenseStr = "max", as this relies on minimizeModelFlux within essentialRxnsTasks. This is especially problematic as the inaccuracies could very easily go unnoticed.

I believe that it would be beneficial to introduce changes to make it so that minimizeModelFlux does not maximizes flux unless explicitly requested, or at least to have this behavior described in the description of checkMetabolicTasks.

Best regards, Bastien Nihant I hereby confirm that I have:

  • [x] Tried to solve the issue on my own
  • [x] Retried to run my code with the latest version of The COBRA Toolbox
  • [x] Checked that a similar issue has not already been opened

(Note: You may replace [ ] with [X] to check the box)

Bastien-N avatar Oct 06 '22 13:10 Bastien-N