jclachance / BOFdat

Generate biomass objective function stoichiometric coefficients for genome-scale models from experimental data
Other
26 stars 6 forks source link

Solver issue in Step3 #35

Open Christiansj83 opened 4 years ago

Christiansj83 commented 4 years ago

When trying BOFdat step3 an exception is raised. Tried both with COBRApy 0.15.3 and 0.16.0.

step3.generate_initial_population(population_name, path_to_model, base_biomass_path, exp_essentiality_path, number_of_populations=5)

Assessing individual metabolite solvability function raised gurobi is not a valid solver interface. Pick from ['glpk_exact', 'glpk', 'scipy']. Traceback (most recent call last): File "C:\Users\csjes\AppData\Local\Continuum\anaconda3\lib\site-packages\cobra\core\model.py", line 150, in solver interface = solvers[interface_to_str(value)] KeyError: 'gurobi'

jclachance commented 4 years ago

BOFdat Step3 requires using the Gurobi solver. This is necessary because of the high number of optimization performed by the genetic algorithm.

You can check if the solver is accessible by opening a python prompt in terminal and running the following commands:

import cobra
model = cobra.io.load_json_model('model_path')
model.solver = 'gurobi'

If the output is the same, you may have to ensure that gurobi is both installed and the license is available. The license may expire and need to be renewed.

maxvthof commented 2 years ago

I got the same error as mentioned above. I made sure that I have gurobi ( conda config --add channels https://conda.anaconda.org/gurobi conda install gurobi ).

Then when I run step3.generate_initial_population, it shows "Assessing individual metabolite solvability" and just keeps running without ending. When I specify that json_model.solver = 'gurobi', I get errors function took longer than 40 seconds, and then it crashes (IndexError: tuple index out of range), independent of the population number. Any suggestions how to solve this?

Environment:

channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - python=2.7
  - jupyterlab
  - numpy=1.13
  - biopython=1.76
  - pip
  - pip:
    - BOFdat
    - cobra==0.11.1

error