<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Julia Community 🟣: St. Elmo Wilken</title>
    <description>The latest articles on Julia Community 🟣 by St. Elmo Wilken (@stelmo).</description>
    <link>https://forem.julialang.org/stelmo</link>
    <image>
      <url>https://forem.julialang.org/images/CkKi9yHQmuiEN8_5ztToy1OdlkOdfZij1T5E03Uof3E/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L3VzZXIvcHJvZmls/ZV9pbWFnZS8xMjEv/YjRhZmEyZTUtYzVh/OC00YWQ3LWE1NTAt/OTU1MTI1YTk1YTk3/LnBuZw</url>
      <title>Julia Community 🟣: St. Elmo Wilken</title>
      <link>https://forem.julialang.org/stelmo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.julialang.org/feed/stelmo"/>
    <language>en</language>
    <item>
      <title>Constraint-based metabolic modeling in Julia</title>
      <dc:creator>St. Elmo Wilken</dc:creator>
      <pubDate>Fri, 05 Aug 2022 10:54:00 +0000</pubDate>
      <link>https://forem.julialang.org/stelmo/constraint-based-metabolic-modeling-in-julia-4870</link>
      <guid>https://forem.julialang.org/stelmo/constraint-based-metabolic-modeling-in-julia-4870</guid>
      <description>&lt;p&gt;How do you rationally engineer the metabolism of a microorganism? First, you need to understand how it works of course! The blueprint describing how a cell functions is encoded by its genome. A cell's genome is the collection of all its genes, which are composed of DNA, and acts like a parts list. Each gene usually gets translated into an enzyme. These enzymes catalyze metabolic reactions, which are used to convert food (e.g. sugars like glucose) into energy, new cells, and other metabolic products, like &lt;a href="https://link.springer.com/article/10.1007/s00253-007-1163-x"&gt;biofuels&lt;/a&gt;. The reactions catalyzed by all these enzymes is what we call the cell's metabolism. &lt;/p&gt;

&lt;p&gt;Over the past few decades synthetic biology has made amazing strides. We are now able to engineering the genome with exquisite precision. For example, it is possible to modify &lt;a href="https://www.nature.com/articles/nature24644"&gt;single DNA bases&lt;/a&gt;, &lt;a href="https://www.nature.com/articles/srep17874"&gt;cut out endogenous genes&lt;/a&gt;, &lt;a href="https://www.science.org/doi/full/10.1126/science.aac9373"&gt;insert entirely new genes&lt;/a&gt;, and artificially &lt;a href="https://www.sciencedirect.com/science/article/pii/S240547122030418X"&gt;regulate the expression of enzymes&lt;/a&gt; with relative ease. An ongoing goal is to better understand the metabolism of an organism so that these gene editing technologies can be harnessed to design and engineer microbes like we would a car. This can be used to &lt;a href="https://www.sciencedirect.com/science/article/pii/S0092867421000957"&gt;save the planet from fossil fuels&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;However, to get there, we need to systematically understand how changes at the gene level impact metabolism. If we can do this, we will know which genes (parts) to modify to bend metabolism to our will. A popular mathematical framework to accomplish this is via &lt;a href="https://www.nature.com/articles/nrg3643"&gt;constraint-based reconstruction and analysis (COBRA)&lt;/a&gt;. Briefly, COBRA entails cataloging all the reactions encoded for by the genome of an organism, and constructing a genome-scale metabolic model. Typically, these metabolic models are composed of 1000s of reactions that describe what metabolites an organism is capable of producing. Importantly, through painstaking work, these reactions are linked to &lt;a href="https://www.nature.com/articles/nbt.3956"&gt;specific genes&lt;/a&gt;. Using an optimization based technique called &lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3108565/"&gt;flux balance analysis&lt;/a&gt; (FBA, described in detail later), it is possible to predict the rate at which metabolic enzymes work (carry flux). The gene reaction rules encoded by the model link specific reactions to genes, allowing us to predict what would happen if the genome of an organism were to be modified.&lt;/p&gt;

&lt;p&gt;Recently, various packages, written purely in Julia, have been released to bring these kinds of analyses to our community. Will will use &lt;a href="https://github.com/LCSB-BioCore/COBREXA.jl"&gt;COBREXA&lt;/a&gt; and &lt;a href="https://github.com/stelmo/Escher.jl"&gt;Escher&lt;/a&gt; to demonstrate how a &lt;a href="https://journals.asm.org/doi/10.1128/ecosalplus.10.2.1"&gt;toy model&lt;/a&gt; of &lt;em&gt;Escherichia coli&lt;/em&gt;'s central metabolism can be engineered to enhance its production of acetate and ethanol.&lt;/p&gt;

&lt;p&gt;First, we need to download the genome-scale metabolic model and visualize it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="n"&gt;COBREXA&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Escher&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CairoMakie&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Tulip&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;

&lt;span class="c"&gt;# download a toy model of Escherichia coli's central metabolism&lt;/span&gt;
&lt;span class="n"&gt;download&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"http://bigg.ucsd.edu/static/models/e_coli_core.json"&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"e_coli_core.json"&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# download the metabolic map &lt;/span&gt;
&lt;span class="n"&gt;download&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"http://bigg.ucsd.edu/escher_map_json/e_coli_core.Core%20metabolism"&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"e_coli_core_map.json"&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# visualize the metabolism &lt;/span&gt;
&lt;span class="n"&gt;escherplot&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"e_coli_core_map.json"&lt;/span&gt;&lt;span class="x"&gt;;&lt;/span&gt; 
    &lt;span class="n"&gt;reaction_show_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reaction_edge_color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;grey&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;metabolite_show_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;metabolite_node_colors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Dict&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"glc__D_e"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;red&lt;/span&gt;&lt;span class="x"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;metabolite_node_color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;lightskyblue&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
&lt;span class="x"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;hidexdecorations!&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_axis&lt;/span&gt;&lt;span class="x"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;hideydecorations!&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_axis&lt;/span&gt;&lt;span class="x"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;current_figure&lt;/span&gt;&lt;span class="x"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://forem.julialang.org/images/WxTU4LUKpUGhXQ4l-4UJhdYp_ym5qmyhJAfOgOq8hGo/w:880/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzLzBj/dGhxb2o5bWc3OXJ1/MmtxYnhhLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/WxTU4LUKpUGhXQ4l-4UJhdYp_ym5qmyhJAfOgOq8hGo/w:880/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzLzBj/dGhxb2o5bWc3OXJ1/MmtxYnhhLnBuZw" alt="Toy metabolic model visualization of E. coli." width="880" height="651"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This model includes &lt;a href="https://en.wikipedia.org/wiki/Glycolysis"&gt;glycolysis&lt;/a&gt;, the &lt;a href="https://en.wikipedia.org/wiki/Citric_acid_cycle"&gt;TCA cycle&lt;/a&gt;, and the &lt;a href="https://en.wikipedia.org/wiki/Electron_transport_chain"&gt;electron transport chain&lt;/a&gt;. These metabolic modules are important in the central carbon metabolism of most cells and organisms. In short, glucose (a sugar, highlighted in red) is converted into energy (ATP) and other metabolic precursors that are used to produce more biomass (cells). Each edge in the figure is a reaction, and each node a metabolite. Most of the reactions in this model actually exist in &lt;em&gt;E. coli&lt;/em&gt;. One exception is the so-called biomass objective function (bottom right hand corner). Essentially, it is a pseudo-reaction that lumps all the unmodeled processes that convert the metabolites generated by the model into biomass. A fundamental assumption behind constraint-based models is that, through evolution, microbes have tuned their metabolism to satisfy some objective. In some cases, growth rate maximization is a &lt;a href="https://www.science.org/doi/10.1126/science.1216882"&gt;good enough simplification&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is where FBA comes into the picture. At its core, FBA formulates these genome-scale metabolic models as optimization problems:&lt;br&gt;


&lt;/p&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;max vμ(v)s. t. S⋅v=0lb≤v≤ub
    \begin{aligned}
    \underset{\mathbf{v}}{\text{max }} &amp;amp; \mu(\mathbf{v}) \\
    \text{s. t. } &amp;amp;  \mathbf{S} \cdot \mathbf{v} = 0 \\
    &amp;amp; \mathbf{lb} \leq \mathbf{v} \leq \mathbf{ub}
    \end{aligned}
&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mtable"&gt;&lt;span class="col-align-r"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;span class="mop op-limits"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mtight"&gt;&lt;span class="mord mathbf mtight"&gt;v&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="mop"&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;max &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;s. t. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="col-align-l"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;μ&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathbf"&gt;v&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;/span&gt;&lt;span class="mord mathbf"&gt;S&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;⋅&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord mathbf"&gt;v&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathbf"&gt;lb&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord mathbf"&gt;v&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;≤&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathbf"&gt;ub&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Here, the metabolism is represented through the stoichiometric matrix, &lt;strong&gt;S&lt;/strong&gt;, which enforces mass balance on the model. It acts to link reactions and metabolites within the model to each other. The biomass objective function is denoted μ, and is a linear function of the reaction fluxes, &lt;strong&gt;v&lt;/strong&gt;, which themselves can be bounded based on measured data. While metabolic models tend to be really big and complex, FBA reduces to a linear program, meaning it can be solved efficiently! &lt;/p&gt;

&lt;p&gt;By making use of Julia's excellent ecosystem, we were able to build &lt;a href="https://github.com/LCSB-BioCore/COBREXA.jl"&gt;COBREXA&lt;/a&gt;. It is a package for performing all manner of constraint-based modeling simulations and reconstructions. So, let's use it to engineer our toy model!&lt;/p&gt;

&lt;p&gt;First, let's simulate the growth of &lt;em&gt;E. coli&lt;/em&gt; under its default conditions (aerobic, glucose fed), and use COBREXA to predict its growth rate and active reactions with FBA.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="c"&gt;# load the model &lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;load_model&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"e_coli_core.json"&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# perform flux balance analysis &lt;/span&gt;
&lt;span class="n"&gt;fluxes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;flux_balance_analysis_dict&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Tulip&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Optimizer&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which results in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;julia&amp;gt; flux_summary(fluxes)
Biomass
  BIOMASS_Ecoli_core_w_GAM: 0.8739
Import
  EX_o2_e:                  -21.7995
  EX_glc__D_e:              -10.0
  EX_nh4_e:                 -4.7653
  EX_pi_e:                  -3.2149
Export
  EX_h_e:                   17.5309
  EX_co2_e:                 22.8098
  EX_h2o_e:                 29.1758
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thus, our model predicts a growth rate of 0.87 1/h when the cell metabolizes 10 mmol glucose/gDW/h (the default input). This is pretty accurate compared to experimental results! We can easily visualize which reactions the cell uses under these conditions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="n"&gt;tol&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1e-3&lt;/span&gt; &lt;span class="c"&gt;# threshold if reaction is active&lt;/span&gt;
&lt;span class="n"&gt;escherplot&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"e_coli_core_map.json"&lt;/span&gt;&lt;span class="x"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;reaction_edge_colors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Dict&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;red&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flux&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;fluxes&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;abs&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flux&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tol&lt;/span&gt;&lt;span class="x"&gt;),&lt;/span&gt;
&lt;span class="x"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;hidexdecorations!&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_axis&lt;/span&gt;&lt;span class="x"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;hideydecorations!&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_axis&lt;/span&gt;&lt;span class="x"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;current_figure&lt;/span&gt;&lt;span class="x"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://forem.julialang.org/images/xsg4luiJagNlrE0w7arSCmGGxDlnB11EypVUKDRwBKk/w:880/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzL2E5/dTNwdW1va2V0YjEy/ZDk0ZmhhLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/xsg4luiJagNlrE0w7arSCmGGxDlnB11EypVUKDRwBKk/w:880/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzL2E5/dTNwdW1va2V0YjEy/ZDk0ZmhhLnBuZw" alt="Aerobic simulation of E. coli's central metabolism" width="880" height="660"&gt;&lt;/a&gt;&lt;br&gt;
As you may see, only some of the reactions are used (the dashed ones are inactive). This is a realistic result, because microbes regulate their metabolism to suite their environmental needs. Specifically, the model uses &lt;a href="https://en.wikipedia.org/wiki/Cellular_respiration#Aerobic_respiration"&gt;respiration&lt;/a&gt; to produce energy, because it is a very efficient (you are doing it right now!). &lt;/p&gt;

&lt;p&gt;However, we would like our engineered microbe to produce ethanol to power our car. One way to achieve this is to knockout (delete) some genes to reroute cellular metabolism to achieve this goal. Let's delete the genes corresponding to cytochrome oxidase (one of the main reactions in aerobic respiration), and see what happens.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="n"&gt;ko_fluxes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;flux_balance_analysis_dict&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Tulip&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Optimizer&lt;/span&gt;&lt;span class="x"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;modifications&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="x"&gt;[&lt;/span&gt;
        &lt;span class="n"&gt;knockout&lt;/span&gt;&lt;span class="x"&gt;([&lt;/span&gt;&lt;span class="s"&gt;"b0978"&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"b0734"&lt;/span&gt;&lt;span class="x"&gt;]),&lt;/span&gt; &lt;span class="c"&gt;# these genes code for cytochrome oxidase&lt;/span&gt;
    &lt;span class="x"&gt;],&lt;/span&gt;
&lt;span class="x"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which results in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="n"&gt;julia&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;flux_summary&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ko_fluxes&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Biomass&lt;/span&gt;
  &lt;span class="n"&gt;BIOMASS_Ecoli_core_w_GAM&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.2117&lt;/span&gt;
&lt;span class="n"&gt;Import&lt;/span&gt;
  &lt;span class="n"&gt;EX_glc__D_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;              &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;10.0&lt;/span&gt;
  &lt;span class="n"&gt;EX_h2o_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                 &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;7.1158&lt;/span&gt;
  &lt;span class="n"&gt;EX_nh4_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                 &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.1542&lt;/span&gt;
  &lt;span class="n"&gt;EX_pi_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                  &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.7786&lt;/span&gt;
  &lt;span class="n"&gt;EX_co2_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                 &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.3782&lt;/span&gt;
&lt;span class="n"&gt;Export&lt;/span&gt;
  &lt;span class="n"&gt;EX_etoh_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                &lt;span class="mf"&gt;8.2795&lt;/span&gt;
  &lt;span class="n"&gt;EX_ac_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                  &lt;span class="mf"&gt;8.5036&lt;/span&gt;
  &lt;span class="n"&gt;EX_for_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                 &lt;span class="mf"&gt;17.8047&lt;/span&gt;
  &lt;span class="n"&gt;EX_h_e&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;                   &lt;span class="mf"&gt;30.5542&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whoa! We have totally changed the cell's physiology! Now, it is growing much slower (0.21 1/h), but it is producing both ethanol and acetate. We can visually inspect what is going again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight julia"&gt;&lt;code&gt;&lt;span class="n"&gt;escherplot&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"e_coli_core_map.json"&lt;/span&gt;&lt;span class="x"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;reaction_edge_colors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Dict&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;red&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flux&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ko_fluxes&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;abs&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;flux&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tol&lt;/span&gt;&lt;span class="x"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;metabolite_node_color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;lightskyblue&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reaction_show_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;metabolite_show_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="x"&gt;,&lt;/span&gt;
&lt;span class="x"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;hidexdecorations!&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_axis&lt;/span&gt;&lt;span class="x"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;hideydecorations!&lt;/span&gt;&lt;span class="x"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_axis&lt;/span&gt;&lt;span class="x"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;current_figure&lt;/span&gt;&lt;span class="x"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://forem.julialang.org/images/Jz3YJFIG429gHehvC7P-fbMJQz1T3I6fj8OYwhRad_A/w:880/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzLzBv/OXQweHd4Z2x1M2Fj/eGZ2eXVnLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://forem.julialang.org/images/Jz3YJFIG429gHehvC7P-fbMJQz1T3I6fj8OYwhRad_A/w:880/mb:500000/ar:1/aHR0cHM6Ly9mb3Jl/bS5qdWxpYWxhbmcu/b3JnL3JlbW90ZWlt/YWdlcy91cGxvYWRz/L2FydGljbGVzLzBv/OXQweHd4Z2x1M2Fj/eGZ2eXVnLnBuZw" alt="Knockout simulation of E. coli." width="880" height="660"&gt;&lt;/a&gt;&lt;br&gt;
The entire metabolism has changed. Without these two crucial genes the cell uses &lt;a href="https://en.wikipedia.org/wiki/Fermentation"&gt;fermentation&lt;/a&gt; to grow and we can use its metabolic byproducts (acetate and ethanol) to power our car.&lt;/p&gt;

&lt;p&gt;COBREXA can do much more than these simple simulations, and was specifically designed to be scalable to massive systems of interacting microbes. You can read the docs &lt;a href="https://lcsb-biocore.github.io/COBREXA.jl/stable/"&gt;here&lt;/a&gt; to see what else it can do. As a challenge, see if you can use the functions in COBREXA to identify which genes to delete to maximize the production of ethanol :) &lt;/p&gt;

</description>
      <category>cobra</category>
      <category>optimization</category>
      <category>modeling</category>
      <category>biology</category>
    </item>
  </channel>
</rss>
