Skip to content

Error when working with an SBML file older than version 3.X #3

@csaintmartin

Description

@csaintmartin

I tried to run the seed2lp target command on a metabolic network whose SBML version is older than 3.X, and got the following error:

Traceback (most recent call last):
  File "/opt/conda/envs/science/bin/seed2lp", line 6, in <module>
    sys.exit(main())
  File "/opt/conda/envs/science/lib/python3.10/site-packages/seed2lp/__main__.py", line 873, in main
    run_seed2lp(cfg, args.cmd, log_dir)
  File "/opt/conda/envs/science/lib/python3.10/site-packages/seed2lp/__main__.py", line 456, in run_seed2lp
    network = Network(args['infile'], run_mode, args['targets_as_seeds'], 
  File "/opt/conda/envs/science/lib/python3.10/site-packages/seed2lp/network.py", line 1385, in __init__
    self.get_network(self.name, to_print, write_sbml)
  File "/opt/conda/envs/science/lib/python3.10/site-packages/seed2lp/network.py", line 427, in get_network
    reaction.lbound, reaction.ubound = self.get_boundaries(r,species)
  File "/opt/conda/envs/science/lib/python3.10/site-packages/seed2lp/network.py", line 183, in get_boundaries
    lower_bound = self.parameters[species][reaction.attrib.get('{'+self.fbc[species]+'}lowerFluxBound')] \
KeyError: None

Please could you catch this error and inform the user that they are working with a metabolic network that does not comply with seed2lp requirements (metabolic network version 3.X)?

Information: To upgrade the SBML version, users could use cobrapy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions