Difference between revisions of "DNA Melting: Simulating DNA Melting - Intermediate Topics"

From Course Wiki
Jump to: navigation, search
Line 1: Line 1:
 
==Overview==
 
==Overview==
In the DNA Melting Lab, the raw data you will record consists of two voltages as they vary over time. In order to estimate the melting temperature, these raw voltages will have to be converted to a melting curve, which gives the fraction of dsDNA as a function of temperature. Tm can be estimated by taking the peak of the derivative of the melting curve.
+
In the DNA Melting Lab, the raw data you will record consists of two voltages as they vary over time. In order to estimate the melting temperature, these raw voltages will have to be converted to a melting curve, which gives the fraction of dsDNA as a function of temperature. T<sub>m</sub> can be estimated directly from the melting curve or by finding the peak of the melting curve's derivative.
  
 
Data analysis steps include:
 
Data analysis steps include:
Line 9: Line 9:
 
# Differentiate the resulting function.
 
# Differentiate the resulting function.
  
It will be essential to have your data analysis scripts working before you come to the lab. This tutorial will demonstrate how to simulate a dataset for a DNA melting experiment. You can use the simulated data to help develop data analysis scripts.
+
It will be essential to have your data analysis scripts working before you come to the lab. This tutorial will demonstrate how to simulate the DNA melting experiment in Matlab. You can use the simulated dataset to help develop your data analysis scripts.
  
 
===Before you begin===
 
===Before you begin===
Line 16: Line 16:
 
*You may also find it helpful to review the [[DNA Melting Thermodynamics|DNA Melting Thermodynamics Lecture Notes]].
 
*You may also find it helpful to review the [[DNA Melting Thermodynamics|DNA Melting Thermodynamics Lecture Notes]].
  
==DNA melting lab data analysis==
+
==Simulate the DNA melting experiment==
The steps are:
+
===Model the cooling of the sample===
 +
At the beginning of an experimental run, the sample is heated in a bath to around 90&deg;C. Over a period of about 15 minutes, the sample cools to room temperature of about 20&deg;C. Cooling can be modeled by an exponential function with a time constant of 3 minutes. Thus, the equation for temperature (in &deg;K) versus time is:
  
# Filter raw data to remove noise.
+
:<math>
# Transform RTD voltage to temperature.
+
T(t) = 293 + 90 e ^ -\frac{t}{180}
# Transform photodiode current to relative fluorescence.
+
</math>
# If necessary, combine multiple samples with identical temperature readings to ensure a uniquely valued function f(t).
+
 
# Differentiate the resulting function.
+
In Matlab:
 +
<pre>
 +
t = 1:899;                            % create a time vector (units: seconds)
 +
T = 90 * exp(-1 * t / 180) + 293;      % exponential cooling from 383K to 293K
 +
plot(t,T);
 +
</pre>
 +
 
 +
[[Image:DNA Sample Cooling.jpg]]
  
 +
Remember that the semicolon at the end of the line prevents Matlab from displaying dozens of annoying lines on the console containing the value of t.
  
 
==Write a function to compute f==
 
==Write a function to compute f==

Revision as of 04:22, 11 April 2008

Overview

In the DNA Melting Lab, the raw data you will record consists of two voltages as they vary over time. In order to estimate the melting temperature, these raw voltages will have to be converted to a melting curve, which gives the fraction of dsDNA as a function of temperature. Tm can be estimated directly from the melting curve or by finding the peak of the melting curve's derivative.

Data analysis steps include:

  1. Filter raw data to remove noise.
  2. Transform RTD voltage to temperature.
  3. Transform photodiode current to relative fluorescence.
  4. Ensure that the melting function is uniquely values by combining samples with identical temperature values.
  5. Differentiate the resulting function.

It will be essential to have your data analysis scripts working before you come to the lab. This tutorial will demonstrate how to simulate the DNA melting experiment in Matlab. You can use the simulated dataset to help develop your data analysis scripts.

Before you begin

Simulate the DNA melting experiment

Model the cooling of the sample

At the beginning of an experimental run, the sample is heated in a bath to around 90°C. Over a period of about 15 minutes, the sample cools to room temperature of about 20°C. Cooling can be modeled by an exponential function with a time constant of 3 minutes. Thus, the equation for temperature (in °K) versus time is:

$ T(t) = 293 + 90 e ^ -\frac{t}{180} $

In Matlab:

t = 1:899;                             % create a time vector (units: seconds)
T = 90 * exp(-1 * t / 180) + 293;      % exponential cooling from 383K to 293K
plot(t,T);

DNA Sample Cooling.jpg

Remember that the semicolon at the end of the line prevents Matlab from displaying dozens of annoying lines on the console containing the value of t.

Write a function to compute f

The first useful piece of code is a function that will compute $ \left . f \right . $ from the equation derived in class. This function must be in its own file called DnaFraction.m.

<include src="http://web.mit.edu/~20.309/www/Matlab/DnaFraction.m" />



Note Icon.jpg The element-by-element divide operator (./) is used instead of the matrix divide operator(/) so that the temperature parameter T can be a vector. If T is a single value, both operators are equivalent. But the / operator will try to do a matrix divide if T is a vector or matrix and give an error since the dimension of the two operands do not match. A for...end loop could also be used to call DnaFraction once for each value of $ T $. But for loops have terrible performance in Matlab and your program will run much faster if you use a vector of $ T $ values instead.


%Returns the fraction of dsDNA given total DNA concentration, temperature, Delta S, and Delta H
%Usage: f = DnaFraction(Ct, T, DeltaS, DeltaH)
function f = DnaFraction(Ct, T, DeltaS, DeltaH)

%Constants
R=8.3;

%first compute Ct * Keq
CtKeq = Ct * exp(DeltaS / R - DeltaH / (R * T));

%now compute f
f = (1 + CtKeq + sqrt(1 + 2 * CtKeq))/CtKeq;

Test the function

First, create a temperature vector. Then call DnaFraction with some reasonable parameters and plot the result. Units are calorie, mole.

t = [20:90] + 273;
f = DnaFraction(.1E-6, t, 304E3, 786);
plot(t,f)