Difference between revisions of "Team:Dundee/Modeling/Appendix2"

Line 2: Line 2:
 
<style>container { text-align:left; min-width:80%; }
 
<style>container { text-align:left; min-width:80%; }
 
#pagebox { text-align:left; width:80%; margin-left:auto; margin-right:auto; }
 
#pagebox { text-align:left; width:80%; margin-left:auto; margin-right:auto; }
#pagebox2 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }#pagebox3 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }#pagebox4 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }<</style>
+
#pagebox2 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }#pagebox3 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }#pagebox4 { text-align:left; width:80%; margin-left:auto; margin-right:auto; }</style><!--Adds margin to the sectinos with class pagebox-->
 +
 
 
<script type="text/x-mathjax-config">
 
<script type="text/x-mathjax-config">
 
   MathJax.Hub.Config({
 
   MathJax.Hub.Config({
 
     "HTML-CSS": { scale: 120}
 
     "HTML-CSS": { scale: 120}
 
   });
 
   });
</script>
+
</script><!--Rescales the size of mathjax equations and inline symbols to make them larger-->
 +
 
 
<style>#about .glyphicon {
 
<style>#about .glyphicon {
 
-webkit-transition:0.3s;
 
-webkit-transition:0.3s;
Line 20: Line 22:
 
background: #E8E8E8;
 
background: #E8E8E8;
 
color: #585858;
 
color: #585858;
}</style>
+
}</style><!--Script sets the button to change colour when hovered over-->
  
  
Line 27: Line 29:
 
     $(this).toggleClass('glyphicon-chevron-down glyphicon-chevron-up');
 
     $(this).toggleClass('glyphicon-chevron-down glyphicon-chevron-up');
 
});
 
});
</script>
+
</script><!--Sets buttons to do something once clicked on-->
 +
 
 +
 
 
<script type="text/javascript">
 
<script type="text/javascript">
 
   $(document).ready(function(){
 
   $(document).ready(function(){
Line 43: Line 47:
 
   });
 
   });
 
});
 
});
</script>
+
</script><!--Allows internal inks on the page and smooth scrolling-->
 +
 
 
<script type="text/x-mathjax-config">
 
<script type="text/x-mathjax-config">
 
MathJax.Hub.Config({
 
MathJax.Hub.Config({
 
   TeX: { equationNumbers: { autoNumber: "AMS" } }
 
   TeX: { equationNumbers: { autoNumber: "AMS" } }
 
});
 
});
</script>
+
</script><!--Sets the equation numbers to be set in oreder of equation appearance-->
<!--The following script tag is to allow for Latex chemical schematics/equations to be shown-->
+
 
 +
 
 
<script type="text/x-mathjax-config">
 
<script type="text/x-mathjax-config">
 
MathJax.Hub.Config({
 
MathJax.Hub.Config({
 
   TeX: {extensions: ["mhchem.js"]}
 
   TeX: {extensions: ["mhchem.js"]}
 
});
 
});
</script>
+
</script><!--The script tag is to allow for Latex chemical schematics/equations to be shown-->
<!--The following script tag allows for MathJax to be used, a language that allows for Latex code to be displayed in html-->
+
 
 
<script type="text/javascript"
 
<script type="text/javascript"
 
   src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
 
   src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
+
</script><!--The script tag allows for MathJax to be used, a language that allows for Latex code to be displayed in html-->
 +
 
 
<style>
 
<style>
  
Line 68: Line 75:
 
span.untermstring { color:#B20000 }
 
span.untermstring { color:#B20000 }
 
span.syscmd { color:#B28C00 }
 
span.syscmd { color:#B28C00 }
</style>
+
</style><!--Sets up colours for span classes to allow for inclusion MATLAB published html-->
 
<body>
 
<body>
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
       <meta name="viewport" content="width=device-width, initial-scale=1.0"><!--Ensures page is mobile device compatible-->
  
  
  
 
     <header>
 
     <header>
     <a class="anchor" id="top"></a>
+
     <a class="anchor" id="top"></a><!--Sets anchor so that section can be navigated back to using #top command-->
 
         <center>
 
         <center>
 
             <h1><highlight class="highlight">Dry Lab</highlight></h1>
 
             <h1><highlight class="highlight">Dry Lab</highlight></h1>
 
             <h3><highlight class="highlight">Appendix 2: Fingerprint Aging Code</highlight></h3>
 
             <h3><highlight class="highlight">Appendix 2: Fingerprint Aging Code</highlight></h3>
 
         </center>
 
         </center>
       </header>
+
       </header><!--Sets header(h1) and subheader(h3)-->
 
<font size="4">
 
<font size="4">
  
  
<a class="anchor" id="selection"></a>
+
<a class="anchor" id="selection"></a><!--Sets anchor so that section can be navigated back to using #selection command-->
 
     <section id="about" class="row1">     
 
     <section id="about" class="row1">     
 
       <div class="row">
 
       <div class="row">
 
         <div class="col-md-6">
 
         <div class="col-md-6">
           <a href="#pca" class="scroll"><span class="glyphicon glyphicon-hand-down" type="button"></span></a>  
+
           <a href="#pca" class="scroll"><span class="glyphicon glyphicon-hand-down" type="button"></span></a><!--Button to navigate to specific section of page-->  
 
           <h3>Principal Component Analysis Code</h3>
 
           <h3>Principal Component Analysis Code</h3>
           <p class="about-content">Principal component analysis MATLAB code.</p>
+
           <p class="about-content">Principal component analysis MATLAB code.</p><!--Text displayed under button-->
 
         </div>
 
         </div>
  
 
         <div class="col-md-6">
 
         <div class="col-md-6">
           <a href="#fmodel" class="scroll"><span class="glyphicon glyphicon-hand-down" type="button"></span></a>
+
           <a href="#fmodel" class="scroll"><span class="glyphicon glyphicon-hand-down" type="button"></span></a><!--Button to navigate to specific section of page-->  
 
           <h3>Squalene Epoxide Model Code</h3>
 
           <h3>Squalene Epoxide Model Code</h3>
           <p class="about-content">MATLAB code for the binding between squalene epoxide and lanosterol synthase mathematical model.</p>
+
           <p class="about-content">MATLAB code for the binding between squalene epoxide and lanosterol synthase mathematical model.</p><!--Text displayed under button-->
 
         </div>
 
         </div>
 
        
 
        
Line 105: Line 112:
  
  
<div id="pagebox">
+
<div id="pagebox"><!--All content within the division is of the pagebox class, i.e has a margin-->
  
<a class="anchor" id="pca"></a>
+
<a class="anchor" id="pca"></a><!--Sets anchor so that section can be navigated back to using #pca command-->
 
     <section id="pca">
 
     <section id="pca">
 
       <div class="row3">
 
       <div class="row3">
Line 115: Line 122:
 
             <div class="row">
 
             <div class="row">
 
                 <h3>Principal Component Analysis Code</h3>
 
                 <h3>Principal Component Analysis Code</h3>
             <p><font color="white"> Lorem ipsum dolor sit amet, nostrud maiestatis quaerendum ne sed. Reque possit ne sea. Te dico labitur mediocritatem ius. Error timeam noluisse eos ad, eam ne magna meliore contentiones, nec ei volumus persecuti.
+
             <p><font color="white"><!--Sets the font colour to wite--> Lorem ipsum dolor sit amet, nostrud maiestatis quaerendum ne sed. Reque possit ne sea. Te dico labitur mediocritatem ius. Error timeam noluisse eos ad, eam ne magna meliore contentiones, nec ei volumus persecuti.
  
 
Dicit animal definitionem et mel, nonumy tacimates nec in. Vis mucius periculis at. At est vidit scripserit repudiandae, agam porro sea ne. Sea et stet tibique praesent, vim et legere aperiri. Quo doming vocibus eleifend no.
 
Dicit animal definitionem et mel, nonumy tacimates nec in. Vis mucius periculis at. At est vidit scripserit repudiandae, agam porro sea ne. Sea et stet tibique praesent, vim et legere aperiri. Quo doming vocibus eleifend no.
Line 122: Line 129:
 
</div>
 
</div>
 
               </div>   
 
               </div>   
  <a href="#selection" class="btn btn-primary btn-lg pull-right" role="button">Back to Top</a>   
+
  <a href="#selection" class="btn btn-primary btn-lg pull-right" role="button">Back to Top</a>  <!--Button that navigates to the top of page-->
<a href="https://2015.igem.org/Team:Dundee/Modeling/Fingerprints#pca" class="btn btn-primary btn-lg pull-right" role="button">View Description of PCA</a>         
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Fingerprints#pca" class="btn btn-primary btn-lg pull-right" role="button">View Description of PCA</a>        <!--Button that navigates to relevant section of Modeling/Fingerprints page-->
 
               </div>
 
               </div>
 
             </div>
 
             </div>
Line 131: Line 138:
 
     </section>
 
     </section>
  
<div id="pagebox2">
+
<div id="pagebox2"><!--All content within the division is of the pagebox class, i.e has a margin-->
<a class="anchor" id="fmodel"></a>
+
<a class="anchor" id="fmodel"></a><!--Sets anchor so that section can be navigated back to using #fmodel command-->
 
     <section id="fmodel">
 
     <section id="fmodel">
 
       <div class="row3">
 
       <div class="row3">
Line 139: Line 146:
 
           <div class="col-lg-12 feature" style="">
 
           <div class="col-lg-12 feature" style="">
 
             <div class="row">
 
             <div class="row">
<font color="white"><h3>Squalene Epoxide Model MATLAB Code</h3><p>The figure shown in the <u><a href="https://2015.igem.org/Team:Dundee/Modeling/Fingerprints#fmodel">squalene epoxide and lanosterol synthase</a></u> were created using MATLAB. Before using MATLAB the original system of equations was non-dimensionalised to the system:</p>
+
<font color="white"><!--set font colour to white--><h3>Squalene Epoxide Model MATLAB Code</h3><p>The figure shown in the <u><a href="https://2015.igem.org/Team:Dundee/Modeling/Fingerprints#fmodel"><!--Links back to Fingerprints page-->squalene epoxide and lanosterol synthase</a></u> were created using MATLAB. Before using MATLAB the original system of equations was non-dimensionalised to the system:</p>
$$
+
$$<!--Mathjax equations are surrounded by $$ $$-->
 
\begin{eqnarray*}
 
\begin{eqnarray*}
 
\frac{dLS}{d\tau}&=&PC-\lambda LS \cdot SE,\\
 
\frac{dLS}{d\tau}&=&PC-\lambda LS \cdot SE,\\
Line 161: Line 168:
 
            
 
            
  
<div class="content"><pre class="codeinput">
+
<div class="content"><pre class="codeinput"><!--Inserts code copied from MATLAB published html-->
 
   <span class="comment"><b><font size='6'colour='green'>MATLAB code from squalene.m file</b></font></span>
 
   <span class="comment"><b><font size='6'colour='green'>MATLAB code from squalene.m file</b></font></span>
 
<span class="comment">% File to solve the system of ODEs describing lanosterol synthase and squalene epoxide binding.</span>
 
<span class="comment">% File to solve the system of ODEs describing lanosterol synthase and squalene epoxide binding.</span>
Line 301: Line 308:
 
                
 
                
 
               </div>   
 
               </div>   
  <a href="#selection" class="btn btn-primary btn-lg pull-right" role="button">Back to Top</a>   
+
  <a href="#selection" class="btn btn-primary btn-lg pull-right" role="button">Back to Top</a>  <!--Button that navigates back to top of page-->
<a href="https://2015.igem.org/Team:Dundee/Modeling/Fingerprints#fmodel" class="btn btn-primary btn-lg pull-right" role="button">View Description of Model</a>         
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Fingerprints#fmodel" class="btn btn-primary btn-lg pull-right" role="button">View Description of Model</a>        <!--Button that navigates to Fingerprints page-->
 
               </div>
 
               </div>
 
</div>
 
</div>
Line 315: Line 322:
  
 
   </body>
 
   </body>
<div id="pagebox3">
+
<div id="pagebox3"><!--All content within the division is of the pagebox class, i.e has a margin-->
<a class="anchor" id="end"></a>
+
<a class="anchor" id="end"></a><!--Sets anchor so that section can be navigated back to using #end command-->
 
     <section id="end">
 
     <section id="end">
 
       <div class="row3">
 
       <div class="row3">
Line 323: Line 330:
 
           <div class="col-lg-12 feature" style="">
 
           <div class="col-lg-12 feature" style="">
 
             <div class="row">
 
             <div class="row">
<font color="white"><p>To see the MATLAB code for the BioSpray section of the project or the Chromate Biosensor section of the project use the following buttons.</font></p>
+
<font color="white"><!--set font colour to white--><p>To see the MATLAB code for the BioSpray section of the project or the Chromate Biosensor section of the project use the following buttons.</font></p>
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix3" class="btn btn-primary btn-lg pull-right" role="button">Appendix 3: Chromate Biosensor</a>   
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix3" class="btn btn-primary btn-lg pull-right" role="button">Appendix 3: Chromate Biosensor</a>  <!--Button that takes user to next page of appendix-->
  
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix1"  class="btn btn-primary btn-lg pull-right" role="button">Appendix 1: BioSpray</a>   
+
<a href="https://2015.igem.org/Team:Dundee/Modeling/Appendix1"  class="btn btn-primary btn-lg pull-right" role="button">Appendix 1: BioSpray</a>  <!--Button that takes user to previous page of appendix-->
 
  </div>   
 
  </div>   
 
      
 
      
Line 340: Line 347:
 
</html>
 
</html>
  
{{:Team:Dundee/navbar}}
+
{{:Team:Dundee/navbar}}<!--Inputs navbar-->
{{:Team:Dundee/footer}}
+
{{:Team:Dundee/footer}}<!--Innputs standard footer-->

Revision as of 18:43, 18 August 2015

Dry Lab

Appendix 2: Fingerprint Aging Code

Principal Component Analysis Code

Principal component analysis MATLAB code.

Squalene Epoxide Model Code

MATLAB code for the binding between squalene epoxide and lanosterol synthase mathematical model.

Principal Component Analysis Code

Lorem ipsum dolor sit amet, nostrud maiestatis quaerendum ne sed. Reque possit ne sea. Te dico labitur mediocritatem ius. Error timeam noluisse eos ad, eam ne magna meliore contentiones, nec ei volumus persecuti. Dicit animal definitionem et mel, nonumy tacimates nec in. Vis mucius periculis at. At est vidit scripserit repudiandae, agam porro sea ne. Sea et stet tibique praesent, vim et legere aperiri. Quo doming vocibus eleifend no. Cu vis partem graeci facilisis. Falli inciderint mei no. Assentior suscipiantur mea id. Vis quas electram prodesset cu, choro omnium conclusionemque an his. Vis latine equidem perfecto ad.

Back to Top View Description of PCA

Squalene Epoxide Model MATLAB Code

The figure shown in the squalene epoxide and lanosterol synthase were created using MATLAB. Before using MATLAB the original system of equations was non-dimensionalised to the system:

$$ \begin{eqnarray*} \frac{dLS}{d\tau}&=&PC-\lambda LS \cdot SE,\\ \frac{dSE}{d\tau}&=&PC-\lambda LS \cdot SE,\\ \frac{PC}{d\tau}&=&\lambda LS \cdot SE-PC-\gamma PC,\\ \frac{dLa}{d\tau}&=&\gamma PC. \end{eqnarray*} $$

The initial conditions were also non-dimensionalised to become:

$$ \begin{eqnarray*} LS(0)&=&v_{0},\\ SE(0)&=&1,\\ PC(0)&=&0,\\ La(0)&=&0. \end{eqnarray*} $$

Two files were written to perform sensitivity analysis; one to set the function (squalene.m) and one to solve the function and plot the results in Figure 1 (run_squalene.m). Both files are shown below, where the green is comments to aid in understanding of the scripts.


  MATLAB code from squalene.m file
% File to solve the system of ODEs describing lanosterol synthase and squalene epoxide binding.
% The vector u has 4 dimensions;
% u(1) = Lanosterol synthase (LS) concentration, {non-dimensionalized}
% u(2) = Squalene epoxide (SE) concentration, {"}
% u(3) = Protosterol cation (PC) concentration (1st Intermediate), {"}
% u(4) = Lanosterol (La) concentration. {"}
% t is the time that the simulation is run over.
% lambda is the 1st binding parameter ((k1/k2)SE(0)).
% gamma is the 2nd binding parameter (k3/k2).
function f = squalene(t,u,lambda,gamma);
% Then set f as the RHS of the system of ODEs.
f = [u(3)-lambda.*u(1)*u(2);
    u(3)-lambda.*u(1)*u(2);
    lambda.*u(1)*u(2)-u(3)-gamma.*u(3);
    gamma.*u(3)];
end
% Then end the function.
% This function can then be solved using ode23 in the file run_squalene.m  by using the @squalene command.
% END OF FILE.


MATLAB code for run_squalene.m file.
% File to solve the non-dimensionalised system of ODEs representing the binding of squalene epoxide (SE) and lanosterol synthase (LS) to form lanosterol (La).
%
% Set the final time of the simulation, set at 30 seconds.
T = 30;
% Set initial concentration of ratio (LS/SE) as the expected value.
u0 = 2.561;
% Parameter a is how many values of each parameter are used in the sensitivity analysis.
a = 100;

% Set lambda1 as the range of values for parameter lambda, where the maximum value is twice the expected.
lambda1 = linspace(0,(0.64061499*2),a);
% Set gamma1 as the range of values for parameter gamma, where the maximum value is twice the expected.
gamma1 = linspace(0,(1.000223733*2),a);
% Set Store as an empty matrix to store the values of lanosterol concentrations for each range of values of lambda1 and gamma1.
Store = zeros(a,a);
% Set a for loop that will solve the system of ODEs from the squalene.m file using the ode23 solver, for each value of lambda1, gamma1.

% The resulting values for the lanosterol concentration are stored in the Store matrix.
for i=1:a
    for j=1:a
[t,u]=ode23(@squalene,[0 T],[u0 1 0 0],[],lambda1(a+1-i),gamma1(j));
 Store(i,j) = u(end,4);

    end
end
% Call up a blank figure, so that no other figures are overwritten.
figure(1)
% Plot a colourplot of Store, that is plot the lanosterol concentration against lambda1 and gamma1.

imagesc(Store)
% Set the colormap as default colour choice, as this is easiest to see.
colormap default
% Remove the values on the x and y axis by using the set command.
set(gca,'YTick',[],'XTick',[]);
% Add a colorbar with user defined axis labels (Tick labels) and label,
% 'Complex Concentration'.
c=colorbar('Ticks',[0,0.99],'TickLabels',{'None','High'},'FontSize',15,'FontWeight','bold');
c.Label.String = 'Complex Concentration';
% Add labels to the x and y axis for clarity on the plot.
xlabel('\fontsize{12} \bf Increasing \lambda');
ylabel('\fontsize{12} \bf Increasing \gamma');
%
%
%% Section 2: This section is used to plot only lambda against lanosterol concentration over time.
% Define store1 as an empty matrix to hold values of LS, SE, PC (1st Intermediate) and La, for each value of lambda1.
store1 = zeros(5000,5,a); % 1st is time, 2:5 are u.
% Set a for loop that will solve the system of ODEs from the squalene.m file using the ode23 solver, for each value of lambda1, with the expected value of gamma1 used.
% The resulting values for LS, SE, PC and the lanosterol concentration are stored in the store1 matrix.
for i=1:a

    [t,u]=ode23(@squalene,[0 T],[2.561 1 0 0],[],lambda1(i),1.000223733);
    store1(end-size(t,1)+1:end,1,i) = t;
    store1(end-size(t,1)+1:end,2:5,i) = u;

end
% Call up a blank figure, so that no other figures are overwritten.
figure(2)
% Plot the values of lambda1 against the corresponding values of lanosterol concentration over time.

 plot(lambda1,squeeze(store1(end,5,:)),'LineWidth',2);
 % Add labels to the x and y axis for clarity on the plot.
 xlabel('\bf \fontsize{12}Increasing \lambda');
 ylabel('\bf \fontsize{12} Lanosterol Concentration');
 % Set the axis to tight so that the axis is not too large for the data.
 axis tight
 %
 %
%% Section 3: This section is used to plot only gamma against lanosterol concentration over time.
% Define store2 as an empty matrix to hold values of LS, SE, PC and La, for each value of gamma1.
store2 = zeros(a,5,a); % 1st is time, 2:4 are u.
% Set a for loop that will solve the system of ODEs from the squalene.m file using the ode23 solver, for each value of gamma1, with the expected value of lambda1 used.
% The resulting values for LS, SE, PC and the lanosterol concentration are stored in the store2 matrix.
for i=1:a

    [t,u]=ode23(@squalene,[0 T],[2.561 1 0 0],[],0.64061499,gamma1(i));
    store2(end-size(t,1)+1:end,1,i) = t;
    store2(end-size(t,1)+1:end,2:5,i) = u;

end
% Call up a blank figure, so that no other figures are overwritten.
figure(3)
% Plot the values of gamma1 against the corresponding values of lanosterol concentration over time.
 plot(gamma1,squeeze(store2(end,5,:)),'LineWidth',2);
% Add labels to the x and y axis for clarity on the plot.
  xlabel('\bf Increasing \gamma');
 ylabel('\bf Lanosterol Concentration');
% Set the axis to tight so that the axis is not too large for the data.
 axis tight
 %
 %
%% Section 4: This section is used to plot only v0, the ratio of (LS(0)/SE(0)) against lanosterol concentration over time.
% Define store3 as an empty matrix to hold values of LS,SE,PC and La, for each value of v0.
store3= zeros(a,5,a);
% Set v0 as the range of values for v0 with the maximum as twice the expected value.
v0=linspace(0,(2.561*2),a);
% Set a for loop that will solve the system of ODEs from the squalene.m file using the ode23 solver, for each value of v0, with the expected value of lambda and gamma used.
% The resulting values for LS, SE, PC and the lanosterol concentration are stored in the store3 matrix.
for i=1:a
    [t,u]= ode23(@squalene,[0 T],[v0(i) 1 0 0],[],0.64061499,1.00223733);
    store3(end-size(t,1)+1:end,1,i) = t;
    store3(end-size(t,1)+1:end,2:5,i) = u;
end
% Call up a new figure, so that no figures are overwritten.
figure(4)
% Plot the values of v0 against the corresponding values of lanosterol concentration over time.
plot(v0,squeeze(store3(end,5,:)),'LineWidth',2);
% Set the axis to tight so that the axis is not too large for the data.
axis tight;
% Add labels to the x and y axis for clarity on the plot.
xlabel('\bf \fontsize{12} Increasing v_{0}');
ylabel('\bf \fontsize{12} Concentration of Lanosterol formed');
%
% END OF FILE.
Back to Top View Description of Model

To see the MATLAB code for the BioSpray section of the project or the Chromate Biosensor section of the project use the following buttons.

Appendix 3: Chromate Biosensor Appendix 1: BioSpray