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
5c54b1b4
Unverified
Commit
5c54b1b4
authored
3 years ago
by
St. Elmo
Browse files
Options
Downloads
Patches
Plain Diff
fix docs + naming issue
parent
b72844de
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/7_community_model.jl
+4
-4
4 additions, 4 deletions
docs/src/notebooks/7_community_model.jl
src/reconstruction/community.jl
+6
-5
6 additions, 5 deletions
src/reconstruction/community.jl
with
10 additions
and
9 deletions
docs/src/notebooks/7_community_model.jl
+
4
−
4
View file @
5c54b1b4
...
...
@@ -72,8 +72,8 @@ end
# ## Add objective function to community model`
biomass_ids
=
model_names
.*
"_BIOMASS_Ecoli_core_w_GAM"
update_objective!
(
community_model
,
biomass_ids
,
objective_id
=
"community_biomass"
)
biomass_ids
_weights
=
Dict
(
model_names
.*
"_BIOMASS_Ecoli_core_w_GAM"
.=>
1.0
)
update_
community_
objective!
(
community_model
,
"community_biomass"
,
biomass_ids_weights
)
# ## Perform community FBA
...
...
@@ -96,8 +96,8 @@ community_model = add_model_with_exchanges(
)
push!
(
model_names
,
"eno_ko"
)
biomass_ids
=
model_names
.*
"_BIOMASS_Ecoli_core_w_GAM"
update_objective!
(
community_model
,
biomass_ids
,
"community_biomass"
)
biomass_ids
_weights
=
Dict
(
model_names
.*
"_BIOMASS_Ecoli_core_w_GAM"
.=>
1.0
)
update_
community_
objective!
(
community_model
,
"community_biomass"
,
biomass_ids_weights
)
d
=
flux_balance_analysis_dict
(
community_model
,
...
...
This diff is collapsed.
Click to expand it.
src/reconstruction/community.jl
+
6
−
5
View file @
5c54b1b4
...
...
@@ -299,7 +299,7 @@ function join_with_exchanges(
_reaction_offsets
=
cumsum
(
reaction_lengths
)
_metabolite_offsets
=
cumsum
(
metabolite_lengths
)
for
i
=
1
:
length
(
models
)
species
=
isempty
(
model_names
)
?
"species_
$(i)
_"
:
model_names
[
i
]
species
=
isempty
(
model_names
)
?
"species_
$(i)
_"
:
model_names
[
i
]
*
"_"
tlbs
,
tubs
=
bounds
(
models
[
i
])
lbs
[
reaction_offset
[
i
]
+
1
:
_reaction_offsets
[
i
]]
.=
tlbs
ubs
[
reaction_offset
[
i
]
+
1
:
_reaction_offsets
[
i
]]
.=
tubs
...
...
@@ -315,7 +315,7 @@ function join_with_exchanges(
if
add_biomass_objective
rxns
[
end
]
=
"community_biomass"
for
i
=
1
:
length
(
models
)
species
=
isempty
(
model_names
)
?
"species_
$(i)
_"
:
model_names
[
i
]
species
=
isempty
(
model_names
)
?
"species_
$(i)
_"
:
model_names
[
i
]
*
"_"
mets
[
end
-
length
(
biomass_ids
)
+
i
]
=
species
.*
biomass_ids
[
i
]
end
end
...
...
@@ -354,7 +354,7 @@ function join_with_exchanges(
sizehint!
(
genes
,
sum
(
n_genes
(
m
)
for
m
in
models
))
for
(
i
,
model
)
in
enumerate
(
models
)
species
=
isempty
(
model_names
)
?
"species_
$(i)
_
"
:
model_names
[
i
]
species
=
isempty
(
model_names
)
?
"species_
$(i)
"
:
model_names
[
i
]
# underscore gets added in add_model_with_exchanges!
biomass_id
=
isempty
(
biomass_ids
)
?
nothing
:
biomass_ids
[
i
]
add_model_with_exchanges!
(
community
,
...
...
@@ -509,7 +509,7 @@ end
biomass_id = nothing,
)
The `StandardModel` variant of [add_model_with_exchanges](@ref), but is in-place.
The `StandardModel` variant of [
`
add_model_with_exchanges
`
](@ref), but is in-place.
"""
function
add_model_with_exchanges!
(
community
::
StandardModel
,
...
...
@@ -519,6 +519,7 @@ function add_model_with_exchanges!(
biomass_id
=
nothing
,
)
stdm
=
model
isa
StandardModel
?
deepcopy
(
model
)
:
convert
(
StandardModel
,
model
)
model_name
=
model_name
*
"_"
for
met
in
values
(
stdm
.
metabolites
)
met
.
id
=
model_name
*
met
.
id
...
...
@@ -565,7 +566,7 @@ end
biomass_id = nothing,
)
The `StandardModel` variant of [add_model_with_exchanges](@ref). Makes a deepcopy of
The `StandardModel` variant of [
`
add_model_with_exchanges
`
](@ref). Makes a deepcopy of
`community` and calls the inplace variant of this function on that copy.
"""
function
add_model_with_exchanges
(
...
...
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