DD-DeCaF / simulations

Model service which takes care of adjusting model according to incoming messages and returns information such as fluxes, theoretical maximum yields, etc
Apache License 2.0
0 stars 1 forks source link

Feat/add gecko functions #147

Closed BenjaSanchez closed 4 years ago

BenjaSanchez commented 4 years ago

closes https://github.com/DD-DeCaF/scrum/issues/1085

Proteomics can now be added to the model as constraints using a driven card. To enable feasible simulations, a preliminar iterative flexibilization step is added that will make the model grow at least at a minimal_growth = inputted measurement - uncertainty. If growth rate is not provided, this step is skipped.

@kvikshaug @carrascomj I decided to skip for now the option of including uptake_secretion_rates as I realized that apply_measurements needs to be modified to properly match exchange reactions in ecModels (will create a separate card for this)

codecov-io commented 4 years ago

Codecov Report

Merging #147 into devel will increase coverage by 1.93%. The diff coverage is 92.68%.

Impacted file tree graph

@@            Coverage Diff            @@
##           devel     #147      +/-   ##
=========================================
+ Coverage   72.5%   74.44%   +1.93%     
=========================================
  Files         20       20              
  Lines        822      896      +74     
=========================================
+ Hits         596      667      +71     
- Misses       226      229       +3
Impacted Files Coverage Δ
src/simulations/resources.py 84.21% <ø> (ø) :arrow_up:
src/simulations/modeling/adapter.py 63.88% <100%> (+4.19%) :arrow_up:
src/simulations/storage.py 84% <100%> (+0.32%) :arrow_up:
src/simulations/schemas.py 100% <100%> (ø) :arrow_up:
src/simulations/modeling/driven.py 86.6% <88.88%> (+3.79%) :arrow_up:

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 f639f07...a1e7b84. Read the comment docs.

BenjaSanchez commented 4 years ago

@kvikshaug addressed all of your comments, thanks for the review! I also added some fixes of things I discovered while including your corrections (handle no uncertainty in proteomics, proper order of inputs in apply_measurements, save unmatched proteins as warnings and not errors).

Note: This branch should not be merged until the identifier field of proteomics matches in backend and frontend (see https://github.com/DD-DeCaF/scrum/issues/1167), otherwise we cannot do proper testing in frontend. Will add backend tests next week :)

BenjaSanchez commented 4 years ago

@kvikshaug done with backend tests! expanded test_measurements_adapter to test proteomics on both a normal model (no change) and an ecModel. I used a fake proteomics dataset that forces the ecModel to flexibilize 2 proteins, and leaves 1 protein out that is not matched. With this all routines in driven are also tested, without introducing too much additional computational time (from 32 seconds to 45 seconds)