-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add interface functionality directly to the model builder
- Loading branch information
Showing
5 changed files
with
197 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
# Copyright (c) 2021-2024, University of Luxembourg | ||
# Copyright (c) 2021-2024, Heinrich-Heine University Duesseldorf | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" | ||
$(TYPEDSIGNATURES) | ||
Linearly scale all bounds in a constraint tree by the `factor`. This actually | ||
changes the model (and may not work in surprising/improper ways with some | ||
constraint systems, esp. the MILP and QP ones). | ||
See also [`scale_constraints`](@ref). | ||
""" | ||
scale_bounds(tree::C.ConstraintTree, factor) = | ||
C.map(tree) do c | ||
isnothing(c.bound) ? c : C.Constraint(value = c.value, bound = factor * c.bound) | ||
end | ||
|
||
""" | ||
$(TYPEDSIGNATURES) | ||
Linearly scale all constraints in a constraint tree by the `factor`. | ||
See also [`scale_bounds`](@ref). | ||
""" | ||
scale_constraints(tree::C.ConstraintTree, factor) = | ||
C.map(tree) do c | ||
c * factor | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
|
||
# Copyright (c) 2021-2024, University of Luxembourg | ||
# Copyright (c) 2021-2024, Heinrich-Heine University Duesseldorf | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" | ||
$(TYPEDEF) | ||
Global configuration options for various COBREXA functions, mainly for various | ||
non-interesting function parameters that are too inconvenient to be passed | ||
around manually. | ||
Changing the configuration values at runtime is possible via the global | ||
[`configuration`](@ref) variable. | ||
""" | ||
Base.@kwdef mutable struct Configuration | ||
|
||
""" | ||
Prefixes that [`flux_balance_constraints`](@ref) uses for guessing | ||
which reactions are exchanges. | ||
""" | ||
exchange_id_prefixes::Vector{String} = ["EX_", "R_EX_"] | ||
|
||
""" | ||
Prefixes that [`flux_balance_constraints`](@ref) uses for guessing | ||
which reactions are biomass reactions. | ||
""" | ||
biomass_id_prefixes::Vector{String} = ["BIOMASS_", "R_BIOMASS_"] | ||
|
||
""" | ||
Reaction identifiers that [`flux_balance_constraints`](@ref) considers to | ||
be ATP maintenance reactions. | ||
""" | ||
atp_maintenance_ids::Vector{String} = ["ATPM", "R_ATPM"] | ||
|
||
""" | ||
SBO numbers that label exchange reactions for | ||
[`flux_balance_constraints`](@ref). | ||
""" | ||
exchange_sbos::Vector{Int} = ["SBO:0000627"] | ||
|
||
""" | ||
SBO numbers that label biomass production reactions for | ||
[`flux_balance_constraints`](@ref). | ||
""" | ||
biomass_sbos::Vector{Int} = ["SBO:0000629"] | ||
|
||
""" | ||
SBO numbers that label ATP maintenance reactions for | ||
[`flux_balance_constraints`](@ref). | ||
""" | ||
atp_maintenance_sbos::Vector{Int} = ["SBO:0000630"] | ||
|
||
""" | ||
SBO numbers that label metabolite demand reactions for | ||
[`flux_balance_constraints`](@ref). | ||
""" | ||
demand_sbos::Vector{Int} = ["SBO:0000628"] | ||
end | ||
|
||
""" | ||
const configuration | ||
The configuration object. You can change the contents of configuration to | ||
override the default behavior of some of the functions. | ||
The available options are described by struct [`Configuration`](@ref). | ||
""" | ||
const configuration = Configuration() |