Difference between revisions of "Team:Moscow/Kinetics"

 
Line 1: Line 1:
  
 
<html>
 
<html>
<head>
+
<head><meta charset="utf-8" />
 
+
<title>KinProj_Final</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<meta charset="utf-8" />
+
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
+
 
+
<meta name="apple-mobile-web-app-capable" content="yes" />
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
+
 
+
<title>KinProj_Final slides</title>
+
 
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
+
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
 
<!-- General and theme style sheets -->
 
<link rel="stylesheet" href="reveal.js/css/reveal.css">
 
<link rel="stylesheet" href="reveal.js/css/theme/simple.css" id="theme">
 
 
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
 
<script>
 
if( window.location.search.match( /print-pdf/gi ) ) {
 
        var link = document.createElement( 'link' );
 
        link.rel = 'stylesheet';
 
        link.type = 'text/css';
 
        link.href = 'reveal.js/css/print/pdf.css';
 
        document.getElementsByTagName( 'head' )[0].appendChild( link );
 
}
 
 
</script>
 
 
<!--[if lt IE 9]>
 
<script src="reveal.js/lib/js/html5shiv.js"></script>
 
<![endif]-->
 
 
<!-- Loading the mathjax macro -->
 
<!-- Load mathjax -->
 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>
 
    <!-- MathJax configuration -->
 
    <script type="text/x-mathjax-config">
 
    MathJax.Hub.Config({
 
        tex2jax: {
 
            inlineMath: [ ['$','$'], ["\\(","\\)"] ],
 
            displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
 
            processEscapes: true,
 
            processEnvironments: true
 
        },
 
        // Center justify equations in code and markdown cells. Elsewhere
 
        // we use CSS to left justify single line equations in code cells.
 
        displayAlign: 'center',
 
        "HTML-CSS": {
 
            styles: {'.MathJax_Display': {"margin": 0}},
 
            linebreaks: { automatic: true }
 
        }
 
    });
 
    </script>
 
    <!-- End of mathjax configuration -->
 
 
<!-- Get Font-awesome from cdn -->
 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.css">
 
  
 
<style type="text/css">
 
<style type="text/css">
Line 11,774: Line 11,719:
 
<style type="text/css">
 
<style type="text/css">
 
/* Overrides of notebook CSS for static HTML export */
 
/* Overrides of notebook CSS for static HTML export */
.reveal {
+
body {
   font-size: 160%;
+
   overflow: visible;
 +
  padding: 8px;
 
}
 
}
.reveal pre {
+
 
  width: inherit;
+
div#notebook {
  padding: 0.4em;
+
   overflow: visible;
  margin: 0px;
+
   border-top: none;
  font-family: monospace, sans-serif;
+
}@media print {
  font-size: 80%;
+
   div.cell {
  box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
+
    display: block;
}
+
    page-break-inside: avoid;
.reveal pre code {
+
   }  
  padding: 0px;
+
   div.output_wrapper {  
}
+
    display: block;
.reveal section img {
+
    page-break-inside: avoid;  
  border: 0px solid black;
+
   }
  box-shadow: 0 0 10px rgba(0, 0, 0, 0);
+
   div.output {  
}
+
    display: block;
.reveal i {
+
    page-break-inside: avoid;  
  font-style: normal;
+
   }
  font-family: FontAwesome;
+
  font-size: 2em;
+
}
+
.reveal .slides {
+
  text-align: left;
+
}
+
.reveal.fade {
+
  opacity: 1;
+
}
+
.reveal .progress {
+
  position: static;
+
}
+
.reveal .controls .navigate-left,
+
.reveal .controls .navigate-left.enabled {
+
  border-right-color: #727272;
+
}
+
.reveal .controls .navigate-left.enabled:hover,
+
.reveal .controls .navigate-left.enabled.enabled:hover {
+
   border-right-color: #dfdfdf;
+
}
+
.reveal .controls .navigate-right,
+
.reveal .controls .navigate-right.enabled {
+
   border-left-color: #727272;
+
}
+
.reveal .controls .navigate-right.enabled:hover,
+
.reveal .controls .navigate-right.enabled.enabled:hover {
+
   border-left-color: #dfdfdf;
+
}
+
.reveal .controls .navigate-up,
+
.reveal .controls .navigate-up.enabled {
+
  border-bottom-color: #727272;
+
}
+
.reveal .controls .navigate-up.enabled:hover,
+
.reveal .controls .navigate-up.enabled.enabled:hover {
+
  border-bottom-color: #dfdfdf;
+
}
+
.reveal .controls .navigate-down,
+
.reveal .controls .navigate-down.enabled {
+
   border-top-color: #727272;
+
}
+
.reveal .controls .navigate-down.enabled:hover,
+
.reveal .controls .navigate-down.enabled.enabled:hover {
+
   border-top-color: #dfdfdf;
+
}
+
.reveal .progress span {
+
  background: #727272;
+
}
+
div.input_area {
+
  padding: 0.06em;
+
}
+
div.code_cell {
+
  background-color: transparent;
+
}
+
div.prompt {
+
  width: 11ex;
+
  padding: 0.4em;
+
  margin: 0px;
+
  font-family: monospace, sans-serif;
+
   font-size: 80%;
+
  text-align: right;
+
}
+
div.output_area pre {
+
   font-family: monospace, sans-serif;
+
  font-size: 80%;
+
}
+
div.output_prompt {
+
  /* 5px right shift to account for margin in parent container */
+
  margin: 5px 5px 0 0;
+
}
+
div.text_cell.rendered .rendered_html {
+
  /* The H1 height seems miscalculated, we are just hidding the scrollbar */
+
  overflow-y: hidden;
+
}
+
a.anchor-link {
+
  /* There is still an anchor, we are only hidding it */
+
  display: none;
+
}
+
.rendered_html p {
+
  text-align: inherit;
+
}
+
::-webkit-scrollbar
+
{
+
  width: 6px;
+
   height: 6px;
+
}
+
::-webkit-scrollbar *
+
{
+
  background:transparent;
+
}
+
::-webkit-scrollbar-thumb
+
{
+
  background: #727272 !important;
+
 
}
 
}
 
</style>
 
</style>
Line 11,892: Line 11,746:
 
<link rel="stylesheet" href="custom.css">
 
<link rel="stylesheet" href="custom.css">
  
</head>
+
<!-- Loading mathjax macro -->
 
+
<!-- Load mathjax -->
 
+
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>
 +
    <!-- MathJax configuration -->
 +
    <script type="text/x-mathjax-config">
 +
    MathJax.Hub.Config({
 +
        tex2jax: {
 +
            inlineMath: [ ['$','$'], ["\\(","\\)"] ],
 +
            displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
 +
            processEscapes: true,
 +
            processEnvironments: true
 +
        },
 +
        // Center justify equations in code and markdown cells. Elsewhere
 +
        // we use CSS to left justify single line equations in code cells.
 +
        displayAlign: 'center',
 +
        "HTML-CSS": {
 +
            styles: {'.MathJax_Display': {"margin": 0}},
 +
            linebreaks: { automatic: true }
 +
        }
 +
    });
 +
    </script>
 +
    <!-- End of mathjax configuration --></head>
 
<body>
 
<body>
 +
  <div tabindex="-1" id="notebook" class="border-box-sizing">
 +
    <div class="container" id="notebook-container">
  
 
<div class="reveal">
 
<div class="slides">
 
<section><section>
 
 
<div class="cell border-box-sizing code_cell rendered">
 
<div class="cell border-box-sizing code_cell rendered">
 
<div class="input">
 
<div class="input">
Line 12,123: Line 11,994:
  
  
<div id="df360e6d-bd9b-4923-b257-b335e650cf29"></div>
+
<div id="81a33e18-2e22-4db6-8eb3-ba89537a39b0"></div>
 
<div class="output_subarea output_javascript ">
 
<div class="output_subarea output_javascript ">
 
<script type="text/javascript">
 
<script type="text/javascript">
var element = $('#df360e6d-bd9b-4923-b257-b335e650cf29');
+
var element = $('#81a33e18-2e22-4db6-8eb3-ba89537a39b0');
  
 
(function(root) {
 
(function(root) {
Line 12,427: Line 12,298:
  
  
<div id="36943179-06aa-44e6-8fb2-04d9b5c83f2f"></div>
+
<div id="37d359ff-c239-4abd-a0ab-e18e8ba99d7a"></div>
 
<div class="output_subarea output_javascript ">
 
<div class="output_subarea output_javascript ">
 
<script type="text/javascript">
 
<script type="text/javascript">
var element = $('#36943179-06aa-44e6-8fb2-04d9b5c83f2f');
+
var element = $('#37d359ff-c239-4abd-a0ab-e18e8ba99d7a');
 
(function(root) {
 
(function(root) {
 
   function embed_document(root) {
 
   function embed_document(root) {
Line 12,506: Line 12,377:
 
</div>
 
</div>
 
</div>
 
</div>
</div>
+
    </div>
</div>
+
  </div>
 +
</body>
  
<script>
+
 
+
require(
+
    {
+
      // it makes sense to wait a little bit when you are loading
+
      // reveal from a cdn in a slow connection environment
+
      waitSeconds: 15
+
    },
+
    [
+
      "reveal.js/lib/js/head.min.js",
+
      "reveal.js/js/reveal.js"
+
    ],
+
 
+
    function(head, Reveal){
+
 
+
        // Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration
+
        Reveal.initialize({
+
            controls: true,
+
            progress: true,
+
            history: true,
+
 
+
            transition: "slide",
+
 
+
            // Optional libraries used to extend on reveal.js
+
            dependencies: [
+
                { src: "reveal.js/lib/js/classList.js",
+
                  condition: function() { return !document.body.classList; } },
+
                { src: "reveal.js/plugin/notes/notes.js",
+
                  async: true,
+
                  condition: function() { return !!document.body.classList; } }
+
            ]
+
        });
+
 
+
        var update = function(event){
+
          if(MathJax.Hub.getAllJax(Reveal.getCurrentSlide())){
+
            MathJax.Hub.Rerender(Reveal.getCurrentSlide());
+
          }
+
        };
+
 
+
        Reveal.addEventListener('slidechanged', update);
+
 
+
        function setScrollingSlide() {
+
            var scroll = false
+
            if (scroll === true) {
+
              var h = $('.reveal').height() * 0.95;
+
              $('section.present').find('section')
+
                .filter(function() {
+
                  return $(this).height() > h;
+
                })
+
                .css('height', 'calc(95vh)')
+
                .css('overflow-y', 'scroll')
+
                .css('margin-top', '20px');
+
            }
+
        }
+
 
+
        // check and set the scrolling slide every time the slide change
+
        Reveal.addEventListener('slidechanged', setScrollingSlide);
+
 
+
    }
+
 
+
);
+
</script>
+
 
+
</body>
+
  
  
 
</html>
 
</html>

Latest revision as of 20:16, 16 October 2019

KinProj_Final

In [3]:
import bokeh
from bokeh.plotting import Figure, output_notebook, show
import math
import scipy
import numpy as np
from bokeh.layouts import widgetbox, row, column
from bokeh.models import CustomJS, ColumnDataSource, Slider, Button, PreText, TextInput

A = 0.35
Em = 20000*math.pow(10,-6)
L = 1
DNA = 2.5 #(наномоль/л) - концентрация ДНК
Cas1 = 5 #(наномоль/л) - концентрация dCas9_1
Cas2 = 5 #(наномоль/л) - концентрация dCas9_2
print((A/(Em*L))*1000)
SO = ((A/(Em*L))*1000)*4 + 10000 #(наномоль/л) - концентрация субстрата
CpO = 0
if (DNA < Cas1 and DNA < Cas2):
    CEBL = DNA
else:
    if(Cas1>Cas2):
        CEBL = Cas2
    else:
        CEBL = Cas1
Km = 10*1000 #(наномоль/л) 
kcat =  2.22 
dt1=[dt for dt in range(0, 3600)] #Изменение времени в секундах
C = [0]*3600
b = 0

#Построение графика
y1 = list(C)
x1 = list(dt1)
source = ColumnDataSource(data=dict(x1=x1, y1=y1))
fig = Figure(plot_width=700, plot_height=500, title="Зависимость концентрации продукта расщепления нитроцефина бета-лактамазой от времени",x_axis_label='Время, с', y_axis_label='Концентрация продукта, нМ')
for i in range(0,3600):
    if (i == 0):
        Cp = CpO
    else:  
        Cp = Cp + ((kcat*CEBL*(SO - Cp))*(dt1[i] - dt1[i-1])/(Km + (SO - Cp)))
        if (Cp >= (A/(Em*L))*1000):
            b = i
    y1[i] = Cp

print(Cp)
dt1 = [dt for dt in range(0,b)]
x1 = list(dt1)
source = ColumnDataSource(data=dict(x1=x1, y1=y1))


#Перестройка графика при изменении параметров

#Общий callback
callback = CustomJS(args=dict(source=source), code="""
    DNA = parseFloat(DNA.value)
    Cas1 = parseFloat(Cas1.value)
    Cas2 = parseFloat(Cas2.value)
    SO = parseInt(SO.value)
    CpO = 0
    CEBL = 0
    if(DNA < Cas1 && DNA < Cas2){CEBL = DNA}else{if(Cas1>Cas2){CEBL = Cas2}else{CEBL = Cas1}}
    Km = parseFloat(Km.value)
    data = source.data
    kcat = 2.22
    dt1=data['x1']
    C=data['y1']
    b = 0

    for (var i = 0; i < 3600; i++)
    {
        if (i == 0)
        {
            Cp = CpO
        }
        else
        {
            Cp = Cp + ((CEBL*kcat*(SO - Cp))*(dt1[i] - dt1[i-1])/(Km + (SO - Cp)))
            if (Cp > SO)
            {
                b = i-1
                break;
            }
        }
        C[i] = Cp
    }
    b.value = b
    source.change.emit();
""")

reset = CustomJS(args=dict(source=source), code="""
    A = 0.2
    Em = 20000*Math.pow(10,-6)
    L = 1
    DNA = 2.5
    Cas1 = 5 
    Cas2 = 5 
    SO = (A/(Em*L))*1000 
    CpO = 0
    CEBL = 0
    if(DNA < Cas1 && DNA < Cas2){CEBL = DNA}else{if(Cas1>Cas2){CEBL = Cas2}else{CEBL = Cas1}}
    Km = 10*1000
    kcat = 2.22
    data = source.data
    dt1=data['x1']
    C=data['y1']
    b = 0

    for (var i = 0; i < 3600; i++)
    {
        if (i == 0)
        {
            Cp = CpO
        }
        else
        {
            Cp = Cp + ((CEBL*kcat*(SO - Cp))*(dt1[i] - dt1[i-1])/(Km + (SO - Cp)))
            if (Cp > SO)
            {
                b = i-1
                break
            }
        }
        C[i] = Cp
    }
    SO.value = A/(Em*L)
    DNA.value = 2
    Cas1.value = 3
    Cas2.value = 3
    Km.value = (10).toString()
    source.change.emit();
""")


#Слайдеры
DNAsl = Slider(title = '[DNA], nM', start=0, end=DNA*2, value=DNA, step=0.5, callback=callback)
callback.args["DNA"] = DNAsl
reset.args["DNA"] = DNAsl
Casasl = Slider(title = '[sgRNA-dCas9_1], nM', start=0, end=Cas1*2, value=Cas1, step=0.5, callback=callback)
callback.args["Cas1"] = Casasl
reset.args["Cas1"] = Casasl
Casbsl = Slider(title = '[sgRNA-dCas9_2], nM', start=0, end=Cas2*2, value=Cas2, step=0.5, callback=callback)
callback.args["Cas2"] = Casbsl
reset.args["Cas2"] = Casbsl
SOsl = Slider(title = '[Nitrocefin], nM', start=SO/2, end=SO*2, value=SO, step=5, callback=callback)
callback.args["SO"] = SOsl
reset.args["SO"] = SOsl

#Textbox'ы
IKm = TextInput(callback=callback, value=str(Km))
callback.args["Km"] = IKm
TKm = PreText(text = "Km")
ITime = TextInput(callback=callback, value=str(b))
callback.args["b"] = ITime
Ttime = PreText(text = "time, needed to detect signal")

#Кнопка Reset
resetbt = Button(callback=reset,label="Reset")
fig.circle('x1','y1', source=source, size = 1.5, color = 'red')
output_notebook()
show(column(row(fig,widgetbox(IKm,TKm,ITime,Ttime)),widgetbox(DNAsl,Casasl,Casbsl,SOsl,resetbt)))
17500.0
17505.115719408626
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('x1', 3599), ('y1', 3600)
Loading BokehJS ...

Для описания кинетики реакций, используемых в нашем проекте, мы разделили их на три части: • Взаимодействие dCas9 с ДНК (связывание) • Взаимодействие разъединенных доменов бета-лактамазы с образованием молекулы фермента • Фермент-субстратное взаимодействие

Исходя из источников литературы, константы связывания dCas9 с ДНК велики, поэтому ими можно пренебречь, следовательно, в рамках модели считается, что связывание dCas9 c ДНК происходит мгновенно.

Фермент-субстратное взаимодействие описывается уравнением Михаэлиса-Ментен:

$$\frac{d[P]}{dt} = \frac{kcat[E0][S]}{Km + [S]}$$

Модель представляет собой интерактивный график зависимости концентрации продукта гидролиза нитроцефина бета-лактамазой от времени. Уравнение имеет следующий вид:

$$[P] = [P] + \frac{kcat[E][S]dt}{Km + [S]}$$