-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
632 import concentration based sbml files #633
Conversation
molInfo.SetDimension(newDim); | ||
msv.Formula = _context.Create<ExplicitFormula>($"{msv.Name}_0").WithName($"{msv.Name}_0").WithDimension(amountDimension).WithFormulaString($"{baseValue.value} * {Constants.VOLUME_ALIAS}"); | ||
msv.Formula.AddObjectPath( | ||
ObjectPathFactory.CreateFormulaUsablePathFrom(ObjectPath.PARENT_CONTAINER, Constants.Parameters.VOLUME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msevestre Check the change in the call. This is why the Volume was not found before. It should not be one single string but the list of all individual paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it would be very nice to use the code base for concentration based reactions, but the way the importer is written it is not trivial to me. I would propose to keep it in mind for the future but just use this solution for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. What about the reaction rate? Aren;t they expecting concentration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msevestre I think this is related to the second PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know lol.
@@ -191,6 +196,7 @@ private void SetMoleculeStartValues(Model model) | |||
if (molInfo.GetContainer().Any(x => x.Name == msv.ContainerPath.LastOrDefault())) | |||
{ | |||
msv.IsPresent = true; | |||
msv.NegativeValuesAllowed = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for 99.9% of MSV the reasonable setting is NegativeValuesAllowed = false
If the msv entry is one of the remaining 0.1% or if there are some numerical issues - it still can be set to true by user.
@PavelBal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yuri05 is right, it can be manually set.
…lues" This reverts commit d6830f4.
molInfo.SetDimension(newDim); | ||
msv.Formula = _context.Create<ExplicitFormula>($"{msv.Name}_0").WithName($"{msv.Name}_0").WithDimension(amountDimension).WithFormulaString($"{baseValue.value} * {Constants.VOLUME_ALIAS}"); | ||
msv.Formula.AddObjectPath( | ||
ObjectPathFactory.CreateFormulaUsablePathFrom(ObjectPath.PARENT_CONTAINER, Constants.Parameters.VOLUME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. What about the reaction rate? Aren;t they expecting concentration?
{ | ||
var gkReaction = _moBiProject.ReactionBlockCollection.First().First(); | ||
var glucosePath = gkReaction.Formula.ObjectPaths.ElementAt(1); | ||
glucosePath.Last().ShouldBeEqualTo("Concentration"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the constant instead of a magic screen
} | ||
|
||
[Observation] | ||
public void ShouldParseUserDefinedFunctions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should_parse_user_defined_functions
Fixes #632 (Import from SBML File with concentration based reactions)