loadmodels.jl 1.5 KB
Newer Older
1
2
3

sbmlfiles = [
    # a test model from BIGG
Miroslav Kratochvil's avatar
Miroslav Kratochvil committed
4
5
6
7
8
9
10
    (
        "e_coli_core.xml",
        "http://bigg.ucsd.edu/static/models/e_coli_core.xml",
        "b4db506aeed0e434c1f5f1fdd35feda0dfe5d82badcfda0e9d1342335ab31116",
        72,
        95,
    ),
11
    # a relatively new non-curated model from biomodels
Miroslav Kratochvil's avatar
Miroslav Kratochvil committed
12
13
14
15
16
17
18
    (
        "T1M1133.xml",
        "https://www.ebi.ac.uk/biomodels/model/download/MODEL1909260004.4?filename=T1M1133.xml",
        "2b1e615558b6190c649d71052ac9e0dc1635e3ad281e541bc7d4fdf2892a5967",
        2517,
        3956,
    ),
19
    # a curated model from biomodels
Miroslav Kratochvil's avatar
Miroslav Kratochvil committed
20
21
22
23
24
25
26
    (
        "Dasgupta2020.xml",
        "https://www.ebi.ac.uk/biomodels/model/download/BIOMD0000000973.3?filename=Dasgupta2020.xml",
        "958b131d4df2f215dae68255433542f228601db0326d26a54efd08ddcf823489",
        2,
        6,
    ),
27
28
29
30
31
]

@testset "Loading of models from various sources" begin
    for (sbmlfile, url, hash, expected_mets, expected_rxns) in sbmlfiles
        if !isfile(sbmlfile)
32
            Downloads.download(url, sbmlfile)
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
        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