IGEM:IMPERIAL/2008/Prototype/Drylab/Data Analysis/BSub Video

From OpenWetWare
Jump to: navigation, search

<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 Synthetic Video

A video of user defined number of motile synthetic bacteria was created using the MATLAB code shown below and two other functions which are called to generate bacteria characteristics and frame-by-frame bacteria trajectory. The background image is also user defined, and is assumed to change with a normal distribution over the total number of frames. Interpolation was used to generate the transitions of both the background and bacteria between frames. The frame rate is also user specified so as to mimic the frame rate at which motility videos are being captured on the microscope.

MATLAB Code

   %Creates video of Bacteria Motility
   
   function bacvideo(vid_time,frame_rate,dframe,ImSize,BkCol,SigBkCol,p)
   
   %Initialise Parameters
   t=-pi:0.1:pi;
   colormap gray;
   frames=zeros(p,1);
   
   for i=1:p
       %Generates Motility Data
       [bac(i).coord,bac(i).frames]=motility(vid_time,frame_rate,300,0,1,30,10);
       bac(i).center_x=ImSize/(2*normrnd(1,1));
       bac(i).center_y=ImSize/(2*normrnd(1,1));
       %[coord,nframes]=motility(vid_time,frame_rate,data_pts,von_a,von_k,maxw_a,exp_l)
       frames(i,1)=bac(i).frames;
   end;
   
   nframes=min(frames);
   
   for i=1:p
       %Generates Bacteria Shape and Intensity
       [bac(i).bactshape,bac(i).bactinten]=shape(nframes,dframe,50, 25, 2, 20, 2);
       %[bactshape,bactinten]=shape(nframes,dframe,L, W, SigSize, I, SigInt);
   end;
   
   %Generates Background Image
   
   %Create Image Size
   backgnd=cell(1+dframe,1); %Square Matrix of Size ImSize
   bkggen=zeros(ImSize);    %Declare Blank Background
   
   %Initialise Background Iterative Points and Index
   backgnd{1,1}=abs(normrnd(BkCol,SigBkCol,ImSize));
   backgnd{1+dframe,1}=abs(normrnd(BkCol,SigBkCol,ImSize));
   low=1;
   high=1+dframe;
       
   for n=1:nframes
       %Generates Series of Images
       if mod(n,dframe)==1
           if n==low
               bkggen=backgnd{1,1};
           elseif n==high
               bkggen=backgnd{1+dframe,1};
               
               %Switches low to high and generates new data for high
               backgnd{1,1}=backgnd{1+dframe,1};
               backgnd{1+dframe,1}=abs(normrnd(BkCol,SigBkCol,ImSize));
               low=high;
               high=low+dframe;
           end;
       else
           bkggen=backgnd{1,1}+((backgnd{1+dframe,1}-backgnd{1,1})/dframe)*(n-low);
       end;
       
       image(bkggen);
       hold on
   
       for i=1:p
           %Draws Shape of Bacteria & Membrane
           bac(i).x=bac(i).bactshape(n,1)*cos(t)+bac(i).coord(n,1)+bac(i).center_x;
           bac(i).y=bac(i).bactshape(n,2)*sin(t+bac(i).bactshape(n,3))+bac(i).coord(n,2)+bac(i).center_y; 
           bac(i).membr_x=1.1*bac(i).bactshape(n,1)*cos(t)+bac(i).coord(n,1)+bac(i).center_x;
           bac(i).membr_y=1.1*bac(i).bactshape(n,2)*sin(t+bac(i).bactshape(n,3))+bac(i).coord(n,2)+bac(i).center_y;  
   
           hold on
           fill(bac(i).membr_x,bac(i).membr_y,[bac(i).bactinten(n,2) bac(i).bactinten(n,2) bac(i).bactinten(n,2)],'EdgeColor','none');
           fill(bac(i).x,bac(i).y,[bac(i).bactinten(n,1) bac(i).bactinten(n,1) bac(i).bactinten(n,1)],'EdgeColor','none');  
           M(n)=getframe;
       end;
       %Stores Frame Data
   
       hold off;
   end;
   
   %Saves as Video
   movie2avi(M,'bac1.avi','compression','none','fps',frame_rate);

Generated Videos

3 types of synthetic videos were generated:

  • Single motile cell without change in shape
  • Single motile cell with change in shape
  • Multiple motile cells with change in shape

Single Motile Cell Without Change in Shape Single Motile Cell With Change in Shape Multiple Motile Cells With Change in Shape


<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>