Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
e6d8f33f
Commit
e6d8f33f
authored
Feb 24, 2021
by
Miroslav Kratochvil
Browse files
load and test models from multiple sources
(Uses a few new models from EBI repository.)
parent
6a5bf4db
Changes
4
Show whitespace changes
Inline
Side-by-side
test/ecoli_flux.jl
View file @
e6d8f33f
...
@@ -15,6 +15,7 @@ end
...
@@ -15,6 +15,7 @@ end
@test
typeof
(
mdl
)
==
Model
@test
typeof
(
mdl
)
==
Model
@info
"The next warning is an expected side-effect of testing an error condition"
@test_throws
AssertionError
readSBML
(
sbmlfile
*
".does.not.really.exist"
)
@test_throws
AssertionError
readSBML
(
sbmlfile
*
".does.not.really.exist"
)
@test
length
(
mdl
.
compartments
)
==
2
@test
length
(
mdl
.
compartments
)
==
2
...
...
test/ecoli_modelonly.jl
deleted
100644 → 0
View file @
6a5bf4db
sbmlfile
=
"e_coli_core.xml"
if
!
isfile
(
sbmlfile
)
download
(
"http://bigg.ucsd.edu/static/models/e_coli_core.xml"
,
sbmlfile
)
end
cksum
=
bytes2hex
(
sha256
(
open
(
sbmlfile
)))
if
cksum
!=
"b4db506aeed0e434c1f5f1fdd35feda0dfe5d82badcfda0e9d1342335ab31116"
@warn
"The downloaded E Coli core model seems to be different from the expected one. Tests will likely fail."
cksum
end
@testset
"SBML model-only file loading"
begin
mdl
=
readSBML
(
sbmlfile
)
@test
typeof
(
mdl
)
==
Model
mets
,
rxns
,
_
=
getS
(
mdl
)
@test
length
(
mets
)
==
72
@test
length
(
rxns
)
==
95
end
test/loadmodels.jl
0 → 100644
View file @
e6d8f33f
sbmlfiles
=
[
# a test model from BIGG
(
"e_coli_core.xml"
,
"http://bigg.ucsd.edu/static/models/e_coli_core.xml"
,
"b4db506aeed0e434c1f5f1fdd35feda0dfe5d82badcfda0e9d1342335ab31116"
,
72
,
95
),
# a relatively new non-curated model from biomodels
(
"T1M1133.xml"
,
"https://www.ebi.ac.uk/biomodels/model/download/MODEL1909260004.4?filename=T1M1133.xml"
,
"2b1e615558b6190c649d71052ac9e0dc1635e3ad281e541bc7d4fdf2892a5967"
,
2517
,
3956
),
# a curated model from biomodels
(
"Dasgupta2020.xml"
,
"https://www.ebi.ac.uk/biomodels/model/download/BIOMD0000000973.3?filename=Dasgupta2020.xml"
,
"958b131d4df2f215dae68255433542f228601db0326d26a54efd08ddcf823489"
,
2
,
6
),
]
@testset
"Loading of models from various sources"
begin
for
(
sbmlfile
,
url
,
hash
,
expected_mets
,
expected_rxns
)
in
sbmlfiles
if
!
isfile
(
sbmlfile
)
download
(
url
,
sbmlfile
)
end
cksum
=
bytes2hex
(
sha256
(
open
(
sbmlfile
)))
if
cksum
!=
hash
@warn
"The downloaded model `
$
sbmlfile' seems to be different from the expected one. Tests will likely fail."
cksum
end
@testset
"Loading of
$
sbmlfile"
begin
mdl
=
readSBML
(
sbmlfile
)
@test
typeof
(
mdl
)
==
Model
mets
,
rxns
,
_
=
getS
(
mdl
)
@test
length
(
mets
)
==
expected_mets
@test
length
(
rxns
)
==
expected_rxns
end
end
end
test/runtests.jl
View file @
e6d8f33f
...
@@ -6,5 +6,5 @@ import Pkg
...
@@ -6,5 +6,5 @@ import Pkg
@testset
"SBML test suite"
begin
@testset
"SBML test suite"
begin
include
(
"version.jl"
)
include
(
"version.jl"
)
include
(
"ecoli_flux.jl"
)
include
(
"ecoli_flux.jl"
)
include
(
"
ecoli_
model
only
.jl"
)
include
(
"
load
model
s
.jl"
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment