opencobra / memote

memote – the genome-scale metabolic model test suite
https://memote.readthedocs.io/
Apache License 2.0
123 stars 26 forks source link

Report error: html file can not be generated #745

Open pkocabas80 opened 1 year ago

pkocabas80 commented 1 year ago

Checklist

Question

I am new to using Memote.

  1. I downloaded latest version of git for Windows 10.
  2. I downloaded Python 3.11.3. I downloaded memote with pip install memote from the terminal.
  3. In terminal i wrote (memote report snapshot path/to/model.xml). However index.html was not generated. How can i solve this problem?
carrascomj commented 1 year ago

Hello! Can you paste here the output of the terminal after running memote report snapshot path/to/model.xml?

pkocabas80 commented 1 year ago

PS C:\Users\Lenovo> memote report snapshot C:\Users\Lenovo\Desktop\model1.xml warning: Model does not contain SBML fbc package information. The current solver interface glpk doesn't support setting the optimality tolerance. warning: SBML package 'layout' not supported by cobrapy, information is not parsed warning: SBML package 'render' not supported by cobrapy, information is not parsed warning: Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: <Reaction R_r146 "D-glyceraldehyde-3-phosphate:NAD+ oxidoreductase (phosphorylating)"> warning: Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: <Reaction R_r146 "D-glyceraldehyde-3-phosphate:NAD+ oxidoreductase (phosphorylating)"> warning: Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: <Reaction R_r552 "ATP:alpha-D-glucose 6-phosphotransferase"> warning: Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: <Reaction R_r552 "ATP:alpha-D-glucose 6-phosphotransferase"> warning: Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: <Reaction R_r557 "ATP:D-fructose-6-phosphate 1-phosphotransferase"> warning: Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: <Reaction R_r557 "ATP:D-fructose-6-phosphate 1-phosphotransferase"> warning: Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: <Reaction R_r576 "ATP:pyruvate 2-O-phosphotransferase"> warning: Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: <Reaction R_r576 "ATP:pyruvate 2-O-phosphotransferase"> warning: Encoding LOWER_BOUND and UPPER_BOUND in KineticLaw is discouraged, use fbc:fluxBounds instead: <Reaction R_r596 "ATP:3-phospho-D-glycerate 1-phosphotransferase"> warning: Use of GENE ASSOCIATION or GENE_ASSOCIATION in the notes element is discouraged, use fbc:gpr instead: <Reaction R_r596 "ATP:3-phospho-D-glycerate 1-phosphotransferase">

pkocabas80 commented 1 year ago

================================================= test session starts ================================================= platform win32 -- Python 3.11.3, pytest-7.3.1, pluggy-1.0.0 rootdir: C:\Users\Lenovo plugins: anyio-3.6.2 collected 164 items / 1 skipped

AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\suite\tests\test_annotation.py FFFFFFFFFFFFFFFF [ 9%] FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.. [ 39%] AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\suite\tests\test_basic.py ....FFFF.....FFFFF... [ 52%] FF [ 53%] AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\suite\tests\test_biomass.py .FFFF..F..F..F..FFF [ 65%] FFF...FFF [ 70%] AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\suite\tests\test_consistency.py FFFatal Python error: Aborted

Current thread 0x0000483c (most recent call first): File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\swiglpk\swiglpk.py", line 359 in glp_set_mat_row File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\optlang\glpk_interface.py", line 777 in _add_constraints File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\optlang\interface.py", line 1474 in update File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\optlang\interface.py", line 1236 in objective File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\optlang\glpk_interface.py", line 628 in objective File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\support\consistency.py", line 104 in check_stoichiometric_consistency File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\suite\tests\test_consistency.py", line 104 in test_inconsistent_min_stoichiometry File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\python.py", line 194 in pytest_pyfunc_call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_callers.py", line 39 in _multicall File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_manager.py", line 80 in _hookexec File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_hooks.py", line 265 in call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\python.py", line 1799 in runtest File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\runner.py", line 169 in pytest_runtest_call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_callers.py", line 39 in _multicall File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_manager.py", line 80 in _hookexec File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_hooks.py", line 265 in call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\runner.py", line 262 in File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\runner.py", line 341 in from_call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\runner.py", line 261 in call_runtest_hook File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\runner.py", line 222 in call_and_report File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\runner.py", line 133 in runtestprotocol File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\runner.py", line 114 in pytest_runtest_protocol File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_callers.py", line 39 in _multicall File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_manager.py", line 80 in _hookexec File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_hooks.py", line 265 in call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\main.py", line 348 in pytest_runtestloop File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_callers.py", line 39 in _multicall File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_manager.py", line 80 in _hookexec File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_hooks.py", line 265 in call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\main.py", line 323 in _main File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\main.py", line 269 in wrap_session File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\main.py", line 316 in pytest_cmdline_main File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_callers.py", line 39 in _multicall File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_manager.py", line 80 in _hookexec File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\pluggy_hooks.py", line 265 in call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages_pytest\config__init__.py", line 166 in main File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\suite\api.py", line 137 in test_model File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\memote\suite\cli\reports.py", line 163 in snapshot File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 760 in invoke File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1404 in invoke File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1657 in invoke File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1657 in invoke File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1055 in main File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1130 in call File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Scripts\memote.exe__main__.py", line 7 in File "", line 88 in _run_code File "", line 198 in _run_module_as_main

Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, markupsafe._speedups, sqlalchemy.cyextension.collections, sqlalchemy.cyextension.immutabledict, sqlalchemy.cyextension.processors, sqlalchemy.cyextension.resultproxy, sqlalchemy.cyextension.util, greenlet._greenlet, swiglpk._swiglpk, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.tslib, pandas._libs.lib, pandas._libs.hashing, pandas._libs.ops, pandas._libs.arrays, pandas._libs.index, pandas._libs.join, pandas._libs.sparse, pandas._libs.reduction, pandas._libs.indexing, pandas._libs.internals, pandas._libs.writers, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.tslibs.strptime, pandas._libs.groupby, pandas._libs.testing, pandas._libs.parsers, pandas._libs.json, libsbml._libsbml, _ruamel_yaml, pydantic.typing, pydantic.errors, pydantic.version, pydantic.utils, pydantic.class_validators, pydantic.config, pydantic.color, pydantic.datetime_parse, pydantic.validators, pydantic.networks, pydantic.types, pydantic.json, pydantic.error_wrappers, pydantic.fields, pydantic.parse, pydantic.schema, pydantic.main, pydantic.dataclasses, pydantic.annotated_types, pydantic.decorator, pydantic.env_settings, pydantic.tools, pydantic, charset_normalizer.md, _cffi_backend, yaml._yaml, pvectorc (total: 91)

carrascomj commented 1 year ago

It seems like check_stoichiometric_consistency is making the test suite abort. If you skip "test_consistency" altogether (adding an argument --skip test_consitency), does it generate a report? If yes, you can try to import memote as a python package and run check_stoichiometric_consistency(model) from python to pinpoint the problem.

pkocabas80 commented 1 year ago

Thank you. I cut the test_consistency.py file from memote folder and pasted it into desktop. Thereafter i ran memote and it generated a html report. But i couldn't solve the rest???

pkocabas80 commented 1 year ago

@carrascomj In Python 3.11.3, i wrote import memote test_consistency("C:\Users\User\Desktop\ihGlycopastoris.xml") However it did not work: image How can i run test_consistency(model)?

carrascomj commented 1 year ago

Hello, you have to import that function itself (python does not import everything unless you tell it so).

from memote.support.consistency import check_stoichiometric_consistency

Before running the test, you have to load the model with cobra (which is installed since you have memote):

import cobra

# notice the "r" before the string since you are using a Windows path
model = cobra.io.read_sbml_model(r"C:\path\to\your\model.xml")

Afterwards, you can the call the function check_stoichiometric_consistency using the model as the first argument:

check_stoichiometric_consistency(model)

That will probably output some error, which is what we'd like to inspect. Hope it helps!

pkocabas80 commented 1 year ago

@carrascomj Thank you so much!!! I tried these. However this time the error is:

test_consistency(model) Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable

Midnighter commented 9 months ago

@pkocabas80 please try exactly the code that Jorge posted above. In particular, make sure to import and use exactly this function:

from memote.support.consistency import check_stoichiometric_consistency