Running padmet report_network from a padmet "enhanced" with the content of metabolic-reactions.xml raised the following error:
padmet report_network --padmetSpec /home/jaudemar/m2m/community_padmet/PMC1354_22/PMC1354_22_Bin_2.padmet --output_dir report_54 --padmetRef Installation/metacyc_27.0.padmet
Traceback (most recent call last):
File "/home/jaudemar/.local/bin/padmet", line 8, in <module>
sys.exit(main())
File "/home/jaudemar/.local/lib/python3.10/site-packages/padmet/__main__.py", line 121, in main
getattr(command_import, command + '_cli')(command_args)
File "/home/jaudemar/.local/lib/python3.10/site-packages/padmet/utils/exploration/report_network.py", line 45, in report_network_cli
padmetSpec.network_report(output_dir, padmetRef_file, verbose)
File "/home/jaudemar/.local/lib/python3.10/site-packages/padmet/classes/padmetSpec.py", line 1215, in network_report
if "REVERSIBLE" in [
File "/home/jaudemar/.local/lib/python3.10/site-packages/padmet/classes/padmetSpec.py", line 1216, in <listcomp>
self.dicOfNode[rxn_id].misc["DIRECTION"][0]
KeyError: 'ENOYL-ACP-REDUCT-NADH-RXN-POLYMER-INST-Saturated-Fatty-Acyl-ACPs-C16-H32/NAD//POLYMER-INST-TRANS-D2-ENOYL-ACP-C16-H32/NADH/PROTON.104.'
Nonetheless, it did not prevent report files to be generated, so tricky error that might be loss in logs if not checking.
Problem
I noticed that reactions from metabolic-reactions.xml in the enhanced padmet were incorrect in the padmet file: missing reaction node, although relations are there.
Doing grep on the reaction id in the padmet gives the following:
ENOYL-ACP-REDUCT-NADH-RXN-POLYMER-INST-Saturated-Fatty-Acyl-ACPs-C16-H32/NAD//POLYMER-INST-TRANS-D2-ENOYL-ACP-C16-H32/NADH/PROTON.104. consumes POLYMER-INST-TRANS-D2-ENOYL-ACP-C16-H32 STOICHIOMETRY 1.0 COMPARTMENT c
ENOYL-ACP-REDUCT-NADH-RXN-POLYMER-INST-Saturated-Fatty-Acyl-ACPs-C16-H32/NAD//POLYMER-INST-TRANS-D2-ENOYL-ACP-C16-H32/NADH/PROTON.104. produces NAD STOICHIOMETRY 1.0 COMPARTMENT c
ENOYL-ACP-REDUCT-NADH-RXN-POLYMER-INST-Saturated-Fatty-Acyl-ACPs-C16-H32/NAD//POLYMER-INST-TRANS-D2-ENOYL-ACP-C16-H32/NADH/PROTON.104. produces POLYMER-INST-Saturated-Fatty-Acyl-ACPs-C16-H32 STOICHIOMETRY 1.0 COMPARTMENT c
ENOYL-ACP-REDUCT-NADH-RXN-POLYMER-INST-Saturated-Fatty-Acyl-ACPs-C16-H32/NAD//POLYMER-INST-TRANS-D2-ENOYL-ACP-C16-H32/NADH/PROTON.104. consumes NADH STOICHIOMETRY 1.0 COMPARTMENT c
ENOYL-ACP-REDUCT-NADH-RXN-POLYMER-INST-Saturated-Fatty-Acyl-ACPs-C16-H32/NAD//POLYMER-INST-TRANS-D2-ENOYL-ACP-C16-H32/NADH/PROTON.104. consumes PROTON STOICHIOMETRY 1.0 COMPARTMENT c
I went back to pgdb_to_padmet which raised no error during its creation.
Turns out there is an error in the code: wrong variable assigned as key when updating dicOfNode. padmet.dicOfNode[reaction_id] = reactant_node should be padmet.dicOfNode[reactant_id] = reactant_node
@jeannegot @PaulineGHG @ArnaudBelcour you might want to take a look and assess whether you've been affected by this bug if you use pgdb_to_padmet --enhance.
Observation
Running
padmet report_network
from a padmet "enhanced" with the content ofmetabolic-reactions.xml
raised the following error:Nonetheless, it did not prevent report files to be generated, so tricky error that might be loss in logs if not checking.
Problem
I noticed that reactions from
metabolic-reactions.xml
in the enhanced padmet were incorrect in the padmet file: missing reaction node, although relations are there.Doing
grep
on the reaction id in the padmet gives the following:I went back to
pgdb_to_padmet
which raised no error during its creation.Turns out there is an error in the code: wrong variable assigned as key when updating dicOfNode.
padmet.dicOfNode[reaction_id] = reactant_node
should bepadmet.dicOfNode[reactant_id] = reactant_node
https://github.com/AuReMe/padmet/blob/5c829d57fd93ddc54b765fada6fb1256cbd78957/padmet/utils/connection/pgdb_to_padmet.py#L1358
Fixing this and doing grep again on the reaction id in the padmet after correction:
Fix
padmet.dicOfNode[reaction_id] = reactant_node
should bepadmet.dicOfNode[reactant_id] = reactant_node
in
https://github.com/AuReMe/padmet/blob/5c829d57fd93ddc54b765fada6fb1256cbd78957/padmet/utils/connection/pgdb_to_padmet.py#L1358