From 19a68da0f723bbafac70fd0e8000fb713d02b4d7 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 9 Jan 2022 13:22:59 +0100 Subject: [PATCH] explain the multi-gene knockouts better Fixes #520 A complete fix might be better in the future (see #552). --- src/analysis/modifications/knockout.jl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/analysis/modifications/knockout.jl b/src/analysis/modifications/knockout.jl index e9051f538..a547b281c 100644 --- a/src/analysis/modifications/knockout.jl +++ b/src/analysis/modifications/knockout.jl @@ -2,7 +2,19 @@ knockout(gene_ids::Vector{String}) A modification that zeroes the bounds of all reactions that would be knocked -out by the specified genes (effectively disables the reactions). +out by the combination of specified genes (effectively disabling the +reactions). + +A slightly counter-intuitive behavior may occur if knocking out multiple genes: +Because this only changes the reaction bounds, multiple gene knockouts _must_ +be specified in a single call to [`knockout`](@ref), because the modifications +have no way to remember which genes are already knocked out and which not. + +In turn, having a reaction that can be catalyzed either by Gene1 or by Gene2, +specifying `modifications = [knockout(["Gene1", "Gene2"])]` does indeed disable +the reaction, but `modifications = [knockout("Gene1"), knockout("Gene2")]` does +_not_ disable the reaction (although reactions that depend either only on Gene1 +or only on Gene2 are disabled). """ knockout(gene_ids::Vector{String}) = (model, optmodel) -> _do_knockout(model, optmodel, gene_ids)