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
486efbb9
Commit
486efbb9
authored
3 years ago
by
Miroslav Kratochvil
Browse files
Options
Downloads
Patches
Plain Diff
consistent arg order for `fix_mass_balanced`
...together with the other commits in this branch, this: Closes #330
parent
d7c31b25
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/src/notebooks/3_basic_stdmodel_usage.jl
+2
-2
2 additions, 2 deletions
docs/src/notebooks/3_basic_stdmodel_usage.jl
src/base/utils/Reaction.jl
+2
-2
2 additions, 2 deletions
src/base/utils/Reaction.jl
with
4 additions
and
4 deletions
docs/src/notebooks/3_basic_stdmodel_usage.jl
+
2
−
2
View file @
486efbb9
...
...
@@ -175,8 +175,8 @@ check_duplicate_reaction(pgm_duplicate, model.reactions; only_metabolites = fals
# ## Checking the internals of `StandardModel`s: `is_mass_balanced`
# Finally, `is_mass_balanced` can be used to check if a reaction is mass
# Finally,
[
`is_mass_balanced`
](@ref)
can be used to check if a reaction is mass
# balanced based on the formulas of the reaction equation.
pgm_duplicate
.
metabolites
=
Dict
{
String
,
Float64
}(
"3pg_c"
=>
1
,
"2pg_c"
=>
-
1
,
"h2o_c"
=>
1
)
# not mass balanced now
is_bal
,
extra_atoms
=
is_mass_balanced
(
pgm_duplicate
,
model
)
# extra_atoms shows which atoms are in excess/deficit
is_bal
,
extra_atoms
=
is_mass_balanced
(
model
,
pgm_duplicate
)
# extra_atoms shows which atoms are in excess/deficit
This diff is collapsed.
Click to expand it.
src/base/utils/Reaction.jl
+
2
−
2
View file @
486efbb9
...
...
@@ -50,14 +50,14 @@ function is_boundary(rxn::Reaction)::Bool
end
"""
is_mass_balanced(
rxn::Reaction,
model::StandardModel)
is_mass_balanced(model::StandardModel
, rxn::Reaction
)
Checks if `rxn` is atom balanced. Returns a boolean for whether the reaction is balanced,
and the associated balance of atoms for convenience (useful if not balanced).
See also: [`get_atoms`](@ref), [`check_duplicate_reaction`](@ref)
"""
function
is_mass_balanced
(
rxn
::
Reaction
,
model
::
StandardModel
)
function
is_mass_balanced
(
model
::
StandardModel
,
rxn
::
Reaction
)
atom_balances
=
Dict
{
String
,
Float64
}()
# float here because stoichiometry is not Int
for
(
met
,
stoich
)
in
rxn
.
metabolites
atoms
=
metabolite_formula
(
model
,
met
)
...
...
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