1
1
"""Test for pulling out annotations from models."""
2
2
3
- from cobra .io import load_model
3
+ from cobra .io import read_sbml_model
4
4
from .fixtures import community
5
+ import micom
5
6
from micom .annotation import annotate , annotate_metabolites_from_exchanges
6
7
7
8
8
9
def test_annotation_cobra_reactions ():
9
- mod = load_model ( "textbook" )
10
+ mod = read_sbml_model ( micom . data . test_taxonomy (). file [ 0 ] )
10
11
rids = [r .id for r in mod .reactions ]
11
12
anns = annotate (rids , mod , what = "reaction" )
12
13
assert "reaction" in anns .columns
@@ -15,7 +16,7 @@ def test_annotation_cobra_reactions():
15
16
16
17
17
18
def test_annotation_cobra_metabolites ():
18
- mod = load_model ( "textbook" )
19
+ mod = read_sbml_model ( micom . data . test_taxonomy (). file [ 0 ] )
19
20
mids = [m .id for m in mod .metabolites ]
20
21
anns = annotate (mids , mod , what = "metabolite" )
21
22
assert "metabolite" in anns .columns
@@ -44,7 +45,7 @@ def test_annotation_micom_metabolites(community):
44
45
45
46
46
47
def test_annotations_cobra_exchanges ():
47
- mod = load_model ( "textbook" )
48
+ mod = read_sbml_model ( micom . data . test_taxonomy (). file [ 0 ] )
48
49
anns = annotate_metabolites_from_exchanges (mod )
49
50
assert anns .shape [0 ] == len (mod .exchanges )
50
51
assert all (
0 commit comments