Comments (3)
Hey!
It’s been some time since I’ve worked on this project but if you post some code examples and describe what you’re trying to do I may be able to help.
from pycotools3.
Basically, I am following the tutorial to obtain the profile likelihoods here. The scans over the parameters work nicely, but the reports do not contain the values of the parameter that was scanned over, but only the values for the remaining optimized parameters. So I wondered if there's a way to get the "right" reports.
Example:
My variables are _k_neo _k_dig _k_trans
from pycotools3 import tasks, viz, model
mod = model.loada(antimony_str, 'test.cps')
with tasks.ParameterEstimation.Context(
mod, experiment_filename,
context='pl', parameters='a'
) as context:
context.set('method', 'hooke_jeeves')
context.set('pe_number', 5) # number of steps in each profile likelihood
context.set('run_mode', 'parallel')
context.set('separator', ',')
context.set('number_of_iterations', 200)
#context.set('report', 'profile_likelihood')
context.set('prefix', '_')
config = context.get_config()
pe = tasks.ParameterEstimation(config)
p = viz.Parse(pe)
print(p.data['_k_neo'])
Example output for _k_neo
gives the values for the optimized values for the remaining parameters, but lacks the values for ´_k_neo` was scanned over.
RSS _k_dig _k_trans
0 27.1121 0.000898 0.006912
1 822.0270 0.000564 0.016508
2 871.2460 0.000519 9.164050
3 1481.4700 12.288000 2.816190
4 inf 0.100000 0.100000
from pycotools3.
Ah I see, if I recall correctly, the issue with storing the actual values of the scanned parameter is that they are calculated within COPASI directly, and the communication system between pycotools and COPASI (i.e. the copasiML) doesn't allow access to these values. Therefore (as you'll see in viz.PlotProfileLikelihood) when plotting these data I ended up recalculating them:
def compute_x(self):
lb = self.pl.config.settings.pl_lower_bound
ub = self.pl.config.settings.pl_upper_bound
parameters = self.get_best_original_parameter_set()
num_steps = self.pl.config.settings.pe_number
dct = {}
for i in parameters:
val = parameters.loc[0, i]
low = numpy.log10(val / lb)
high = numpy.log10(val * ub)
dct[i] = pandas.Series(numpy.logspace(low, high, num_steps).flatten())
df = pandas.concat(dct, axis=1)
return df
If you wanted to do stuff with the data, it might be an idea to either copy and paste the source code for viz.PlotProfileLikelihood and use this as a starting point or deriving a new class from it. I.e.
class MyComplicatedBespokeProfileLikelihoodAnalysis(viz.PlotProfileLikelihood):
pass
Personally, I'd opt for the former. Hope this helps.
Ciaran
from pycotools3.
Related Issues (9)
- pycotools3: code for michaelis_menten model creation is not working HOT 6
- Question about pycotools vs. python bindings for COPASI HOT 1
- Attribute error in tasks.MultiModelFit and name error in utils HOT 4
- how to convert the compartment unit and particle number into molarity HOT 2
- Pip installation failing with dependencies HOT 1
- Retrieving Differential Equations from Copasi File, Antimony String, etc., using Pycotools3 HOT 3
- Not SBML file HOT 2
- SBML Import HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycotools3.