Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
COBREXA.jl
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCSB-BioCore
COBREXA.jl
Commits
bacd6f6d
Commit
bacd6f6d
authored
3 years ago
by
Miroslav Kratochvil
Browse files
Options
Downloads
Patches
Plain Diff
compatibility with SBML 0.6
parent
1b2fa49e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Project.toml
+1
-1
1 addition, 1 deletion
Project.toml
src/base/types/SBMLModel.jl
+12
-13
12 additions, 13 deletions
src/base/types/SBMLModel.jl
with
13 additions
and
14 deletions
Project.toml
+
1
−
1
View file @
bacd6f6d
...
...
@@ -30,7 +30,7 @@ MAT = "0.10"
MacroTools
=
"0.5.6"
OSQP
=
"0.6"
OrderedCollections
=
"1.4"
SBML
=
"0.
5
"
SBML
=
"0.
6
"
Tulip
=
"0.7"
julia
=
"1"
...
...
This diff is collapsed.
Click to expand it.
src/base/types/SBMLModel.jl
+
12
−
13
View file @
bacd6f6d
...
...
@@ -42,7 +42,7 @@ n_metabolites(model::SBMLModel)::Int = length(model.sbml.species)
Recreate the stoichiometry matrix from the [`SBMLModel`](@ref).
"""
function
stoichiometry
(
model
::
SBMLModel
)
::
SparseMat
_
,
_
,
S
=
SBML
.
getS
(
model
.
sbml
)
_
,
_
,
S
=
SBML
.
stoichiometry_matrix
(
model
.
sbml
)
return
S
end
...
...
@@ -53,8 +53,7 @@ Get the lower and upper flux bounds of model [`SBMLModel`](@ref). Throws `Domain
case if the SBML contains mismatching units.
"""
function
bounds
(
model
::
SBMLModel
)
::
Tuple
{
SparseVec
,
SparseVec
}
lbu
=
SBML
.
getLBs
(
model
.
sbml
)
ubu
=
SBML
.
getUBs
(
model
.
sbml
)
lbu
,
ubu
=
SBML
.
flux_bounds
(
model
.
sbml
)
unit
=
lbu
[
1
][
2
]
getvalue
=
(
val
,
_
)
::
Tuple
->
val
...
...
@@ -83,7 +82,7 @@ balance(model::SBMLModel)::SparseVec = spzeros(n_metabolites(model))
Objective of the [`SBMLModel`](@ref).
"""
objective
(
model
::
SBMLModel
)
::
SparseVec
=
SBML
.
getOCs
(
model
.
sbml
)
objective
(
model
::
SBMLModel
)
::
SparseVec
=
SBML
.
flux_objective
(
model
.
sbml
)
"""
genes(model::SBMLModel)::Vector{String}
...
...
@@ -165,13 +164,13 @@ function Base.convert(::Type{SBMLModel}, mm::MetabolicModel)
return
SBMLModel
(
SBML
.
Model
(
Dict
(),
# parameters
Dict
(
""
=>
[]
),
# units
Dict
(
[
Dict
(
""
=>
1
),
# units
Dict
(
comp
=>
SBML
.
Compartment
(
nothing
,
nothing
,
nothing
,
nothing
,
nothing
,
nothing
)
for
comp
in
compss
],
),
Dict
(
[
),
Dict
(
mid
=>
SBML
.
Species
(
nothing
,
# name
_default
(
""
,
comps
[
mi
]),
# compartment
...
...
@@ -184,8 +183,8 @@ function Base.convert(::Type{SBMLModel}, mm::MetabolicModel)
_sbml_export_notes
(
metabolite_notes
(
mm
,
mid
)),
_sbml_export_annotation
(
metabolite_annotations
(
mm
,
mid
)),
)
for
(
mi
,
mid
)
in
enumerate
(
mets
)
],
),
Dict
(
[
),
Dict
(
rid
=>
SBML
.
Reaction
(
Dict
([
mets
[
i
]
=>
stoi
[
i
,
ri
]
for
...
...
@@ -203,15 +202,15 @@ function Base.convert(::Type{SBMLModel}, mm::MetabolicModel)
_sbml_export_notes
(
reaction_notes
(
mm
,
rid
)),
_sbml_export_annotation
(
reaction_annotations
(
mm
,
rid
)),
)
for
(
ri
,
rid
)
in
enumerate
(
rxns
)
],
),
Dict
(
[
),
Dict
(
gid
=>
SBML
.
GeneProduct
(
nothing
,
nothing
,
_sbml_export_notes
(
gene_notes
(
mm
,
gid
)),
_sbml_export_annotation
(
gene_annotations
(
mm
,
gid
)),
)
for
gid
in
genes
(
mm
)
],
),
),
Dict
(),
# function definitions
),
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment