Skip to content

Commit

Permalink
Undo previous incorrect commits
Browse files Browse the repository at this point in the history
   There had been a couple of incorrect commits/pushs in the last days...
  • Loading branch information
tomdierkes committed Jul 9, 2013
1 parent 157badf commit bd8aae2
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .eric4project/BioPARKIN.e4q
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
<!-- eric4 user project file for project BioPARKIN -->
<!-- Saved: 2013-02-15, 10:25:54 -->
<!-- Saved: 2013-03-04, 16:49:31 -->
<!-- Copyright (C) 2013 Moritz Wade, Thomas Dierkes, Susanna Röblitz, moritzwade@gmail.com -->
<UserProject version="4.0">
</UserProject>
164 changes: 163 additions & 1 deletion .eric4project/BioPARKIN.e4t
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd">
<!-- eric4 tasks file for project BioPARKIN -->
<!-- Saved: 2013-02-15, 10:25:54 -->
<!-- Saved: 2013-03-04, 16:49:31 -->
<Tasks version="4.2">
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Handle mutliple EntityData objects correctly</Summary>
Expand All @@ -12,4 +12,166 @@
<Linenumber>417</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Either remove the old plot widget or store all plot widgets in a []/{}</Summary>
<Description></Description>
<Created>2013-03-04, 11:45:42</Created>
<Resource>
<Filename>src/simulationworkbench/simulationworkbenchcontroller.py</Filename>
<Linenumber>280</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Either remove the old table widget or store all table widgets in a []/{}</Summary>
<Description></Description>
<Created>2013-03-04, 11:45:42</Created>
<Resource>
<Filename>src/simulationworkbench/simulationworkbenchcontroller.py</Filename>
<Linenumber>307</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Either remove the old plot widget or store all plot widgets in a []/{}</Summary>
<Description></Description>
<Created>2013-03-04, 11:45:42</Created>
<Resource>
<Filename>src/simulationworkbench/simulationworkbenchcontroller.py</Filename>
<Linenumber>339</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Either remove the old table widget or store all table widgets in a []/{}</Summary>
<Description></Description>
<Created>2013-03-04, 11:45:42</Created>
<Resource>
<Filename>src/simulationworkbench/simulationworkbenchcontroller.py</Filename>
<Linenumber>384</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Either remove the old table widget or store all table widgets in a []/{}</Summary>
<Description></Description>
<Created>2013-03-04, 11:45:42</Created>
<Resource>
<Filename>src/simulationworkbench/simulationworkbenchcontroller.py</Filename>
<Linenumber>420</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Sanitize string</Summary>
<Description></Description>
<Created>2013-03-04, 11:49:29</Created>
<Resource>
<Filename>src/odehandling/odemanager.py</Filename>
<Linenumber>36</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Set!</Summary>
<Description></Description>
<Created>2013-03-04, 11:49:29</Created>
<Resource>
<Filename>src/odehandling/odemanager.py</Filename>
<Linenumber>45</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Replace this wrapping by using the original SBMLEntities (for now, we have two wrapper types...)</Summary>
<Description></Description>
<Created>2013-03-04, 11:49:29</Created>
<Resource>
<Filename>src/odehandling/odemanager.py</Filename>
<Linenumber>91</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: What about "generated ODE vs RateRule"? Overwrite generated ODE? Might happen inherently because of identical ID in {} in backend</Summary>
<Description></Description>
<Created>2013-03-04, 11:49:29</Created>
<Resource>
<Filename>src/odehandling/odemanager.py</Filename>
<Linenumber>109</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Reenable this! Stoichiometry won't work correctly without it.</Summary>
<Description></Description>
<Created>2013-03-04, 11:51:24</Created>
<Resource>
<Filename>src/odehandling/odegenerator.py</Filename>
<Linenumber>204</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Is this needed in Python?</Summary>
<Description></Description>
<Created>2013-03-04, 11:51:24</Created>
<Resource>
<Filename>src/odehandling/odegenerator.py</Filename>
<Linenumber>542</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Is this needed in Python?</Summary>
<Description></Description>
<Created>2013-03-04, 11:51:24</Created>
<Resource>
<Filename>src/odehandling/odegenerator.py</Filename>
<Linenumber>555</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO:</Summary>
<Description></Description>
<Created>2013-03-04, 11:51:24</Created>
<Resource>
<Filename>src/odehandling/odegenerator.py</Filename>
<Linenumber>583</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO:</Summary>
<Description></Description>
<Created>2013-03-04, 11:51:24</Created>
<Resource>
<Filename>src/odehandling/odegenerator.py</Filename>
<Linenumber>621</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: A RegEx would be nicer</Summary>
<Description></Description>
<Created>2013-03-04, 16:25:00</Created>
<Resource>
<Filename>src/backend_parkincpp/parkincppbackend.py</Filename>
<Linenumber>440</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Handle DataDescriptorUnit</Summary>
<Description></Description>
<Created>2013-03-04, 16:25:00</Created>
<Resource>
<Filename>src/backend_parkincpp/parkincppbackend.py</Filename>
<Linenumber>569</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Handle DataDescriptorUnit</Summary>
<Description></Description>
<Created>2013-03-04, 16:25:00</Created>
<Resource>
<Filename>src/backend_parkincpp/parkincppbackend.py</Filename>
<Linenumber>597</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: Handle DataDescriptorUnit</Summary>
<Description></Description>
<Created>2013-03-04, 16:25:00</Created>
<Resource>
<Filename>src/backend_parkincpp/parkincppbackend.py</Filename>
<Linenumber>687</Linenumber>
</Resource>
</Task>
</Tasks>
91 changes: 91 additions & 0 deletions data/sample_bioparkin_data.m
@@ -0,0 +1,91 @@
%
% [retval] = sample_bioparkin_data( fname, tpoints, [nlevel] )
%
% input:
% ------
% fname - a BioPARKIN data file
% tpoints - new time point vector at which the
% given data is resampled
% nlevel - optional: the additive noiselevel
% (default value: 0.01)
%
% output:
% -------
% retval - the new data matrix WITHOUT the header line
% of the input fileparts
%
% Additionally, a new file with the file name [fname '_pert' ext]
% will be created, storing the reaampled data (but WITHOUT the SD
% columns, up to now ...)
%

% Copyright (C) 2011
% Zuse Institute Berlin, Germany
%
% Date 24/11/2011
% Written by Thomas Dierkes
%
function [retval] = sample_bioparkin_data( fname, tpoints, noise )

if nargin < 2
error('nargin too small: Missing new timepoints?') ;
return ;
end
if nargin < 3
noise = 0.01 ;
end

fidin = fopen( fname ) ;

if fidin < 0
error('fopen: fidin = %d', fidin) ;
return ;
end


header = fgetl(fidin) ; % read WTHOUT trailing newline

A = [] ;

while ~ feof(fidin)
line = fgets(fidin) ;

a = sscanf( line, '%f') ;
A = [ A; a'] ;
end

fclose( fidin ) ;

[m,n] = size(A) ;

t = A(:,1) ;
tpoints = tpoints(:) ;
m = length(tpoints) ;

retval = [ tpoints, ...
interp1( t, A(:,2:n), tpoints ) + noise*randn(m,n-1) ] ;

%

[p,fn,ext] = fileparts( fname ) ;
% fullfile(p, [fn '_pert' ext])
fidout = fopen( fullfile(p, [fn '_pert' ext]), "w" ) ;

if fidout < 0,
error('fopen: fidout = %d', fidout) ;
return ;
end

fprintf( fidout, '%s\n', header ) ;
for j=1:m
fprintf( fidout, '%g \t', retval(j,:) ) ;
fprintf( fidout, '\n' ) ;
end

fclose( fidout ) ;






2 changes: 1 addition & 1 deletion src/BioPARKIN.py
Expand Up @@ -79,7 +79,7 @@ class BioParkinController(QMainWindow, Ui_MainWindow):
@organization: Zuse Insitute Berlin
"""

__version__ = "1.2.23"
__version__ = "1.2.25"
__author__ = "Moritz Wade & Thomas Dierkes"
__contact__ = "wade@zib.de or dierkes@zib.de"
__copyright__ = "Zuse Institute Berlin 2011"
Expand Down
11 changes: 10 additions & 1 deletion src/backend/settingsandvalues.py
Expand Up @@ -24,18 +24,24 @@

# DEFAULT VALUES

# 04.03.13 td: added default value for cubic Hermite interpolation (disabled)
DEFAULT_CUBIC_HERMITE = False

DEFAULT_STARTTIME = 0
DEFAULT_ENDTIME = 100
DEFAULT_NUMBER_INTERVALS = 100

DEFAULT_RTOL = "1E-07"
DEFAULT_ATOL = "1E-09"
DEFAULT_XTOL = "1E-03"
#DEFAULT_RTOL = "1E-06"
#DEFAULT_ATOL = "1E-12"
#DEFAULT_XTOL = "1E-04"
DEFAULT_MAX_NUM_NEWTON_STEPS = 50
DEFAULT_SD_SPECIES = "1.0"

DEFAULT_NO_AUTO_ROW_SCALING = False
DEFAULT_JACOBIAN = 3
DEFAULT_JACOBIAN = 1 # 3
DEFAULT_PROBLEM_TYPE = 3
DEFAULT_RESIDUAL_SCALING = 1
DEFAULT_PARAMETER_CONSTRAINTS = OPTIONS_PARAMETER_CONSTRAINT_TYPES[0]
Expand All @@ -51,6 +57,9 @@
#### CONSTANT STRINGS ###
# (for accessing dictionaries, etc.)

# 04.03.13 td: added option setting for cubic Hermite interpolation
SETTING_USE_CUBIC_HERMITE = "setting_use_cubic_hermite"

SETTING_STARTTIME = "setting_starttime"
SETTING_ENDTIME = "setting_endtime"
SETTING_NUMBER_TIMEPOINTS = "setting_number_timepoints"
Expand Down
20 changes: 14 additions & 6 deletions src/backend_parkincpp/parkincppbackend.py
Expand Up @@ -270,6 +270,11 @@ def _createOdeManager(self):
logging.debug("Creating ODE Manager...")

self.odeManager = ODEManager(self.mainModel)

# 04.03.13 td: cubic Hermite interpolation flag
self.odeManager.cubintflag = self.settings[settingsandvalues.SETTING_USE_CUBIC_HERMITE]\
if settingsandvalues.SETTING_USE_CUBIC_HERMITE in self.settings\
else settingsandvalues.DEFAULT_CUBIC_HERMITE

self.odeManager.startTime = self.settings[settingsandvalues.SETTING_STARTTIME]\
if settingsandvalues.SETTING_STARTTIME in self.settings\
Expand Down Expand Up @@ -319,9 +324,13 @@ def _createBioSystem(self):
self.bioSystem.setSolverRTol(rTol)
self.bioSystem.setSolverATol(aTol)

flag = int(self.odeManager.debugflag)
self.bioSystem.setSolverDebugFlag(flag)
logging.info("Monitoring of ODE Solver: %d" % flag)
cflag = int(not self.odeManager.cubintflag)
self.bioSystem.setSolverInterpolationFlag(cflag)
logging.info("Cubic Hermite Interpolation: %s" % ("ON" if cflag <= 0 else "OFF"))

dflag = int(self.odeManager.debugflag)
self.bioSystem.setSolverDebugFlag(dflag)
logging.info("Monitoring of ODE Solver: %s" % ("OFF" if dflag <= 0 else "ON"))

# set names / identifies of parameters
for paramWrapper in self.odeManager.parameterList:
Expand Down Expand Up @@ -987,8 +996,7 @@ def _doParameterEstimation(self):
totRMS = sum([self.relRMS[spec] for spec in self.relRMS.keys()])
logging.info(" Total RMS**2: %e" % (float(totRMS)/float(countMeas)) )
for speciesID, rmsValue in self.relRMS.items():
logging.info(" (%5.2f%%) %e = relRMS[%s]**2 " % (
100.0*float(rmsValue)/float(totRMS), float(rmsValue)/float(countMeas), speciesID) )
logging.info(" (%5.2f%%) %e = relRMS[%s]**2 " % ( 100.0*float(rmsValue)/float(totRMS), float(rmsValue)/float(countMeas), speciesID) )
else:
logging.warning(" No measurements present?!? ")
logging.info("------------------------------")
Expand Down Expand Up @@ -1142,7 +1150,7 @@ def _handleEstimatedParamResults(self):
estimatedParamSet.setId("Identified Parameter Values")
estimatedParamSet.setType(services.dataservice.ESTIMATED_PARAMS)

selected = {}
selected = {}
for selectedParam in self.selectedParams:
selected[selectedParam.getCombinedId()] = selectedParam

Expand Down
1 change: 1 addition & 0 deletions src/odehandling/odemanager.py
Expand Up @@ -61,6 +61,7 @@ def __init__(self, mainModel):
self.endTime = None

self.debugflag = None #
self.cubintflag = None # use cubic Hermite interpolation
self.rtol = None # relative tolerance for integrator
self.atol = None # absolute tolerance for integrator
self.xtol = None # required tolerance for gauss newton
Expand Down

0 comments on commit bd8aae2

Please sign in to comment.