Commit 7a06df12 authored by St. Elmo's avatar St. Elmo
Browse files

removed vs code stuff

parent 9ef72f0c
......@@ -4,6 +4,7 @@ authors = ["st elmo <stelmozors@gmail.com>"]
version = "0.1.0"
[deps]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
GZip = "92fee26a-97fe-5a0c-ad85-20a5f3185b63"
Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b"
......@@ -15,8 +16,10 @@ JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tulip = "6dd1b50a-3aae-11e9-10b5-ef983d2400fa"
......
......@@ -18,6 +18,7 @@ using Ipopt
# Gibbs
using Measurements
using Statistics
using PyCall
include("global_cobratools.jl")
......
{
"folders": [
{
"path": ".."
}
],
"settings": {
}
}
\ No newline at end of file
......@@ -19,42 +19,5 @@ function Base.show(io::IO, gibbs::Gibbs)
end
function mapGibbs(rxns::Array{Reaction, 1}; ph="7.0", T=298.15, R=8314.46261815324)
gibbs_data = JLD.load(joinpath("data", "gibbs_$ph.jld"), "gibbs")
name_mapping = JLD.load(joinpath("data", "bigg_to_kegg.jld"), "bigg_to_kegg") # need to fix for other name spaces
ΔG⁰s = Gibbs[]
ΔGs = Gibbs[]
for i in eachindex(rxns)
id = rxns[i].id
if haskey(name_mapping, id)
gs = Measurement{Float64}[]
for kegg in name_mapping[id]
if haskey(gibbs_data, kegg)
push!(gs, gibbs_data[kegg][1] ± gibbs_data[kegg][2])
end
end
if isempty(gs)
println(id)
push!(ΔG⁰s, Gibbs(0.0 ± 0.0)) # missing
push!(ΔGs, Gibbs(0.0 ± 0.0)) # missing
else
mg = mean(gs)
Q = 1.0
for (met, stoich) in rxns[1].metabolites
if stoich > 0
Q = Q * (met.concentration^stoich)
else
Q = Q / (met.concentration^stoich)
end
end
gadj = mg + R * T * log(Q)
push!(ΔG⁰s, Gibbs(mg)) # missing
push!(ΔGs, Gibbs(gadj)) # missing
end
else
println(id)
push!(ΔG⁰s, Gibbs(0.0 ± 0.0)) # missing
push!(ΔGs, Gibbs(0.0 ± 0.0)) # missing
end
end
return ReactionGibbs(rxns, ΔG⁰s, ΔGs)
end
\ No newline at end of file
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