|
|
(33 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | {{Heidelberg/header
| |
− | }}
| |
− | {{Heidelberg/navbar
| |
− | }}
| |
− | {{Heidelberg/templateus/Mainbody|
| |
− | Modeling.|
| |
− | Interactive tools|
| |
− | https://static.igem.org/mediawiki/2017/a/ae/T--Heidelberg--2017_Background_Tiger.jpg|
| |
− | {{Heidelberg/templateus/Contentsection|
| |
− | {{#tag:html|
| |
− | <h2>Number of mutations and mutated sequences</h2>
| |
− | Expected number of mutations in a single sequence:
| |
− | $$p_{m} = \frac{N_{mutations} }{L_{Sequence} } = N_{generations} \cdot r_{mutation} = t_{total} \cdot \Phi \cdot r_{mutation}$$
| |
− |
| |
− | The expected share of sequences that shows at least one mutation in \(L_{Sequence}\) bp is the probability that \(L_{sequence}\) basepairs stay unchanged when \(\frac{N_{mutations} }{L_{Sequence} }\) mutations are expected:
| |
− | $$p_{M} = \frac{N_{mutated} }{N_{Sequences} } = 1 - p(N_{mutations}=0) = 1 - (1-p_{m})^{L_{Sequence} } $$
| |
− |
| |
− | With this equation we can also calculate the number of sequences \(N_{Sequences}\) that have to be sequenced in order to find a mutated one with a probability of \(p(N_{mutated} > 0)\).
| |
− | $$ N_{Sequences} = \frac{p(N_{mutated} > 0)}{p_{M} } $$
| |
− |
| |
− | The probability to find at least one mutated sequence under the given conditions is
| |
− | $$p(N_{mutated}>0) = 1 - (1-p_{M})^{N_{sequences} }$$
| |
− | which gives
| |
− | $$N_{Sequences} = \frac{ln(1-p(N_{mutated}>0))}{ln(1-p_{M})}$$
| |
− |
| |
− | Set \(\Phi\) to zero to use the number of generations for the calculation. If \(\Phi\) and the number of generations are given, \(\Phi\) is used.
| |
− | Consider \(L_{Sequence}\) as the number of basepairs that is expected to be mutated. If half of the sequence you are interested in, is highly conserved choose a lower \(L_{Sequence}\).
| |
| | | |
− |
| |
− | <form action="" id="form1">
| |
− | <section>
| |
− | <h2>Get your mutations</h2>
| |
− | <ul class="input-list style-1 clearfix">
| |
− | <li>
| |
− | <label>
| |
− | Mutation rate \(r_{mutation} \:[bp/generation]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="mr" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Flow troughLagoon \(\Phi_{lagoon} \: [Volumes/h]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="phi" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Total time<br> in lagoon \(t_{total} \: [h]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="tt" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Number<br> of generations \(N_{generations}\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="ng" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Length of sequence that can mutate \(L_{Sequence} \: [bp]\)<br>
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="ls" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Number of sequences that are sequenced \(N_{Sequences}\)<br>
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="ns" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Probability to get at least one mutated result \(p(N_{mutated}>0) \)<br>
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="pm" value="0.9" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="Submit" id="input_form" onclick="return number_mutations();">
| |
− | </div>
| |
− | </li>
| |
− | </ul>
| |
− | </section>
| |
− | </form>
| |
− | <div class="container-fluid" style="margin-top: 10px;" id="container2">
| |
− | <p id="warnings_mutations"></p>
| |
− | <br>
| |
− | <p id="number_generations"></p>
| |
− | <p>\(p_{m} =\) <span id="amount_mutations"></span> %(bp/bp).</p>
| |
− | <p>\(N_{mutations} =\) <span id="number_mutations"></span> bp per sequence.</p>
| |
− | <p>The share of sequences that shows at least one mutation in \(L_{Sequence}\) bp is \(p_{M}=\) <span id="amount_mutated"></span> % of sequences</p>
| |
− | <p id="probability_positive_sequencing"></p>
| |
− | <p id="number_to_seq"></p>
| |
− | </div>
| |
− |
| |
− |
| |
− | }}
| |
− | }}
| |
− | {{Heidelberg/templateus/Contentsection|
| |
− | {{#tag:html|
| |
− | <h2>Diff tool</h2>
| |
− | Marks differences in two strings, ignores newlines.
| |
− |
| |
− |
| |
− | <form action="" id="form2">
| |
− | <section>
| |
− | <ul class="input-list style-1 clearfix">
| |
− | <li>
| |
− | <label>
| |
− | String 1<br>
| |
− | <textarea id="str1" lang='en-150' rows=8 cols=50></textarea>
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | String 2<br>
| |
− | <textarea id="str2" lang='en-150' rows=8 cols=50></textarea>
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label for="case_sensitive">
| |
− | Case sensitive
| |
− | <input type="checkbox" Name="Case sensitive" id="case_sensitive" value="True" checked>
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="Submit" id="input_form2" onclick="return differences();">
| |
− | </div>
| |
− | </li>
| |
− | </ul>
| |
− | </section>
| |
− | </form>
| |
− | <div>
| |
− | Comparison:
| |
− | <div style="overflow-x:scroll !important; overflow-y:hidden !important; max-height: 100px !important; background-color: whitesmoke;">
| |
− | <p id="outstr1" style="display:inline !important; overflow: hidden !important; white-space: nowrap !important; font-family: monospace !important;"></p>
| |
− | <br>
| |
− | <p id="outstr2" style="display:inline !important; overflow: hidden !important; white-space: nowrap !important; font-family: monospace !important;"></p>
| |
− | </div>
| |
− | <p id="diffinfo"></p>
| |
− | </div>
| |
− | }}
| |
− | }}
| |
− | {{Heidelberg/templateus/Contentsection|
| |
− | {{#tag:html|
| |
− | <h2>Glucose Concentratoin</h2>
| |
− | Calculate the ideal glucose concentration in the medium used for either a turbidostat or a single flask.
| |
− | The glucose concentration in the <b>turbidostat</b> \(c_{G_{T} }\) is increased with the incoming medium with a flow rate of \(\Phi\) and a glucose concentration of \(c_{G_{M} }\). It is decreased by with the medium that leaves the turbidostat with the same flow rate, but a glucose concentration of \(c_{G_{T} }\). Additionally E. coli take up glucose with a concentration of \(c_{E}\) and a rate of \(q\).
| |
− | $$
| |
− | \frac{\partial c_{G_{T} }(t)}{\partial t} = \Phi \cdot c_{G_{M} } - \Phi \cdot c_{G_{T} } - c_{E} \cdot q
| |
− | $$
| |
− | In the case of a turbidostat we can assume a dynamic equilibrium:
| |
− | $$
| |
− | \frac{\partial c_{G_{T} }(t)}{\partial t} = 0
| |
− | $$
| |
− | This results in
| |
− | $$
| |
− | c_{G_{T} } = c_{G_{M} } - \frac{c_{E. coli} \cdot q}{\Phi}
| |
− | $$ $$
| |
− | \Leftrightarrow c_{G_{M} } (c_{G_{T} }) = c_{G_{T} } + \frac{c_{E} \cdot q}{\Phi}
| |
− | $$
| |
− | When a lagoon with Volume \(V_{L}\) and a flowrate of \(\Phi_{L}\) is supplied by the turbidostat the glucose consumption in that lagoon can be modeled the same way. Because the <i>E. coli</i> titer, glucose concentration and flow rate into the lagoon are constant, a steady state equilibrium can be assumed:
| |
− | $$
| |
− | c_{G_{L} } = c_{G_{T} } - \frac{c_{E. coli} \cdot q}{\Phi_{L} }
| |
− | $$
| |
− | In the context of PACE mutagenesis plasmids are induced in the lagoons which stops growth of E. coli, hence the E. coli titer is assumed to be the same as in the turbidostat.
| |
− | $$
| |
− | c_{G_{L} } = c_{G_{M} } - \frac{c_{E} \cdot q}{\Phi} - \frac{c_{E} \cdot q}{\Phi_{L} }
| |
− | $$
| |
− | $$
| |
− | \Leftrightarrow c_{G_{M} } (c_{G_{L} }) = c_{G_{L} } + \frac{c_{E} \cdot q}{\Phi} + \frac{c_{E} \cdot q}{\Phi_{L} }
| |
− | $$
| |
− |
| |
− | <br>
| |
− | If the concentration of glucose in a <b>flask</b>, \(c_{G_{F} }\) needs to be determined, the functional dependencies are as follows.
| |
− |
| |
− | As there is no incoming medium, or medium that leaves the flask, the concentration of glucose is only changed by <i>E. coli</i> degrading it.
| |
− | $$
| |
− | \frac{\partial c_{G_{F} }(t)}{\partial t} = q \cdot \int_{t_{0} }^{t} c_{E}(t) \: dt
| |
− | $$
| |
− | Exponential growth of the <i>E. coli</i> is assumed, resulting in
| |
− | $$c_{G_{F} }(t) = c_{G_{F} }(t_{0}) - q \cdot \int_{t_{0} }^{t} c_{E}(t) \: dt
| |
− | $$
| |
− | $$
| |
− | = c_{G_{F} }(t_{0}) -q \cdot \int_{t_{0} }^{t} c_{E}(t_{0}) \cdot exp\left(\frac{ln(2) \cdot t}{t_{E} }\right) dt
| |
− | $$
| |
− | $$
| |
− | = c_{G_{F} }(t_{0}) - q \cdot c_{E}(t_{0}) \cdot t_{E} \cdot \left(exp\left(\frac{ln(2) \cdot t}{t_{E} }\right) - exp\left(\frac{ln(2) \cdot t_{0} }{t_{E} }\right)\right)
| |
− | $$
| |
− | So the glucose starting concentration \(c_{G_{F} }(t_{0})\) needed to get a concentration of \(c_{G_{f} }(t)\) afer a duration of \(t\) is calculated by
| |
− | $$
| |
− | c_{G_{F} }(t_{0}) = c_{G_{F} }(t) + q \cdot c_{E}(t_{0}) \cdot t_{E} \cdot \left(exp\left(\frac{ln(2) \cdot t}{t_{E} }\right) - exp\left(\frac{ln(2) \cdot t_{0} }{t_{E} }\right)\right)
| |
− | $$
| |
− | If logistic growth is assumed, the term for \(c_{E}(t)\) changes. Here \(c_{c}\) is the capacity, the maximum concentration of <i>E. coli</i> under the present conditions.
| |
− | $$
| |
− | c_{G_{F} }(t) = c_{G_{F} }(t_{0}) - q \cdot \int_{t_{0} }^{t} c_{E}(t) \: dt
| |
− | $$
| |
− | $$
| |
− | = c_{G_{F} } (t_{0}) -q \int_{t_{0} }^{t} \frac{c_{E}(t_{0}) \: exp \big(ln(2) \cdot \frac{t}{t_{E} } \big)}{1+ \frac{c_{E}(t_{0})}{c_{c} } \: exp \big(ln(2) \cdot \frac{t}{t_{E} }\big)} \: dt
| |
− | $$
| |
− | $$
| |
− | = c_{G_{F} } (t_{0}) - q \: \frac{t_{E} \cdot c_{c} }{ln(2)} \cdot ln \Bigg( \frac{1 + \frac{c_{E}(t_{0})}{c_{c} } exp\big(ln(2) \: \frac{t}{t_{e} } \big)}{1 + \frac{c_{E}(t_{0})}{c_{c} } } \Bigg)
| |
− | $$
| |
− | So the glucose starting concentration \(c_{G_{F} }(t_{0})\) needed to get a concentration of \(c_{G_{f} }(t)\) afer a duration of \(t\) is calculated by
| |
− | $$
| |
− | c_{G_{F} } (t_{0}) = c_{G_{F} } (t) + q \: \frac{t_{E} \cdot c_{c} }{ln(2)} \cdot ln \Bigg( \frac{1 + \frac{c_{E}(t_{0})}{c_{c} } exp\big(ln(2) \: \frac{t}{t_{e} } \big)}{1 + \frac{c_{E}(t_{0})}{c_{c} } } \Bigg)
| |
− | $$
| |
− |
| |
− | <br>
| |
− | <b>Further calculations</b> for simplification of entering data:
| |
− | $$
| |
− | c_{E. coli_{DW} } = c_{E. coli_{OD600} } \cdot 0.36
| |
− | $$
| |
− | according to <i>Milo et al.</i><x-ref>Milo2009</x-ref>.
| |
− | $$
| |
− | q = 0.183 \: g_{Glucose} \: g_{DW}^{-1} \: h^{-1}
| |
− | $$
| |
− | according to <i>Neubauer et al.</i><x-ref>Neubauer2001</x-ref>.
| |
− |
| |
− |
| |
− | Because turbidstats are operated at a constant cell density, the flow rate \(\Phi\) can be calculated from the generation time \(t_{E}\).
| |
− | $$
| |
− | \Phi = \frac{ln(2)}{t_{E} }
| |
− | $$
| |
− |
| |
− | If the <i>E. coli</i> titer in \(g_{DW}/l\) is zero, it is calculated from the OD, else the dryweight value is used. If the glucose concentration in \(mmol/l\) not zero, it is used for the calulation. If the generation time \(t_{E}\) is not zero, it is used to calculate the flow rate \(\Phi\).
| |
− | }}
| |
− | }}
| |
− | {{Heidelberg/templateus/Contentsection|
| |
− | {{#tag:html|
| |
− | <form action="" id="form1">
| |
− | <section>
| |
− | <h2>Get the ideal concentration</h2>
| |
− | <ul class="input-list style-1 clearfix">
| |
− | <li>
| |
− | <label>
| |
− | Glucose concentration <br> \(c_{G} \: [g/l]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="cturbidostat" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Glucose concentration <br> \(c_{G} \: [mmol/l]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="cturbidostatmol" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Flow rate <br>\(\Phi \:[Volumes/h]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="fr" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Generation time <br>\(t_{E} \:[min]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="te" value="30" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | <i>E. coli</i> titer<br> \(c_{E. coli} \:[OD600]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="ectiterod" value="0.8" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | <i>E. coli</i> titer<br> \(c_{E. coli} \:[g_{DW}/l]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="ectiterdw" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Lagoon volume<br> \(V_{L} \:[ml]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="vl" value="100" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Lagoon Flow rate <br> \(\Phi_{L} \:[ml/min]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="phil" value="1.667" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Glucose degradation<br>\(q \: [g_{glucose} \: g_{DW}^{-1} h^{-1}]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="q" value="0.183" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | Time <br>\(t \: [min]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="gluc_time" value="90" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | <i>E. coli</i> start concentration<br>\(c_{E} \: [g/L]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="ec0dw" value="0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | <i>E. coli</i> start concentration<br>\(c_{E} \: [OD600]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="ec0od" value="0.01" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | <i>E. coli</i> capacity <br>\(c_{c} \: [g/L]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="cmaxdw" value="0.72" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <label>
| |
− | <i>E. coli</i> capacity <br>\(c_{c} \: [OD600]\)
| |
− | <input type="number" pattern="[0-9]+([,\.][0-9]+)?" id="cmaxod" value="2.0" lang='en-150' step="any">
| |
− | </label>
| |
− | </li>
| |
− | </ul>
| |
− |
| |
− | <ul class="input-list style-1 clearfix">
| |
− | <li>
| |
− | <label for="logistic">
| |
− | Logistic <input type="checkbox" Name="Logistic" id="logistic" value="True" checked>
| |
− | </label>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="Medium (Turbidostat)" id="input_form" onclick="return glucosecont();">
| |
− | </div>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="Medium (Lagoon)" id="input_form" onclick="return glucosecont_lagoon();">
| |
− | </div>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="Lagoon (Medium)" id="input_form" onclick="return glucosecont_forward();">
| |
− | </div>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="Medium (Flask)" id="input_form" onclick="return glucosedis();">
| |
− | </div>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="New Medium (Flask) " id="input_form" onclick="return glucosedisnew();">
| |
− | </div>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="Flask (Medium)" id="input_form" onclick="return glucosedis_forward();">
| |
− | </div>
| |
− | </li>
| |
− | <li>
| |
− | <div style="padding-top: 30px;">
| |
− | <input type="button" value="New Flask (Medium)" id="input_form" onclick="return glucosedisnew_forward();">
| |
− | </div>
| |
− | </li>
| |
− | </ul>
| |
− | </section>
| |
− | </form>
| |
− |
| |
− | <p id="glucoseout"></p><br>
| |
− | <div style="width: 100% !important; overflow-x: auto !important;">
| |
− | <div style="width: 100% !important; min-width: 700 !important;" id="glucoseplot">
| |
− | </div>
| |
− | </div>
| |
− | <br>
| |
− | }}
| |
− | }}
| |
− | }}
| |
− | {{Heidelberg/references2
| |
− | }}
| |
− | {{Heidelberg/footer
| |
− | }}
| |
− |
| |
− |
| |
− | {{Heidelberg/tools_code
| |
− | }}
| |
− |
| |
− | <script type="text/javascript">
| |
− |
| |
− | var call = 0;
| |
− |
| |
− | //example that contains everything needed
| |
− | function dummy(){
| |
− | //get the values
| |
− | var mr = Number(document.getElementById('mr').value);
| |
− |
| |
− | //initialise variables
| |
− | var a_mutations = 0;
| |
− |
| |
− | //calculate
| |
− | if(phi==0){
| |
− | a_mutations = ng * mr;
| |
− | }
| |
− |
| |
− | //return the results
| |
− | $("#amount_mutated").html((Math.round(100000 * a_mutated))/1000);
| |
− | $("#number_generations").html(ng_out);
| |
− |
| |
− | //end the function
| |
− | return false;
| |
− | }
| |
− |
| |
− | function number_mutations(){
| |
− |
| |
− | //get the values
| |
− | var mr = Number(document.getElementById('mr').value);
| |
− | var phi = Number(document.getElementById('phi').value);
| |
− | var ng = Number(document.getElementById('ng').value);
| |
− | var tt = Number(document.getElementById('tt').value);
| |
− | var ls = Number(document.getElementById('ls').value);
| |
− | var ns = Number(document.getElementById('ns').value);
| |
− | var pm = Number(document.getElementById('pm').value);
| |
− |
| |
− | //initialise variables
| |
− | var a_mutations = 0;
| |
− | var n_mutations = '?';
| |
− | var a_mutated = '?';
| |
− | var ng_out = "";
| |
− | var number_to_seq_out = "";
| |
− | var number_to_seq = 0;
| |
− | var probability_positive_sequencing = ''
| |
− | var warnings = ""
| |
− |
| |
− | //Check, if given values make sense:
| |
− |
| |
− | if(mr>1){
| |
− | warnings += "A mutation rate that is above one mutation per basepair, per generation does not make sense. 100 % should be enough, right? ";
| |
− | mr = 1;
| |
− | }
| |
− |
| |
− | if(pm>1){
| |
− | warnings += "A probability of 100 % should be enough, right?. ";
| |
− | pm = 1;
| |
− | }
| |
− |
| |
− | //calculate
| |
− |
| |
− |
| |
− | if(phi*tt==0){
| |
− | a_mutations = 1 - Math.pow((1 - mr), ng);
| |
− | ng_out = "";
| |
− | }
| |
− | else{
| |
− | a_mutations = 1 - Math.pow((1 - mr), tt*phi);
| |
− | ng = tt*phi;
| |
− | ng_out = "The conditions result in " + ng + " generations.";
| |
− | }
| |
− |
| |
− | n_mutations = ls * a_mutations;
| |
− | a_mutated = 1 - Math.pow((1-a_mutations), ls);
| |
− |
| |
− | if(ns!=0){
| |
− | probability_positive_sequencing = ns*a_mutated;
| |
− | $("#probability_positive_sequencing").html("Sequencing " + ns + " sequences results in a " + ((Math.round(probability_positive_sequencing*100))/100) + "% probabiltiy of finding at least one mutated sequence.");
| |
− | }
| |
− | else{
| |
− | $("#probability_positive_sequencing").html("");
| |
− | }
| |
− |
| |
− | if(pm!=0){
| |
− | number_to_seq = Math.max(1, Math.round((Math.log(1-pm))/(Math.log(1-a_mutated))));
| |
− | if(isNaN(number_to_seq)){
| |
− | if(pm==1){
| |
− | number_to_seq_out = "To be 100 % sure, sequence infinitely many sequences.";
| |
− | }
| |
− | else{
| |
− | number_to_seq_out = "Unluckily we were unable to calculate the number of sequences to sequence to have a " + (pm*100) + "% probability for a positive result.";
| |
− | }
| |
− | }
| |
− | else{
| |
− | number_to_seq_out = "Sequence " + number_to_seq + " clones to have a " + (pm*100) + " % probability to have at least one mutated under the results.";
| |
− | }
| |
− | }
| |
− |
| |
− | //return the results
| |
− | $("#amount_mutations").html((Math.round(1000000 * a_mutations))/10000);
| |
− | $("#number_mutations").html((Math.round(n_mutations*100))/100);
| |
− | $("#amount_mutated").html((Math.round(100000 * a_mutated))/1000);
| |
− | $("#number_generations").html(ng_out);
| |
− | $("#number_to_seq").html(number_to_seq_out);
| |
− | $("#warnings_mutations").html(warnings);
| |
− |
| |
− |
| |
− | //end the function
| |
− | return false;
| |
− | }
| |
− |
| |
− | </script>
| |
− | <script type="text/javascript">
| |
− |
| |
− | function glucosecont(){
| |
− | glucose('cont');
| |
− | }
| |
− | function glucosecont_lagoon(){
| |
− | glucose('cont_lagoon');
| |
− | }
| |
− | function glucosecont_forward(){
| |
− | glucose('cont_forward');
| |
− | }
| |
− |
| |
− |
| |
− | function glucosedis(){
| |
− | glucose('dis');
| |
− | }
| |
− | function glucosedisnew(){
| |
− | glucose('disnew');
| |
− | }
| |
− |
| |
− | function glucosedis_forward(){
| |
− | glucose('disforward');
| |
− | }
| |
− | function glucosedisnew_forward(){
| |
− | glucose('disnewforward');
| |
− | }
| |
− |
| |
− | </script>
| |
− | <script type="text/javascript">
| |
− | console.log('alive');
| |
− |
| |
− | function glucose(mode){
| |
− | //get the values
| |
− | var cturbidostat = Number(document.getElementById('cturbidostat').value);
| |
− | var cturbidostatmol = Number(document.getElementById('cturbidostatmol').value);
| |
− | var fr = Number(document.getElementById('fr').value);
| |
− | var ectiterod = Number(document.getElementById('ectiterod').value);
| |
− | var ectiterdw = Number(document.getElementById('ectiterdw').value);
| |
− | var q = Number(document.getElementById('q').value);
| |
− | var te = Number(document.getElementById('te').value);
| |
− | var gluc_time = Number(document.getElementById('gluc_time').value);
| |
− | var ec0dw = Number(document.getElementById('ec0dw').value);
| |
− | var ec0od = Number(document.getElementById('ec0od').value);
| |
− | var vl = Number(document.getElementById('vl').value);
| |
− | var phil = Number(document.getElementById('phil').value);
| |
− | var cmaxod = Number(document.getElementById('cmaxod').value);
| |
− | var cmaxdw = Number(document.getElementById('cmaxdw').value);
| |
− | var logistic = document.getElementById("logistic").checked;
| |
− |
| |
− | //initialise variables
| |
− | var glucoseout = "";
| |
− | var frl = 0;
| |
− | var glucosemedium = 0;
| |
− | var gl_OD = 0.36;
| |
− |
| |
− | frl = phil*60/vl;
| |
− |
| |
− | if(ectiterdw == 0){
| |
− | ectiterdw = ectiterod * gl_OD;
| |
− | }
| |
− | else{
| |
− | ectiterod = ectiterdw/gl_OD;
| |
− | }
| |
− |
| |
− | if(cturbidostatmol != 0){
| |
− | cturbidostat = cturbidostatmol * 180.1559/1000.0;
| |
− | }
| |
− | else{
| |
− | cturbidostatmol = cturbidostat/(180.1559/1000.0);
| |
− | }
| |
− |
| |
− | if(te != 0){
| |
− | fr = 60.0 * Math.LN2/te;
| |
− | }
| |
− | else{
| |
− | te = fr * Math.LN2/60.0;
| |
− | }
| |
− |
| |
− | if(ec0dw == 0){
| |
− | ec0dw = ec0od * gl_OD;
| |
− | }
| |
− | else{
| |
− | ec0od = ec0dw/gl_OD;
| |
− | }
| |
− |
| |
− | if(cmaxdw == 0){
| |
− | cmaxdw = cmaxod * gl_OD;
| |
− | }
| |
− | else{
| |
− | cmaxod = cmaxdw/gl_OD;
| |
− | }
| |
− |
| |
− | if(mode == 'cont'){
| |
− | //calculate
| |
− | glucosemedium = cturbidostat + ((ectiterdw * q)/fr);
| |
− |
| |
− | var glucosemediummol = glucosemedium/(180.1559/1000.0);
| |
− |
| |
− | //return the results
| |
− | glucoseout =
| |
− | "With a <b>glucose concentration of " +
| |
− | (0.01*Math.round(100*glucosemedium)) +
| |
− | " g/L, " +
| |
− | (0.01*Math.round(100*glucosemediummol)) +
| |
− | "mmol/l in the medium</b>, a flow rate of " +
| |
− | (0.01*Math.round(100*fr)) +
| |
− | " Volumes/h, or a generation time of " +
| |
− | Math.round(te) +
| |
− | " min, an <i>E. coli</i> titer of " + (0.01*Math.round(100*ectiterdw)) +
| |
− | " g/l, an OD600 of " +
| |
− | (0.01*Math.round(100*ectiterod)) +
| |
− | " and a degradation rate of " +
| |
− | (0.01*Math.round(100*q)) +
| |
− | " g l<sup>-1</sup>cfu<sup>-1</sup>h<sup>-1</sup> a concentration of " +
| |
− | (0.01*Math.round(100*cturbidostat)) +
| |
− | " g/L, "
| |
− | + (0.01*Math.round(100*cturbidostatmol)) +
| |
− | " mmol/l is maintained.";
| |
− |
| |
− | $("#glucoseplot").html('');
| |
− |
| |
− | }
| |
− | else if(mode=='cont_lagoon'){
| |
− | glucosemedium_lagoon = cturbidostat + ((ectiterdw * q)/fr) + ((ectiterdw * q)/fr);
| |
− |
| |
− | glucose_turbidostat = glucosemedium_lagoon - ((ectiterdw * q)/fr);
| |
− |
| |
− | var glucose_turbidostat_mol = glucose_turbidostat/(180.1559/1000.0);
| |
− |
| |
− | var glucosemedium_lagoon_mol = glucosemedium_lagoon/(180.1559/1000.0);
| |
− |
| |
− | //return the results
| |
− | glucoseout =
| |
− | "With a <b>glucose concentration of " +
| |
− | (0.01*Math.round(100*glucosemedium_lagoon)) +
| |
− | " g/l, " +
| |
− | (0.01*Math.round(100*glucosemedium_lagoon_mol)) +
| |
− | "mmol/l in the medium</b>, a turbidostat flow rate of " +
| |
− | (0.01*Math.round(100*fr)) +
| |
− | " Volumes/h, or a generation time of " +
| |
− | Math.round(te) +
| |
− | " min, a lagoon with a volume of " +
| |
− | vl +
| |
− | " ml and a flow rate of " +
| |
− | phil +
| |
− | " ml/min, an <i>E. coli</i> titer of " + (0.01*Math.round(100*ectiterdw)) +
| |
− | " g/l, an OD600 of " +
| |
− | (0.01*Math.round(100*ectiterod)) +
| |
− | " and a degradation rate of " +
| |
− | (0.01*Math.round(100*q)) +
| |
− | " g l<sup>-1</sup>cfu<sup>-1</sup>h<sup>-1</sup> a concentration of " +
| |
− | (0.01*Math.round(100*cturbidostat)) +
| |
− | " g/L, "
| |
− | + (0.01*Math.round(100*cturbidostatmol)) +
| |
− | " mmol/l in the lagoon is maintained. Under this conditions the <b>in the turbidostat the glucose concentration is " +
| |
− | (0.01*Math.round(100*glucose_turbidostat)) +
| |
− | "g/l, " +
| |
− | (0.01*Math.round(100*glucose_turbidostat_mol)) +
| |
− | " mmol/l.</b>"
| |
− | ;
| |
− |
| |
− | $("#glucoseplot").html('');
| |
− |
| |
− | }
| |
− | else if(mode=='cont_forward'){
| |
− | glucosemedium_lagoon = Math.max(0, cturbidostat - ((ectiterdw * q)/fr) - ((ectiterdw * q)/fr));
| |
− |
| |
− | glucose_turbidostat = Math.max(0, cturbidostat - ((ectiterdw * q)/fr));
| |
− |
| |
− | var glucose_turbidostat_mol = glucose_turbidostat/(180.1559/1000.0);
| |
− |
| |
− | var glucosemedium_lagoon_mol = glucosemedium_lagoon/(180.1559/1000.0);
| |
− |
| |
− | //return the results
| |
− | glucoseout =
| |
− | "With a glucose concentration of " +
| |
− | (0.01*Math.round(100*cturbidostat)) +
| |
− | " g/l, " +
| |
− | (0.01*Math.round(100*cturbidostatmol)) +
| |
− | "mmol/l in the medium</b>, a turbidostat flow rate of " +
| |
− | (0.01*Math.round(100*fr)) +
| |
− | " Volumes/h, or a generation time of " +
| |
− | Math.round(te) +
| |
− | " min, a lagoon with a volume of " +
| |
− | vl +
| |
− | " ml and a flow rate of " +
| |
− | phil +
| |
− | " ml/min, an <i>E. coli</i> titer of " + (0.01*Math.round(100*ectiterdw)) +
| |
− | " g/l, an OD600 of " +
| |
− | (0.01*Math.round(100*ectiterod)) +
| |
− | " and a degradation rate of " +
| |
− | (0.01*Math.round(100*q)) +
| |
− | " g l<sup>-1</sup>cfu<sup>-1</sup>h<sup>-1</sup> <b>a concentration of " +
| |
− | (0.01*Math.round(100*glucosemedium_lagoon)) +
| |
− | " g/L, "
| |
− | + (0.01*Math.round(100*glucosemedium_lagoon_mol)) +
| |
− | " mmol/l in the lagoon</b> is maintained. Under this conditions the <b>in the turbidostat the glucose concentration is " +
| |
− | (0.01*Math.round(100*glucose_turbidostat)) +
| |
− | "g/l, " +
| |
− | (0.01*Math.round(100*glucose_turbidostat_mol)) +
| |
− | " mmol/l.</b>"
| |
− | ;
| |
− |
| |
− | $("#glucoseplot").html('');
| |
− |
| |
− | }
| |
− | else{
| |
− | if(mode.endsWith('forward')){
| |
− | glucosemedium = cturbidostat;
| |
− | if(logistic){
| |
− | cturbidostat = Math.max(0, glucosemedium - q * ((te * cmaxdw)/Math.LN2) * Math.log((1+(((ec0dw/cmaxdw) * Math.exp(Math.LN2 * gluc_time/te))))/1+(ec0dw/cmaxdw))); }
| |
− | else{
| |
− | cturbidostat = Math.max(0, glucosemedium - q * ec0dw * te * (Math.exp(Math.LN2 * gluc_time/te) - 1));
| |
− | }
| |
− | }
| |
− | else{
| |
− | if(logistic){
| |
− | glucosemedium = Math.max(0, cturbidostat + (q * ((te * cmaxdw)/Math.LN2) * Math.log((1 + ((ec0dw/cmaxdw) * Math.exp(Math.LN2 * gluc_time/te)))/(1 + (ec0dw/cmaxdw)))));
| |
− | }
| |
− | else{
| |
− | glucosemedium = Math.max(0, cturbidostat + q * ec0dw * te * (Math.exp(Math.LN2 * gluc_time/te) - 1));
| |
− | }
| |
− | }
| |
− | var glucosemediummol = glucosemedium/(180.1559/1000.0);
| |
− |
| |
− | var od_warning = "";
| |
− | var end_od = ec0od * Math.exp(Math.LN2 * gluc_time/te);
| |
− | if(end_od > 1.0){
| |
− | if(!logistic){
| |
− | od_warning = "<br><br><strong>Warning:</strong> With an OD of " + end_od + " the <i>E. coli</i> are not in exponential phase at the end of the experiment. This model is designed for applications with E. coli in exponential phase and therfore assumes exponential growth. The glucose consumption is overestimated as well as the concentration in the medium needed to reach the desired concentration.";
| |
− | }
| |
− | }
| |
− |
| |
− | //return the results
| |
− | glucoseout = "With a glucose concentration of "
| |
− | + (0.01*Math.round(100*Math.max(0,glucosemedium)))
| |
− | + " g/L, "
| |
− | +(0.01*Math.round(100*Math.max(0,glucosemediummol)))
| |
− | + "mmol/l in the medium, a generation time of " + (0.01*Math.round(100*te))
| |
− | + " min, an <i>E. coli</i> starting titer of "
| |
− | + (0.01*Math.round(100*ec0dw))
| |
− | + " g/l, an OD600 of "
| |
− | + (0.01*Math.round(100*ec0od))
| |
− | + " and a degradation rate of "
| |
− | + (0.0001*Math.round(10000*q))
| |
− | + " g l<sup>-1</sup>cfu<sup>-1</sup>h<sup>-1</sup> a <b>concentration of "
| |
− | + (0.01*Math.round(100*cturbidostat))
| |
− | + " g/L, "
| |
− | + (0.01*Math.round(100* cturbidostatmol))
| |
− | + " mmol/l</b> is reached after "
| |
− | + gluc_time
| |
− | + " minutes."
| |
− | + od_warning;
| |
− | if(logistic){
| |
− | glucoseout += " This calculation assumed logistic growth with a maximum capacity of OD600 = "
| |
− | + cmaxod
| |
− | + ", "
| |
− | + cmaxdw
| |
− | + " g/L dryweight.";
| |
− | }
| |
− | else{
| |
− | glucoseout += " This calculation assumed exponential growth.";
| |
− | }
| |
− | }
| |
− |
| |
− | $("#glucoseout").html(glucoseout);
| |
− |
| |
− | //plot glucose concentration and e. coli titer
| |
− | if(mode.startsWith('dis')){
| |
− | if(mode.startsWith('disnew')){
| |
− | call = 0;
| |
− | }
| |
− | var glucoseplot = document.getElementById('glucoseplot');
| |
− |
| |
− | var gluc_time_exp = 1.25 * gluc_time;
| |
− | var t = new Array(501);
| |
− | var cecoli = new Array(501);
| |
− | var cg = new Array(501);
| |
− |
| |
− | if(logistic){
| |
− | for(var it = 0; it <=500; it++){
| |
− | t[it] = it*gluc_time_exp/500;
| |
− |
| |
− | cecoli[it] = Math.max(0, (ec0od * Math.exp(Math.LN2 * t[it]/te))/(1 + (ec0od/cmaxod) * Math.exp(Math.LN2 * (t[it]/te))));
| |
− |
| |
− | cg[it] = Math.max(0, glucosemedium - (q * ((te * cmaxdw)/Math.LN2) * Math.log((1 + (ec0dw/cmaxdw) * Math.exp(Math.LN2 * t[it]/te))/(1 + (ec0dw/cmaxdw)))));
| |
− |
| |
− | }
| |
− | }
| |
− | else{
| |
− | for(var it = 0; it <=500; it++){
| |
− | t[it] = it*gluc_time_exp/500;
| |
− |
| |
− | cecoli[it] = Math.max(0, ec0od * Math.exp(Math.LN2 * t[it]/te));
| |
− |
| |
− | cg[it] = Math.max(0, glucosemedium - (q * ec0dw * te * (Math.exp(Math.LN2 * (t[it]/te)) - 1.0)));
| |
− | }
| |
− | }
| |
− |
| |
− | var xticks = [0, (gluc_time/4), (2*gluc_time/4), (3*gluc_time/4), (gluc_time), (gluc_time*1.25)];
| |
− |
| |
− | var ecolicolors = ['#005493', '#6698BE', '#B2CBDD', '#009193', '#66BDEE', '#B3DEDE'];
| |
− | var glucosecolors = ['#9D1C20', '#BB5651', '#D89F9C', '#F8991D', '#FBB748', '#FED699'];
| |
− |
| |
− | if(cg[0] == 0){
| |
− | var glucrange = [-0.1, 1.1];
| |
− | }
| |
− | else{
| |
− | var glucrange = [-0.1*cg[0], cg[0]*1.1];
| |
− | }
| |
− |
| |
− | var glucosedata = [{x: t,
| |
− | y: cg,
| |
− | name: 'Glucose [g/l] ' + (call+1),
| |
− | line: {color: glucosecolors[call % glucosecolors.length]},
| |
− | hoverlabel: {font: {family: 'Josefin Sans'}}
| |
− | },
| |
− | {x: t,
| |
− | y: cecoli,
| |
− | name: 'E. coli [OD600] ' + (call+1),
| |
− | yaxis: 'y2',
| |
− | line: {color: ecolicolors[call % glucosecolors.length]},
| |
− | hoverlabel: {font: {family: 'Josefin Sans'}}
| |
− | }];
| |
− |
| |
− | var color = '#393939';
| |
− | var font = {
| |
− | family: 'Josefin Sans',
| |
− | size: 18,
| |
− | color: color
| |
− | };
| |
− | var layout = {
| |
− | title: 'Glucose concentration and phage titer in discontinuous culture',
| |
− | showlegend: true,
| |
− | width: 800,
| |
− | font: font,
| |
− | legend: {
| |
− | orientation: 'v',
| |
− | x: 1.15,
| |
− | xanchor: 'left',
| |
− | y: 1
| |
− | },
| |
− | xaxis: {
| |
− | title: 'Duration [min]',
| |
− | titlefont: font,
| |
− | showgrid: false,
| |
− | ticks: 'outside',
| |
− | ticklen: 2,
| |
− | tickwidth: 2,
| |
− | tickfont: font,
| |
− | tickvals: xticks,
| |
− | tickmode: 'array',
| |
− | linecolor: color,
| |
− | linewidth: 3,
| |
− | zeroline: false
| |
− | },
| |
− | yaxis: {
| |
− | title: 'Glucose concentration [g/l]',
| |
− | titlefont: font,
| |
− | showgrid: false,
| |
− | ticks: 'outside',
| |
− | ticklen: 2,
| |
− | tickwidth: 2,
| |
− | tickfont: font,
| |
− | tick0: 0,
| |
− | dtick: glucrange[1]/7.0,
| |
− | linecolor: color,
| |
− | linewidth: 3,
| |
− | zeroline: false,
| |
− | range: glucrange
| |
− | },
| |
− | yaxis2: {
| |
− | range: [0.0, Math.min(1.0, cecoli[500])],
| |
− | title: 'E. coli titer [OD600]',
| |
− | side: 'right',
| |
− | overlaying: 'y',
| |
− | titlefont: font,
| |
− | showgrid: false,
| |
− | ticks: 'outside',
| |
− | ticklen: 2,
| |
− | tickwidth: 2,
| |
− | tickfont: font,
| |
− | tick0: 0,
| |
− | dtick: cecoli[cecoli.length-1]*1.1/7.0,
| |
− | linecolor: color,
| |
− | linewidth: 3,
| |
− | zeroline: false,
| |
− | range: [-0.1*cecoli[cecoli.length-1], cecoli[cecoli.length-1]*1.1]
| |
− | },
| |
− | shapes: [{
| |
− | type: 'line',
| |
− | x0: gluc_time,
| |
− | x1: gluc_time,
| |
− | y0: glucrange[0],
| |
− | y1: glucrange[1],
| |
− | line:{
| |
− | width: 2,
| |
− | color: color,
| |
− | },
| |
− | visible: true
| |
− | }]
| |
− | };
| |
− |
| |
− | if(mode.startsWith('disnew') || call == 0){
| |
− | Plotly.newPlot(glucoseplot, glucosedata, layout);
| |
− | call++;
| |
− | }
| |
− | else{
| |
− | Plotly.plot(glucoseplot, glucosedata, layout);
| |
− | call++;
| |
− | }
| |
− | }
| |
− | }
| |
− |
| |
− | </script>
| |
− | <script type="text/javascript">
| |
− |
| |
− | function differences(){
| |
− | //get the values
| |
− | var str1 = document.getElementById('str1').value;
| |
− | var str2 = document.getElementById('str2').value;
| |
− | str1 = str1.replace(/(\r\n|\n|\r)/gm,"");
| |
− | str2 = str2.replace(/(\r\n|\n|\r)/gm,"");
| |
− |
| |
− | //initialise variables
| |
− | var diff = [];
| |
− | var outstr1 = "";
| |
− | var outstr2 = "";
| |
− | var diffs = 0;
| |
− | var lendiffs = 0;
| |
− | var sharedlen = 0;
| |
− | var diffinfo = "";
| |
− | var str1_comp = str1;
| |
− | var str2_comp = str2;
| |
− |
| |
− | //calculate
| |
− |
| |
− | if(document.getElementById("case_sensitive").checked == false){
| |
− | str1_comp = str1.toLowerCase();
| |
− | str2_comp = str2.toLowerCase();
| |
− | }
| |
− |
| |
− | var i = 0;
| |
− | while(i < str1.length){
| |
− | if(i==str2.length){
| |
− | break;
| |
− | }
| |
− | if(str1_comp[i]==str2_comp[i]){
| |
− | outstr1 += str1[i];
| |
− | outstr2 += str2[i];
| |
− | }
| |
− | else{
| |
− | diffs += 1;
| |
− | outstr1 += '<span style="color: red">' + str1[i] + '</span>';
| |
− | outstr2 += '<span style="color: red">' + str2[i] + '</span>';
| |
− | }
| |
− | i++;
| |
− | }
| |
− | sharedlen = i;
| |
− | while(i < str1.length){
| |
− | outstr1 = outstr1 + '<span style="color: blue">' + str1[i] + '</span>';
| |
− | i++;
| |
− | lendiffs++;
| |
− | }
| |
− | while(i < str2.length){
| |
− | outstr2 = outstr2 + '<span style="color: blue">' + str2[i] + '</span>';
| |
− | i++;
| |
− | lendiffs++;
| |
− | }
| |
− | diffinfo = "The strings are different for " + diffs + " from " + sharedlen + " positions (" + (0.01*Math.round(10000*(diffs/sharedlen))) + "%)and their length differs by " + lendiffs + " positions.";
| |
− |
| |
− | //return the results
| |
− | $("#outstr1").html(outstr1);
| |
− | $("#outstr2").html(outstr2);
| |
− | $("#diffinfo").html(diffinfo);
| |
− |
| |
− | //end the function
| |
− | return false;
| |
− | }
| |
− |
| |
− | </script>
| |