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

Allow initial concentrations / sizes in condition table #238

Merged
merged 10 commits into from
Jan 22, 2020

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Jan 21, 2020

@LeonardSchmiester:

  • Update documentation

@dweindl:

  • Add special handling for compartments when checking condition table
  • .. add test case
  • Ensure NaN is considered valid input
  • .. add test case
    - [ ] Add something like get_initial_states()
    - [ ] .. add test case

@codecov-io
Copy link

codecov-io commented Jan 21, 2020

Codecov Report

Merging #238 into develop will increase coverage by 0.21%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #238      +/-   ##
===========================================
+ Coverage    77.94%   78.16%   +0.21%     
===========================================
  Files           20       20              
  Lines         1424     1424              
  Branches       313      313              
===========================================
+ Hits          1110     1113       +3     
+ Misses         249      247       -2     
+ Partials        65       64       -1
Impacted Files Coverage Δ
petab/lint.py 75.66% <ø> (+0.88%) ⬆️
petab/parameter_mapping.py 73.12% <100%> (ø) ⬆️
petab/format_version.py 100% <0%> (+100%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30851c9...755fe26. Read the comment docs.

.pylintrc Show resolved Hide resolved
doc/documentation_data_format.md Outdated Show resolved Hide resolved
doc/documentation_data_format.md Outdated Show resolved Hide resolved
Column names are global parameter IDs or IDs of constant species as given in
the SBML model. These parameters will override any parameter values specified
in the model. `parameterOrStateId`s and `conditionId`s must be unique.
Column names are global parameter IDs, IDs of species or compartments as given
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Column names are global parameter IDs, IDs of species or compartments as given
Column names are global parameter IDs, or IDs of species or compartments defined

concentration/amount given in the SBML model or given by a preequilibration
condition. If `NaN` is provided for a condition, the result of the
preequilibration (or initial concentration/amount from the SBML model, if no
preequilibration is defined) is used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for understanding: so when there is a species id defined, but there is also preeq. then the species value overrides whatever comes out of the preeq, s.t. the preeq does not actually need to be run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you specify all initial conditions here, and if for the simulationCondition all of them are non-NaN, then you could as well skip preequlibration. This is only useful (and sometimes required, since you generally can't just preequilibrate a subset of the model) if you do not add/overwrite all initial conditions here.

preequilibration (or initial concentration/amount from the SBML model, if no
preequilibration is defined) is used.

If a compartment Id is provided, it is interpreted as the initial compartment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind id, ID, Id


Values for condition parameters may be provided either as numeric values, or
as parameter IDs. In case parameter IDs are provided, they need to be defined
in the SBML model, the parameter table or both.
as IDs defined in the SBML model, the parameter table or both.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would be a scenario where the id is only defined in the parameter table and it is to be overwritten in a condition-specific manner?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could set output parameters in a condition-specific manner, avoiding the not so aesthetic observableParameter1_observableId construct.


Additional columns are *not* allowed.

*Note 1:* Instead of adding additional columns to the condition table, they
can easily be added to a separate file, since every row of the condition table
has `parameterId` as unique key.
has `parameterOrStateId` as unique key.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameterOrStateOrCompartmentId. But I still don't understand the sentence.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still wrong, rows are conditions. I removed the whole sentence. Doesn't really belong here, and at the time this sentence was correct, it was probably an answer to a not asked question.


Row- and column-ordering are arbitrary, although specifying `parameterId`
first may improve human readability. The `conditionName` column is optional.
first may improve human readability. The `conditionName` column is optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why parameterId first? you mean conditionId?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. As previous. This was from the days where the table was transposed. Never got updated...

@dweindl dweindl merged commit a58b79f into develop Jan 22, 2020
@dweindl dweindl deleted the feature_181_initials branch January 22, 2020 20:06
@dweindl dweindl mentioned this pull request Jan 28, 2020
dweindl added a commit that referenced this pull request Jan 29, 2020
Release 0.1.0

Data format:

* Introduce observables table instead of SBML assignment rules for defining
  observation model (#244) (moves observableTransformation and noiseModel
  from the measurement table to the observables table)
* Allow initial concentrations / sizes in condition table (#238)
* Fixes and clarifications in the format documentation
* Changes in prior columns of the parameter table (#222)
* Introduced separate version number of file format, this release being
  version 1

Library:

* Adaptations to new file formats
* Various bugfixes and clean-up, especially in visualization and validator
* Parameter mapping changed to include all model parameters and not only
  those differing from the ones defined inside the SBML model
* Introduced constants for all field names and string options, replacing
  most string literals in the code (#228)
* Added unit tests and additional format validation steps
* Optional parallelization of parameter mapping (#205)
* Extended documentation (in-source and example Jupyter notebooks)
LeonardSchmiester added a commit that referenced this pull request Feb 11, 2020
* Add pylint config

* Fixes ys (#237)

* fix merge error

* add petablint yaml test

* add parameters test

* Parameter mapping should include all model parameters (#235)

Closes #103

* Parameter mapping should include all model parameters
* Known values should be filled in
* Extend and update tests
* Refactor parameter mapping
* properly handle estimated and non-estimated parameters
* Fix wrong parameter scale returned from mapping
* ...

* Allow initial concentrations / sizes in condition table (#238)

* Allow species and compartments in condition table

* Updated doc allowing for states etc in condition file

* Update pylint: allow lower-case constants

* Export __format_version__

* Fix returning floats as strings in case there are parameter names in the condition table

Co-authored-by: LeonardSchmiester <leonard.schmiester@helmholtz-muenchen.de>

* Barplots and Replicates with Simulation data (#214)

Fixes #196, fixes #210, fixes #213

* Cleanup visualization (#240)

* Add constants for visualization field IDs
* .. and some others
* start using them
* formatting, ...

* Observables table instead of SBML assignment rules (#244)

Closes #201, closes #241 

* Update data format doc for observable table

* Add field name constants for observable table

* Add observables table to petab.Problem

* Update YAML schema and CompositeProblem

* Add functions for writing PEtab dataframes to files

* Deprecate SBML-observable functions

* Implement validation for observable table

* Add function for converting SBML-observable models to observable table

* Use costants for PEtab table fields

* Update PEtab files illustration

* Fix most pylint issues (Closes #234)

* Update vis to observalble table (Closes #246)

  No need to check for equal NOISE_DISTRIBUTION and OBSERVABLE_TRANSFORMATION anymore, so they are no longer included in the measurement table, and cannot differ for the same observableId

* Fix and update flatten_timepoint_specific_output_overrides

  Closes #247

  Was creating wrong observables before

* Address review comments

  Co-authored-by: Yannik Schälte <31767307+yannikschaelte@users.noreply.github.com>

* Release 0.1.0; file format version 1

* Fix parameter mapping: include output parameters not present in SBML model

* Add convenience functions to petab.Problem

* get_optimization_parameter_scales
* get_optimization_to_simulation_scale_mapping
* add tests

* Fix petab/petab_schema.yaml missing in pypi package

* Update pylint ignorelist

* Update README

* Remove obsolete functions

... related to hierarchical optimization, which should be kept outside PEtab

* Let get_placeholders return an (ordered) list of placeholders

because it is much more useful

* Add check for valid identifiers (Closes #179) (#253)

Co-authored-by: Polina Lakrisenko <p.lakrisenko@gmail.com>

* Deprecate petab.problem.from_folder (Closes #245)

... as well as get_default_*_file_name

* Release 0.1.1

* Barplot uniform coloring & yScale=log fix #196 (#255)


* resolves #197

* small fix

* change all barplot colors to blue

* allow to extract only estimate parameters (#256)

* allow to extract only estimate parameters

* add docstrings

* Visu callobs par (#262)

* fix #261

* corrected flake8 error - line too long

* deleted white space

* add F403 to falke8 tests

* Fix handling of numeric observable/noiseFormula in observable table (Fixes #264)

* Add properties for fixed/free and scaled values (#268)

* allow to extract only estimate parameters

* add docstrings

* return scaled versions of arrays

* Update petab/problem.py

Co-Authored-By: Daniel Weindl <dweindl@users.noreply.github.com>

Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>

* Observables function (#269)

* allow to extract only estimate parameters

* add docstrings

* return scaled versions of arrays

* Update petab/problem.py

Co-Authored-By: Daniel Weindl <dweindl@users.noreply.github.com>

* add get_observables function

* add observables test; use observables file in petab test

* fix typo

* move get_observables to ..._ids

* remove unused arg

* add docstring

* fix lint

* fix pylint

* fix flake8

Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>

* Fix documentation hierarchy

* Add functions to get all of fixed|free, scaled parameter values (#273)

* allow to extract only estimate parameters

* add docstrings

* return scaled versions of arrays

* Update petab/problem.py

Co-Authored-By: Daniel Weindl <dweindl@users.noreply.github.com>

* add get_observables function

* add observables test; use observables file in petab test

* fix typo

* move get_observables to ..._ids

* remove unused arg

* add docstring

* fix lint

* fix pylint

* fix flake8

* fix typo

* streamline fixed|free|all, and scaled values

* fix default args

* fix codacy

* address reviewer comment: return empty list

* add docstring#

* add more docstrings

* fix var type error

* address reviewer comments

Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>

* Default column to look for simulation results should be 'simulation'

* PEtab COMBINE archives (#271)

* Add create_combine_archive for generation of COMBINE archives

* Add support for reading PEtab COMBINE archives

* Add tests for COMBINE archive r/w

* Fix sbml_observables_to_table - got broken in eb5453

* Increase test coverage (#278)

* allow to extract only estimate parameters

* add docstrings

* return scaled versions of arrays

* Update petab/problem.py

Co-Authored-By: Daniel Weindl <dweindl@users.noreply.github.com>

* add get_observables function

* add observables test; use observables file in petab test

* fix typo

* move get_observables to ..._ids

* remove unused arg

* add docstring

* fix lint

* fix pylint

* fix flake8

* fix typo

* streamline fixed|free|all, and scaled values

* fix default args

* fix codacy

* address reviewer comment: return empty list

* add docstring#

* add more docstrings

* fix var type error

* address reviewer comments

* add parameter properties test

* add tests for get/write_parameter_df

* add measurements tests

* add conditions tests

* fix conditions create function

* add parameter tests

* add observables tests

* fixup

* add docstrings

* address reviewer comments

* random edit to see if codacy is happy

* random stuff to annoy codecov

Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>

Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
Co-authored-by: Yannik Schälte <31767307+yannikschaelte@users.noreply.github.com>
Co-authored-by: LeonardSchmiester <leonard.schmiester@helmholtz-muenchen.de>
Co-authored-by: Simon Merkt <49190262+MerktSimon@users.noreply.github.com>
Co-authored-by: Polina Lakrisenko <p.lakrisenko@gmail.com>
Co-authored-by: LaraFuhrmann <55209716+LaraFuhrmann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants