Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior for error handling for missing "NAME" Line in KEGG entry files #57

Closed
emarquezz opened this issue Mar 13, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@emarquezz
Copy link

emarquezz commented Mar 13, 2024

Currently, there's an issue in the code where the absence of a "NAME" line in KEGG Entry files causes a NotImplementedError, stopping the process. However, adding a second line like "NAME NONE" in the file resolves the problem.

File ~/opt/anaconda3/envs/carveME/lib/python3.8/site-packages/cobramod/parsing/kegg.py:497, in KeggParser._parse(root, directory, genome)
    495                 kegg_dict = method(kegg_dict=root)  # type: ignore
    496         return kegg_dict
--> 497 raise NotImplementedError(
    498     "Given identifier could not be parsed properly. "
    499     "Please contact maintainers."
    500 )
File example

"ENTRY R12754 Reaction
DEFINITION CO2 + Hydrogen <=> Formate
.
.
.

Works fine just adding

ENTRY R10243 Reaction
NAME None
DEFINITION Tetrahydrofolate + Acetyl-CoA <=> 5-Methyltetrahydrofolate + CoA + CO
.
.
.

To address this issue, I propose implementing a warning mechanism instead of raising a hard error when encountering missing "NAME" lines in KEGG Entry files and just filling it as empty.

This issue was encountered while using cobramod version 1.1.1.

Also, thank you so much! cobramod has been really useful for my work :)

@cambordas cambordas self-assigned this Mar 13, 2024
@cambordas cambordas added the bug Something isn't working label Mar 13, 2024
@cambordas
Copy link
Collaborator

Hi there, thanks for the feedback and the head-ups 😄

I think we could use the Comment section in case that there is no Name section available. I will take a look and fix it, should be straight-forward

I am glad CobraMod 🐍 is helping other researchers :)

@JanNiklasWeder
Copy link
Member

JanNiklasWeder commented May 8, 2024

Hi, just a quick update.

With the latest CobraMod 1.2.0 (#53) update, the problem you've been experiencing should no longer occur. The 'identifier' is used instead if the 'NAME' section is omitted.

Therefore, I will close this issue. If similar errors occur due to other missing sections, feel free to open a new issue.

Unfortunately, I have not found any information on which other entries KEGG considers optional. If anyone knows, please leave a note here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants