Unverified Commit 2d29baa1 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

add skeleton for SBML representation of genes and chemistry

parent 9e2b6ab8
......@@ -36,3 +36,4 @@ Tulip = "6dd1b50a-3aae-11e9-10b5-ef983d2400fa"
[compat]
DistributedData = "0.1.3"
julia = "1"
SBML = "0.3.2"
......@@ -50,3 +50,13 @@ end
balance(a::SBMLModel)::SparseVec = spzeros(n_metabolites(a))
objective(a::SBMLModel)::SparseVec = SBML.getOCs(a.m)
genes(a::SBMLModel)::Vector{String} = [k for k in a.m.gene_products]
function reaction_gene_associations(a::SBMLModel)::Maybe{Vector{Vector{String}}}
#TODO
end
metabolite_chemistry(a::SBMLModel, mid::String) =
isnothing(m.species[mid].formula) ? nothing :
(_formula_to_dict(m.species[mid].formula), default(0, m.species[mid].charge))
"""
Maybe{T} = Union{Nothing, T}
A nice name for "nullable" type.
"""
const Maybe{T} = Union{Nothing,T}
"""
default(d::T, x::Maybe{T})::T where {T}
Fold the `Maybe{T}` down to `T` by defaulting.
"""
function default(d::T, x::Maybe{T})::T where {T}
isnothing(x) ? d : x
end
"""
_formula_to_dict(f::String)::Dict{String,Int}
"""
function _formula_to_dict(f::String)::Dict{String,Int}
return Dict() #TODO
end
"""
_dict_to_formula(f::String)::Dict{String,Int}
"""
function _dict_to_formula(f::String)::Dict{String,Int}
return "" #TODO
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