cobrapy icon indicating copy to clipboard operation
cobrapy copied to clipboard

CPLEX Error 1236: Control character in string.

Open Melclic opened this issue 4 years ago • 4 comments

Problem description

Trying to open model of Y.Lipolytica iMK735 and returns the following error:

y_lipolytica_iMK735.zip

cplex.exceptions.errors.CplexSolverError: CPLEX Error  1236: Control character in string.

I am not using the cplex library and still confronted with this error message. And in a docker environment where I know cplex is not installed I get the following error:

glp_set_row_name: i = 744: row name contains invalid character(s)
Error detected in file api/prob1.c at line 452
Aborted (core dumped)

Code Sample

When trying to perform validation of the model:

>>> cobra.io.validate_sbml_model('y_lipolytica_iMK735.sbml')
(None, {'SBML_FATAL': [], 'SBML_ERROR': [], 'SBML_SCHEMA_ERROR': [], 'SBML_WARNING': ['E0 (Warning): SBO term consistency (core, L786); Invalid \'sboTerm\' attribute value for a Compartment object; The value of the \'sboTerm\' attribute on a <compartment> is expected to be an SBO identifier (http://www.biomodels.net/SBO/). In SBML Level 2 prior to Version 4 it is expected to refer to a participant physical type (i.e., terms derived from SBO:0000236, "participant physical type"); in Versions 4 and above it is expected to refer to a material entity (i.e., terms derived from SBO:0000240, "material entity").\nReference: L3V1 Section 5\n SBO term \'SBO:0000289\' on the <compartment> is not in the appropriate branch.\n'], 'COBRA_FATAL': ['CPLEX Error  1236: Control character in string.'], 'COBRA_ERROR': [], 'COBRA_WARNING': [], 'COBRA_CHECK': []})

Dependency Information

System Information

OS Linux OS-release 4.15.0-106-generic Python 3.6.8

Package Versions

cobra 0.18.1 depinfo 1.5.3 future 0.18.2 numpy 1.18.4 optlang 1.4.4 pandas 1.0.3 pip 20.1.1 python-libsbml-experimental 5.18.1 ruamel.yaml 0.15.77 setuptools 46.4.0 six 1.14.0 swiglpk 4.65.1 wheel 0.34.2

Melclic avatar Jul 02 '20 13:07 Melclic

My first question is, are you sure that you do not have CPLEX installed in the same environment? It would be very unusual for cobrapy to pick the CPLEX solver if it is not available.

Midnighter avatar Jul 02 '20 13:07 Midnighter

My first question is, are you sure that you do not have CPLEX installed in the same environment? It would be very unusual for cobrapy to pick the CPLEX solver if it is not available.

I have tried it on multiple machines (where I admit there is cplex installed but not enabled in cobra), and have also tried it in a docker environment and an error occurs (although not the same one, updated the error report to reflect that).

Melclic avatar Jul 02 '20 20:07 Melclic

I think this is related to https://github.com/opencobra/cobrapy/issues/955. The metabolite IDs contain ASCII placeholders that translate to an @ sign which is not allowed in GLPK or Cplex IDs.

cdiener avatar Jul 02 '20 22:07 cdiener

I have tried it on multiple machines (where I admit there is cplex installed but not enabled in cobra), and have also tried it in a docker environment and an error occurs (although not the same one, updated the error report to reflect that).

This is not very transparent but cobrapy will pick CPLEX over GLPK if it is available in the environment. Regardless, @cdiener points to the heart of the matter.

Midnighter avatar Jul 03 '20 07:07 Midnighter