Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding RidgeFBA test script #130

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions test/RidgeFBA_test .jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This script can be used to test the functionality of RidgeFBA
# Here, the metabolic model 'e_coli_core' is downloaded and by assumption of biomass as objective function,
# flux dixtribution is computed and the value for objective function is tested

using JuMP, Ipopt
using SBML
using HTTP
using Test

# Downloading the metabolic model
ecoli_model=HTTP.get("http://bigg.ucsd.edu/static/models/e_coli_core.xml")
write("e_coli_core.xml",ecoli_model.body)
ecoli_metabolic_model=readSBML("e_coli_core.xml")


#The name of the reactions are extracted as a vector.
reaction_names_keySet=keys(ecoli_metabolic_model.reactions)
reaction_names=[]
for item in reaction_names_keySet
push!(reaction_names,item)

end

#Obtaining the biomass reaction index
for n in 1:length(ecoli_metabolic_model.reactions)

if occursin("BIOMASS" , reaction_names[n])
global biomass_index=n
end
end


#As biomass is set as objective function the corresponding element in c vector is set to 1
c_test=zeros(1,length(ecoli_metabolic_model.reactions))
c_test[biomass_index]=1



flux_vector=RidgeFBA(ecoli_metabolic_model,c_test,10^-5)


@test isapprox(flux_vector[biomass_index] ,46.17244338638067; atol=0.001)