Skip to content
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

Create new 'DAE Solver' category; put IDA-like things in it. #115

Merged
merged 7 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/BioPortal-submission.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"ontology": "https://data.bioontology.org/ontologies/KISAO",
"pullLocation": "https://raw.githubusercontent.com/SED-ML/KiSAO/2.32/kisao.owl",
"pullLocation": "https://raw.githubusercontent.com/SED-ML/KiSAO/2.34/kisao.owl",
"hasOntologyLanguage": "OWL",
"description": "The Kinetic Simulation Algorithm Ontology (KiSAO) is an ontology of algorithms for simulating and analyzing biological models, as well as the characteristics of these algorithms, their input parameters, and their outputs. In addition, KiSAO captures relationships among algorithms, their parameters, and their outputs.",
"version": "2.32",
"version": "2.34",
"released": "2023-05-24T02:54:00-00:00",
"status": "production",
"homepage": "http://biomodels.net/kisao/",
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.34 (OWL 2)
- Added organizational 'DAE solver' (`KISAO_0000699`) for collecting solvers that can solve DAE problems.
- Removed 'has characteristic' some 'differential-algebraic equation problem' from KINSOL and from 'method for solving a system of linear equations'.
- The characteristics 'differential-algebraic equation problem' and ''ordinary differential equation problem' are no longer disjoint (and in fact the former are a complete subset of the latter).

## 2.33 (OWL 2)
- Reorganized the steady state algorithms: moved flux balance and steady state to 'general steady state method' (`KISAO_0000630`), and others to the 'steady state root-finding method' (`KISAO_0000407`)

## 2.32 (OWL 2)
- Added algorithm concepts for eQuilibrator.
- Added organizational 'ODE solver' (`KISAO_0000694`) for noting in SED-ML that some solver should be used, but which is not important.
Expand Down
158 changes: 137 additions & 21 deletions kisao.owl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kisao_full.owl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<rdfs:comment xml:lang="en">Kinetic Simulation Algorithm Ontology (full version, containing deprecated classes)</rdfs:comment>
<rdfs:seeAlso rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://co.mbine.org/standards/kisao</rdfs:seeAlso>
<rdfs:seeAlso rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://identifiers.org/pubmed/22027554</rdfs:seeAlso>
<owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">2.33</owl:versionInfo>
<owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">2.34</owl:versionInfo>
<skos:definition xml:lang="en">The Kinetic Simulation Algorithm Ontology (KiSAO) classifies algorithms available for the simulation and analysis of models in biology, and their characteristics and the parameters required for their use.</skos:definition>
</owl:Ontology>

Expand Down
2 changes: 1 addition & 1 deletion libkisao/python/kisao/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.33'
__version__ = '2.34'
5 changes: 3 additions & 2 deletions libkisao/python/kisao/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@

ID_HAS_CHARACTERISTIC_RELATIONSHIP = 'KISAO_0000245' # has characteristic

ID_ODE_PROBLEM_CHARACTERISTIC = 'KISAO_0000374' # ordinary differential equation problem
ID_SDE_PROBLEM_CHARACTERISTIC = 'KISAO_0000371' # stochastic differential equation problem
ID_STEADYSTATE_PROBLEM_CHARACTERISTIC = 'KISAO_0000696' # steady state root-finding problem
ID_PDE_PROBLEM_CHARACTERISTIC = 'KISAO_0000372' # partial differential equation problem
ID_DAE_PROBLEM_CHARACTERISTIC = 'KISAO_0000373' # differential algebraic equation problem
ID_ODE_PROBLEM_CHARACTERISTIC = 'KISAO_0000374' # ordinary differential equation problem
ID_STEADYSTATE_PROBLEM_CHARACTERISTIC = 'KISAO_0000696' # steady state root-finding problem
ID_EXACT_SOLUTION_CHARACTERISTIC = 'KISAO_0000236' # exact solution
ID_APPROXIMATE_SOLUTION_CHARACTERISTIC = 'KISAO_0000237' # approximate solution

Expand Down
14 changes: 14 additions & 0 deletions libkisao/python/kisao/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
ID_SDE_PROBLEM_CHARACTERISTIC,
ID_STEADYSTATE_PROBLEM_CHARACTERISTIC,
ID_PDE_PROBLEM_CHARACTERISTIC,
ID_DAE_PROBLEM_CHARACTERISTIC,
ID_EXACT_SOLUTION_CHARACTERISTIC,
ID_APPROXIMATE_SOLUTION_CHARACTERISTIC,
ID_ALGORITHM,
Expand Down Expand Up @@ -45,6 +46,7 @@
'get_rule_based_algorithms',
'get_sde_algorithms',
'get_pde_algorithms',
'get_dae_algorithms',
'get_flux_balance_algorithms',
'get_logical_simulation_algorithms',
'get_logical_stable_state_search_algorithms',
Expand Down Expand Up @@ -140,6 +142,18 @@ def get_ode_algorithms():
return get_terms_with_characteristics([ID_ALGORITHM], [ID_ODE_PROBLEM_CHARACTERISTIC])


@ functools.lru_cache(maxsize=None)
def get_dae_algorithms():
""" Get the terms for DAE integration algorithms::

'modelling simulation algorithm' and 'has characteristic' some 'differential algebraic equation problem'

Returns:
:obj:`set` of :obj:`pronto.Term`: terms
"""
return get_terms_with_characteristics([ID_ALGORITHM], [ID_DAE_PROBLEM_CHARACTERISTIC])


@ functools.lru_cache(maxsize=None)
def get_gillespie_like_algorithms(exact=True, approximate=False):
""" Get the terms for algorithms that execute similar simulations to Gillespie's
Expand Down
21 changes: 20 additions & 1 deletion libkisao/python/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def test_ode_algorithms(self):
self.assertIn(kisao.get_term('KISAO_0000086'), terms) # Fehlberg method
self.assertIn(kisao.get_term('KISAO_0000088'), terms) # LSODA
self.assertIn(kisao.get_term('KISAO_0000560'), terms) # LSODA/LSODAR hybrid method
self.assertIn(kisao.get_term('KISAO_0000355'), terms) # DASPK
self.assertIn(kisao.get_term('KISAO_0000283'), terms) # IDA

self.assertNotIn(kisao.get_term('KISAO_0000499'), terms) # DFBA

Expand Down Expand Up @@ -145,14 +147,31 @@ def test_sde_algorithms(self):
self.assertEqual(sdes.intersection(odes), set())
self.assertEqual(sdes.intersection(pdes), set())

def test_dae_algorithms(self):
kisao = Kisao()
daes = utils.get_dae_algorithms()
odes = utils.get_ode_algorithms()

self.assertNotIn(kisao.get_term('KISAO_0000019'), daes) # CVODE
self.assertNotIn(kisao.get_term('KISAO_0000030'), daes) # Euler forward
self.assertIn(kisao.get_term('KISAO_0000355'), daes) # DASPK
self.assertIn(kisao.get_term('KISAO_0000283'), daes) # IDA

self.assertNotIn(kisao.get_term('KISAO_0000499'), daes) # DFBA

self.assertEqual(daes.intersection(odes), daes) # subset of ODE algorithms
self.assertEqual(daes.intersection(utils.get_gillespie_like_algorithms(
exact=True, approximate=False)), set()) # disjoint from Gillespie-like terms
self.assertEqual(daes.intersection(utils.get_gillespie_like_algorithms(
exact=False, approximate=True)), set()) # disjoint from Gillespie-like terms

def test_steadystate_algorithms(self):
kisao = Kisao()
terms = utils.get_steadystate_algorithms()

self.assertIn(kisao.get_term('KISAO_0000407'), terms) # steady state root-finding algorithm
self.assertIn(kisao.get_term('KISAO_0000568'), terms) # NLEQ1
self.assertIn(kisao.get_term('KISAO_0000569'), terms) # NLEQ2
self.assertIn(kisao.get_term('KISAO_0000355'), terms) # DASPK
self.assertIn(kisao.get_term('KISAO_0000413'), terms) # Exact Newton Method

self.assertNotIn(kisao.get_term('KISAO_0000499'), terms) # DFBA
Expand Down
10 changes: 10 additions & 0 deletions updating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# What needs to be updated when making a new release

Put new version into:
* libkisao/python/kisao/_version.py
* kisao.owl (i.e. <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">2.34</owl:versionInfo>)
* kisao_full.owl (i.e. <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">2.34</owl:versionInfo>)
* .github/workflows/BioPortal-submission.json

Summarize changes in:
* CHANGELOG.md
Loading