Skip to content

Commit

Permalink
feat: extend annotation tests with a check for inchi strings (#580)
Browse files Browse the repository at this point in the history
* feat: extend annotation tests with a check for inchi strings

* test: fix test_generate_metabolite_annotation_miriam_match
  • Loading branch information
ChristianLieven committed Jan 22, 2019
1 parent 4f7dfc3 commit 81b74ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Next Release
* Unpin pytest (require >= 4.0) and adjust some internal mechanics accordingly.
* Display an alternative message if some biomass components do not contain a
formula.
* Extend the annotations tests by a check for full length InChI strings.

0.8.11 (2019-01-07)
-------------------
Expand Down
4 changes: 4 additions & 0 deletions memote/support/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# 'Kegg' ['gen','rxn','met'] 'http://www.kegg.jp/'
# 'SEED' ['met'] 'http://modelseed.org/'
#
# 'InChI' ['met'] 'https://www.ebi.ac.uk/chebi/'
# 'InChIKey' ['met'] 'http://cactus.nci.nih.gov/chemical/structure'
# 'ChEBI' ['met'] 'http://bioportal.bioontology.org/ontologies/CHEBI'
# 'BRENDA' ['rxn'] 'http://www.brenda-enzymes.org/'
Expand Down Expand Up @@ -106,6 +107,9 @@
('seed.compound', re.compile(r"^cpd\d+$")),
('inchikey', re.compile(
r"^[A-Z]{14}\-[A-Z]{10}(\-[A-Z])?")),
('inchi', re.compile(
r"^InChI\=1S?\/[A-Za-z0-9\.]+(\+[0-9]+)?"
r"(\/[cnpqbtmsih][A-Za-z0-9\-\+\(\)\,\/\?\;\.]+)*$")),
('chebi', re.compile(r"^CHEBI:\d+$")),
('hmdb', re.compile(r"^HMDB\d{5}$")),
('reactome', re.compile(
Expand Down
2 changes: 2 additions & 0 deletions tests/test_for_support/test_for_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def met_each_present(base):
'kegg.compound': "C00022",
'seed.compound': "cpd00020",
'inchikey': "LCTONWCANYUPML-UHFFFAOYSA-M",
'inchi': "InChI=1S/C3H4O3/c1-2(4)3(5)6/h1H3,(H,5,6)/p-1",
'chebi': ["CHEBI:14987", "CHEBI:15361",
"CHEBI:26462", "CHEBI:26466",
"CHEBI:32816", "CHEBI:45253",
Expand Down Expand Up @@ -129,6 +130,7 @@ def met_broken_id(base):
'metanetx.chemical': "MNXR23",
'kegg.compound': "K00022",
'seed.compound': "cdp00020",
'inchi': "InBhI=1/C2H6O/z1-2-3/h3H,2Z2,1Y3",
'inchikey': "LCT-ONWCANYUPML-UHFFFAOYSA-M",
'chebi': ["CHEBI:487", "CHEBI:15361", "CHEBI:26462", "CHEBI:26466",
"CHEBI:32816", "CEBI:O", "CHEBI:86354", "CHEBI:8685"],
Expand Down

0 comments on commit 81b74ce

Please sign in to comment.