<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Reproducing the example in Figure 1 of Shlomi et al. 2009
<p>**Authors**
Step1:  <span style="color
Step2:  Reproducing Figure 1B
We have written a python function that implements the entire method proposed by Shlomi et al in the "findBiomarkers()" function. For now we will simply check to see if it produces the same qualitative results as the original paper. 
We have reconstructed the network in Figure 1A. We will now block reaction 1 and show that we predict what is in Figure 1B.
<ASSISTANT_TASK:>
Python Code:
import cobra
from utils import findBiomarkers, show_map
import pandas as pd
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
model = cobra.io.read_sbml_model("models/Shlomi_example.xml")
Explanation: Reproducing the example in Figure 1 of Shlomi et al. 2009
<p>**Authors**: Thierry D.G.A Mondeel, Stefania Astrologo, Ewelina Weglarz-Tomczak & Hans V. Westerhoff <br/>
University of Amsterdam <br/>2017
</p>
Next we will focus on an intriguing application of the human metabolic model: the ability to predict the accumulation and depletion of any biomarker metabolites in extracellular tissues and fluids upon a specific mutation. 
The method we will utilize to do this is based on flux variability analysis and was presented originally in (Shlomi, 2009). It was subsequently used in the RECON2 paper to produce Figure 3.
This code reproduces the network and biomarker predictions in the example from (Schlomi,2009), Figure 1.
You can read the paper here: http://doi.org/10.1038/msb.2009.22
<span style="color:red">Assignment (10 min):</span>
To follow and understand this tutorial be sure you:
* Read the abstract of the paper by Shlomi et al. 
* If time permits you should also read through the introduction which is only 3 paragraphs.
* Also take a look at the RECON2 paper again, specifically the part concerning Figure 3. Read the caption of the figure and the paragraph of text above it. http://www.nature.com/nbt/journal/v31/n5/full/nbt.2488.html
Some essential parts of the method will be introduced in the notebook below. 
<span style="color:red">Assignment (10 min):</span>
We already made the example network shown in Figure A from the original publication below. Execute the cell below and read the portion of the methods section from Shlomi et al. that we pasted below.
End of explanation
# write a for loop here. 
# tip: make use of model.reactions and of the .reaction attribute of each reaction
Explanation: <span style="color:red">Assignment (10 min):</span> Read and try to understand the following excerpt from the methods section from Shlomi et al. 
The method
 This is a selective copy/paste from the original paper: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2683725/
We present a new computational approach for systematically predicting the pattern of metabolic biomarkers characterizing each metabolic disorder whose causative gene is included in the human metabolic network model (Duarte et al, 2007). Let a boundary metabolite denote a metabolite that is known to be taken-up or secreted between the intracellular and extracellular compartments. 
Let an exchange interval denote a possible range of uptake and secretion fluxes of a given boundary exchange interval. For each metabolic disorder and each boundary metabolite, we predict its exchange interval between human tissues and biofluids, for both healthy and disease cases. This exchange interval is computed through a CBM method called flux variability analysis (FVA) (Mahadevan and Schilling, 2003), which accounts for the entire space of feasible flux states that satisfy mass-balance stoichiometric constraints and reaction directionality constraints (embedded in the model of (Duarte et al, 2007)). 
For the healthy case, the exchange interval is computed while the reactions affected by the disease are constrained to be active, whereas for the disease case, they are constrained to be inactive. By comparing the predicted exchange interval between the healthy state and the disease state for each boundary metabolite, one can determine whether the pertaining boundary metabolite concentration in biofluids (termed biomarker) is expected to be elevated, reduced or unchanged. 
If the predicted changes are marked such that there is no overlap between the exchange intervals of the healthy case and the disease case, the predicted biomarker change is considered to be highly confident.
An illustrative example of the predicted biomarker changes' ranges and their underlying rationale for the healthy state and some disease state is depicted in Figures 1A and B. The predicted exchange intervals of metabolite M1 (M2) suggest that its extracellular concentration is elevated (reduced) in the disease case. The disjoint exchange intervals obtained for the healthy case and the disease case for both M1 and M2 render these predictions as highly confident. The exchange intervals of metabolite M6 (M4) suggest that their extracellular concentrations are elevated (reduced) in the disease case. Examining, for example, the exchange interval of metabolite M6 shows that in the healthy case, M6 can be either taken-up from biofluids or secreted in a lower rate (as some of it is required in the healthy state; Supplementary Figure 1). In the disease case, M6 (synthesized through M5) can only be secreted to biofluids. It should be noted that mass-balance stoichiometric constraints that play an important role in determining the exchange intervals of different metabolites and are accounted for by the CBM method (and as will be shown, play an important role in determining biomarker changes in addition to the network topology) are not depicted in this kind of illustration.
<img src="images/shlomi_example.png">
<span style="color:red">Assignment (5 min):</span> Make sure you understand why, if flux variablity analysis predicts an exchange interval of metabolite X to become more positive,
this "predicts" that the metabolite builds up in the biofluids! And vice versa.
<span style="color:red">Assignment (5 min):</span> Make sure you agree that we have reconstructed the network in Figure 1A correctly. Write a for loop that prints all reactions in the model and check that they are correct.
End of explanation
exchanges = [ rxn for rxn in model.reactions if rxn.products == [] ]
exchangesIds = [rxn.id for rxn in exchanges]
findBiomarkers(model,fvaRxns=exchangesIds,mods=[model.reactions.R1.id],cutoff=0)
Explanation: Reproducing Figure 1B
We have written a python function that implements the entire method proposed by Shlomi et al in the "findBiomarkers()" function. For now we will simply check to see if it produces the same qualitative results as the original paper. 
We have reconstructed the network in Figure 1A. We will now block reaction 1 and show that we predict what is in Figure 1B.
End of explanation
<END_TASK>