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

just reformat everything

...to be able to continue pushing formatted code sanely
parent a1987d7d
Pipeline #42960 passed with stages
in 9 minutes and 58 seconds
...@@ -99,8 +99,11 @@ end ...@@ -99,8 +99,11 @@ end
Return the reaction equation of reaction with id `rxn_id` in model. The reaction Return the reaction equation of reaction with id `rxn_id` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::CoreModel, rxn_id::String)::Dict{String, Float64} function reaction_stoichiometry(m::CoreModel, rxn_id::String)::Dict{String,Float64}
Dict(m.mets[k]=>v for (k, v) in zip(findnz(m.S[:, first(indexin([rxn_id], m.rxns))])...)) Dict(
m.mets[k] => v for
(k, v) in zip(findnz(m.S[:, first(indexin([rxn_id], m.rxns))])...)
)
end end
""" """
...@@ -109,8 +112,8 @@ end ...@@ -109,8 +112,8 @@ end
Return the reaction equation of reaction with id `rxn_ind` in model. The reaction Return the reaction equation of reaction with id `rxn_ind` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::CoreModel, rxn_ind::Int)::Dict{String, Float64} function reaction_stoichiometry(m::CoreModel, rxn_ind::Int)::Dict{String,Float64}
Dict(m.mets[k]=>v for (k, v) in zip(findnz(m.S[:, rxn_ind])...)) Dict(m.mets[k] => v for (k, v) in zip(findnz(m.S[:, rxn_ind])...))
end end
""" """
......
...@@ -110,7 +110,7 @@ end ...@@ -110,7 +110,7 @@ end
Return the reaction equation of reaction with id `rxn_id` in model. The reaction Return the reaction equation of reaction with id `rxn_id` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::CoreModelCoupled, rxn_id::String)::Dict{String, Float64} function reaction_stoichiometry(m::CoreModelCoupled, rxn_id::String)::Dict{String,Float64}
reaction_stoichiometry(m.lm, rxn_id) reaction_stoichiometry(m.lm, rxn_id)
end end
...@@ -120,7 +120,7 @@ end ...@@ -120,7 +120,7 @@ end
Return the reaction equation of reaction with id `rxn_ind` in model. The reaction Return the reaction equation of reaction with id `rxn_ind` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::CoreModelCoupled, rxn_ind::Int)::Dict{String, Float64} function reaction_stoichiometry(m::CoreModelCoupled, rxn_ind::Int)::Dict{String,Float64}
reaction_stoichiometry(m.lm, rxn_ind) reaction_stoichiometry(m.lm, rxn_ind)
end end
......
...@@ -282,7 +282,7 @@ end ...@@ -282,7 +282,7 @@ end
Return the reaction equation of reaction with id `rxn_id` in model. The reaction Return the reaction equation of reaction with id `rxn_id` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::JSONModel, rxn_id::String)::Dict{String, Float64} function reaction_stoichiometry(m::JSONModel, rxn_id::String)::Dict{String,Float64}
ind = findfirst(x -> x["id"] == rxn_id, m.json["reactions"]) ind = findfirst(x -> x["id"] == rxn_id, m.json["reactions"])
m.json["reactions"][ind]["metabolites"] m.json["reactions"][ind]["metabolites"]
end end
......
...@@ -174,7 +174,7 @@ metabolite_compartment(m::MATModel, mid::String) = _maybemap( ...@@ -174,7 +174,7 @@ metabolite_compartment(m::MATModel, mid::String) = _maybemap(
Return the reaction equation of reaction with id `rxn_id` in model. The reaction Return the reaction equation of reaction with id `rxn_id` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::MATModel, rxn_id::String)::Dict{String, Float64} function reaction_stoichiometry(m::MATModel, rxn_id::String)::Dict{String,Float64}
rxn_ind = first(indexin([rxn_id], m.mat["rxns"])) rxn_ind = first(indexin([rxn_id], m.mat["rxns"]))
reaction_stoichiometry(m, rxn_ind) reaction_stoichiometry(m, rxn_ind)
end end
...@@ -186,7 +186,7 @@ Return the reaction equation of reaction with index `rxn_index` in model. The re ...@@ -186,7 +186,7 @@ Return the reaction equation of reaction with index `rxn_index` in model. The re
equation maps metabolite ids to their stoichiometric coefficients. Note, `rxn_index` can equation maps metabolite ids to their stoichiometric coefficients. Note, `rxn_index` can
be any suitable type that can index into an array. be any suitable type that can index into an array.
""" """
function reaction_stoichiometry(m::MATModel, rxn_ind)::Dict{String, Float64} function reaction_stoichiometry(m::MATModel, rxn_ind)::Dict{String,Float64}
met_inds = findall(m.mat["S"][:, rxn_ind] .!= 0.0) met_inds = findall(m.mat["S"][:, rxn_ind] .!= 0.0)
Dict(m.mat["mets"][met_ind] => m.mat["S"][met_ind, rxn_ind] for met_ind in met_inds) Dict(m.mat["mets"][met_ind] => m.mat["S"][met_ind, rxn_ind] for met_ind in met_inds)
end end
......
...@@ -143,7 +143,7 @@ _sbml_export_notes = _sbml_export_annotation ...@@ -143,7 +143,7 @@ _sbml_export_notes = _sbml_export_annotation
Return the reaction equation of reaction with id `rxn_id` in model. The reaction Return the reaction equation of reaction with id `rxn_id` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::SBMLModel, rxn_id::String)::Dict{String, Float64} function reaction_stoichiometry(m::SBMLModel, rxn_id::String)::Dict{String,Float64}
m.sbml.reactions[rxn_id].stoichiometry m.sbml.reactions[rxn_id].stoichiometry
end end
......
...@@ -288,7 +288,7 @@ end ...@@ -288,7 +288,7 @@ end
Return the reaction equation of reaction with id `rxn_id` in model. The reaction Return the reaction equation of reaction with id `rxn_id` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::StandardModel, rxn_id::String)::Dict{String, Float64} function reaction_stoichiometry(m::StandardModel, rxn_id::String)::Dict{String,Float64}
m.reactions[rxn_id].metabolites m.reactions[rxn_id].metabolites
end end
......
...@@ -312,9 +312,12 @@ end ...@@ -312,9 +312,12 @@ end
Return the reaction equation of reaction with id `rxn_id` in model. The reaction Return the reaction equation of reaction with id `rxn_id` in model. The reaction
equation maps metabolite ids to their stoichiometric coefficients. equation maps metabolite ids to their stoichiometric coefficients.
""" """
function reaction_stoichiometry(m::MetabolicModel, rxn_id::String)::Dict{String, Float64} function reaction_stoichiometry(m::MetabolicModel, rxn_id::String)::Dict{String,Float64}
mets = metabolites(m) mets = metabolites(m)
Dict(mets[k] => v for (k, v) in zip(findnz(stoichiometry(m)[:, first(indexin([rxn_id], reactions(m)))])...)) Dict(
mets[k] => v for (k, v) in
zip(findnz(stoichiometry(m)[:, first(indexin([rxn_id], reactions(m)))])...)
)
end end
""" """
......
...@@ -59,7 +59,8 @@ function atom_exchange(flux_dict::Dict{String,Float64}, model::StandardModel) ...@@ -59,7 +59,8 @@ function atom_exchange(flux_dict::Dict{String,Float64}, model::StandardModel)
for (met, stoich_rxn) in model.reactions[rxn_id].metabolites for (met, stoich_rxn) in model.reactions[rxn_id].metabolites
adict = get_atoms(model.metabolites[met]) adict = get_atoms(model.metabolites[met])
for (atom, stoich_molecule) in adict for (atom, stoich_molecule) in adict
atom_flux[atom] = get(atom_flux, atom, 0.0) + flux * stoich_rxn * stoich_molecule atom_flux[atom] =
get(atom_flux, atom, 0.0) + flux * stoich_rxn * stoich_molecule
end end
end end
end end
......
...@@ -21,20 +21,12 @@ function add_reactions( ...@@ -21,20 +21,12 @@ function add_reactions(
xu::AbstractFloat; xu::AbstractFloat;
check_consistency = false, check_consistency = false,
) where {V1<:VecType,V2<:VecType} ) where {V1<:VecType,V2<:VecType}
new_lm = add_reactions( new_lm = add_reactions(m.lm, s, b, c, xl, xu, check_consistency = check_consistency)
m.lm,
s,
b,
c,
xl,
xu,
check_consistency = check_consistency,
)
return CoreModelCoupled( return CoreModelCoupled(
new_lm, new_lm,
hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm)-n_reactions(m.lm))), hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm) - n_reactions(m.lm))),
m.cl, m.cl,
m.cu m.cu,
) )
end end
...@@ -72,13 +64,13 @@ function add_reactions( ...@@ -72,13 +64,13 @@ function add_reactions(
xu, xu,
rxn, rxn,
mets, mets,
check_consistency = check_consistency check_consistency = check_consistency,
) )
return CoreModelCoupled( return CoreModelCoupled(
new_lm, new_lm,
hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm)-n_reactions(m.lm))), hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm) - n_reactions(m.lm))),
m.cl, m.cl,
m.cu m.cu,
) )
end end
...@@ -103,20 +95,12 @@ function add_reactions( ...@@ -103,20 +95,12 @@ function add_reactions(
xu::V; xu::V;
check_consistency = false, check_consistency = false,
) where {M<:MatType,V<:VecType} ) where {M<:MatType,V<:VecType}
new_lm = add_reactions( new_lm = add_reactions(m.lm, Sp, b, c, xl, xu, check_consistency = check_consistency)
m.lm,
Sp,
b,
c,
xl,
xu,
check_consistency = check_consistency,
)
return CoreModelCoupled( return CoreModelCoupled(
new_lm, new_lm,
hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm)-n_reactions(m.lm))), hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm) - n_reactions(m.lm))),
m.cl, m.cl,
m.cu m.cu,
) )
end end
...@@ -127,16 +111,12 @@ Add all reactions from `m2` to `m1`. ...@@ -127,16 +111,12 @@ Add all reactions from `m2` to `m1`.
""" """
function add_reactions(m1::CoreModelCoupled, m2::CoreModel; check_consistency = false) function add_reactions(m1::CoreModelCoupled, m2::CoreModel; check_consistency = false)
new_lm = add_reactions( new_lm = add_reactions(m1.lm, m2, check_consistency = check_consistency)
m1.lm,
m2,
check_consistency=check_consistency
)
return CoreModelCoupled( return CoreModelCoupled(
new_lm, new_lm,
hcat(m1.C, spzeros(size(m1.C, 1), n_reactions(new_lm)-n_reactions(m1.lm))), hcat(m1.C, spzeros(size(m1.C, 1), n_reactions(new_lm) - n_reactions(m1.lm))),
m1.cl, m1.cl,
m1.cu m1.cu,
) )
end end
...@@ -174,13 +154,13 @@ function add_reactions( ...@@ -174,13 +154,13 @@ function add_reactions(
xu, xu,
rxns, rxns,
mets, mets,
check_consistency = check_consistency check_consistency = check_consistency,
) )
return CoreModelCoupled( return CoreModelCoupled(
new_lm, new_lm,
hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm)-n_reactions(m.lm))), hcat(m.C, spzeros(size(m.C, 1), n_reactions(new_lm) - n_reactions(m.lm))),
m.cl, m.cl,
m.cu m.cu,
) )
end end
...@@ -197,7 +177,7 @@ function remove_reactions(m::CoreModelCoupled, rxns::Vector{Int}) ...@@ -197,7 +177,7 @@ function remove_reactions(m::CoreModelCoupled, rxns::Vector{Int})
remove_reactions(m.lm, rxns), remove_reactions(m.lm, rxns),
m.C[:, filter(e -> e rxns, 1:n_reactions(m))], m.C[:, filter(e -> e rxns, 1:n_reactions(m))],
m.cl, m.cl,
m.cu m.cu,
) )
end end
...@@ -222,7 +202,8 @@ end ...@@ -222,7 +202,8 @@ end
""" """
function remove_reactions(m::CoreModelCoupled, rxns::Vector{String}) function remove_reactions(m::CoreModelCoupled, rxns::Vector{String})
rxn_indices = [findfirst(isequal(name), m.lm.rxns) for name in intersect(rxns, m.lm.rxns)] rxn_indices =
[findfirst(isequal(name), m.lm.rxns) for name in intersect(rxns, m.lm.rxns)]
if isempty(rxn_indices) if isempty(rxn_indices)
return m return m
else else
...@@ -398,12 +379,7 @@ function change_bounds!( ...@@ -398,12 +379,7 @@ function change_bounds!(
xl::V = Float64[], xl::V = Float64[],
xu::V = Float64[], xu::V = Float64[],
) where {V<:VecType} ) where {V<:VecType}
change_bounds!( change_bounds!(model.lm, rxns, xl = xl, xu = xu)
model.lm,
rxns,
xl = xl,
xu = xu
)
end end
""" """
...@@ -421,10 +397,5 @@ function change_bounds!( ...@@ -421,10 +397,5 @@ function change_bounds!(
xl::V = Float64[], xl::V = Float64[],
xu::V = Float64[], xu::V = Float64[],
) where {V<:VecType} ) where {V<:VecType}
change_bounds!( change_bounds!(model.lm, rxns, xl = xl, xu = xu)
model.lm,
rxns,
xl = xl,
xu = xu
)
end end
...@@ -210,7 +210,8 @@ constrain reactions that require the genes to function to carry zero flux. ...@@ -210,7 +210,8 @@ constrain reactions that require the genes to function to carry zero flux.
remove_gene!(model, "g1") remove_gene!(model, "g1")
``` ```
""" """
remove_gene!(model::StandardModel, gid::String; knockout_reactions::Bool = false) = remove_genes!(model, [gid]; knockout_reactions = knockout_reactions) remove_gene!(model::StandardModel, gid::String; knockout_reactions::Bool = false) =
remove_genes!(model, [gid]; knockout_reactions = knockout_reactions)
function set_bound(model::StandardModel, reaction_id::String; ub, lb) function set_bound(model::StandardModel, reaction_id::String; ub, lb)
reaction = model.reactions[reaction_id] reaction = model.reactions[reaction_id]
......
...@@ -151,8 +151,7 @@ function add_model_with_exchanges( ...@@ -151,8 +151,7 @@ function add_model_with_exchanges(
rxnsadd = "$(model_name)_" .* reactions(model) rxnsadd = "$(model_name)_" .* reactions(model)
if !isnothing(biomass_id) if !isnothing(biomass_id)
metsadd = metsadd = ["$(model_name)_" .* metabolites(model); "$(model_name)_" * biomass_id]
["$(model_name)_" .* metabolites(model); "$(model_name)_" * biomass_id]
else else
metsadd = "$(model_name)_" .* metabolites(model) metsadd = "$(model_name)_" .* metabolites(model)
end end
...@@ -247,7 +246,7 @@ function join_with_exchanges( ...@@ -247,7 +246,7 @@ function join_with_exchanges(
add_biomass_objective = true, add_biomass_objective = true,
biomass_ids = String[], biomass_ids = String[],
model_names = String[], model_names = String[],
)::CoreModel where M <: MetabolicModel )::CoreModel where {M<:MetabolicModel}
if add_biomass_objective && isempty(biomass_ids) if add_biomass_objective && isempty(biomass_ids)
throw( throw(
...@@ -284,7 +283,8 @@ function join_with_exchanges( ...@@ -284,7 +283,8 @@ function join_with_exchanges(
nnz_total = nnz_total =
sum(length(first(nnz)) for nnz in nnzs) + sum(length(first(nnz)) for nnz in nnzs) +
length(models) * length(exchange_rxn_ids) + length(models) * length(exchange_rxn_ids) +
length(exchange_met_ids) + nnz_add length(exchange_met_ids) +
nnz_add
n_reactions_metabolic = sum(reaction_lengths) n_reactions_metabolic = sum(reaction_lengths)
n_reactions_total = n_reactions_metabolic + length(exchange_rxn_ids) + column_add n_reactions_total = n_reactions_metabolic + length(exchange_rxn_ids) + column_add
n_metabolites_metabolic = sum(metabolite_lengths) n_metabolites_metabolic = sum(metabolite_lengths)
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
lp = flux_balance_analysis(cp, Tulip.Optimizer) lp = flux_balance_analysis(cp, Tulip.Optimizer)
@test termination_status(lp) == MOI.OPTIMAL @test termination_status(lp) == MOI.OPTIMAL
sol = JuMP.value.(lp[:x]) sol = JuMP.value.(lp[:x])
@test isapprox(objective_value(lp), expected_optimum, atol=TEST_TOLERANCE) @test isapprox(objective_value(lp), expected_optimum, atol = TEST_TOLERANCE)
@test isapprox(cp.c' * sol, expected_optimum, atol=TEST_TOLERANCE) @test isapprox(cp.c' * sol, expected_optimum, atol = TEST_TOLERANCE)
# test the "nicer output" variants # test the "nicer output" variants
fluxes_vec = flux_balance_analysis_vec(cp, Tulip.Optimizer) fluxes_vec = flux_balance_analysis_vec(cp, Tulip.Optimizer)
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
add_gene!(m, Gene("g1")) add_gene!(m, Gene("g1"))
add_gene!(m, Gene("g2")) add_gene!(m, Gene("g2"))
add_reaction!(m, Reaction("v1", metabolites = Dict("A" => -1.0, "B" => 1.0), grr = [["g1"]])) add_reaction!(
m,
Reaction("v1", metabolites = Dict("A" => -1.0, "B" => 1.0), grr = [["g1"]]),
)
add_reaction!( add_reaction!(
m, m,
Reaction("v2", metabolites = Dict("A" => -1.0, "B" => 1.0), grr = [["g1", "g2"]]), Reaction("v2", metabolites = Dict("A" => -1.0, "B" => 1.0), grr = [["g1", "g2"]]),
......
...@@ -12,14 +12,18 @@ ...@@ -12,14 +12,18 @@
# atom tracker # atom tracker
atom_fluxes = atom_exchange(sol, model) atom_fluxes = atom_exchange(sol, model)
@test isapprox(atom_fluxes["C"], 37.19016648975907; atol=TEST_TOLERANCE) @test isapprox(atom_fluxes["C"], 37.19016648975907; atol = TEST_TOLERANCE)
@test atom_exchange("FBA", model)["C"] == 0.0 @test atom_exchange("FBA", model)["C"] == 0.0
@test isapprox(atom_exchange("BIOMASS_Ecoli_core_w_GAM", model)["C"], -42.5555; atol=TEST_TOLERANCE) @test isapprox(
atom_exchange("BIOMASS_Ecoli_core_w_GAM", model)["C"],
-42.5555;
atol = TEST_TOLERANCE,
)
# metabolite trackers # metabolite trackers
consuming, producing = metabolite_fluxes(sol, model) consuming, producing = metabolite_fluxes(sol, model)
@test isapprox(consuming["atp_c"]["PFK"], -7.47738; atol=TEST_TOLERANCE) @test isapprox(consuming["atp_c"]["PFK"], -7.47738; atol = TEST_TOLERANCE)
@test isapprox(producing["atp_c"]["PYK"], 1.75818; atol=TEST_TOLERANCE) @test isapprox(producing["atp_c"]["PYK"], 1.75818; atol = TEST_TOLERANCE)
# set bounds # set bounds
cbm = make_optimization_model(model, optimizer) cbm = make_optimization_model(model, optimizer)
......
...@@ -25,17 +25,29 @@ ...@@ -25,17 +25,29 @@
["EX_m1"; "Exch_m3"; "Ex_m2"], ["EX_m1"; "Exch_m3"; "Ex_m2"],
["m1"; "m2"; "m3_e"], ["m1"; "m2"; "m3_e"],
) )
@test filter(looks_like_exchange_reaction, reactions(cp)) == ["EX_m1", "Exch_m3", "Ex_m2"] @test filter(looks_like_exchange_reaction, reactions(cp)) ==
@test filter(x -> looks_like_exchange_reaction(x; exchange_prefixes = ["Exch_"]), reactions(cp)) == ["Exch_m3"] ["EX_m1", "Exch_m3", "Ex_m2"]
@test filter(
x -> looks_like_exchange_reaction(x; exchange_prefixes = ["Exch_"]),
reactions(cp),
) == ["Exch_m3"]
# this is originally the "toyModel1.mat" # this is originally the "toyModel1.mat"
cp = test_toyModel() cp = test_toyModel()
@test filter(looks_like_exchange_reaction, reactions(cp)) == ["EX_m1(e)", "EX_m3(e)", "EX_biomass(e)"] @test filter(looks_like_exchange_reaction, reactions(cp)) ==
@test filter(x -> looks_like_exchange_reaction(x; exclude_biomass=true), reactions(cp)) == ["EX_m1(e)", "EX_m3(e)"] ["EX_m1(e)", "EX_m3(e)", "EX_biomass(e)"]
@test filter(
x -> looks_like_exchange_reaction(x; exclude_biomass = true),
reactions(cp),
) == ["EX_m1(e)", "EX_m3(e)"]
@test filter(looks_like_exchange_metabolite, metabolites(cp)) == ["m1[e]", "m3[e]"] @test filter(looks_like_exchange_metabolite, metabolites(cp)) == ["m1[e]", "m3[e]"]
@test filter(looks_like_biomass_reaction, reactions(cp)) == ["EX_biomass(e)", "biomass1"] @test filter(looks_like_biomass_reaction, reactions(cp)) ==
@test filter(x -> looks_like_biomass_reaction(x; exclude_exchanges=true), reactions(cp)) == ["biomass1"] ["EX_biomass(e)", "biomass1"]
@test filter(
x -> looks_like_biomass_reaction(x; exclude_exchanges = true),
reactions(cp),
) == ["biomass1"]
end end
@testset "Looks like functions, basic" begin @testset "Looks like functions, basic" begin
......
...@@ -175,10 +175,10 @@ end ...@@ -175,10 +175,10 @@ end
lp = CoreModel( lp = CoreModel(
[1.0 1 1 0; 1 1 1 0; 1 1 1 0; 0 0 0 1], [1.0 1 1 0; 1 1 1 0; 1 1 1 0; 0 0 0 1],
collect(1.:4), collect(1.0:4),
collect(1.:4), collect(1.0:4),
collect(1.:4), collect(1.0:4),
collect(1.:4), collect(1.0:4),
["r1"; "r2"; "r3"; "r4"], ["r1"; "r2"; "r3"; "r4"],
["m1"; "m2"; "m3"; "m4"], ["m1"; "m2"; "m3"; "m4"],
) )
......
...@@ -54,7 +54,16 @@ end ...@@ -54,7 +54,16 @@ end
@test cp.cl == new_cp.cl @test cp.cl == new_cp.cl
@test cp.cu == new_cp.cu @test cp.cu == new_cp.cu
new_cp = add_reactions(cp, 2.0 * ones(4), 3 .* ones(4), 2.0, -1.0, 1.0, "r4", ["m$i" for i in 1:4]) new_cp = add_reactions(
cp,
2.0 * ones(4),
3 .* ones(4),
2.0,
-1.0,
1.0,
"r4",
["m$i" for i = 1:4],
)
@test cp.C == new_cp.C[:, 1:end-1] @test cp.C == new_cp.C[:, 1:end-1]
@test cp.cl == new_cp.cl @test cp.cl == new_cp.cl
@test cp.cu == new_cp.cu @test cp.cu == new_cp.cu
...@@ -78,21 +87,15 @@ end ...@@ -78,21 +87,15 @@ end
2 .* ones(10), 2 .* ones(10),
-ones(10), -ones(10),
ones(10), ones(10),
["r$i" for i in 1:10], ["r$i" for i = 1:10],
["m$i" for i in 1:4] ["m$i" for i = 1:4],
)