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

Update RegEx patterns for annotation IDs #751

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Next Release
* (Cookiecutter) Add an action for comparing models in Pull
Requests (`#23 <https://github.com/opencobra/cookiecutter-memote/pull/23>`_).
* Dropped support for python3.6 and python3.7 in favor of python3.8 to python3.11.
* Update Regex patterns for ``refseq``, ``metanetx.reaction``, ``reactome``, ``brenda``,
``biocyc``, ``hmdb``, and ``metanetx.chemical`` IDs.

0.14.0 (2023-09-13)
-------------------
Expand Down
26 changes: 13 additions & 13 deletions src/memote/support/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
(
"refseq",
re.compile(
r"^((AC|AP|NC|NG|NM|NP|NR|NT|"
r"NW|XM|XP|XR|YP|ZP)_\d+|"
r"(NZ\_[A-Z]{4}\d+))(\.\d+)?$"
r"^(((WP|AC|AP|NC|NG|NM|NP|NR|NT|"
r"NW|XM|XP|XR|YP|ZP)_\d+)|"
r"(NZ\_[A-Z]{2,4}\d+))(\.\d+)?$"
),
),
(
Expand Down Expand Up @@ -95,11 +95,11 @@
("rhea", re.compile(r"^\d{5}$")),
("kegg.reaction", re.compile(r"^R\d+$")),
("seed.reaction", re.compile(r"^rxn\d+$")),
("metanetx.reaction", re.compile(r"^MNXR\d+$")),
("metanetx.reaction", re.compile(r"^(MNXR\d+|EMPTY)$")),
("bigg.reaction", re.compile(r"^[a-z_A-Z0-9]+$")),
(
"reactome",
re.compile(r"(^R-[A-Z]{3}-[0-9]+(-[0-9]+)?$)|(^REACT_\d+(\.\d+)?$)"),
re.compile(r"(^R-[A-Z]{3}-\d+(-\d+)?(\.\d+)?$)|(^REACT_\d+(\.\d+)?$)"),
),
(
"ec-code",
Expand All @@ -112,12 +112,12 @@
(
"brenda",
re.compile(
r"^\d+\.-\.-\.-|\d+\.\d+\.-\.-|"
r"\d+\.\d+\.\d+\.-|"
r"\d+\.\d+\.\d+\.(n)?\d+$"
r"^((\d+\.-\.-\.-)|(\d+\.\d+\.-\.-)|"
r"(\d+\.\d+\.\d+\.-)"
r"|(\d+\.\d+\.\d+\.\d+))$"
),
),
("biocyc", re.compile(r"^[A-Z-0-9]+(?<!CHEBI)" r"(\:)?[A-Za-z0-9+_.%-]+$")),
("biocyc", re.compile(r"^[A-Z-0-9]+(\:)?[A-Za-z0-9+_.%-:]+$")),
]
)

Expand All @@ -136,14 +136,14 @@
),
),
("chebi", re.compile(r"^CHEBI:\d+$")),
("hmdb", re.compile(r"^HMDB\d{5}$")),
("hmdb", re.compile(r"^HMDB\d+$")),
(
"reactome",
re.compile(r"(^R-[A-Z]{3}-[0-9]+(-[0-9]+)?$)|(^REACT_\d+(\.\d+)?$)"),
re.compile(r"(^R-[A-Z]{3}-\d+(-\d+)?(\.\d+)?$)|(^REACT_\d+(\.\d+)?$)"),
),
("metanetx.chemical", re.compile(r"^MNXM\d+$")),
("metanetx.chemical", re.compile(r"^(MNXM\d+|BIOMASS|WATER)$")),
("bigg.metabolite", re.compile(r"^[a-z_A-Z0-9]+$")),
("biocyc", re.compile(r"^[A-Z-0-9]+(?<!CHEBI)(\:)?[A-Za-z0-9+_.%-]+$")),
("biocyc", re.compile(r"^[A-Z-0-9]+(\:)?[A-Za-z0-9+_.%-:]+$")),
]
)

Expand Down