Commit b4e8a9e9 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

fix the index in remove_metabolites of CoreModel

the tests might have been kindof a warning sign
parent aad22c68
Pipeline #46884 passed with stages
in 8 minutes and 54 seconds
......@@ -402,7 +402,7 @@ end
model,
[
ridx for ridx in 1:n_reactions(model) if
any(in.(findnz(model.S[:, ridx])[2], Ref(metabolite_idxs)))
any(in.(findnz(model.S[:, ridx])[1], Ref(metabolite_idxs)))
],
)
mask = .!in.(1:n_metabolites(model), Ref(metabolite_idxs))
......
......@@ -220,10 +220,10 @@ end
m3 = remove_metabolites(model, Int.(indexin(["glc__D_e", "for_c"], metabolites(model))))
m4 = remove_metabolite(model, first(indexin(["glc__D_e"], metabolites(model))))
@test size(stoichiometry(m1)) == (70, 22)
@test size(stoichiometry(m2)) == (71, 22)
@test size(stoichiometry(m3)) == (70, 22)
@test size(stoichiometry(m4)) == (71, 22)
@test size(stoichiometry(m1)) == (70, 90)
@test size(stoichiometry(m2)) == (71, 93)
@test size(stoichiometry(m3)) == (70, 90)
@test size(stoichiometry(m4)) == (71, 93)
@test all((!in(metabolites(m1))).(["glc__D_e", "for_c"]))
@test !(["glc__D_e"] in metabolites(m2))
@test all((!in(metabolites(m3))).(["glc__D_e", "for_c"]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment