Replies: 5 comments 11 replies
-
I put a very early draft of what I'd like to do at #1193 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Just to comment. I don't see how to a @property
def compartments(self) -> Set:
"""Return set of compartments the metabolites are in. which will remain with the same behavior. The new |
Beta Was this translation helpful? Give feedback.
-
Also GeneProducts could have compartments, but somehow indirectly.
I.e. a GeneProduct can reference a species (often used to encode the actual protein which is the gene product) which can have a localization. But this would be a bit indirect. I would suggest to not set a |
Beta Was this translation helpful? Give feedback.
-
Okay. This is for the various developers, including @Midnighter @matthiaskoenig @cdiener Related question - does Optlang (should) have any compartment features? Right now, it doesn't, and I don't think it should, but I wanted to ask as part of this discussion. |
Beta Was this translation helpful? Give feedback.
-
Moved here from the PR discussion:
MK:
For the transport reactions you just add a compartment such as id="pm" name="plasma membrane" spatialDimensions="2" and then set transport_reaction.compartment=pm. This also allows nicely to define at which interface compartments transporters are located. The spatialDimensions information is especially important in scaling of systems, because volume and area scale differently, e.g. if a cell growths. So you would scale proteins differently if a cell growths.
I agree, copying of the complete compartment is nice to have, but should not be the default behavior.
Dev meeting would be great. Would be happy to participate.
Sorry forgot. There are also many membrane bound reactions which catalyze on one side of the compartment. I.e. the enymes are associated with the membrane, but all the metabolites involved are on one side of the membrane. Inferring compartments from metabolites gives incorrect compartments here.
MB:
I don't see yet how this gives the wrong information. If an enzyme is membrane bound but carries out the reaction only in one compartment, that is where the reaction happens, right?
CD:
Agree with @Midnighter here. Reaction is a bit of an abstract concept but if you go by physical chemistry it is a collision that passes an energy threshold so it requires physical contact. So the actual reaction would still take place where the substrate is located. For channels the initial adsorption/entry takes place on one side of the membrane and secretion/export on the other side. The substrate and product would have different compartments and the reaction would have two compartments due to the multi-step nature. Which is how it is handled in cobrapy right now. If you want to specifically model what happens with the molecule inside the channel you have to add a species in the membrane compartment as well. I totally get that enzymes can have a single location in that case but reactions are not exactly the same thing.
MK:
@cdiener and @Midnighter: For scaling of reaction bounds based on RNA or protein data the incorrect compartment will give the incorrect scaling. I.e. proteins (reactions) in the membrane should be scaled based on Area, not volume. For this to work the reactions should be assigned the correct location, i.e. it happens at the membrane.
I.e.
See the following paper for discussion in the kinetic context: https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-020-03913-8
This is a big issue when using Data to set bounds for reactions, or also to just account for dilution with cell growth (e.g. in approaches such as RBA). Because cobrapy is meant as a core library on which other packages can build more complex analysis the correct handling of this cases would be important. If cobrapy is just a simple tool for FBA, never mind.
Similar issues exist for visualization algorithms using the information in SBML. The important information about the localization of the reaction at the membrane is lost and the network is visualized incorrectly.
Yes, it makes sense to infer localization from metabolites if no localization information is available for the reaction. But if the user provides information this should not be discarded. I.e. it must be possible to set the compartment of a reaction and existing information should not be overwritten by heuristics.
CD:
@matthiaskoenig if the reaction happens in the membrane I think everybody agrees. But the argument from the paper seems incomplete as only one component is bound to the membrane but the other may still diffuse freely in the cytosol. If you scale the cell volume up this would still enter as a volumetric measure for that second freely diffusible component. And regarding the scope of cobrapy: as the name implies we provide infrastructure for constraint-based modeling which is admittedly not very well defined but I would say that kinetic models and (general) visualization would generally not fall within that scope. However, I do agree that information should not be dropped and we could save that either in the annotations or a separate attribute. Though it would be nice if SBML could support multiple compartments for an enzyme since membrane-bound components or channels do have parts embedded in several compartments. I am also not super eager of allowing that reactions may involve metabolites that have no overlap with the enzyme compartment now. Having a reaction assigned to the nucleus using metabolites from the extracellular space does not look right to me.
UA:
@cdiener @matthiaskoenig
I looked at the SBML standard, and it seems that only species have compartments. I think that means that per SBML, only metabolites have compartments, but I could be wrong. Compartments can have any number of dimensions between 0 and 3, so you could set up the membrane as a compartment with two dimensions (and then it would be scaled by area).
There also seems to be an ability to set up compartment type and compartment relationships using the multi plugin in SBML.
Some questions
Did I understand the SBML standard correctly?
What would you like to have compartments able to be assigned in cobrapy? Metabolites? Genes? Reactions? All of them? Would a compartment be unique to one type of object, or can the same one have genes and metabolites, for example.
MK:
@akaviaLab you are wrong. Please just look at the SBML specification. You definitely did not look in the document. Reactions have compartments.
So the main question is what to do if the compartment attribute is already set on a reaction or directly assigned. This should have precedence over any heuristics. That is all I am advocating here.
CD:
@matthiaskoenig we can't remove the reaction compartments logic in cobrapy right now due to backwards compatibility. Also the interpretation is different and more correct in cobrapy IMO as it actually ensures that reaction compartments are compatible with metabolite compartments (but we can ask the community to decide). But we can definitely store the SBML-assigned compartment and have that assigned as a different attribute like rxn.enzyme_compartment (which is what SBML seems to describe) or in the annotations. SBML writing would than use this compartment.
But either way it's unrelated to the PR and can be addressed in a separate discussion.
UA:
@matthiaskoenig @cdiener
Sorry, I got the standard wrong.
SBML requires that species have a compartment, but it seems optional for reactions (see the Reaction section 4.11.1 p 70 of the standard).
Could we set the code that if reaction compartment was set implicitly, it will be returned (and written to SBML). Otherwise, reaction.compartments keeps returning the current, which is a set of the compartments the metabolites have?
If both reactions and metabolites have compartments, I don't think it would make sense for genes to have compartments. Maybe in the future, if we want to do ME models (or similar stuff), there can be a protein that derives from gene and has compartments. Section 7.12 (p 137 of the standard). @cdiener and @Midnighter, do you agree genes shouldn't have compartments now?
Beta Was this translation helpful? Give feedback.
All reactions