Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PEtab code #164

Closed
dweindl opened this issue Apr 5, 2019 · 8 comments
Closed

Update PEtab code #164

dweindl opened this issue Apr 5, 2019 · 8 comments

Comments

@dweindl
Copy link
Member

dweindl commented Apr 5, 2019

To deal with PEtab-dev/PEtab#92

Consider moving some model-processing code to AMICI.

@LeonardSchmiester
Copy link
Member

When using the PEtab importer, I get the error message:
Parameter dependent conditions in the condition file are not yet supported.

I think this is related to this issue right?

If I see it correctly, this is already implemented in PEtab. Would it be enough to delete the check for parameter dependent conditions (lines 165-169 in petab_import.py) or are there more changes required?

@afvillaverde
Copy link

Deleting lines 165-169 in petab_import.py is not enough: it leads to an error in line 205, which results in an error message from /amici/sbml_import.py:
'Cannot make %s a constant parameter: Parameter does not exist'.

@LeonardSchmiester
Copy link
Member

I think this is due to constant species which should be handled as parameters. Not sure, if this is already implemented in PEtab

@dweindl
Copy link
Member Author

dweindl commented Sep 25, 2019

If I see it correctly, this is already implemented in PEtab. Would it be enough to delete the check for parameter dependent conditions (lines 165-169 in petab_import.py) or are there more changes required?

Yes, I think this check can safely be removed to fix that issue.

@dweindl
Copy link
Member Author

dweindl commented Sep 25, 2019

Deleting lines 165-169 in petab_import.py is not enough: it leads to an error in line 205, which results in an error message from /amici/sbml_import.py:
'Cannot make %s a constant parameter: Parameter does not exist'.

Can you provide an example and/or a full stack trace?

@afvillaverde
Copy link

afvillaverde commented Sep 25, 2019

This is the code I'm running::

import pypesto
import amici
import petab
import numpy as np
import matplotlib.pyplot as plt
folder_base = "/home/alex/Documents/"
model_name = "speedy"
petab_problem = petab.Problem.from_folder(folder_base + model_name)
importer = pypesto.PetabImporter(petab_problem)
model = importer.create_model()

And this is the error:

KeyError Traceback (most recent call last)
in
----> 1 model = importer.create_model()
2 print(model.getParameterScale())
3 print("Model parameters:", list(model.getParameterIds()), '\n')
4 print("Model const parameters:", list(model.getFixedParameterIds()), '\n')
5 print("Model outputs: ", list(model.getObservableIds()), '\n')

~/anaconda3/envs/ENV_AMICI/lib/python3.7/site-packages/pypesto/objective/petab_import.py in create_model(self, force_compile)
113 logger.info(f"Compiling amici model to folder "
114 f"{self.output_folder}.")
--> 115 self.compile_model()
116 else:
117 logger.info(f"Using existing amici model in folder "

~/anaconda3/envs/ENV_AMICI/lib/python3.7/site-packages/pypesto/objective/petab_import.py in compile_model(self)
203 constantParameters=constant_parameter_ids,
204 sigmas=sigmas,
--> 205 noise_distributions=noise_distrs
206 )
207

~/anaconda3/envs/ENV_AMICI/lib/python3.7/site-packages/amici/sbml_import.py in sbml2amici(self, modelName, output_dir, observables, constantParameters, sigmas, noise_distributions, verbose, assume_pow_positivity, compiler, allow_reinit_fixpar_initcond, compile)
243
244 self.reset_symbols()
--> 245 self.processSBML(constantParameters)
246 self.processObservables(observables, sigmas, noise_distributions)
247 ode_model = ODEModel()

~/anaconda3/envs/ENV_AMICI/lib/python3.7/site-packages/amici/sbml_import.py in processSBML(self, constantParameters)
282 self.checkSupport()
283 self._gather_locals()
--> 284 self.processParameters(constantParameters)
285 self.processSpecies()
286 self.processReactions()

~/anaconda3/envs/ENV_AMICI/lib/python3.7/site-packages/amici/sbml_import.py in processParameters(self, constantParameters)
479 if not self.sbml.getParameter(parameter):
480 raise KeyError('Cannot make %s a constant parameter: '
--> 481 'Parameter does not exist.' % parameter)
482
483 parameter_ids = [par.getId() for par

KeyError: 'Cannot make SP_53872_2 a constant parameter: Parameter does not exist.'

@paulstapor
Copy link
Contributor

paulstapor commented Oct 11, 2019

Working on this issue in general has recently started, with #186 , to be precise.
I would say it's a valid goal for 0.0.10, to have the import moved to AMICI as far as possible.
Once this is done, I would consider this issue resolved...

@dweindl dweindl pinned this issue Dec 16, 2019
@dweindl dweindl added this to the Better PEtab support milestone Dec 16, 2019
@dweindl
Copy link
Member Author

dweindl commented Dec 16, 2019

I think this is outdated. Closing.

@dweindl dweindl closed this as completed Dec 16, 2019
@yannikschaelte yannikschaelte unpinned this issue Feb 20, 2020
m-philipps pushed a commit that referenced this issue Jun 14, 2022
…ile) (#164)

* add handling of empty observableParameters column in measurement file
 
* addresses #162
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants