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
3b1b805d
Unverified
Commit
3b1b805d
authored
3 years ago
by
St. Elmo
Browse files
Options
Downloads
Patches
Plain Diff
update reaction
parent
187ef239
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/base/types/Reaction.jl
+65
-67
65 additions, 67 deletions
src/base/types/Reaction.jl
with
65 additions
and
67 deletions
src/base/types/Reaction.jl
+
65
−
67
View file @
3b1b805d
using
Base
:
Float64
using
Base
:
kwarg_decl
"""
Reaction struct.
...
...
@@ -27,32 +27,60 @@ mutable struct Reaction
notes
::
Notes
annotations
::
Annotations
objective_coefficient
::
Float64
Reaction
(
id
=
""
;
name
=
nothing
,
metabolites
=
Dict
{
String
,
Float64
}(),
lb
=
-
_constants
.
default_reaction_bound
,
ub
=
_constants
.
default_reaction_bound
,
grr
=
nothing
,
subsystem
=
nothing
,
notes
=
Notes
(),
annotations
=
Annotations
(),
objective_coefficient
=
0.0
,
)
=
new
(
id
,
name
,
metabolites
,
lb
,
ub
,
grr
,
subsystem
,
notes
,
annotations
,
objective_coefficient
,
)
end
"""
Reaction(
id = "";
name = nothing,
metabolites = Dict{String,Float64}(),
lb = -_constants.default_reaction_bound,
ub = _constants.default_reaction_bound,
grr = nothing,
subsystem = nothing,
notes = Notes(),
annotations = Annotations(),
objective_coefficient = 0.0,
)
A constructor for Reaction that only takes a reaction `id` and
assigns default/uninformative values to all the fields that are not
explicitely assigned.
"""
Reaction
(
id
=
""
;
name
=
nothing
,
metabolites
=
Dict
{
String
,
Float64
}(),
lb
=
-
_constants
.
default_reaction_bound
,
ub
=
_constants
.
default_reaction_bound
,
grr
=
nothing
,
subsystem
=
nothing
,
notes
=
Notes
(),
annotations
=
Annotations
(),
objective_coefficient
=
0.0
,
)
=
Reaction
(
id
,
name
,
metabolites
,
lb
,
ub
,
grr
,
subsystem
,
notes
,
annotations
,
objective_coefficient
,
)
Reaction
(
id
::
String
;
metabolites
=
Dict
{
String
,
Real
}(),
kwargs
...
)
=
Reaction
(
id
;
Dict
(
k
=>
float
(
v
)
for
(
k
,
v
)
in
metabolites
),
kwargs
...
)
"""
Reaction(
id::String,
...
...
@@ -61,7 +89,12 @@ Reaction(
default_bound = _constants.default_reaction_bound,
)
Convenience constructor for `Reaction`.
Convenience constructor for `Reaction`. The reaction equation is specified using
`metabolites`, which is a dictionary mapping metabolite ids to stoichiometric
coefficients. The direcion of the reaction is set through `dir` which can take
`:bidirectional`, `:forward`, and `:reverse` as values. Finally, the
`default_bound` is the value taken to mean infinity in the context of constraint
based models, often this is set to a very high flux value like 1000.
"""
function
Reaction
(
id
::
String
,
...
...
@@ -90,7 +123,12 @@ Reaction(
default_bound = _constants.default_reaction_bound,
)
Convenience constructor for `Reaction`.
Convenience constructor for `Reaction`. The reaction equation is specified using
`metabolites`, which is a dictionary mapping metabolite ids to stoichiometric
coefficients. The direcion of the reaction is set through `dir` which can take
`:bidirectional`, `:forward`, and `:reverse` as values. Finally, the
`default_bound` is the value taken to mean infinity in the context of constraint
based models, often this is set to a very high flux value like 1000.
"""
Reaction
(
id
::
String
,
...
...
@@ -103,43 +141,3 @@ Reaction(
dir
;
default_bound
=
default_bound
,
)
"""
Reaction(
id::String;
name = nothing,
metabolites = Dict{String,Real}(),
lb = -_constants.default_reaction_bound,
ub = _constants.default_reaction_bound,
grr = nothing,
subsystem = nothing,
notes = Notes(),
annotations = Annotations(),
objective_coefficient = 0.0,
)
Convenience constructor for `Reaction`.
"""
Reaction
(
id
::
String
;
name
=
nothing
,
metabolites
=
Dict
{
String
,
Real
}(),
lb
=
-
_constants
.
default_reaction_bound
,
ub
=
_constants
.
default_reaction_bound
,
grr
=
nothing
,
subsystem
=
nothing
,
notes
=
Notes
(),
annotations
=
Annotations
(),
objective_coefficient
=
0.0
,
)
=
Reaction
(
id
,
name
,
Dict
(
k
=>
float
(
v
)
for
(
k
,
v
)
in
metabolites
),
lb
,
ub
,
grr
,
subsystem
,
notes
,
annotations
,
objective_coefficient
,
)
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