segrelab / GEM2CUE

MIT License
0 stars 0 forks source link

Handle compartment nomenclature #1

Open michaelsilverstein opened 2 years ago

michaelsilverstein commented 2 years ago

BIGG names compartments as e whereas CarveMe uses C_e. Handling:

  1. Infer compartment: default, throw a warning if inferred, throw an error if we can't infer
  2. Force options on user: preference, but prevents unskilled users

For inference, need checkpoint to ensure that all models contain shared compartment

Unittest: on BIGG and CarveMe model

michaelsilverstein commented 2 years ago

Proposal: we can use the compartment for reactions model.exchanges to find the name of the extracellular compartment.

Reactions are classified as "exchange" reactions if it has no reactants or products (model.reaction.boundary = True).

Here is where model.exchanges is define: https://github.com/opencobra/cobrapy/blob/e838e5403be7243a18dc7ae10e26551cb28d21cc/src/cobra/core/model.py#L966-L972

Where model.reaction.boundary is defined: https://github.com/opencobra/cobrapy/blob/dc68ee66f6192ad02687aa2da12def3cfe36513d/src/cobra/core/reaction.py#L537-L543

Cobrapy even relies on e in compartment name: https://github.com/opencobra/cobrapy/blob/e838e5403be7243a18dc7ae10e26551cb28d21cc/src/cobra/medium/boundary_types.py#L29-L59