# 3D animation of listeria moving in Xenopus extract in 2D # Version 1.0 9-27-09 # Based on Shenoy et al (in Julie Theriot's group)PNAS May 15, 2007 vol. 104 # # Plots the trajectory of a listeria bacterium and then its distance and speed vs. time # Listeria is a pathogenic bacterium responsible for much food-borne illness # It moves along its substrate by polymerizing the protein actin, pushing off against # the substrate by leaving a "comet tail" easily visualized under light microscopy # Theriot's group has shown that listeria rotates as it travels. # Movies of all this can be viewed at Julie Theriot's group website at: http://cmgm.stanford.edu/theriot/ from visual import * from visual.graph import * # import graphing features # STUDENT PARAMETERS # ratio between w, the rate at which the listeria rotates around its long axis # and Omega, the rate of change of the angle the long axis makes with the x axis. wOmega = 0.1 # timestep in dimensionless units wt dt = 0.1 Ntimesteps = 3000 # total number of timesteps for the simulation ######################### # # Small amplitude sine: wOmega=0.1, dt = 0.1, Ntimesteps = 3000 # S curve or Large amplitude sine: wOmega=0.5-1.0, dt = 0.1, Ntimesteps = 3000 # Serpentine: wOmega=1.5-1.0, dt = 0.1, Ntimesteps = 3000 # Translating figure 8 wOmega=2.5, dt = 0.1, Ntimesteps = 3000 # Spirals wOmega=20.2, dt =0.01, Ntimesteps = 3000 # # # ############################## oxa = 1 oya = 1 oza = 0.1 x_o = 0 # initial value of x, y and z--starts at the origin y_o = 0 z_o = 0 # Initialize graphics scene - put the 3D box at x=50, y=0, make it 800 wide and 200 high scene=display(width=1200,height=600,x=50, y=0) scene.ambient=0.24 scene.background=color.white scene.title="Listeria trajectory, parameter value ="+str(wOmega) scene.range=(oxa,oya,oza) #this sets the viewing angle scene.forward=(0,0,1) # create wireframe with dimensions of the pixel sizes along x,y,z for now # create the 8 points. then join em up p1 = (oxa,oya,oza) p2 = (-oxa,oya,oza) p3 = (-oxa,-oya,oza) p4 = (oxa,-oya,oza) p5 = (oxa,oya,-oza) p6 = (-oxa,oya,-oza) p7 = (-oxa,-oya,-oza) p8 = (oxa,-oya,-oza) square1 = curve(pos=[p1,p2,p3,p4,p1],color=color.black) square2 = curve(pos=[p5,p6,p7,p8,p5],color=color.black) square3 = curve(pos=[p1,p5,p8,p4,p1],color=color.black) square4 = curve(pos=[p2,p6,p7,p3,p2],color=color.black) # end of wireframe # initialize listeria's position at (xo,yo,zo), pointing along +y listeria = cone(pos=(x_o,y_o,z_o), radius=0.01, axis=(0,0.01,0), color=color.white) listeria_position=[] listeria_speed=[] # create curve to plot the listeria's trajectory c = curve(pos=(x_o,y_o,z_o),color=color.red) n=0 while n <= Ntimesteps: rate (30) # screen refresh rate t = n*dt # current time # first update velocity, then update position second! # If switched in order, it looses energy and orbits don't close! listeria.velocity = vector([-sin(wOmega*sin(t)),cos(wOmega*sin(t)),0.0]) listeria.pos = listeria.pos + listeria.velocity*dt listeria.axis = 0.1*vector([-sin(wOmega*sin(t)),cos(wOmega*sin(t)),0.0]) listeria_position.append(mag(listeria.pos)) listeria_speed.append(mag(listeria.velocity)) c.append(pos=listeria.pos) n=n+1