IGEM:IMPERIAL/2008/Prototype/Drylab/Data Analysis/BSub Motility: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
mNo edit summary
 
Line 1: Line 1:
{{Imperial/StartPage}}
{{Imperial/StartPage2}}


=Generating Bacteria Trajectory=
= Generating Bacteria Trajectory =


==Synthetic Motility Data==
== Synthetic Motility Data ==
[[Image:Trajectory_real.TIF|left|150px|Real Bacteria Trajectory]] [[Image:Trajectory_synth.TIF |right|150px|Synthetic Bacteria Trajectory]]
[[Image:Trajectory_real.TIF|left|150px|Real Bacteria Trajectory]] [[Image:Trajectory_synth.TIF |right|150px|Synthetic Bacteria Trajectory]]


Line 14: Line 14:
*Tumbling Duration: Exponential Distribution with parameter <math>\lambda</math>
*Tumbling Duration: Exponential Distribution with parameter <math>\lambda</math>


==MATLAB Code==
== MATLAB Code ==


     %Generation of Bacteria Trajectory
     %Generation of Bacteria Trajectory

Latest revision as of 13:04, 16 September 2008

<html> <style type="text/css"> .firstHeading {display: none;} </style> </html> <html> <style type="text/css">

   table.calendar          { margin:0; padding:2px; }

table.calendar td { margin:0; padding:1px; vertical-align:top; } table.month .heading td { padding:1px; background-color:#FFFFFF; text-align:center; font-size:120%; font-weight:bold; } table.month .dow td { text-align:center; font-size:110%; } table.month td.today { background-color:#3366FF } table.month td {

   border:2px;
   margin:0;
   padding:0pt 1.5pt;
   font-size:8pt;
   text-align:right;
   background-color:#FFFFFF;
   }
  1. bodyContent table.month a { background:none; padding:0 }

.day-active { font-weight:bold; } .day-empty { color:black; } </style> </html>

<html><script language="JavaScript">

var timeout = 250; var closetimer = 0; var ddmenuitem = 0;

// open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out //document.onclick = mclose; </script> <table background="http://i59.photobucket.com/albums/g305/Timpski/ToolbarBackground.png" style="color:#ffffff;" link="#ffffff" cellpadding="0" cellspacing="1" border="0" bordercolor="#ffffff" align="center" width="100%"><tr><td colspan="6" class="wetlab"><br><br><br></td></tr> <tr><td align="center" width="10%" valign="bottom"><ul id="sddm"><a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Home"> Home </a></ul> </td><td align="center" width="20%" valign="bottom"><ul id="sddm"><a href="#"

       onclick="mopen('m1')" 
       onmouseover="mopen('m1')" 
       onmouseout="mclosetime()">Biofabricator Subtilis</a>
       <div id="m1" 
           onmouseover="mcancelclosetime()" 
           onmouseout="mclosetime()">
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Project">Project Specifications</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Chassis_1">Why B. subtilis?</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Chassis_2">B. subtilis: Benefits vs Challenges</a>
       </div></ul>

</td><td align="center" width="18%" valign="bottom"><ul id="sddm"><a href="#"

       onclick="mopen('m2')" 
       onmouseover="mopen('m2')" 
       onmouseout="mclosetime()">Wet Lab</a>
       <div id="m2" 
           onmouseover="mcancelclosetime()" 
           onmouseout="mclosetime()">
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Wet_Lab">Wet Lab Hub</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Cloning_Strategy">Cloning Strategy</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Protocols">Experiments & Protocols</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Major_Results">Experimental Results</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/BioBricks">BioBricks & Characterisation</a>
       </div></ul>

</td><td align="center" width="18%" valign="bottom"><ul id="sddm"><a href="#"

       onclick="mopen('m3')" 
       onmouseover="mopen('m3')" 
       onmouseout="mclosetime()">Dry Lab</a>
       <div id="m3" 
           onmouseover="mcancelclosetime()" 
           onmouseout="mclosetime()">
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Dry_Lab">Dry Lab Hub</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Growth_Curve">Growth Curves</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Genetic_Circuit">Genetic Circuits</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Motility">Motility Analysis</a>
       <a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Appendices">Appendices - Code etc.</a>
       </div></ul>

</td><td align="center" width="17%" valign="bottom"><ul id="sddm"><a href="http://2008.igem.org/Team:Imperial_College/Notebook"> Notebook </a></ul> </td><td align="center" width="17%" valign="bottom"><ul id="sddm"><a href="http://openwetware.org/wiki/IGEM:IMPERIAL/2008/New/Team"> Our Team </a></ul> </td></tr></table></html>

<html><style type="text/css">

div.Section { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; background-image: url(http://openwetware.org/images/a/a0/Background.PNG); background-size: 100%; background-origin: content; }

/* Text (paragraphs) */ div.Section p { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:justify; margin-top:0px; margin-left:30px; margin-right:30px; }

/* Headings */ div.Section h1 { font:22pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:left; color:#3366FF; font-weight:bold; }

/* Subheadings */ div.Section h2 { font:18pt Calibri, Verdana, Arial, Geneva, sans-serif; color:#3366FF; margin-left:5px; font-weight:bold; }

/* Subsubheadings */ div.Section h3 { font:22pt Calibri, Verdana, Arial, sans-serif; color:#E5EBFF; margin-left:10px; font-weight:bold; }

/* Subsubsubheadings */ div.Section h4 { font:22pt Calibri, Verdana, Arial, sans-serif; color:#2B48B3; margin-left:10px; font-weight:bold; }

/* Subsubsubsubheadings */ div.Section h5 { font:12pt Calibri, Verdana, Arial, sans-serif; color:#3366FF; margin-left:20px; }

/* References */ div.Section h6 { font:12pt Calibri, Verdana, Arial, sans-serif; font-weight:bold; font-style:italic; color:#3366FF; margin-left:25px; }

/* Hyperlinks */ div.Section a { }

div.Section a:hover { }

/* Tables */ div.Section td { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:justify; vertical-align:top; padding:2px 4px 2px 4px; }

/* Lists */ div.Section li { font:11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align:left; margin-top:0px; margin-left:30px; margin-right:0px; }

/* TOC stuff */ table.toc { margin-left:10px; }

table.toc li { font: 11pt/16pt Calibri, Verdana, Arial, Geneva, sans-serif; text-align: justify; margin-top: 0px; margin-left:2px; margin-right:2px; }

/* [edit] links */ span.editsection { color:#BBBBBB; font-size:10pt; font-weight:normal; font-style:normal; vertical-align:bottom; }

span.editsection a { color:#BBBBBB; font-size:10pt; font-weight:normal; font-style:normal; vertical-align:bottom; }

span.editsection a:hover { color:#3366FF; font-size:10pt; font-weight:normal; font-style:normal; vertical-align:bottom; }

/* Drop-down Menu */

  1. sddm {

margin: 0; padding: 0; z-index: 30 margin: 0; padding: 0; float: center; font: bold 12pt Calibri, Verdana, Arial, Geneva, sans-serif; border: 0px; list-style: none; }

  1. sddm a {

display: block; margin: 0px 0px 0px 0px; padding: 0 0 12px 0; color: #FFFFFF; text-align: center; text-decoration: none; }

  1. sddm a:hover {

border: 0px }

  1. sddm div {

position: absolute; visibility: hidden; margin: 0; padding: 0; background: #66aadd; border: 1px solid #66aadd } #sddm div a { position: relative; left: 0; display: block; margin: 0; padding: 5px 10px; width: auto; white-space: nowrap; text-align: left; text-decoration: none; background: #FFFFFF; color: #2875DE; font: 11pt Calibri, Verdana, Arial, Geneva, sans-serif } #sddm div a:hover { background: #66aadd; color: #FFFFFF } </style></html>

Generating Bacteria Trajectory

Synthetic Motility Data

Real Bacteria Trajectory
Real Bacteria Trajectory
Synthetic Bacteria Trajectory
Synthetic Bacteria Trajectory

Synthetic distributions for bacteria run velocity, run duration, tumbling angle and tumbling duration were generated in the data gathering process. Alternative models may be assumed for the above motility characteristics, however we assumed that the run velocity had a Maxwell Distribution like the velocity of gas molecules, run and tumbling duration to be exponentially distributed and tumbling angle to be von Mises distributed. Parameters for the distributions are then user defined.

In this instance, we have decided to use the following distributions:

  • Run Velocity: Maxwell Distribution with parameter a
  • Run Duration: Exponential Distribution with parameter [math]\displaystyle{ \lambda }[/math]
  • Tumbling Angle: von Mises Distribution with parameters a and k
  • Tumbling Duration: Exponential Distribution with parameter [math]\displaystyle{ \lambda }[/math]

MATLAB Code

   %Generation of Bacteria Trajectory
   
   function [coord,nframes]=motility(vid_time,frame_rate,data_pts,von_a,von_k,maxw_a,exp_l)
   
   %Initialise Parameters
   frame_count=0;
   coord_pt=zeros(data_pts,2);
   beta=zeros(data_pts,1);
   tumb_frames=1;  %Bacteria Tubmles in First Frame
   coord(1,:)=coord_pt(1,:);
   n=1;
   
   %Generates Bacteria Motility Statistics
   theta=randraw('vonmises',[von_a,von_k],data_pts+1);      %Generates tumbling angle
   v_run=randraw('maxwell',maxw_a,data_pts+1);  %Generates run speed
   t_run=randraw('exp',1,data_pts+1);           %Generates run duration
   t_tumb=randraw('exp',exp_l,data_pts+1);
   
   %Generates Coordinate Points
   for k=1:data_pts
       beta(k+1)=beta(k)+theta(k);  %Generates cummulative turn angle 
       %Displacement=Velocity*Time
       coord_pt(k+1,1)=coord_pt(k,1)+v_run(k+1)*cos(beta(k+1))*t_run(k+1);    
       coord_pt(k+1,2)=coord_pt(k,2)+v_run(k+1)*sin(beta(k+1))*t_run(k+1); 
   end;
   
   if (sum(t_run+t_tumb))>vid_time
       %Generates Total Number of Frames, Points Data and Skeleton
       while frame_count <= (vid_time*frame_rate)
           %Generates Total Number of Frames
           frame_count=frame_count+round(t_run(n+1)*frame_rate)+round(t_tumb(n+1)*frame_rate);
           
           %Generates Bacteria Trajectory
           run_frames=tumb_frames+round(t_run(n+1)*frame_rate);
           coord(run_frames,:)=coord_pt(n+1,:);
           
           for i=(tumb_frames+1):(run_frames-1)
               coord(i,:)=coord(i-1,:)+(coord(run_frames,:)-coord(tumb_frames,:))/(run_frames-tumb_frames);
           end;
           
           tumb_frames=run_frames+round(t_tumb(n)*frame_rate);
       
           %Generates Trajectory
           for i=(run_frames+1):tumb_frames
               coord(i,:)=coord(run_frames,:);
           end;
         
       %Counter
       n=n+1;
       end;
   else
       sprintf('%s','Insufficient Data Points!')
   end;
   
   nframes=length(coord);


<html><center><table style="color:#ffffff;background-color:#66aadd;" cellpadding="3" cellspacing="1" border="0" bordercolor="#ffffff" align="center"> <tr><td><ul id="sddm"></html>[[IGEM:IMPERIAL/2008/New/{{{1}}}|< Previous]]<html></ul> </td><td><ul id="sddm"><a href="#">Back to top</a></ul> </td><td><ul id="sddm"></html>[[IGEM:IMPERIAL/2008/New/{{{2}}}|Next >]]<html></ul> </td></tr></table> </center></html>