cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
147 stars 50 forks source link

cplex binding throws error TypeError: not a list #80

Closed mmp3 closed 4 years ago

mmp3 commented 4 years ago

Hello,

I am running carveme via Python 3.7 on Ubuntu. I have CPLEX installed and the python bindings for CPLEX installed as well. I ran carveme_init after successful installation and it completed successfully.

The following command throws an error. I have tried it for other genomes and it throws the same error. "cds.fa" contains the CDS sequences as DNA. (see cds.fa.gz )

Thank you.

command:

carve --dna cds.fa

stderr output:

Reported 14330 pairwise alignments, 14330 HSPs.
1178 queries aligned.
Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/carve", line 364, in <module>
    ref_score=args.reference_score
  File "/home/ubuntu/.local/bin/carve", line 198, in main
    debug_output=debug_output)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/carveme/reconstruction/carving.py", line 236, in carve_model
    ref_reactions=ref_reactions, ref_score=ref_score, debug_output=debug_output)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/carveme/reconstruction/carving.py", line 123, in minmax_reduction
    solver.update()
  File "/home/ubuntu/.local/lib/python3.7/site-packages/framed/solvers/cplex_interface.py", line 206, in update
    self.add_variables(var_ids, lbs, ubs, vartypes)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/framed/solvers/cplex_interface.py", line 105, in add_variables
    self.problem.variables.add(names=var_ids, lb=lbs, ub=ubs, types=vartypes)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/cplex/_internal/_subinterfaces.py", line 456, in add
    obj, lb, ub, types, names, columns)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/cplex/_internal/_baseinterface.py", line 41, in _add_iter
    addfun(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/cplex/_internal/_subinterfaces.py", line 378, in _add
    types, names)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/cplex/_internal/_procedural.py", line 967, in newcols
    xctype, colname)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/cplex/_internal/_pycplex.py", line 1785, in CPXXnewcols
    return _pycplex_platform.CPXXnewcols(env, lp, ccnt, py_obj, py_lb, py_ub, xctype, colname)
TypeError: not a list
cdanielmachado commented 4 years ago

Duplicated, please check https://github.com/cdanielmachado/carveme/issues/81 for details.

mmp3 commented 4 years ago

Problem solved. I had used pip install cplex which led to the error above.

When I tried installing the python bindings that come with CPLEX itself. i.e.

cd /opt/ibm/ILOG/CPLEX_Studio_Community129/python
sudo python3.7 setup.py install

Then it worked.

Side note: the free edition is not enough. carveme exceeds the limits of the free edition:

cplex.exceptions.errors.CplexSolverError: CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at https://ibm.co/2s0wqSa.