Difference between revisions of "Spring 2020 Assignment 9"

From Course Wiki
Jump to: navigation, search
m (Feedback systems)
 
(44 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
{{Template:20.309}}
 
{{Template:20.309}}
 
__NOTOC__
 
__NOTOC__
==Second-order systems==
+
==Signals and systems==
 +
{{Template:Assignment Turn In|message =
 +
Fill out the table below. Match each system function with its Bode magnitude and phase plot, step response, and pole zero diagram. (Write one letter A-E in each box below.) In the row labeled “Description,” write a descriptive name of each system, such as “low-pass filter” or “overdamped second-order system.”
 +
}}
  
 +
{| border="1" style="width: 85%;"
 +
!System function
 +
!<math>\frac{1}{s+1}</math>
 +
!<math>\frac{s}{s+1}</math>
 +
!<math>\frac{s}{s^2+2s+1}</math>
 +
!<math>\frac{s}{s^2+0.1s+1}</math>
 +
!<math>\frac{s}{s^2+10s+1}</math>
 +
|-
 +
!Magnitude plot
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
!Phase plot
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
!Step response
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
!Pole/zero plot
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
!Description
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|}
 +
<center>
 +
'''Magnitude Plots'''
  
==The Frequency Dependence of Osmo-Adaptation in Saccharomyces cerevisiae==
+
[[File:Transfer function matching magnitude plots.png|700 px]]
Read [[https://www.dropbox.com/s/cmgq0b33vn8csow/Frequency%20Dependence%20of%20Osmo-Adaptation%20in%20Saccharomyces%20cerevisiae.pdf?dl=0 The Frequency Dependence of Osmo-Adaptation in Saccharomyces cerevisiae]] and the [[https://www.dropbox.com/s/y9k4qfzg8uld656/The%20Frequency%20Dependence%20of%20Osmo-Adaptation%20in%20Saccharomyces%20cerevisiae%20supporting.pdf?dl=0 supporting information.]]. This paper will be the focus of exam 2. We will discuss the paper and the supporting information on Thursday and Friday.
+
  
{{Template:Assignment Turn In|message =
+
'''Phase Plots'''
Answer the following questions about The Frequency Dependence of Osmo-Adaptation in S. cerevisiae:
+
<ol>
+
<li>What is the primary mechanism by which S. cerevisiae recovers from hyperosmotic shock?</li>
+
<li>What model did Mettetal, et. al. use for Hog1 activation in response to a hyperosmotic shock?</li>
+
<li>Mettetal, et. al. found that that the hyperosmotic shock response of wild-type yeast was (choose one): underdamped, critically damped, or overdamped.</li>
+
<li>The response of the mutant (low Pbs) yeast was (choose one): underdamped, critically damped, or overdamped.</li>
+
<li>In the plot below, indicate which step response corresponds to the wild-type strain and the mutant strain.</li>
+
[[file:Mettetal yeast model step response.png]]
+
  
 +
[[File:Transfer function matching phase plots.png|700 px]]
  
 +
'''Step Response Plots'''
  
{{Template:Assignment Turn In|message = Our goal for assignment 10 is to reproduce the bode plot in the paper (Figure 2 B and C), and fit it to a model second-order system. We will only measure the 'wild type' yeast strain, since measuring the mutant would take too much time.
+
[[File:Transfer function matching step response plots.png|700 px]]
# What mathematical model did Mettetal, ''et. al.'' use for the yeast response network? Express the model in the following forms: transfer function (TF), poles and zeros (ZPK), single differential equation (SDE), and coupled differential equations (CDE). Express the TF, SDE, and ZPK models in terms of the undamped natural frequency, <math>\omega_0</math>, damping ratio <math>\zeta</math>, and/or damped natural frequency <math>\omega_D</math>.
+
# Find an expression for the step response and plot it over a range of values of <math>\omega_0</math> and <math>\zeta</math>. A hand-drawn plot is fine, but you should probably look into MATLAB's <tt>step</tt> function.
+
# Plot the frequency response (i.e. make a Bode plot) of the system over a range of <math>\omega_0</math> and <math>\zeta</math> values that includes over damped, critically damped, and under damped.
+
# What are two questions that you have about the paper's methodology or how we're going to implement the experiment in 20.309?
+
}}
+
  
==Yeast image analysis code==
+
'''Pole Zero Plots'''
  
Download the data provided in the class dropbox folder. This data was collected by 20.309 students last semester. The movies were collected using the same 20.309 microscope that you built in class with an upgrade (that you would have done in Assignment 8 had we been on campus...) to incorporate a second fluorescence color. During an experiment, the microscope first recorded an image with blue illumination (exciting GFP) followed by one with green illumination (exciting RFP). It had a 40x objective and a 125 mm tube lens - remember that results in a 25x magnification.
+
[[File:Transfer function matching pole zero plots.png|700 px]]
 +
</center>
 +
{{Template:Assignment Turn In|message =
 +
*  Use graphical methods to find the Fourier transform of the half-cosine pulse function x(t) plotted below, which consists of the positive half of a 1 Hz cosine, repeated forever at a rate of 1 Hz.
 +
* What is the lowest frequency component of x(t), not counting <math>\hat{X}(0)</math>?
 +
}}
  
The sample is similar to the one in Mettetal ''et al.'': we are using ''S. cerevisiae'' with the protein Hog1 fused to GFP (which is excited by blue light) and an mRNA binding protein (we'll call MCP) fused to tagRFP (which is excited by green light) to locate the nucleus. A solenoid valve controls whether or not the medium provided to the yeast cells contains a high salt concentration, and in the experiment we oscillate between a high and low salt medium at a fixed rate. We expect to see the yeast cells 'respond' to an osmotic shock as a more localized Hog1-GFP signal that overlaps with the signal from the nucleus (RFP). Our goal is to calculate the average correlation coefficient between Hog1 and the nucleus as a function of the high/low valve state.
+
[[File:Cosine pulse function.png|700 px]]
 +
One way to create x(t) using functions that appear on the transform table is:
 +
# '''multiply''' a '''cosine''' by a '''rectangle''', and then
 +
# '''convolve''' the result with the '''comb function''' <math>\mathrm{III(}t)=\sum\limits_{n=-∞}^{∞} \delta(t-nT)</math>.  
 +
Use the diagram below to help you find the answer. The left column of shows signals in the time domain, and the right column shows the magnitude of the Fourier transform of each signal. The top right plot is filled in for you, plus a little hint that might help you make an accurate plot.  
  
Load some data into MATLAB:
+
(The phase of the transforms in this problem is zero at all frequencies, so it is not plotted.)
<pre>
+
load('fall2019_StudentData_1');
+
</pre>
+
The data is stored in a struct called <tt>yeastOsmoticShockData</tt>.  
+
<pre> 
+
yeastOsmoticShockData =
+
  
  struct with fields:
+
[[File:Cosine pulse transform worksheet.png|700 px]]
  
                        Movie: [544×728×2×16 uint16]
+
==Feedback systems==
                          Time: [16×2 double]
+
{{Template:Assignment Turn In|message =
                    ValveState: [16×2 logical]
+
<ul>
        ValveOscillationPeriod: 960
+
<li>Find the transfer function <math>\hat{H}(s)=(\hat{V}_{out}(s))/(\hat{V}_{in}(s))</math> of the left-hand circuit shown below, assuming L = 1 H and R = 1&Omega;.</li>
    BlueCameraGainAndExposure: [6 5000000]
+
<li>Plot the poles and zeros of H ̂(s) on a set of axes using x’s for poles and o’s for zeroes.</li>
    GreenCameraGainAndExposure: [15 5000000]
+
<li>The left-hand circuit is placed in feedback system, as shown in the right-hand block diagram below. The triangle represents an amplifier with gain G that does not depend on frequency. Find the transfer function of the feedback system <math>\hat{F}(s)=(\hat{Y}(s))/(\hat{X}(s)).</math></li>
</pre>
+
<li>Plot the poles and zeros of <math>\hat{F}(s)</math> for G=1, 9, and 19. Label the gain value for each point.
 +
</ul>
 +
}}
  
The data structure contains all the important information from the experiment:
+
<center>
* <tt>yeastOsmoticShockData.Movie</tt> is a two-color movie, where the 3d dimension is the color (1 = Blue excitation = GFP, 2 = Green excitation = RFP), and the fourth is the frame number. Notice that <tt> yeastOsmoticShockData.Movie</tt> is a uint16 data type which is the same as the movies you worked with in the particle tracking assignments.
+
{|
* <tt>yeastOsmoticShockData.Time</tt> is the time stamp of each frame, recorded in seconds from the start of the experiment. Column 1 contains the timestamps of the GFP images, column 2 is for the RFP images.
+
|[[File:LR Low Pass Filter for S20 Assignment 9.png|250 px]]
* <tt>yeastOsmoticShockData.ValveOscillationPeriod</tt> is the oscillation valve period, in seconds.
+
|[[File:Feedback System Block Diagram for S20 Assignment 9.png|350 px]]
* <tt>yeastOsmoticShockData.BlueCameraGainAndExposure</tt> and <tt>yeastOsmoticShockData.GreenCameraGainAndExposure</tt> are the blue and green illumination camera settings in the format <tt>[gain, exposure]</tt>, where <tt>exposure</tt> is in microseconds.
+
|}
* <tt>yeastOsmoticShockData.ValveState</tt> is the state of the solenoid pinch valve controlling the salt concentration at the time of each image. The valve state is 0 for low salt, and 1 for high salt. If you need to know the valve state more precisely, it can be calculated with the following conditional statement: <math> sin(2 \pi t/T) \ge 0 </math>, where ''T'' is the valve oscillation period, and ''t'' is the time since the start of the experiment (this is how the state is determined in the software).
+
</center>
  
{{Template:Assignment Turn In|message = Choose a single frame of the movie. Make a four panel figure and display: the GFP image, the RFP image (both with a scale bar), and their corresponding image histograms. Include an appropriate title for each panel. }}
+
{{Template:Assignment Turn In|message =
 +
# Find the transfer function of the circuit below for L = 1 H and R = 1 &Omega; and C=1 F.
 +
# The circuit is placed in the same feedback system shown in the previous question. Plot the poles for gains of 1/4, 3/4, 5/4, 10/4, and 17/4. You may generate your plot by hand or use MATLAB.
 +
}}
 +
<center>[[File:LRC circuit for SP20 assignment 9.png|250 px]]</center>
  
==Analyze a frame==
+
==The Frequency Dependence of Osmo-Adaptation in Saccharomyces cerevisiae==
 +
{{Template:Assignment Turn In|message =
 +
Read [https://www.dropbox.com/s/cmgq0b33vn8csow/Frequency%20Dependence%20of%20Osmo-Adaptation%20in%20Saccharomyces%20cerevisiae.pdf?dl=0 The Frequency Dependence of Osmo-Adaptation in Saccharomyces cerevisiae] and the [https://www.dropbox.com/s/y9k4qfzg8uld656/The%20Frequency%20Dependence%20of%20Osmo-Adaptation%20in%20Saccharomyces%20cerevisiae%20supporting.pdf?dl=0 supporting information.]. '''This paper will be the focus of exam 2.''' We will discuss the paper and the supporting information on Thursday and Friday (4/30 and 5/1).
  
In each frame of our movie, we need to locate and identify individual cells, and find the correlation coefficient between the cell image and the nuclei image. If the Hog1 signal is localized in the nucleus, the correlation should be close to 1, while if there is no correlation between the signals, the correlation will be close to zero. In reality, we'll likely see correlations close to about 0.5, but we'll look for an increase or decrease in the signal to determine the amount of Hog1 localization.
+
Answer the following questions about The Frequency Dependence of Osmo-Adaptation in S. cerevisiae:
 +
<ol>
 +
<li>What is the primary mechanism by which S. cerevisiae recovers from hyperosmotic shock?</li>
 +
<li>What mathematical model did Mettetal, ''et. al.'' use for Hog1 activation in response to a hyperosmotic shock? Express the model in the following forms
 +
<ul>
 +
<li>transfer function (TF)</li>
 +
<li>poles and zeros (ZPK)</li>
 +
<li>single differential equation (SDE)</li>
 +
<li>coupled differential equations (CDE)</li>
 +
</ul>Express the TF, SDE, and ZPK models in terms of the undamped natural frequency, <math>\omega_0</math>, damping ratio <math>\zeta</math>, and/or damped natural frequency <math>\omega_D</math>.</li>
 +
<li>What mathematical model did Mettetal, et. al. use to account for nonlinearities in the system?</li>
 +
<li>Plot the frequency response (i.e. make a Bode plot) of the model over a range of <math>\omega_0</math> and <math>\zeta</math> values that includes over damped, critically damped, and under damped.</li>
 +
<li>Find an expression for the step response and plot it over a range of values of <math>\omega_0</math> and <math>\zeta</math>. A hand-drawn plot is fine, but you should probably look into MATLAB's <tt>step</tt> function.</li>
 +
<li>Mettetal, et. al. found that the hyperosmotic shock response of wild-type yeast was (choose one): underdamped, critically damped, or overdamped.</li>
 +
<li>The response of the mutant (low Pbs) yeast was (choose one): underdamped, critically damped, or overdamped.</li>
 +
<li>Which of the step responses below corresponds to Mettetal's model for the wild-type strain and the mutant strain (neglecting the nonlinear element)?</li>
 +
<li>Which of the Bode plots below corresponds to Mettetal's model for the wild-type strain and the mutant strain?</li>
 +
<li>Which of the pole zero diagrams below corresponds to Mettetal's model for the wild-type strain and the mutant strain?</li>
 +
<li>What are two questions that you have about the paper's methodology?</li>
 +
}}
  
[[Image:FindingCellsAndNucleiExample.png|center|thumb|400px]]
+
<center>
 +
{|
 +
|[[file:Mettetal yeast model step response.png|250 px]]
 +
|[[file:Mettetal yeast model Bode plots.png|250 px]]
 +
|[[file:Mettetal yeast model pole zero diagrams.png|250 px]]
 +
|}
 +
</center>
  
Start with the following basic layout of the function:
+
==Yeast experiment data==
 +
Unfortunately, we won't be collecting our own data in the lab this semester, but it's still important to get a feel for what the raw data look like and how the signal manifests itself in those images.
  
 +
* Download the data file <tt>'fall2019_StudentData_3.mat'</tt> from the [https://www.dropbox.com/sh/j9gdbaoypukdydd/AACP1c3w6JzyzAa--XVpgMV0a?dl=0 Assignment 9 folder] in the course dropbox. The file contains raw data collected by 20.309 students during the Fall 2019 semester.
 +
* Load the file into your MATLAB workspace. You should see a variable called <tt>yeastOsmoticShockData</tt>, a struct which contains the movie data plus other relevant experimental parameters:
 
<pre>
 
<pre>
function [AverageNucleusHog1Correlation, StandardErrorNucleusHog1Correlation] = AnalyzeFrame( TwoColorFrame, BackgroundImage, BackgroundRectangle )
+
>> yeastOsmoticShockData
  
    % 1. estimate the background level
+
yeastOsmoticShockData =  
backgroundScaleFactors = FindBackgroundScaleFactor(TwoColorFrame,BackgroundImage, BackgroundRectangle);
+
  
cellFrame = TwoColorFrame(:,:,1) - backgroundScaleFactors(1)*BackgroundImage(:,:,1);
+
  struct with fields:
nucleiFrame = TwoColorFrame(:,:,2) - backgroundScaleFactors(2)*BackgroundImage(:,:,2);
+
  
    % 2. identify individual yeast cells in the GFP image
+
                        Movie: [544×728×2×32 uint16]
     % 3. calculate the correlation coefficient between the GFP intensities an RFP intensities within each cell region
+
                          Time: [32×2 double]
    % 4. output the mean correlation coefficient for all cells in the frame
+
                    ValveState: [32×1 logical]
 
+
        ValveOscillationPeriod: 480
end
+
     BlueCameraGainAndExposure: [3 5000000]
 +
    GreenCameraGainAndExposure: [15 5000000]
 
</pre>
 
</pre>
  
As you work through this part of the Assignment, fill out the <tt>AnalyzeFrame</tt> function to incorporate each of the outlined steps.  
+
The engineered cells we used had 2 fluorescent proteins: a Hog1-GFP fusion and a nuclear protein tagged with RFP. Accordingly, the movie data has 2 color planes. The size of the movie's third dimension is 2. (It was 1 for the monochrome images we took in lab earlier this semester.)
 
+
===Finding cells===
+
  
We could consider using a threshold to identify cells in an image, similar to how we found fluorescent particles in Assignments 4 and 5. The problem here, is that thresholding doesn't allow us separate a single cells from a clump of cells. Since we know that yeast cells are roughly spherical, we can use <tt>imfindcircles</tt> to locate them. <tt>imfindcircles</tt> is an implemenattion of the [https://www.mathworks.com/help/images/ref/imfindcircles.html| Hough transform].  
+
* Color plane 1 is the GFP-Hog1 image, taken with blue illumination and green emission.  
 +
* The second color plane shows the RFP nuclear tag protein, taken with yellow/green illumination and red emission filters.
  
 +
Use <tt>implay</tt> to watch each color of the movie:
 
<pre>
 
<pre>
    [cellCenters, cellRadii] = imfindcircles(cellFrame,[Rmin Rmax],'ObjectPolarity','bright','Sensitivity',0.95);
+
implay(double(yeastOsmoticShockData.Movie(:,:,1,:))/4095);
 +
implay(double(yeastOsmoticShockData.Movie(:,:,2,:))/4095);
 
</pre>
 
</pre>
  
Here, <tt>Rmin</tt> and <tt>Rmax</tt> are the smallest and largest expected 'radii'. How can you estimate <tt>Rmin</tt> and <tt>Rmax</tt>?
+
Can you see how the distribution of Hog1 changes when the cell undergoes osmotic shock?
  
The function <tt>viscircles(cellCenters,cellRadii)</tt> may be useful to visualize your results.
+
A way to visualize the Hog1 and the nuclear protein simultaneously is to combine the two images into a single color color movie. The code below shows the GFP in cyan and the RFP in red. Areas of high overlap appear white. The code normalizes each frame to optimize the display contrast. It also overlays a square indicator in the upper left corner of the image &mdash; green for low salt and red for high salt.
  
=== Loop through each cell and calculate the correlation coefficient between GFP and RFP ===
+
* ''Tip!'' You can replay the movie in slow motion by changing the replay frame rate! In the movie player window, simply go to the Playback tab, click on Frame Rate... and change the playback frame rate (from 20 fps = 'real time' like the original source movie) to 1 frame per second for instance.
  
Next we want to calculate the response of the Hog1 protein. In the paper, they calculated the response as the ratio of GFP intensities inside and outside the nucleus: <math> R_{Hog1} = \frac{<GFP_{nucleus}>}{<GFP_{cell}>}</math>. We'll use an alternative way to find the response: by finding the correlation coefficient between the GFP and RFP signals within each cell.
 
 
Finish filling out <tt>AnalyzeFrame</tt> to loop through each circle found in the frame and extract the corresponding pixel intensities from your GFP and RFP images. Then, calculate the correlation coefficients between these two intensity vectors (<tt>corr</tt> in MATLAB). The following helper function may be useful.
 
 
<pre>
 
<pre>
function Im = createMaskFromCircles(centers,radii,ImageSize)
+
close all
    Im = zeros(ImageSize);
+
 
    [X, Y] = meshgrid(1:ImageSize(2), 1:1:ImageSize(1));
+
combinedMovie = zeros( size( yeastOsmoticShockData.Movie ) + [ 0 0 1 0 ] );
 +
normalize = @( x ) ( x - min( x(:) ) ) / range( x(:) );
  
    for ii = 1:length(radii)
+
for ii = 1: size( yeastOsmoticShockData.Movie, 4 )
        isBright = (X-centers(ii,1)).^2+(Y-centers(ii,2)).^2 <= radii(ii,1)^2;
+
  gfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,1,ii) ) );
        isAlreadyFound = (Im == 1);
+
  gfpImageWithIndicator = gfpImage;
        Im = Im + (isBright & ~isAlreadyFound);
+
  gfpImageWithIndicator(10:50,10:50) = 1 - yeastOsmoticShockData.ValveState(ii);
    end
+
  rfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,2,ii) ) );
    Im( Im > 1 ) = 1;
+
  rfpImageWithIndicator = rfpImage;
 +
  rfpImageWithIndicator(10:50,10:50) = yeastOsmoticShockData.ValveState(ii);
 +
  combinedMovie(:,:,:,ii) = cat( 3, rfpImageWithIndicator, gfpImageWithIndicator, gfpImage );
 
end
 
end
 +
 +
implay( combinedMovie )
 
</pre>
 
</pre>
  
Once you've collected each individual correlation coefficient, find the mean and standard error, and output these from the function.
+
Or try the one below for fun. If you are inspired, come up with one of your own.
  
== Analyze the movie==
+
<pre>
 +
close all
  
Once you've set up your analysis for a single frame, you'll now want to loop through the movie and collect the responses as a function of time.
+
combinedMovie = zeros( size( yeastOsmoticShockData.Movie ) + [ 0 0 1 0 ] );
 +
normalize = @( x ) ( x - prctile( x(:), 0.999 ) ) / prctile( x(:), 0.001 );
  
{{Template:Assignment Turn In|message =  
+
for ii = 1: size( yeastOsmoticShockData.Movie, 4 )
 +
  gfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,1,ii) ) );
 +
  rfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,2,ii) ) );
 +
 
 +
  gfpImageWithIndicator = gfpImage;
 +
  rfpImageWithIndicator = rfpImage;
 +
  gfpImageWithIndicator(10:50,10:50) = 1 - yeastOsmoticShockData.ValveState(ii);
 +
  rfpImageWithIndicator(10:50,10:50) = yeastOsmoticShockData.ValveState(ii);
 +
 
 +
  displayImage = hsv2rgb( cat( 3, gfpImage, ones( size( gfpImage ) ), rfpImage ) );
 +
  combinedMovie(:,:,:,ii) = displayImage;
 +
end
  
# Analyze each frame of the movie and plot the average cellular response as a function of time.
+
implay( combinedMovie )
#* In a single figure, plot the data in one subplot, and the pinch valve state (1 for high salt, 0 for low salt) in a second subplot.
+
</pre>
# Write a function to fit the response to a sinusoid and extract the predicted amplitude and phase shift of the response signal. Plot the best fit function on the same plot as your data.
+
# Report the resulting best fit parameters. }}
+
  
 +
{{Template:Assignment Turn In|message =
 +
# Step through the frames of the movie using the implay controls (for either the raw data or the color movie, your choice). Identify a frame where the signal is "high" - in other words, where the Hog1 signal is localized in the nucleus. Turn in the frame number that you've identified and a screen shot of the GFP-Hog1 movie at that frame number.
 +
# Repeat for a frame where the signal is "low" - in other words, where the Hog1 signal is uniformly distributed throughout the cell. Turn in the frame number that you've identified and a screen shot of the GFP-Hog1 movie at that frame number.
 +
}}
  
{{Template:Assignment Turn In|message = Turn in all your MATLAB code in pdf format. No need to include functions that you used but did not modify.}}
 
{{Template:Assignment 9 Analyzing yeast images navigation}}
 
 
{{Template:20.309 bottom}}
 
{{Template:20.309 bottom}}

Latest revision as of 16:42, 30 April 2020

20.309: Biological Instrumentation and Measurement

ImageBar 774.jpg


Signals and systems


Pencil.png

Fill out the table below. Match each system function with its Bode magnitude and phase plot, step response, and pole zero diagram. (Write one letter A-E in each box below.) In the row labeled “Description,” write a descriptive name of each system, such as “low-pass filter” or “overdamped second-order system.”


System function $ \frac{1}{s+1} $ $ \frac{s}{s+1} $ $ \frac{s}{s^2+2s+1} $ $ \frac{s}{s^2+0.1s+1} $ $ \frac{s}{s^2+10s+1} $
Magnitude plot
Phase plot
Step response
Pole/zero plot
Description

Magnitude Plots

Transfer function matching magnitude plots.png

Phase Plots

Transfer function matching phase plots.png

Step Response Plots

Transfer function matching step response plots.png

Pole Zero Plots

Transfer function matching pole zero plots.png


Pencil.png
  • Use graphical methods to find the Fourier transform of the half-cosine pulse function x(t) plotted below, which consists of the positive half of a 1 Hz cosine, repeated forever at a rate of 1 Hz.
  • What is the lowest frequency component of x(t), not counting $ \hat{X}(0) $?


Cosine pulse function.png One way to create x(t) using functions that appear on the transform table is:

  1. multiply a cosine by a rectangle, and then
  2. convolve the result with the comb function $ \mathrm{III(}t)=\sum\limits_{n=-∞}^{∞} \delta(t-nT) $.

Use the diagram below to help you find the answer. The left column of shows signals in the time domain, and the right column shows the magnitude of the Fourier transform of each signal. The top right plot is filled in for you, plus a little hint that might help you make an accurate plot.

(The phase of the transforms in this problem is zero at all frequencies, so it is not plotted.)

Cosine pulse transform worksheet.png

Feedback systems


Pencil.png
  • Find the transfer function $ \hat{H}(s)=(\hat{V}_{out}(s))/(\hat{V}_{in}(s)) $ of the left-hand circuit shown below, assuming L = 1 H and R = 1Ω.
  • Plot the poles and zeros of H ̂(s) on a set of axes using x’s for poles and o’s for zeroes.
  • The left-hand circuit is placed in feedback system, as shown in the right-hand block diagram below. The triangle represents an amplifier with gain G that does not depend on frequency. Find the transfer function of the feedback system $ \hat{F}(s)=(\hat{Y}(s))/(\hat{X}(s)). $
  • Plot the poles and zeros of $ \hat{F}(s) $ for G=1, 9, and 19. Label the gain value for each point.


LR Low Pass Filter for S20 Assignment 9.png Feedback System Block Diagram for S20 Assignment 9.png


Pencil.png
  1. Find the transfer function of the circuit below for L = 1 H and R = 1 Ω and C=1 F.
  2. The circuit is placed in the same feedback system shown in the previous question. Plot the poles for gains of 1/4, 3/4, 5/4, 10/4, and 17/4. You may generate your plot by hand or use MATLAB.


LRC circuit for SP20 assignment 9.png

The Frequency Dependence of Osmo-Adaptation in Saccharomyces cerevisiae


Pencil.png

Read The Frequency Dependence of Osmo-Adaptation in Saccharomyces cerevisiae and the supporting information.. This paper will be the focus of exam 2. We will discuss the paper and the supporting information on Thursday and Friday (4/30 and 5/1).

Answer the following questions about The Frequency Dependence of Osmo-Adaptation in S. cerevisiae:

  1. What is the primary mechanism by which S. cerevisiae recovers from hyperosmotic shock?
  2. What mathematical model did Mettetal, et. al. use for Hog1 activation in response to a hyperosmotic shock? Express the model in the following forms
    • transfer function (TF)
    • poles and zeros (ZPK)
    • single differential equation (SDE)
    • coupled differential equations (CDE)
    Express the TF, SDE, and ZPK models in terms of the undamped natural frequency, $ \omega_0 $, damping ratio $ \zeta $, and/or damped natural frequency $ \omega_D $.
  3. What mathematical model did Mettetal, et. al. use to account for nonlinearities in the system?
  4. Plot the frequency response (i.e. make a Bode plot) of the model over a range of $ \omega_0 $ and $ \zeta $ values that includes over damped, critically damped, and under damped.
  5. Find an expression for the step response and plot it over a range of values of $ \omega_0 $ and $ \zeta $. A hand-drawn plot is fine, but you should probably look into MATLAB's step function.
  6. Mettetal, et. al. found that the hyperosmotic shock response of wild-type yeast was (choose one): underdamped, critically damped, or overdamped.
  7. The response of the mutant (low Pbs) yeast was (choose one): underdamped, critically damped, or overdamped.
  8. Which of the step responses below corresponds to Mettetal's model for the wild-type strain and the mutant strain (neglecting the nonlinear element)?
  9. Which of the Bode plots below corresponds to Mettetal's model for the wild-type strain and the mutant strain?
  10. Which of the pole zero diagrams below corresponds to Mettetal's model for the wild-type strain and the mutant strain?
  11. What are two questions that you have about the paper's methodology?
  12. </div>


Mettetal yeast model step response.png Mettetal yeast model Bode plots.png Mettetal yeast model pole zero diagrams.png

Yeast experiment data

Unfortunately, we won't be collecting our own data in the lab this semester, but it's still important to get a feel for what the raw data look like and how the signal manifests itself in those images.

  • Download the data file 'fall2019_StudentData_3.mat' from the Assignment 9 folder in the course dropbox. The file contains raw data collected by 20.309 students during the Fall 2019 semester.
  • Load the file into your MATLAB workspace. You should see a variable called yeastOsmoticShockData, a struct which contains the movie data plus other relevant experimental parameters:
>> yeastOsmoticShockData

yeastOsmoticShockData = 

  struct with fields:

                         Movie: [544×728×2×32 uint16]
                          Time: [32×2 double]
                    ValveState: [32×1 logical]
        ValveOscillationPeriod: 480
     BlueCameraGainAndExposure: [3 5000000]
    GreenCameraGainAndExposure: [15 5000000]

The engineered cells we used had 2 fluorescent proteins: a Hog1-GFP fusion and a nuclear protein tagged with RFP. Accordingly, the movie data has 2 color planes. The size of the movie's third dimension is 2. (It was 1 for the monochrome images we took in lab earlier this semester.)

  • Color plane 1 is the GFP-Hog1 image, taken with blue illumination and green emission.
  • The second color plane shows the RFP nuclear tag protein, taken with yellow/green illumination and red emission filters.

Use implay to watch each color of the movie:

implay(double(yeastOsmoticShockData.Movie(:,:,1,:))/4095);
implay(double(yeastOsmoticShockData.Movie(:,:,2,:))/4095);

Can you see how the distribution of Hog1 changes when the cell undergoes osmotic shock?

A way to visualize the Hog1 and the nuclear protein simultaneously is to combine the two images into a single color color movie. The code below shows the GFP in cyan and the RFP in red. Areas of high overlap appear white. The code normalizes each frame to optimize the display contrast. It also overlays a square indicator in the upper left corner of the image — green for low salt and red for high salt.

  • Tip! You can replay the movie in slow motion by changing the replay frame rate! In the movie player window, simply go to the Playback tab, click on Frame Rate... and change the playback frame rate (from 20 fps = 'real time' like the original source movie) to 1 frame per second for instance.
close all

combinedMovie = zeros( size( yeastOsmoticShockData.Movie ) + [ 0 0 1 0 ] );
normalize = @( x ) ( x - min( x(:) ) ) / range( x(:) );

for ii = 1: size( yeastOsmoticShockData.Movie, 4 )
  gfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,1,ii) ) );
  gfpImageWithIndicator = gfpImage;
  gfpImageWithIndicator(10:50,10:50) = 1 - yeastOsmoticShockData.ValveState(ii);
  rfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,2,ii) ) );
  rfpImageWithIndicator = rfpImage;
  rfpImageWithIndicator(10:50,10:50) = yeastOsmoticShockData.ValveState(ii);
  combinedMovie(:,:,:,ii) = cat( 3, rfpImageWithIndicator, gfpImageWithIndicator, gfpImage );
end

implay( combinedMovie )

Or try the one below for fun. If you are inspired, come up with one of your own.

close all

combinedMovie = zeros( size( yeastOsmoticShockData.Movie ) + [ 0 0 1 0 ] );
normalize = @( x ) ( x - prctile( x(:), 0.999 ) ) / prctile( x(:), 0.001 );

for ii = 1: size( yeastOsmoticShockData.Movie, 4 )
  gfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,1,ii) ) );
  rfpImage = normalize( double( yeastOsmoticShockData.Movie(:,:,2,ii) ) );
  
  gfpImageWithIndicator = gfpImage;
  rfpImageWithIndicator = rfpImage;
  gfpImageWithIndicator(10:50,10:50) = 1 - yeastOsmoticShockData.ValveState(ii);
  rfpImageWithIndicator(10:50,10:50) = yeastOsmoticShockData.ValveState(ii);
  
  displayImage = hsv2rgb( cat( 3, gfpImage, ones( size( gfpImage ) ), rfpImage ) );
  combinedMovie(:,:,:,ii) = displayImage;
end

implay( combinedMovie )


Pencil.png
  1. Step through the frames of the movie using the implay controls (for either the raw data or the color movie, your choice). Identify a frame where the signal is "high" - in other words, where the Hog1 signal is localized in the nucleus. Turn in the frame number that you've identified and a screen shot of the GFP-Hog1 movie at that frame number.
  2. Repeat for a frame where the signal is "low" - in other words, where the Hog1 signal is uniformly distributed throughout the cell. Turn in the frame number that you've identified and a screen shot of the GFP-Hog1 movie at that frame number.


</div>
Retrieved from "http://measurebiology.org/w/index.php?title=Spring_2020_Assignment_9&oldid=44221"