Skip to main content

Utilities for working with the Kinetic Simulation Algorithm Ontology (KiSAO)

Project description

Python package for working with the the Kinetic Simulation Algorithm Ontology (KiSAO), an ontology of algorithms for simulating and analyzing biological models, as well as the characteristics of these algorithms, their input parameters, and their outputs.

Installing this package

Requirements

  • Python >= 3.7

  • pip

Installation

Please run the following command to install this package:

pip install kisao

To generate a matrix of the substitutability among algorithms, install this package with the substitutability-matrix option:

pip install kisao[substitutability-matrix]

Tutorial

from kisao import Kisao
from kisao import utils
from kisao.data_model import AlgorithmSubstitutionPolicy

# load the ontology
kisao = Kisao()

# get a term
term = kisao.get_term('KISAO_0000019')

# get the name of the term
term.name
>> 'CVODE'

# get sets of methods
algs = utils.get_ode_algorithms()
sorted([alg.name for alg in algs])[0:5]
>> [
      'Adams method',
      'Adams predictor-corrector method',
      'Adams-Bashforth method',
      'Adams-Moulton method',
      'Bader-Deuflhard method',
   ]

algs = utils.get_sde_algorithms()
algs = utils.get_pde_algorithms()
algs = utils.get_tau_leaping_algorithms()
algs = utils.get_ode_algorithms()
algs = utils.get_gillespie_like_algorithms()
algs = utils.get_tau_leaping_algorithms()
algs = utils.get_rule_based_algorithms()
algs = utils.get_sde_algorithms()
algs = utils.get_pde_algorithms()
algs = utils.get_flux_balance_algorithms()
algs = utils.get_logical_algorithms()
algs = utils.get_hybrid_algorithms()

# get a set of substitutable algorithms for a specific substitution policy
cvode = kisao.get_term('KISAO_0000019')
euler_forward = kisao.get_term('KISAO_0000030')
lsoda = kisao.get_term('KISAO_0000088')
lsodar = kisao.get_term('KISAO_0000089')
fba = kisao.get_term('KISAO_0000437')
fva = kisao.get_term('KISAO_0000526')

alt_algs = utils.get_substitutable_algorithms_for_policy(cvode,
    substitution_policy=AlgorithmSubstitutionPolicy.SIMILAR_APPROXIMATIONS)
sorted([alt_alg.name for alt_alg in alt_algs])[0:5]
>> [
      'Adams method',
      'Adams predictor-corrector method',
      'Adams-Bashforth method',
      'Adams-Moulton method',
      'Bader-Deuflhard method',
   ]

# get a preferred substitution for an algorithm
requested_alg = lsoda
implemented_algs_in_preferred_order = [cvode, lsoda, lsodar, euler_forward]
alt_alg = utils.get_preferred_substitute_algorithm(requested_alg, implemented_algs_in_preferred_order,
    substitution_policy=AlgorithmSubstitutionPolicy.SIMILAR_APPROXIMATIONS)
alt_alg.name
>> 'LSODA'

requested_alg = lsoda
implemented_algs_in_preferred_order = [cvode, euler_forward]
alt_alg = utils.get_preferred_substitute_algorithm(requested_alg, implemented_algs_in_preferred_order,
    substitution_policy=AlgorithmSubstitutionPolicy.SIMILAR_APPROXIMATIONS)
alt_alg.name
>> 'CVODE'

requested_alg = lsoda
implemented_algs_in_preferred_order = [fba, fva]
alt_alg = utils.get_preferred_substitute_algorithm(requested_alg, implemented_algs_in_preferred_order,
    substitution_policy=AlgorithmSubstitutionPolicy.SIMILAR_APPROXIMATIONS)
alt_alg
>> None

Browsing KiSAO

KiSAO can be browsed through BioPortal and OLS.

Browsing the substitutability of algorithms catalogued by KiSAO

A matrix of the substitutability of algorithms catalogued by KiSAO is available here. The documentation for this package describes the queries and rules used to define this matrix.

Contributing to KiSAO

Please see the KiSAO repository for information about contributing to KiSAO and this package.

License

This package is released under Artistic License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kisao-2.30.tar.gz (107.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kisao-2.30-py2.py3-none-any.whl (109.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file kisao-2.30.tar.gz.

File metadata

  • Download URL: kisao-2.30.tar.gz
  • Upload date:
  • Size: 107.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kisao-2.30.tar.gz
Algorithm Hash digest
SHA256 e94e1aef646c5db476a4d49559458f2e336ff02afdb04f1ede96959fadf838fb
MD5 587c3f80c4307c4732f8b0757c5d23ee
BLAKE2b-256 eae1cf1fdf5f3799292844cf2c96e59836966d8285b1ff4070792be024867663

See more details on using hashes here.

File details

Details for the file kisao-2.30-py2.py3-none-any.whl.

File metadata

  • Download URL: kisao-2.30-py2.py3-none-any.whl
  • Upload date:
  • Size: 109.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kisao-2.30-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 62bd00e37113c2fd4128f0503f41d8315e92c5c65183b420cb687fd7e19506a2
MD5 41158413710ea9f4c63ba91c82493368
BLAKE2b-256 e1b315d99ab995ae4388ca03fb77623f1102cc54d5976dc495e0365ccc6a1377

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page