Difference between revisions of "2016.igem.org:Team:Manchester/Model/Analyse"

(Created page with "{{Manchester/CSS}} <html> <style> .width45{ width:45%; margin:auto; } .width90{ width:90%; margin:auto; } .width40{ width:40%; margin:auto; } .wid...")
 
Line 86: Line 86:
 
</style>
 
</style>
  
<h1 class="title11">PDF (Probability Density Function)</h1>
+
<h1 class="title11">Units and beer’s law</h1>
  
 
<div class="team">
 
<div class="team">
  
<h1 class="smalltitle">What is a PDF?</h1>
+
<h1 class="smalltitle">Why units must be same?</h1>
 
<p style="font-size:17px;">
 
<p style="font-size:17px;">
First a piece of jargon, a pdf or probability density function. Is something that describes a distribution e.g the well known bell curve for a normal distribution. If you were to select a range of values the distribution could select the area of the curve between the min and max is proportional to the probability the value would be in this range.
+
In the lab we could produce concentration vs time graphs, these were simulated using our model.
 +
We required the units for both to be the same so we could compare.
 
</p>
 
</p>
  
 
+
<h1 class="smalltitle">How we did this model?</h1>
<h1 class="smalltitle">Set the need</h1>
+
 
+
 
+
 
<p style="font-size:17px;">
 
<p style="font-size:17px;">
So we know have a data set for the parameters and we want to pick them in a smart way for running in the model. This is done by turning the data into a pdf. See diagrams for a schematic of the process.  
+
For our model our concentrations should be measured in units like mM i.e a measure of the amount of compounds per volume.  
<br /><br />
+
The model units come from the units used in the initial conditions, we used mM by having the concentrations in ug/ml from the lab and dividing by the molecular weight.
Values could be randomly picked from the found parameters, but what about the ‘gaps’ between the points? These could be perfectly valid potential values too.
+
<br /><br />
+
Converting a discrete dataset into a continuous one allows for better precision and makes sure your not missing any interesting parameter range, this continuous one is our pdf.
+
</p>
+
  
 
<h1 class="smalltitle">What are the options Allude to advantages and disadvantages</h1>
 
 
 
<p style="font-size:17px;">
 
here are multiple ways to create a pdf from a data set. They can be split into two categories; parametric and nonparametric . Parametric meaning the data is used to find parameters for a known distribution that will fit the data the best. We tried two Parametric methods fitting to a log normal distribution  and fitting to a normal distribution.
 
<br /><br />
 
Non parametric methods don’t use knowledge of a known distribution, we tried one such method “kernels” this works by giving each data point an associated wave the superposition of which gives your pdf.
 
<br /><br />
 
All these methods have advantages and drawbacks which will be discussed in the code section.
 
 
</p>
 
</p>
  
<h1 class="smalltitle">Graphs to aid understanding</h1>
+
<h1 class="smalltitle">How we did this experimental?</h1>
 
+
 
+
 
<p style="font-size:17px;">
 
<p style="font-size:17px;">
The graphs are displaying samples from a pdf used the lognormal method. As you can see from the histograms it has given much more information about the densely populated 0-100 Km value range, however it has unfairly reduced the amount of  Km = ~ 500 and ~ 700 values. This is a potential downside of parametric methods and can be remedied by the kernel method. However looking at the ascending order values these Km values are still present in the sample of 500.
+
The experimental team used a plate reader. The units showing concentration over time were optical density values, these can be converted into a concentration using beers law and a calibration experiment.  
</p>
+
  
<center>
 
<img class="width50" src="https://static.igem.org/mediawiki/2016/b/b8/T--Manchester--modelling_graph_4.png" alt="graph 1" />
 
</center>
 
 
<center>
 
<img class="width50" src="https://static.igem.org/mediawiki/2016/f/f9/T--Manchester--modelling_graph_5.png" alt="graph 2" />
 
</center>
 
 
<center>
 
<img class="width50" src="https://static.igem.org/mediawiki/2016/a/a7/T--Manchester--modelling_graph_6.png" alt="graph 3" />
 
</center>
 
 
 
<h1 class="smalltitle1">How it’s done - Finding function</h1>
 
 
<p style="font-size:17px;">
 
Relevant github link. All files discussed here are available for reference
 
<br /><br />
 
Recall from the theory section we tried the lognormal distribution
 
Firstly the distribution function must be calculate. For the parametric methods the standard deviation and the mean are calculated from the data set, these are then put into the relevant equation. For the kernel method, the epanechnikov kernel was used for the waves associated with each point.
 
 
</p>
 
</p>
  
 
<h1 class="smalltitle1">How it’s done - </h1>
 
  
  
 +
<h1 class="smalltitle">Calibration experiment</h1>
 
<p style="font-size:17px;">
 
<p style="font-size:17px;">
Bins are created (The more the better as long as you have data to fill them while having good statistics.) The function is evaluated at the start position of each of these bins and the cumulative integral of the function is found. With this cumulative function returning the value of the integral at each bin start point in a array. These values are then all normalised so that the final value is equal to 1. As such the difference between two sequential values is equal to the probability that a value lies in that range.
+
The calibration experiment was done with Abts h202 and hrp there was excess H202 so that the equilibrium was such that we could assume all the abts was oxidised. We did this for a range of initial conditions. We now knew the od values at steady state and the concentrations at steady state. And hence we could calibrate.  
 
<br /><br />
 
<br /><br />
A random number between 0 and 1 is now generated , this is used to select which bin to sample from using the knowledge from the previous paragraph.  
+
There were some extra complications because abts decays and the other reagents cause absorbance, these were taken into account initially but the change was negligible so it was ignored, this assumption could be relaxed in the future. This analysis allowed us to convert od values to ug/ml and hence mM.
<br /><br />
+
Finally a newly generated separate random number between 0 and 1 is used to decide where in the bin the value will be, to illustrate if a bins start point was 3 and had a width of 2 if you get a random number 0.5 your value would be 4.  
+
 
+
  
 
</p>
 
</p>
  
  
<h1 class="smalltitle1">Noticed fail cases assessment of methods</h1>
 
  
 +
<h1 class="smalltitle">Theory of beer's law</h1>
 
<p style="font-size:17px;">
 
<p style="font-size:17px;">
Relevant github link. All files discussed here are available for reference
+
Beer’s law simply states that concentration in a unit like mM is proportional to absorbance measured in od value, a result from fluid mechanics leads to this phenomena specifically with the od scale.
<br /><br />
+
As was mentioned briefly in the theory section each method has some drawbacks. In the following it is important to note that enzyme rate constants are distributed log-normally what I really mean by this is the rate constant has one true value but variation in it log normally will produce similar end results . Also that we tested these methods by using a self iterating code that updated guessed constants by fitting to data (an explanation of this code won’t be given in text but contact us for details.), in this the data was manufactured to have come from some specific parameters. But the code didn’t know about those. Note we had to take into account sloppy parameters etc, see parameter analysis section. This code as such should have evolved to have the manufactured parameters.
+
<br /><br />
+
The gaussian method was generally very good in that it would always evolve towards the manufactured constants initially, however when close it would never make it equilibrating a good distance away. Also it overshoots if coming from below zero with a high deviation in the tried constants.  
+
<br /><br />
+
Log normal method generally gets very close (within a couple %) to the actual parameters but can often overshoot.
+
Kernel method provides even better fits but can go completely crazy if the data set is too spread, but does take into account multi peaked distributions better, especially with a large h (look into kernel theory to find out what that means) .
+
 
+
We also experimented with trying modified pdf generators that used e.g an increased variance, some of these had success.
+
<br /><br />
+
With this knowledge you can choose a good pdf generator or perhaps mix of generators for any data case
+
 
</p>
 
</p>
  
  
<h1 class="smalltitle1">Suggested procedure</h1>
 
  
 +
<span class="box1"></span>
  
<p style="font-size:17px;">
 
The validity of these generators will depend on what sort of curves your constants generate, therefore in general, to test you must use a code like “Emporer” (name in github). And find these validity conditions out for yourself.
 
</p>
 
 
<h1 class="smalltitle1">Density bins</h1>
 
 
<p style="font-size:17px;">
 
A simpler alternative that will require a large and high density data set to be valid is to use only the data points you have make each sequential gap between data points a bin and pick bins for sampling proportional to the density of data points i.e 1 divided by width of bin would be a good measure. This can then be normalised to 1 and finished like it’s explained in how it's done-implementation. 
 
</p>
 
 
<span class="box1"></span>
 
  
  

Revision as of 14:53, 18 October 2016

Manchester iGEM 2016

Units and beer’s law

Why units must be same?

In the lab we could produce concentration vs time graphs, these were simulated using our model. We required the units for both to be the same so we could compare.

How we did this model?

For our model our concentrations should be measured in units like mM i.e a measure of the amount of compounds per volume. The model units come from the units used in the initial conditions, we used mM by having the concentrations in ug/ml from the lab and dividing by the molecular weight.

How we did this experimental?

The experimental team used a plate reader. The units showing concentration over time were optical density values, these can be converted into a concentration using beers law and a calibration experiment.

Calibration experiment

The calibration experiment was done with Abts h202 and hrp there was excess H202 so that the equilibrium was such that we could assume all the abts was oxidised. We did this for a range of initial conditions. We now knew the od values at steady state and the concentrations at steady state. And hence we could calibrate.

There were some extra complications because abts decays and the other reagents cause absorbance, these were taken into account initially but the change was negligible so it was ignored, this assumption could be relaxed in the future. This analysis allowed us to convert od values to ug/ml and hence mM.

Theory of beer's law

Beer’s law simply states that concentration in a unit like mM is proportional to absorbance measured in od value, a result from fluid mechanics leads to this phenomena specifically with the od scale.