-
Let's add thoughts and ideas for COBREXA 2.0 here: Breaking changes (v2.0)
Close longstanding issues
Non-breaking changes (v.2.1+)
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
Here is a potential option we can consider for a dramatic change: #=
Is this a better way to encapsulate the default cobrexa model types?
Note, I assume we have renamed our abstract type to AbstractMetabolicModel,
thus JSONModel, SBMLModel, MATModel <: AbstractMetabolicModel
=#
abstract type AbstractReaction end
abstract type AbstractMetabolite end
abstract type AbstractGene end
# this should be a subtype of AbstractMetabolicModel but I don't know how to code that in...
struct MetabolicModel{R, M, G} where {R<:AbstractReaction, M<:AbstractMetabolite, G<:AbstractGene}
id::String
reactions::Vector{R}
metabolites::Vector{M}
genes::Vector{G}
end
# Implement CoreModel like this:
const CoreModel = MetabolicModel{CoreReaction, CoreMetabolite, CoreGene}
struct CoreReaction <: AbstractReaction
id :: String
column :: SparseVec
lb :: Float64
ub :: Float64
objective_coefficient :: Maybe{Float64}
coupled :: SparseVec
end
struct CoreMetabolite <: AbstractMetabolite
id :: String # matches order of column in CoreReaction
end
struct CoreGene <: AbstractGene
id :: String # matches order of
end
# Implement StandardModel like this:
const StandardModel = MetabolicModel{GeneralizedReaction{???}, ...} # here ??? depends on what you want
struct GeneralizedReaction{T} <: AbstractReaction
id :: String
metadata :: Vector{Pair{Symbol, T}}
end
#=
metadata1 = [
Pair(:name => "Pyruvate formate lyase"),
Pair(:metabolite => ("accoa_c", 1)),
Pair(:metabolite => ("coa_c", -1)),
Pair(:upper_bound => 1000.0),
Pair(:isozyme => (b0902, b0903)),
Pair(:isozyme => (b0902, b3114)),
]
r1 = GeneralizedReaction("rxn1", metadata1)
=#
#=
metadata2 = [
Pair(:name => "Pyruvate formate lyase"),
Pair(:metabolite => ("accoa_c", 1)),
Pair(:metabolite => ("coa_c", -1)),
Pair(:lower_bound => 0.0),
Pair(:isozyme => ((1, b0902), (2, b0903))),
Pair(:isozyme => ((3, b0902), (2, b3114))),
]
r2 = GeneralizedReaction("rxn2", metadata2)
=#
#=
Then r1 and r2 have different types depending on what your model needs.
=# |
Beta Was this translation helpful? Give feedback.
-
Just a reminder to self -- @mihal-sysbio pointed out we should care about naming our variant of Gecko somehow better (which is reasonable to avoid confusion). It might be GeckoLite (need to verify). |
Beta Was this translation helpful? Give feedback.
-
CODE FREEZE FOR 2.0: Feb 10th |
Beta Was this translation helpful? Give feedback.
-
Another thing to consider adding: more documentation. It was rather difficult for me to understand there are different types of Models that what can and cannot be done with each so that I do right conversion. |
Beta Was this translation helpful? Give feedback.
spoiler: we redone
next
completely.