diff --git a/HISTORY.rst b/HISTORY.rst index e6e2d471..54893fba 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,8 @@ Next Release * (Cookiecutter) Add an action for comparing models in Pull Requests (`#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) ------------------- diff --git a/src/memote/support/annotation.py b/src/memote/support/annotation.py index 4378847b..db710462 100644 --- a/src/memote/support/annotation.py +++ b/src/memote/support/annotation.py @@ -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+)?$" ), ), ( @@ -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", @@ -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]+(?