File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This script can be used to test the functionality of RidgeFBA
2
+ # Here, the metabolic model 'e_coli_core' is downloaded and by assumption of biomass as objective function,
3
+ # flux dixtribution is computed and the value for objective function is tested
4
+
5
+ using JuMP, Ipopt
6
+ using SBML
7
+ using HTTP
8
+ using Test
9
+
10
+ # Downloading the metabolic model
11
+ ecoli_model= HTTP. get (" http://bigg.ucsd.edu/static/models/e_coli_core.xml" )
12
+ write (" e_coli_core.xml" ,ecoli_model. body)
13
+ ecoli_metabolic_model= readSBML (" e_coli_core.xml" )
14
+
15
+
16
+ # The name of the reactions are extracted as a vector.
17
+ reaction_names_keySet= keys (ecoli_metabolic_model. reactions)
18
+ reaction_names= []
19
+ for item in reaction_names_keySet
20
+ push! (reaction_names,item)
21
+
22
+ end
23
+
24
+ # Obtaining the biomass reaction index
25
+ for n in 1 : length (ecoli_metabolic_model. reactions)
26
+
27
+ if occursin (" BIOMASS" , reaction_names[n])
28
+ global biomass_index= n
29
+ end
30
+ end
31
+
32
+
33
+ # As biomass is set as objective function the corresponding element in c vector is set to 1
34
+ c_test= zeros (1 ,length (ecoli_metabolic_model. reactions))
35
+ c_test[biomass_index]= 1
36
+
37
+
38
+
39
+ flux_vector= RidgeFBA (ecoli_metabolic_model,c_test,10 ^- 5 )
40
+
41
+
42
+ @test isapprox (flux_vector[biomass_index] ,46.17244338638067 ; atol= 0.001 )
You can’t perform that action at this time.
0 commit comments