Skip to content

Commit

Permalink
fix: Update RegEx patterns for annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
WalkerKnapp committed Sep 22, 2023
1 parent 4c08f46 commit aaf4495
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
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

0 comments on commit aaf4495

Please sign in to comment.