Code Monkey home page Code Monkey logo

biosustain / pseudobatch Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 0.0 26.4 MB

The Pseudobatch transformation is a method to easy analysis of measurement from a fed-batch fermentation process. After transformation, the data can be analysed as if it was obtained from a batch fermentation process. The Pseudobatch transformation is especially useful for fed-batch processes where samples where drawn from the bioreactor.

Home Page: https://biosustain.github.io/pseudobatch/

License: MIT License

Jupyter Notebook 90.62% Python 5.61% Stan 0.52% Dockerfile 0.46% Shell 0.01% Julia 2.79%
fermentation fermentation-process microbiology fed-batch

pseudobatch's People

Contributors

teddygroves avatar viktorht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pseudobatch's Issues

Process for accessing error propagation

There will be a new python function pseudobatch.run_error_propagtion or similar, which will take the same input as the existing transformation functions, but will also take in a dictionary of error propagation inputs.

We will need to do some pydantic/panderas stuff to validate the error propagation input.

[Quality of use improvement] Verify that samples and volume loss matches

I cannot think of any situation where volume is removed and it should be not considered a sample. Therefore we could build in a verification that check that the user has given a sample volume at index' where volume is lost. Not that since there is feeding we cannot assume only assume that the sample volume is equal to or smaller than the volume drop.

Change prepend=0 to accum_feed[0]

feed_in_interval = np.diff(accum_feed, prepend=0)

In the line of code above, we calculate the feed_in_interval from the accumulated field at the moment this is the one-step-diff, i.e.
$$
feed : in : interval : i = accumfeed_i - accumfeed_{i-1}
$$

This produces nan at index i = 0. The question of the issue is what value to put in place of that nan.

I think that the correct value is accum_feed[0], because then it says that the first value in the accumulated feed vector, describes the feed during the first interval. Currently, we force this value to zero in the prepend=0. This has worked because all of our examples have accum_feed[0].

Documentation of Bayesian model and error propagation.

Waiting for #6

I suggest that we make three notebooks.

article/validation_of_bayesian_model.ipynb
Validation plots to show that the bayesian model does what we think.

article/article_error_propagation_analysis.ipynb
Here we run the sample the Bayesian model with fixed measurement error on the concentration, then compare fixed measurement error to uncertainty in the posterior of the pseudo batch transformed values. This is what we already do in A realistic examples of the error propagation section of one of the notebooks. But we will need to redo it using the Python API.

Docs/source/Tutorials/7 - Pseudobatch transformation with uncertainty
Describes how to use the Bayesian Pseudobatch API using one of the data sets.

pseudobatch_transform_pandas validate input

Current behaviour: The following call does not produce an error even though in the measured_concentration_colnames argument two columns are given, while only one conc_in_feed is given.

pseudobatch_transform(
    df=df,
    measured_concentration_colnames=['c_biomass', 'c_glucose'],
    ...
    conc_in_feed=[0]
)

When len(measured_concentration_colnames) != len(conc_in_feed) an error should be raised.

Setup Readthedocs

We need to setup the readthedocs page. As far as I can tell this requires permission from Biosustain organization admins. I an awaiting approval.

Too tight prior on f_non_zero

The f_non_zero parameter suffers from the same problem as the prior for m, i.e. that it is difficult to assign a meaningful prior for the marginal distribution. The easiest solution is to do the same as for prior_m and hardcode an extremely weakly informative prior in the error_propagation.py.

Alternatively, the y_f is excluded from the likelihood, and instead, make a random variable describes from which we can draw f's. This random variable would be f_non_zero ~ lognormal(y_f * apump, sigma_f).

Which solution do you prefer @teddygroves?

Make pseudobatch installation independent of CmdStan

Currently, the package requires CmdStan to install through pip. CmdStan is used to calculate the pseudo batch transformation with uncertainty propagation. However, most users will likely not use this functionality. CmdStan can be tricky to install, thus this will likely be a major hurdle to most potential users.

In the desired solution the following will only install the standard functions:

pip install pseudobatch

The following will also install the uncertainty propagation function and requires CmdStan:

pip install pseudobatch[uncertainty]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.