Skip to content

Commit

Permalink
add more types
Browse files Browse the repository at this point in the history
  • Loading branch information
stelmo committed Nov 11, 2023
1 parent 5152235 commit 7f32b58
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,28 @@
Type of optional values.
"""
const Maybe{X} = Union{Nothing,X}

"""
$(TYPEDEF)
Information about isozyme composition including subunit stoichiometry and
turnover numbers.
# Fields
$(TYPEDFIELDS)
"""
Base.@kwdef mutable struct Isozyme
gene_product_stoichiometry::Dict{String,Float64}
kcat_forward::Maybe{Float64} = nothing
kcat_backward::Maybe{Float64} = nothing
end

"""
$(TYPEDSIGNATURES)
A convenience constructor for [`Isozyme`](@ref) that takes a string gene
reaction rule and converts it into the appropriate format. Assumes the
`gene_product_stoichiometry` for each subunit is 1.
"""
Isozyme(gids::Vector{String}; kwargs...) =
Isozyme(; gene_product_stoichiometry = Dict(gid => 1.0 for gid in gids), kwargs...)

0 comments on commit 7f32b58

Please sign in to comment.