Unverified Commit 0794963b authored by cylon-x's avatar cylon-x 🤖 Committed by St. Elmo
Browse files

automatic formatting changes

parent 05c3f817
......@@ -24,7 +24,7 @@ function Base.push!(
species_name,
has_biomass_objective;
biomass_id = "",
) where {M<:MetabolicModel}
) where {M<:MetabolicModel}
if has_biomass_objective && biomass_id == ""
throw(
......
......@@ -12,16 +12,25 @@
exchange_rxn_ids = filter(startswith("EX_"), boundary_rxn_ids)
exchange_met_ids = filter(endswith("_e"), boundary_met_ids)
biomass_ids = ["BIOMASS_Ecoli_core_w_GAM","BIOMASS_Ecoli_core_w_GAM"]
community = COBREXA.join([m1, m2], exchange_rxn_ids, exchange_met_ids; add_biomass_objective=true, biomass_ids=biomass_ids)
biomass_ids = ["BIOMASS_Ecoli_core_w_GAM", "BIOMASS_Ecoli_core_w_GAM"]
community = COBREXA.join(
[m1, m2],
exchange_rxn_ids,
exchange_met_ids;
add_biomass_objective = true,
biomass_ids = biomass_ids,
)
env_ex_inds = indexin(exchange_rxn_ids, reactions(community))
m2_ex_inds = indexin(exchange_rxn_ids, reactions(m2))
community.xl[env_ex_inds] .= m2.xl[m2_ex_inds]
community.xu[env_ex_inds] .= m2.xu[m2_ex_inds]
biomass_metabolite_inds = indexin(["species_1_BIOMASS_Ecoli_core_w_GAM", "species_2_BIOMASS_Ecoli_core_w_GAM"], metabolites(community))
biomass_metabolite_inds = indexin(
["species_1_BIOMASS_Ecoli_core_w_GAM", "species_2_BIOMASS_Ecoli_core_w_GAM"],
metabolites(community),
)
community.S[biomass_metabolite_inds, end] .= -1.0
community.c[end] = 1.0
......@@ -30,7 +39,7 @@
d = flux_balance_analysis_dict(community, Tulip.Optimizer)
@test size(stoichiometry(community)) == (166, 211)
@test isapprox(d["community_biomass"], 0.41559777495618294, atol = TEST_TOLERANCE,)
@test isapprox(d["community_biomass"], 0.41559777495618294, atol = TEST_TOLERANCE)
end
@testset "Heterogenous model join" begin
......@@ -54,7 +63,13 @@ end
biomass_ids = ["BIOMASS_Ecoli_core_w_GAM", "BIOMASS_Ec_iJO1366_core_53p95M"]
community = COBREXA.join([m1, m2], exchange_rxn_ids, exchange_met_ids; add_biomass_objective=true, biomass_ids=biomass_ids)
community = COBREXA.join(
[m1, m2],
exchange_rxn_ids,
exchange_met_ids;
add_biomass_objective = true,
biomass_ids = biomass_ids,
)
env_ex_inds = indexin(exchange_rxn_ids, reactions(community))
m2_ex_inds = indexin(exchange_rxn_ids, reactions(m2))
......@@ -63,21 +78,24 @@ end
for (env_ex, m2_ex, m1_ex) in zip(env_ex_inds, m2_ex_inds, m1_ex_inds)
m2lb = isnothing(m2_ex) ? 0.0 : m2.xl[m2_ex]
m2ub = isnothing(m2_ex) ? 0.0 : m2.xu[m2_ex]
m1lb = isnothing(m1_ex) ? 0.0 : m1.xl[m1_ex]
m1ub = isnothing(m1_ex) ? 0.0 : m1.xu[m1_ex]
community.xl[env_ex] = m1lb + m2lb
community.xu[env_ex] = m1ub + m2ub
community.xl[env_ex] = m1lb + m2lb
community.xu[env_ex] = m1ub + m2ub
end
biomass_metabolite_inds = indexin(["species_1_BIOMASS_Ecoli_core_w_GAM", "species_2_BIOMASS_Ec_iJO1366_core_53p95M"], metabolites(community))
biomass_metabolite_inds = indexin(
["species_1_BIOMASS_Ecoli_core_w_GAM", "species_2_BIOMASS_Ec_iJO1366_core_53p95M"],
metabolites(community),
)
community.S[biomass_metabolite_inds, end] .= -1.0
community.c[end] = 1.0
community.xl[end] = 0.0
community.xu[end] = 1000.0
@test size(stoichiometry(community)) == (2203, 3003)
@test isapprox(d["community_biomass"], 0.8, atol = TEST_TOLERANCE,)
@test isapprox(d["community_biomass"], 0.8, atol = TEST_TOLERANCE)
end
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