Skip to content

Commit

Permalink
build based on 2845131
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 31, 2023
1 parent 2ad6855 commit c77fedd
Show file tree
Hide file tree
Showing 47 changed files with 461 additions and 461 deletions.
2 changes: 1 addition & 1 deletion dev/concepts/1_screen/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
nothing
nothing
[7.47738193404817, 1.8840414375838503e-8, 4.860861010127701, -16.023526104614593, … ]
[7.47738193404817, 1.8840414375838503e-8, 4.860861010127701, -16.023526104614593, … ]</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Contents</a><a class="docs-footer-nextpage" href="../2_modifications/">Writing custom optimizer modifications »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Thursday 11 May 2023 09:37">Thursday 11 May 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
[7.47738193404817, 1.8840414375838503e-8, 4.860861010127701, -16.023526104614593, … ]</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Contents</a><a class="docs-footer-nextpage" href="../2_modifications/">Writing custom optimizer modifications »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Tuesday 31 October 2023 12:25">Tuesday 31 October 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/concepts/2_modifications/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
GLPK.Optimizer,
modifications = [add_sum_constraint(100.0)])

sum(v) # should print ~100.0</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../1_screen/">« Screening many model variants</a><a class="docs-footer-nextpage" href="../3_custom_models/">Working with custom models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Thursday 11 May 2023 09:37">Thursday 11 May 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
sum(v) # should print ~100.0</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../1_screen/">« Screening many model variants</a><a class="docs-footer-nextpage" href="../3_custom_models/">Working with custom models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Tuesday 31 October 2023 12:25">Tuesday 31 October 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/concepts/3_custom_models/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
&quot;rxn4&quot; =&gt; 1.0
</code></pre><h2 id="Writing-generic-model-modifications"><a class="docs-heading-anchor" href="#Writing-generic-model-modifications">Writing generic model modifications</a><a id="Writing-generic-model-modifications-1"></a><a class="docs-heading-anchor-permalink" href="#Writing-generic-model-modifications" title="Permalink"></a></h2><p>The custom model structure can also be made compatible with many of the existing variant-generating functions and analysis modifiers.</p><p>The functions prepared for use as &quot;variants&quot; in <a href="../../functions/analysis/#COBREXA.screen-Tuple"><code>screen</code></a>, usually prefixed by <code>with_</code>, have their generic variants that only call simpler, overloadable functions for each specific model. This choice is based on the overloading dispatch system of Julia. For example,<a href="../../functions/reconstruction/#COBREXA.with_removed_metabolites-Tuple"><code>with_removed_metabolites</code></a> is implemented very generically by reducing the problem to some specific <a href="../../functions/reconstruction/#COBREXA.remove_metabolites-Tuple{CoreModel, AbstractVector{Int64}}"><code>remove_metabolites</code></a> functions selected by the dispatch, as follows:</p><pre><code class="language-julia">with_removed_metabolites(args...; kwargs...) =
m -&gt; remove_metabolites(m, args...; kwargs...)</code></pre><p>To be able to use <a href="../../functions/reconstruction/#COBREXA.with_removed_metabolites-Tuple"><code>with_removed_metabolites</code></a> in your model, we can just overload the actual inner function. For the simple circular model, the modification might as well look like this:</p><pre><code class="language-julia">COBREXA.remove_metabolites(m::CircularModel, n::Int) =
return CircularModel(m.size - n)</code></pre><div class="admonition is-danger"><header class="admonition-header">Functions that generate model variants must be pure</header><div class="admonition-body"><p>Notice that the function is &quot;pure&quot;, i.e., does not make any in-place modifications to the original model structure. That property is required for <a href="../../functions/analysis/#COBREXA.screen-Tuple"><code>screen</code></a> and other functions to properly and predictably apply the modifications to the model. To expose potential in-place modifications to your codebase, you should instead overload the &quot;bang&quot; counterpart of remove metabolites, called <a href="../../functions/reconstruction/#COBREXA.remove_metabolites!-Tuple{CoreModel, AbstractVector{Int64}}"><code>remove_metabolites!</code></a>.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../2_modifications/">« Writing custom optimizer modifications</a><a class="docs-footer-nextpage" href="../4_wrappers/">Extending the models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Thursday 11 May 2023 09:37">Thursday 11 May 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
return CircularModel(m.size - n)</code></pre><div class="admonition is-danger"><header class="admonition-header">Functions that generate model variants must be pure</header><div class="admonition-body"><p>Notice that the function is &quot;pure&quot;, i.e., does not make any in-place modifications to the original model structure. That property is required for <a href="../../functions/analysis/#COBREXA.screen-Tuple"><code>screen</code></a> and other functions to properly and predictably apply the modifications to the model. To expose potential in-place modifications to your codebase, you should instead overload the &quot;bang&quot; counterpart of remove metabolites, called <a href="../../functions/reconstruction/#COBREXA.remove_metabolites!-Tuple{CoreModel, AbstractVector{Int64}}"><code>remove_metabolites!</code></a>.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../2_modifications/">« Writing custom optimizer modifications</a><a class="docs-footer-nextpage" href="../4_wrappers/">Extending the models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Tuesday 31 October 2023 12:25">Tuesday 31 October 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/concepts/4_wrappers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
COBREXA.reaction_flux(x::LeakyModel) = [reaction_flux(x.mdl); zeros(1, n_reactions(x.mdl))]
COBREXA.coupling(x::LeakyModel) = [coupling(x.mdl) zeros(n_coupling_constraints(x.mdl))]</code></pre><p>(Among other, we modified the <a href="../../functions/types/#COBREXA.reaction_flux-Tuple{MetabolicModel}"><code>reaction_flux</code></a> so that all analysis methods ignore the leak reaction.)</p><p>Now, any model can be made to lose some chosen metabolites as follows:</p><pre><code class="language-julia">leaks = [&quot;M_o2_c&quot;, &quot;M_pi_c&quot;, &quot;M_glx_c&quot;]
leaky_e_coli = LeakyModel(leaks, 5, load_model(&quot;e_coli_core.xml&quot;))</code></pre><h2 id="Example-3:-Combining-the-wrappers"><a class="docs-heading-anchor" href="#Example-3:-Combining-the-wrappers">Example 3: Combining the wrappers</a><a id="Example-3:-Combining-the-wrappers-1"></a><a class="docs-heading-anchor-permalink" href="#Example-3:-Combining-the-wrappers" title="Permalink"></a></h2><p>With both wrappers implemented individually, it is easy to combine them by re-wrapping. We can easily create a model that is slowed down and moreover leaks the metabolites as follows:</p><pre><code class="language-julia">leaky_slow_e_coli = LeakyModel(leaks, 5, RateChangedModel(1/2, load_model(&quot;e_coli_core.xml&quot;)))</code></pre><p>As with all wrapping operations, take care about the exact order of applying the wraps. The other combination of the model wraps differs by also changing the rate of the metabolite leaks, which did not happen with the <code>leaky_slow_e_coli</code> above:</p><pre><code class="language-julia">slowly_leaking_slow_e_coli = RateChangedModel(1/2, LeakyModel(leaks, 5, load_model(&quot;e_coli_core.xml&quot;)))</code></pre><p>Expectably, the model can be solved with standard functions:</p><pre><code class="language-julia">v = flux_balance_analysis_dict(slowly_leaking_slow_e_coli, GLPK.Optimizer)
v[&quot;R_BIOMASS_Ecoli_core_w_GAM&quot;] # prints out ~0.38</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../3_custom_models/">« Working with custom models</a><a class="docs-footer-nextpage" href="../../functions/">Contents »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Thursday 11 May 2023 09:37">Thursday 11 May 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
v[&quot;R_BIOMASS_Ecoli_core_w_GAM&quot;] # prints out ~0.38</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../3_custom_models/">« Working with custom models</a><a class="docs-footer-nextpage" href="../../functions/">Contents »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Tuesday 31 October 2023 12:24">Tuesday 31 October 2023</span>. Using Julia version 1.8.0.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit c77fedd

Please sign in to comment.