Open dweindl opened 4 years ago
Some notes from discussion with @FFroehlich about enabling use of PySB models:
observableFormula
and noiseFormula
in the measurement table, but one would reference pysb.Expression
IDs there.pysb.Initial
s.sbml_files
needs to be generalized or an additional field needs to be added. (Would one want to allow combining models of different formats?) class Model
base classclass SbmlModel
class PysbModel
I had the problem that my model was specified in BNGL and I wanted to create a PEtab problem from it to test several optimizers. SBML export from BNGL worked well, but PEtab did not support many of the characters used in the SBML export, so I wrote a script to remove them.
From my perspective the main advantage of rule-based modelling languages is the higher level of abstraction in model formulation. I think it would be good if PEtab for rule-based modelling languages would support the same level of abstraction, i.e. use patterns rather than species (except that a pattern may uniquely specify a species). In particular, this would be the case for initial concentrations in the conditions table and observableFormula
and noiseFormula
in the observable table (probably the whole observable table could become optional for rule-based models, as they allow explicit observable specification anyway, which is in contrast to SBML as far as I know; a reasonable default could be chosen for the noiseFormula
).
For optimisation toolboxes that only work with SBML, one could provide a petab.Problem.to_sbml
method that relies on the export functionality of BNGL/PySB. Sure, some auto-converted SBML species names and observableFormula
s would be ugly, but (a) I see no need to write the auto-converted PEtab problem to files (other than for debugging purposes) and (b) even if they are inspected by humans, I could not think of a more systematic and concise way to represent the combinatorial complexity arising from rule-based models (I guess the developers of rule-based languages have spent a lot of thought on that).
Like I said above, I would benefit from BNGL or PySB support myself and would be happy to contribute as far as my abilities allow.
Thanks for sharing your views @paulflang.
Agreed, that it would be convenient to allow for patterns in observable/noise formulas and species in the condition table. Might be a bit of a pain to parse, but should be feasible.
For optimisation toolboxes that only work with SBML, one could provide a petab.Problem.to_sbml method that relies on the export functionality of BNGL/PySB.
Sounds useful.
Hey, I'm one of the PySB developers, this sounds like something that would be useful. Happy to support this from the PySB side, if anything needs adding there.
Re: Species IDs, you're correct @dweindl that species aren't canonically named in PySB, since they're generated at runtime via network generation. However, observables are named in a PySB model, so one option would be to refer to observables directly. Likewise for initial conditions, which typically refer to a named parameter (or a constant expression, which are also named).
Hi @alubbock, great to hear that. I had some further discussion with @FFroehlich and I think we have a rough plan. We'll post an update here soon. It would be mostly what you suggested, i.e., having initials and observables defined in the PySB model and only referencing those in the other PEtab files.
It took significantly longer than expected, but we finally posted a proposal to allow for different model formats in PEtab -> https://github.com/PEtab-dev/PEtab/pull/538
Would be great if PEtab would be usable with non-SBML models. Formats to consider would include e.g. cellML, bngl, pysb, .... Personally interested in pysb support.
Will be a significant implementation effort, but probably worth it. Need to abstract from model implementation. For preparation, all
libsbml.Model
instances should be replaced by newclass Model
, abstract base class. Concrete implementations would beSbmlModel
,PysbModel
, ...This does not imply any changes in file formats (yet). For the next format update, it would be good to already think about how to handle that e.g. in yaml files. Allow for
sbml_model_file
,xx_model_file
, ... or addmodel_type
?Anybody interested in joining in for that?