Chaste icon indicating copy to clipboard operation
Chaste copied to clipboard

Enable importing of SBML models into Chaste

Open kwabenantim opened this issue 1 year ago • 4 comments

Background

  • SBML and CellML are now widely adopted for defining and sharing models of subcellular biological processes.
  • @MauriceHendrix and @mirams have developed chaste-codegen as a Python 3 replacement for Chaste’s CellML-to-Chaste-C++ converter.
  • Other preliminary work by @jmosborne has investigated using libSBML to parse SBML files and create Chaste-compatible C++ classes specifying subcellular reaction networks (SBMLChaste).

Scope of Work Building on these efforts, we will:

  • Extend the primary Chaste codebase to enable all users to import new/existing SBML models for gene regulatory networks and signalling pathways.
  • Seek to validate these SBML capabilities through external compliance testing (https://synonym.caltech.edu/software/sbml-test-suite).

kwabenantim avatar Jul 04 '23 12:07 kwabenantim

Roadmap

  • [ ] SRN Models
    • [x] Start with existing code from SBMLChaste.
      • [x] Check that existing code works with current Chaste develop.
      • [x] Check that existing code generator works with Python 3.
    • [ ] No cell-cell communication:
      • [x] Generate C++ Chaste code for simpler models that do not need cell-cell coupling e.g. Goldbeter (1991).
      • [ ] Add tests to check that generated model matches expected model.
      • [x] Check that generated models pass existing Chaste tests.
    • [ ] Cell-cell communication:
      • [ ] Generate C++ Chaste code for models that require cell-cell coupling e.g. Van Leeuwen (2007).
      • [ ] Add tests to check that generated model matches expected model.
      • [ ] Check that generated models pass existing Chaste tests.
  • [ ] Cell-Cycle Models
    • [ ] Generate cell-cycle models from SBML for models that already exist in Chaste e.g. WntCellCycleModel.
      • [ ] Work out how to handle events (this isn't a consideration for SRN models).
        • [ ] Try using CVODE root finding to look for ODE events e.g. cell size drops to 0.
    • [ ] Add tests to check that generated model matches expected model.
    • [ ] Check that generated models pass existing Chaste tests.
  • [ ] Project
    • [x] Create a separate chaste_codegen_sbml project.
    • [x] Pin specific versions of libSBML and other dependencies.
    • [ ] Use similar test setup as chaste_codegen i.e. use CMake to create a virtualenv etc.
      • [x] Use same virtualenv as chaste_codegen to avoid slowing down configuration.
      • [ ] Consider merging chaste_codegen_sbml and chaste_codegen into same package, perhaps one package with two submodules, one for cellml and the other for sbml.
    • [ ] Allow run-time / compile-time code generation from Chaste, similar to approach used in chaste_codegen.

Other

  • [ ] Update https://en.wikipedia.org/wiki/List_of_systems_biology_modeling_software

kwabenantim avatar Oct 10 '23 08:10 kwabenantim

Goldbeter (1991)

Notes

  • Chaste C++ model was generated successfully from SBML using SBMLChaste.
  • There are some differences in implementation between the generated model and the existing Chaste model.
  • Current tests do not work for generated model due to implementation differences. For example:
    • Missing expected GetC(), GetM(), and GetX() methods to return state variables.
    • OdeSystem and SrnModel are combined in a single file in the generated model but separated in the original Chaste implementation.
    • Some code that needs fixing e.g. double activation of cdc2 kinase = cell * (1 + -1 * CDC-2 Kinase) * V1 * pow(K1 + -1 * CDC-2 Kinase + 1, -1);

Tests

  • [x] TestGoldbeter1991CellSrn
    • Fix variable names.
    • Fix generated ODE number of parameters from 5 to 3.
    • Add methods to get state variables. Use variable names for clarity.
    • Disable "timescale conversions".
    • SetDt(0.1)
    • Use the RungeKutta4IvpOdeSolver solver, same as the existing class.
  • [x] TestGoldbeter1991OdeSystem
  • [x] TestGoldbeter1991OdeBasedSrnModels
    • Model identifier is "SbmlSrnWrapperModel-GoldbeterOdeSystem-3".

kwabenantim avatar Oct 24 '23 07:10 kwabenantim

I would think GetM() etc. methods should be replaced by ones that follow the OdeSystemInformation form, e.g. GetVariable("M") or GetParameter("M") etc. (automatically available when OdeSystemInformation in the hpp is complete.)

mirams avatar Oct 24 '23 21:10 mirams

Work is in a separate chaste_codegen_sbml project.

mirams avatar Oct 31 '23 09:10 mirams