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

Solver issue in Step3 #35

Open
Christiansj83 opened this issue Oct 9, 2019 · 2 comments
Open

Solver issue in Step3 #35

Christiansj83 opened this issue Oct 9, 2019 · 2 comments

Comments

@Christiansj83
Copy link

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
Copy link
Owner

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
Copy link

maxvthof commented Jun 25, 2022

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

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

3 participants