Skip to content

Commit c1f415f

Browse files
authored
maintenance fixes, fixes #356 (#360)
* remove constant property from observable parameter and change file suffix of steady state example SBML to xml, fixes #351 * improve libSBML error printing and add SBML validation, fixes #343 * add publications to readme.md, fixes #329 * add get{Parameter,State,Observable,...}Ids function and correct respective get...Names function * proper subscripting in plotting routines, fixes #359 * fix typos * fix(python) make observable name input optional, add documentation * documentation(python) added documentation to checkLibSBMLErrors
1 parent 9740939 commit c1f415f

File tree

9 files changed

+322
-893
lines changed

9 files changed

+322
-893
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,9 @@ python/testSpeedy.py
189189
python/test.txt
190190

191191
tests/test/*
192+
192193
coverage_py.xml
194+
195+
.idea/*
196+
197+
python/examples/example_steadystate/model_steadystate_scaled/*

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ AMICI provides a multilanguage (Python, C++, Matlab) interface for the SUNDIALS
55

66
The interface was designed to provide routines for efficient gradient computation in parameter estimation of biochemical reaction models but is also applicable to a wider range of differential equation constrained optimization problems.
77

8+
## Publications
9+
10+
[Fröhlich, F., Kaltenbacher, B., Theis, F. J., & Hasenauer, J. (2017). Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks. Plos Computational Biology, 13(1), e1005331. doi: 10.1371/journal.pcbi.1005331](https://doi.org/10.1371/journal.pcbi.1005331)
11+
12+
[Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). Parameter estimation for dynamical systems with discrete events and logical operations. Bioinformatics, 33(7), 1049-1056. doi: 10.1093/bioinformatics/btw764](https://doi.org/10.1093/bioinformatics/btw764)
13+
814
## Current build status
915

1016
[![Build Status](https://travis-ci.org/ICB-DCM/AMICI.svg?branch=master)](https://travis-ci.org/ICB-DCM/AMICI)
1117
[![CodeCov](https://codecov.io/gh/ICB-DCM/AMICI/branch/master/graph/badge.svg)](https://codecov.io/gh/ICB-DCM/AMICI)
12-
13-

include/amici/model.h

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ namespace amici {
517517
*/
518518
virtual std::vector<std::string> getParameterNames() const { return std::vector<std::string>(); }
519519

520-
521520
/**
522521
* @brief Reports whether the model has state names set.
523522
* @return
@@ -553,6 +552,54 @@ namespace amici {
553552
* @return the names
554553
*/
555554
virtual std::vector<std::string> getObservableNames() const { return std::vector<std::string>(); }
555+
556+
/**
557+
* @brief Reports whether the model has parameter ids set.
558+
* @return
559+
*/
560+
virtual bool hasParameterIds() const { return np() && !getParameterIds().empty(); }
561+
562+
/**
563+
* @brief Get ids of the model parameters
564+
* @return the ids
565+
*/
566+
virtual std::vector<std::string> getParameterIds() const { return std::vector<std::string>(); }
567+
568+
/**
569+
* @brief Reports whether the model has state ids set.
570+
* @return
571+
*/
572+
virtual bool hasStateIds() const { return nx && !getStateIds().empty(); }
573+
574+
/**
575+
* @brief Get ids of the model states
576+
* @return the ids
577+
*/
578+
virtual std::vector<std::string> getStateIds() const { return std::vector<std::string>(); }
579+
580+
/**
581+
* @brief Reports whether the model has fixed parameter ids set.
582+
* @return
583+
*/
584+
virtual bool hasFixedParameterIds() const { return nk() && !getFixedParameterIds().empty(); }
585+
586+
/**
587+
* @brief Get ids of the fixed model parameters
588+
* @return the ids
589+
*/
590+
virtual std::vector<std::string> getFixedParameterIds() const { return std::vector<std::string>(); }
591+
592+
/**
593+
* @brief Reports whether the model has observable ids set.
594+
* @return
595+
*/
596+
virtual bool hasObservableIds() const { return ny && !getObservableIds().empty(); }
597+
598+
/**
599+
* @brief Get ids of the observables
600+
* @return the ids
601+
*/
602+
virtual std::vector<std::string> getObservableIds() const { return std::vector<std::string>(); }
556603

557604
/** number of states */
558605
const int nx;

python/amici/plotting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def plotStateTrajectories(rdata, state_indices=None, ax = None):
2020
if not state_indices:
2121
state_indices = range(rdata['x'].shape[1])
2222
for ix in state_indices:
23-
ax.plot(rdata['t'], rdata['x'][:, ix], label='$x_%d$' % ix)
23+
ax.plot(rdata['t'], rdata['x'][:, ix], label='$x_{%d}$' % ix)
2424
ax.set_xlabel('$t$ (s)')
2525
ax.set_ylabel('$x_i(t)$ (mmol/ml)')
2626
ax.legend()
@@ -45,7 +45,7 @@ def plotObservableTrajectories(rdata, observable_indices=None, ax = None):
4545
if not observable_indices:
4646
observable_indices = range(rdata['y'].shape[1])
4747
for iy in observable_indices:
48-
ax.plot(rdata['t'], rdata['y'][:, iy], label='$y_%d$' % iy)
48+
ax.plot(rdata['t'], rdata['y'][:, iy], label='$y_{%d}$' % iy)
4949
ax.set_xlabel('$t$ (s)')
5050
ax.set_ylabel('$y_i(t)$ (AU)')
5151
ax.legend()

0 commit comments

Comments
 (0)