EnzymeML / PyEnzyme

🧬 - Data management and modeling framework based on EnzymeML.
BSD 2-Clause "Simplified" License
21 stars 9 forks source link

add function to TL_Pysces to write EnzymeML document with fit results #16

Closed HannahDi closed 2 years ago

HannahDi commented 2 years ago

Changes

Add function to automatically add fit results to the EnzymeML document and write it. Example code:

psc = ThinLayerPysces('PGM-ENO.omex')  
fit = psc.runOptimisation()  
psc.writeEnzymeML('PGM-ENO_results')

This will change the name of the EnzymeML document to PGM-ENO_results and create the new document. If no name is given, the old EnzymeML document will be overwritten.

Motivation

closes #15


This change is Reviewable

jmrohwer commented 2 years ago
        return self.fit

    def _addResultsToEnzymeML(self):

Maybe move the helper function under the one that utilizes it. It is easier to understand the whole concept if you scroll down.

I agree.

            parameters[parameter_name] = (value, unit)

    def writeEnzymeML(self, name=None):

Maybe add the possibiity to customize path and filename, but provide your currrent setup as default, maybe?

I see this is already implemented.

jmrohwer commented 2 years ago

Another point we should consider is the type of error estimate and if/how this should be specified. In the use case here, lmfit estimates the errors from the covariance matrix during the optimization. However, there are also other approaches, such as estimating confidence intervals (at a given probability, typically 95%) from the profile likelihood. lmfit has some built in support for this, but in my own work I am looking at extending this. The profile likelihood gives a better indication of parameter identifiability than the simple estimate from the covariance matrix. We can maybe discuss this on Monday as well.