Difference between revisions of "DNA Melting Part 1: Measuring Temperature and Fluorescence"

From Course Wiki
Jump to: navigation, search
(LabVIEW VI)
Line 1: Line 1:
 
[[Category:Lab Manuals]]
 
[[Category:Lab Manuals]]
 
[[Category:20.309]]
 
[[Category:20.309]]
[[Category:Dna Melting Lab]]
+
[[Category:DNA Melting Lab]]
 
<div style="padding: 10px; width: 7.5in; border: 3px solid #000000;">
 
<div style="padding: 10px; width: 7.5in; border: 3px solid #000000;">
  

Revision as of 18:43, 13 March 2010

DNA Melting Apparatus

Introduction

Example DNA melting curves showing the effect of varying ionic strength. The data has been filtered to reduce noise.
Differentiating the melting curve simplifies finding Tm.

In this lab, you will measure the melting temperature of several DNA samples to determine the effect of sequence length, ionic strength and complementarity. A common application of this technique exploits the length dependence of DNA melting temperatures to examine PCR products in order to determine whether a desired sequence was successfully amplified.

The measurement technique utilizes a fluorescent dye that binds preferentially to double stranded DNA (dsDNA). This characteristic of the dye allows the relative concentration of dsDNA to be determined by measuring the intensity of fluorescent light given off by an excited sample.

The DNA melting apparatus you will construct consists of five major subsystems: excitation, fluorescence measurement, heating, temperature sensing, and data acquisition. You will build these subsystems out of an LED, a photodiode and amplifier, a thermoelectric cooler (TEC), a resistance temperature detector (RTD), and a PC data acquisition system.

The goal of your time in the lab will be to measure fluorescence intensity versus temperature for each of the samples over a range of about 90°C to room temperature. This will provide a basis for estimating the melting temperature, Tm of each sample. (Tm is defined as the temperature where half of the DNA in the sample remains hybridized.)

Three of the samples will be unknown. All the unknowns will have the same length, but different degrees of complementarity: complete match, single mismatch, and complete mismatch. Using the data you gather, you will attempt to identify these three samples.

Overview of the apparatus

SYBR Green I is a fluorescent dye with peak sensitivity to 498 nm blue light. The dye emits green light with a wavelength of 522 nm.[1] You can easily observe this – a room-temperature sample of dsDNA and SYBR green looks yellow from the combination of blue excitation and green fluorescence. At higher temperatures, when there is no dsDNA for the dye to bind to, the sample will appear blue or clear. In order to produce a melting curve, your apparatus will measure the amount of fluorescent emission from the SYBR Green dye over a range of temperatures.

Temperature will be measured by an RTD, which is a kind of resistor that predictably varies in value with temperature. Fluorescence intensity will be measured by a photodiode (and associated optical system). The sample will be heated by a thermoelectric device. A computer data acquisition system will record the signals from the photodiode and RTD. These signals must be processed to convert them from raw quantities to temperature and relative dsDNA concentration. The melting temperature, Tm can be estimated from a graph of this data or its derivative.

The DNA melting apparatus includes excitation, fluorescence measurement, temperature sensing, and data acquisition functions.

As shown in the diagram, an aluminum heating block holds a cuvette containing the sample under test. The sample is a combination of DNA and a fluorescent dye called SYBR Green. In addition to being a convenient holder, the block gives the setup enough thermal inertia to facilitate a measurement from natural cooling. (Without the block, the sample would cool too quickly.)

Blue light from an LED illuminates one side of the cuvette. An optical filter shapes the output spectrum of the LED so that only the desired wavelengths of light fall on the sample.

A photodiode placed at 90 degrees to the LED source detects the green light emitted by bound SYBR Green. The photodiode is placed behind an optical filter to ensure that only the fluorescent light given off by the sample is detected.

Since photodiodes produce only a very small amount of current, it will be necessary to build a very high gain transimpedence amplifier to produce a signal that is measurable by the PC data acquisition cards. Photodiode amplifiers are particularly challenging because many of the non-ideal characteristics of op amps become apparent at high gain.

An RTD attached to the heating block and wired to a voltage divider provides an indication of temperature. The temperature of the heating block will be a proxy for the sample temperature. Unfortunately, the block cools faster when it is hot than when it is near room temperature. You will have to get the heating block set up in your apparatus quickly after you remove it from the heating block.

A PC data acquisition card digitizes the amplified photodiode and RTD signals. A LabVIEW virtual instrument (VI) records the signals over time. Data from the DNA melting VI can be saved to a file. The file can be loaded into Matlab for analysis.

The LabVIEW VI also implements a lock-in amplifier. This is done by driving the LED at a desired carrier frequency, then performing necessary mixing and filtering in software. The lock-in amplifier greatly improves signal quality by reducing the effect of 1/f noise on the signal.

Objectives and learning goals

  • Measure temperature with an RTD.
  • Implement a high gain two-stage amplifier for photodiode current multiplication.
  • Measure light intensity with a photodiode.
  • Build an optical system for exciting the sample with blue light and gathering the fluorescence output on the photodiode.
  • Record dsDNA concentration versus temperature curves for several samples.
  • Estimate Tm from your data.
  • Compare the measured curves with theoretical models.
  • Identify unknown DNA samples.

Lab procedure

Roadmap

  1. Build an optical system containing the LED, heating block, sample, photodiode, filters, and lenses.
  2. Hook up a three terminal voltage regulator to create an electrical power supply for the LED.
  3. Build, test, and calibrate the temperature-sensing circuit.
  4. Build an amplification/offset circuit for the DNA fluorescence signal.
  5. Troubleshoot and optimize your system.
  6. Heat a samples of DNA with SYBR Green dye and record DNA melting curves as the samples cool.
  7. Analyze the data. Identify the three unknown samples. Compare your observations to theoretical models.

Optical system

DNA Melting Optical System Diagram

The optical system consists of an LED, excitation filter, sample cuvette, heating block, emission filter, photodiode, optional lenses, and associated mounting hardware. Construct your system on an optical breadboard. The breadboard has a grid of tapped holes for mounting all kinds of optical and mechanical hardware. ThorLabs manufactures most of the hardware stocked in the lab. A few of the components you will certainly use include: 1/2" diameter posts, CP02 cage plates, and 1” diameter lens tubes.

Use optical rails and rail carriers or optical bases to mount 1/2” posts on the breadboard. RA90 right angle post clamps and post holderscan also be useful.

There are a variety of ways to construct the apparatus. A good design will be compact, stable, and simple. It will be necessary to shield the optical system from ambient light, so a small footprint will be advantageous.

Illumination

Begin by mounting the LED on your breadboard. Note that there are two styles of LEDs. The Lamina LED Array is mounted on an aluminum heat sink and bolted to a CP02 cage plate. The CP02 attaches to the top of a post. It has an SM1 threaded hole through the middle that connects to 1” diameter lens tubes. The Cree LEDs[2] are already mounted in a 1” lens tube.

Both styles of LED emit a range of wavelengths with a peak at 475 nm. A Chroma Technology D470 filter eliminates unwanted parts of the spectrum that might interfere with detection of the fluorescence signal. The filters have exposed, delicate coatings and must be handled carefully. In addition, the filter works better in one direction than the other.

Light from both kinds of LEDs diverges in a cone with an angle of about 100 degrees, so place the device close to the sample. You can also use a lens to concentrate the LED's output. Several lenses are available in the lab:

Fluorescence detection

The SM05PD1A photodiode is mounted in a short tube with SM05 threads. Use a SM1A6 adapter to mount the photodiode in a CP02 cage plate. Mount the photodiode assembly to the breadboard at 90 degrees to the LED. Build a system to hold the Chroma E515LPV2 emission filter in front of the photodiode. You can use a lens to focus light from the sample on to the detector to improve performance, if you like.

Put an optical quick connect at the end of the photodiode assembly to facilitate easy attachment of the heating block during experimental runs. The other half of the quick connect goes into the CP02 cage plate mounted on the heating block.

Electrical System

Temperature detection

Temperature Detection Circuit

The electrical resistance of most materials varies with temperature. RTDs are a special resistors (usually made out of platinum) that exhibit a nearly linear change in its value with temperature. An RTD may be used to accurately measure temperature by including it as an element in a voltage divider. As the resistance of the RTD changes, so will the voltage across it.

A PPG102A1 RTD has been pre-mounted to the DNA heating block. This RTD has a nominal resistance of 1 KΩ and its value increases with temperature. Note that the maximum current carrying capacity of this device is 1 ma. Hook up the RTD in a voltage divider. Make sure the divider has no more than 1 mA flowing through it. Use freeze spray or heat the block on the warmer to test the circuit.

The Labview VI calculates the temperature of the heating block based on the voltage across the RTD. This calculation assumes the use of +15V and 15KΩ. The diagram to the right shows the suggested circuit. The capacitor across the RTD implements a low pass filter. The purpose of this filter is to eliminate noise in your temperature reading. Consider the following points when choosing a capacitor value: What is the frequency range that you want filtered? The time constant of the filter is determined by the two resistors in parallel with the capacitor. What is the time constant of your filter? If it too large compared to the rate of change of temperature, it could cause a delay in your temperature reading.


Heating control

We will use a thermoelectic cooler (TEC) to heat the sample in this lab. A TEC is a device that becomes warm on side and cold on the other side when a DC voltage is applied across it. Before heating the sample, make sure that the TEC makes good thermal contact with the heating block. If there is not good thermal contact, hot spots will develop damaging the TEC. To ensure good contact, use thermal grease and make sure that the heating block lies flat on the TEC.

To control the TEC we will use a digital output from the Labview VI and a solid state relay. The relay is an electronic switch with four pins. Two pins are for the control voltage and the other pins are the two sides of the switch. When the control voltage is "high", the switch is turned "on" (this means the switch is closed = the two pins are connected together). The Labview VI provides a digital output that will serve as the control voltage.

The Labview VI allows you to set the temperature that you want. The VI compares the desired temperature to the current temperature (determined by the voltage across the RTD). If the desired temperature is higher than the current temperature, then the digital output is "high". If the desired temperature is equal to or lower to the current temperature, the output is "low".

The diagram below is the suggested schematic for the lab. The positive side of the TEC is always connected to +11V. The negative side of the TEC is connected to the first pin of the relay (one side of the switch). The other side of the switch is connected to ground. When the control voltage is high, the switch is closed and the negative side of the TEC is connected to ground. Now that the negative side of the TEC is connected to ground, there is a DC voltage across the TEC and current flowing through it, which will cause the TEC to heat up. When the switch is open, the TEC does not have a path to ground and the TEC will not heat up. Make sure that the current is turned all the way up for the TEC power supply. The TEC requires up to 3amps to heat up to our desired temperature.

Multi-stage photodiode amplification circuit

LED driver

LED Driving Circuit.


The LED used in this lab consumes approximately 0.3 Amps of current when maximally on, which is more than the NI-DAQ system is capable of driving. To amplify the current drive to the LED, you will be using a Darlington Transistor. This is a three terminal devices, consisting of a Base, Emitter, and Collector, which should be wired into the circuit shown below. The base contact of the BJT is used to deliver a small amount of current from the NI-DAQ, which causes the device to conduct a much larger current through the LED.

To ensure that the BJT delivers a constant current to the LED, the circuit also includes a current feedback amplifier (more use of op amps!). This is simply a buffer implementation, with gain of 1. Finally, note that the voltage to the BJT and LED setup comes from the fixed 5V supply, whereas the op amp operates on +/– VCC (+/-15V).

It is possible to drive an LED with a voltage source; however, the steepness of a diode's I-V curve results in large current swings in current for small changes in supply voltage. LED brightness is proportional to current, so a current source tends to provide a more stable light output.

Double check your wiring before connecting the LED. The LED can be damaged by excessive current. Remember the rule of thumb: if you can't keep your finger on a component indefinitely, it is too hot. Use a larger feedback resistor to keep the electronics cooler (at the expense of light output).

If the LED is too bright the sample will become photobleached very quickly. You will be able to set the amplitude and offset of the the sinusoid driving the LED. This is set in the Labview VI. Set the offset so that the sinusoid is always positve (i.e. if the amplitude is 250mV then the offset should be 125mv).

Photodiode amplifier

Excited SYBR Green molecules emit photons in all directions, some of which pass through the emission filter and strike the photodiode. This generates a tiny current, which must be converted to a voltage and amplified to a level that can be conveniently measured. In order to determine the requirements for the amplifier, it is helpful to estimate the amount of current that will be produced by the photodiode.

Estimating photodiode current

The current output of the photodiode depends on several factors: illumination intensity, illumination system efficiency, fluorophore absorption and quantum yield, optical system collection efficiency, and photodiode quantum efficiency. Many of these quantities are difficult to know precisely, so a back-of-the-envelope calculation will have to suffice. You will probably need to fine tune your amplifier gain after the system is assembled.

$ I_{PD} \approx P_{LED} \; A_{LED} \; \alpha_{fluor} \; \phi_{fluor} \; A_{diode} \; \phi_{diode} $
where,
PLED is the LED power, about 0.5 W = 2.5 * 1019 photons/sec,
ALED is the efficiency of Illumination system, about 0.1, considering the spectral output of the LED, filter, lens, etc...,
αfluor is the SYBR Green absorption coefficient (approximately 0.85, estimated using Beer's law for a system with path length = 1cm, dsDNA concentration = 1μM, and a molar absorption coefficient for SYBR Green I of 73x103)[3]
φfluor is the quantum yield of SYBR Green, about 0.8 [4]
Adiode is the optical system collection efficiency, about 0.1
φdiode is the photodiode quantum efficiency, typically around 0.8 electrons per photon

Substituting the guesses gives an estimate of about 16 nanoamps full scale current.

Amplification circuit

The NI-DAQ interface card used in lab can digitize a voltage between positive and negative 10 Volts. A first approach to providing this voltage swing at the digitizer inputs was demonstrated in the homework: a transimpedance amplifier (sometimes called a current-to-voltage converter) with a gain of approximately 6x108 V/A will produce an output that approximately matches this range, given a 16 nanoamp input. (Why not simply use a resistor, and omit the op-amp?) Implementing the photodiode amplifier in a single stage presents a number of challenges, however, as many of the non-ideal behaviors of op amps become apparent at such high gain values. This term, we will be implementing a two-stage photodiode amplifier, as shown in the figure below. Your job as circuit designers will be to fill in the appropriate filtering capacitor and feedback resistor values to achieve the desired gain at the output. Think carefully about how you want to distribute the gain of the system across the two stages: how does feedback affect the noise of the amplifier? What are the dominant sources of noise in the DNA melting setup, which ones do you have most control over, and how will you control for them? Applying your knowledge of feedback and transfer functions, you should be able to determine the optimal gain configuration of each stage for lowest output noise.


Multi-stage photodiode amplification circuit

Even with these optimizations, it will be important to keep your wiring short and neat. The amplifier and wiring will also be susceptible to physical movement, so prevent things from getting bumped during experimental runs. Select an op amp that has as low input bias current as possible. (Why?) The DNA melting lab is stocked with a variety of op amps – you should familiarize yourself with the data sheets provided with these devices when making your selections. Finally, a note about resistors and capacitors: recall that resistors introduce thermal noise, while capacitors do not. Therefore, the optimized system will use as low resistor values as are reasonable in filters and feedback paths.

Practical matters

As with most amplifiers, care should be taken with lead dress, component placement and supply decoupling in order to ensure stability.

LF411 Datasheet

In theory, there is no difference between theory and practice. But, in practice, there is.

Jan L. A. van de Snepscheut/Yogi Berra

The universe is rife with electrical noise. Keeping the noise out of sensitive electronic instruments requires a great deal of care. Unfortunately, electronic breadboards are a poor environment in which to construct high gain amplifiers. A few simple tricks can improve things.

  • Use power supply bypass capacitors. Connect a large capacitor between all supply voltages and ground. Large, electrolytic capacitors of at least 0.1 μF work well for this purpose. Electrolytic capacitors are polarized. Make sure to put them in the right direction (or they will explode).
  • Use the binding posts on the breadboard to connect your power supplies.
  • Power Supplies: Use a seperate power supply for the op-amp circuits, LED driving circuit, and the heating control. Make sure to tie the 5V ground to +15V/-15V ground at the power supply. If you connect the grounds on the breadboard, there will be a potential difference between the grounds. This voltage difference is due to the large current swing of the LED driver flowing through the parasitic resistance of the breadboard.

PC Data Acquisition System

Each lab PC is equipped with a National Instruments USB-6212 or USB-6341 data acquisition (DAQ) card.

The USB-6212[5] has 16, 16-bit analog input channels which can, in sum total, accomplish 400 thousand samples per second (400kS/s). That is, if there are two channels, each one will be alternately sampled, and EACH sampled at 200kS/s. A multiplexer sequentially selects from among the 16 single-ended and 8 differential input signals. The card also supports two 16 bit analog output channels with an update rate of 250 kS/s and an output range of +/-10 V and up to +/-2 mA.

The USB-6212 also has 32 digital input/output channels and a digital ground. A 50 kΩ pull-down resistor is typically used in series with connections to these channels.

The USB-6341[6] is s little more powerful. It has 16, 16-bit analog input channels which can, in sum total, accomplish 500 thousand samples per second (500kS/s). Again, a multiplexer sequentially selects from among the 16 single-ended and 8 differential input signals. The card also supports two 16 bit analog output channels but they have an update rate of 900 kS/s and an output range of +/-10 V and up to +/-2 mA.

Finally, the USB-6341 has 24 digital input/output channels and a digital ground, as well as 4, 100 MHz counter/timers.

LabVIEW VI

The DNA Melting LabVIEW VI is located in the Students/Labs/DNA Melting folder of the course locker. Double click to launch the VI. (The current version is R1.0)

Click the run arrow or select Operate->Run from the menu to start the VI. The top two charts show the digitized voltage at the RTD and diode inputs over time. Use the range settings to get a good view of the signal.

At the end of an experimental run, use the Write Data button to save the most recent result in a comma delimited file that can be read into Matlab or Excel.

Debugging the apparatus

  1. Use freeze spray and the heat gun to make sure the temperature circuit is working properly.
  2. Cover and uncover the photodiode to verify operation of the fluorescence measurement system.
  3. Use a box and a piece of black cloth to shield your apparatus from ambient light. Can you measure the difference between a cuvette filed with water and one with DNA and SYBR Green?
  4. Observe every electrical signal node with the oscilloscope. Are any signals noisy? Is there a way to improve the quality of poor signals?
  5. Watch the fluorescence readout over time. Is it stable or does it drift?
  6. Is your temperature reading nonsensical? Make sure you are using 15V supply and 15kohm resistor, for your voltage supply. Also make sure that the DAQ input is placed across the RTD not the 15Kohm resistor.
  7. Is your LED being driven at the desired carrier frequency? Try turning the carrier frequency down low enough to see it turn on and off (try 5Hz). Try pointing the LED directly at the photodiode. Is the frequency of the photodiode signal what you expect?
  8. Is your sampling photobleaching quickly? Turn the amplitude of the LED signal down at the Labview VI. Try an amplitude of .25 V and an offset .125 V. Turning the amplitude down decreases signal strength, but you can gain signal strength by focusing the green fluorescent light on the photodiode with lenses.

Experimental procedure

Once your instrument is running to your satisfaction, measure melting curves each of the 5 conditions:

  • 40bp perfect match
  • 30bp perfect match
  • 3 unknown 20 bp sequences (perfect match, single mismatch, and complete mismatch)
  • 20 bp perfect match at different ionic strength

If you have time, you can run additional experiments. For example, you could gather additional ionic strength data points.

The DNA melting apparatus will generate the best data when both the amplifier circuit and LED have been on for a while and all the components have reached their steady state temperature. Make sure the outupts of the system are stable before you begin taking data. Turn your apparatus on and measure the difference between a cool DNA sample and water. Run the DNA melting LabVIEW VI in the DNAMelting directory of the course locker.

The steps for each experimental run are:

  1. Open the LabView VI
  2. Set the carrier frequency, the LED amplitude, the desired temperature, and the filter cutoff frequencies
  3. Prepare a sample and place cuvette in heating block
  4. Run the Labview: recording RTD and photodiode output


Make a sample


Warning.jpg SYBR Green I in DMSO is readily absorbed through skin. Synthetic oligonucleotides may be harmful by inhalation, ingestion, or skin absorption. Wear gloves when handling samples. Wear safety goggles if there is a danger of liquid splashing into your eyes. Do not create aerosols. The health effects of SYBR Green I have not been thoroughly investigated. See the SYBR Green I and synthetic oligonucleotide MSDS in the couse locker for more information.


Pipet 500μl of DNA plus dye solution into a disposable plastic cuvette. Pipet 20μl of mineral oil on top of the sample to help prevent evaporation. Put a top on the cuvette and mark it with a permanent marker. Keep the sample vertical to make sure the oil stays on top. You should be able to use the same sample for many heating/cooling cycles. Only discard it if you lose significant volume due to evaporation. If you need to leave the sample overnight, store it in the lab refrigerator. If you finish with a sample and it is still in good shape, pass it on to another group.


Sample Disposal


Global Tree.gif Discard pipette tips with DNA sample residue in the Biohazard Sharps container. Do not pour synthetic oligonucleotides or SYBR Green down the drain. Empty the liquid into the waste container provided. Dispose of plastic cuvettes in the Biohazard container.


Data Analysis

Use Matlab or another environment of your choosing to analyze the raw data. In outline, the steps are:

  1. Load data file produced by LabVIEW VI into Matlab
  2. Apply median filter to reduce impulse noise
  3. Apply FIR filter to reduce other sources of noise
  4. Convert RTD voltage to temperature
  5. Normalize fluorescence signal
  6. Sort or bin the data to ensure that fluorescence versus temperature is a function
  7. Average data from multiple experimental runs, if necessary
  8. Apply correction for photobleaching, if necessary
  9. Apply correction or SYBR Green temperature dependence, if possible
  10. Compute the finite difference Δfluorescence/Δtemperature
  11. Estimate the melting temperature
  12. Create plots

Organization of data analysis script

Since you will be analyzing several experimental runs in a similar way, it makes sense to save the particulars of each experimental run (such as the name of the file that the data is stored in and the KCl concentration) in an array of data structures. Matlab implements a data type called a cellular array. Cellular arrays use pointy braces {} instead of parenthesis (). If foo is a cellular array, then foo{1} is the first element.

The following code demonstrates how to create the cellular array of data structures. The code fills in the first element of a cellular array (DnaMatchSampleInfo):

DnaMatchSampleInfo = {}  % null cellular array

DnaMatchSampleInfo{1}.filename = 'DNA Melting Data\20bp 100mM.txt';
DnaMatchSampleInfo{1}.SampleName = '20 bp 100mM';
DnaMatchSampleInfo{1}.KclConcentration = 100;
DnaMatchSampleInfo{1}.DnaConcentration = 30;
DnaMatchSampleInfo{1}.FilterNormalizedCutoffFrequency = 0.1;
DnaMatchSampleInfo{1}.FilterOrder = 25;
DnaMatchSampleInfo{1}.NormalizationMin = 0.01;
DnaMatchSampleInfo{1}.NormalizationMax = 0.99;
DnaMatchSampleInfo{1}.TrimStart = 0;
DnaMatchSampleInfo{1}.TrimEnd = 0;

... fill in more entries here ...

After initializing DnaMatchSampleInfo, each element will contain a data structure with the parameters of a particular experimental run. You can create additional cellular arrays for different sets of experiments. For example, DnaLengthSampleInfo might contain parameters for the 20, 30, and 40 base pair samples.

Using the information in the cellular arrays, it is easy to write a for loop that will process all of the data for a particular set of experiments. The function (called DnaMelt might look something like this:

% Function to process DNA melting data from LabVIEW VI
% sampleInfo is a cellular array of data structures
% output is a cellular array containing original data and computed values
function out = DnaMelt(sampleInfo)

% initialize variables
out = {};

for ii=1:length(sampleInfo)

    ... process the data ...

end

Loading a data file

Use the load command to read in a data file.

    rawData = load(sampleInfo{ii}.filename);

The first column contains RTD voltage samples and the second contains the corresponding fluorescence voltages.

Converting voltages to temperature and relative fluorescence

These are straightforward mathematical manipluations on the dataset.

Designing an FIR low pass filter

The matlab commands fir1 and freqz are useful for designing a low pass filter. Use fir1 to generate the filter kernel and freqz to plot its frequency response. Increasing the order of the filter will make the transition between pass and stop bands sharper.

Try plotting a few different filter designs:

freqz(fir1(30, 0.15))
freqz(fir1(300, 0.15))

Applying the FIR filter

Use the conv command to apply the filter. But be careful how you treat the samples near the beginning and end of the signal. conv returns a vector of length m + n - 1, where m and n are the lenghts of the two operands. conv will assume that all values outside of the defined signal are zero. This will distort your signal near the beginning and end. You can handle this by pre-padding your data with made-up data (usually the initial and final values) or just chopping off the extra samples.

The following functions may be of use:

% usage: ConvolveAndClip(kernel, data)
% convolves <kernel> with <data> and trims the ends of the result to length
% length(data) - length(kernel)
function out=ConvolveAndClip(kernel, data)

temp = conv(kernel, data);
trim = length(kernel);
out = temp(trim:end-trim);
% usage: PadAndConvolve(kernel, data)
% Pads <data> with initial and final values, convolves <data> with 
% <kernel>, and trims the result to the same length as <data>
function out=PadAndConvolve(kernel, data)

frontPaddingLength = floor(length(kernel)/2);
rearPaddingLength = ceil(length(kernel)/2);
frontPadding = data(1) * ones(frontPaddingLength, 1);
rearPadding = data(end) * ones(rearPaddingLength, 1);

s = size(data);

if(s(1) > s(2))
    paddedData = [frontPadding;data;rearPadding];
else
    paddedData = [frontPadding' data rearPadding'];
end

out = ConvolveAndClip(kernel, paddedData);

Ensuring that F(Temperature) is a function

Because there is noise in the temperature readout, your raw data is not guaranteed to be a function. You will run into all sorts of trouble taking the finite difference later on if your data is not a function. This can be solved by either sorting the data by temperature (using Matlab's sort command) or binning the samples by temperature (by iterating through the data with a for loop.)

Each approach has merits and disadvantages. Sorting by temperature can result in some very small ΔT values, which tend to be very noisy. Binning has the advantage of resulting in a uniformly sampled dataset — provided that there is at least one sample in each bin.

Computing the finite difference

The diff command will compute the finite difference of a discrete-time signal, which is an approximation of a continuous derivative. Remember that you need to comput ΔFluorescence/ΔTemperature, not ΔFluorescence/ΔTime. Therefore, you must divide by ΔTemperature.

The differencing operation is particularly sensitive to noise. (What is the frequency response of a differencer?) If your derivative plots are noisy, you may be able to improve them by applying additional filtering.

One estimate of Tm is the peak value of the derivative.

Fitting the model

In the Simulating DNA melting tutorial, there is a function for computing the theoretical value of dsDNA concencrentation as a function of DNA concentration, temperature, Δs° and ΔS°.

To perform the fit, use the matlab function from the tutorial. You can tuse matlab's curve fitter (lsqcurvefit) to estimate best-fit values for ΔH° and ΔS°.

lsqcurvefit requires the fitting function to be implemented a particular way. You may find the following code excerpt, which declares a suitable function called myFunction, useful. It also computes the R squared value for the fit.

   % Create user function for fitting
    DnaConcentration = sampleInfo{ii}.DnaConcentration;
    myFunction = @ (x, xdata)  DnaFraction(DnaConcentration, xdata, x(1), x(2));

    % Fit data to model
    fitOptions = optimset('TolFun',1E-30,'TolX',1E-10,'MaxFunEvals',1E4,'MaxIter',1E4);
    [fitValues, resnorm] = lsqcurvefit(myFunction, [-150 -71E3], temperature, ...
                    fluorescence, [-inf -inf], [inf inf], fitOptions);
    rSquared = 1 - resnorm / norm(fluorescence - mean(fluorescence))^2; 

Plot legends in Matlab

Annoyingly, Matlab handles legends differently than other plot commands. The hold command does not apply to the legend command. (Direct complaints to http://www.mathworks.com/support.) The following code excerpt adds a plot legend. This code runs after the main loop. The cellular array out contains the results from processing. This code also places an "X" at the melting temperature.

% Compute text cell array for plot legends and plot an
% "X" at the estimated melting temperature

for ii=1:length(out)
    legendText{2 * ii - 1} = sampleInfo{ii}.SampleName;
    legendText{2 * ii} = [sampleInfo{ii}.SampleName ' Best Fit'];
    figure(1)
    plot(out{ii}.maxDerivativeTemperature, out{ii}.fluorescence(out{ii}.maxDerivativeIndex), 'linewidth',2,'marker','x','markersize',18,'color',out{ii}.plotColor);
    plot(out{ii}.maxModelDerivativeTemperature, out{ii}.fitFluorescence(out{ii}.maxModelDerivativeIndex), 'linewidth',2,'marker','x','markersize',18,'color',out{ii}.modelPlotColor);
    figure(2)
    plot(out{ii}.maxDerivativeTemperature, out{ii}.dFdT(out{ii}.maxDerivativeIndex), 'linewidth',2,'marker','x','markersize',18,'color',out{ii}.plotColor);
    plot(out{ii}.maxModelDerivativeTemperature, out{ii}.dModelFdT(out{ii}.maxModelDerivativeIndex), 'linewidth',2,'marker','x','markersize',18,'color',out{ii}.modelPlotColor);
end

% Add the legends
figure(1)
legend(legendText, 'location', 'southwest');
hold off;
figure(2)
legend(legendText, 'location', 'southwest');
hold off;

Report Requirements

Report outline

Use the following format for your report:

  1. Results
    Samples run
    List all of the samples you characterized (length/ionic strength)
    Data plots
    All plots should be complete with title, axis labels, and legend. Plot both your experimental data and the best fit curves from the DNA melting mode. Plots in this section should include only data that was created by your group's own hands in the lab. Analysis of other people's datasets belongs in a different section (see below).
    1. Single set of axes with plots of dsDNA concentration versus temperature for the 20 base pair complementary, single mismatch, and complete masmatch samples.
    2. Single set of axes with plots of ΔdsDNA concentration/Δtemperature for the 20 base pair complementary, single mismatch, and complete masmatch samples.
    3. Single set of axes with plots of dsDNA concentration versus temperature for the ionic strength or oligo length samples you measured.
    4. Single set of axes with plots of ΔdsDNA concentration/Δtemperature for the ionic strength or oligo length samples you measured.
    Table of estimated thermodynamic parameters
    Include estimated ΔH, ΔS, and Tm values (by multiple methods)
    Comparative data analysis and plots
    Plots of any data you analyzed that came from other groups
    Data analysis overview
    Bullet point summary of your data analysis methodology.
    Discussion of results
    Bullet point discussion of results. Compare your results to theoretical models and/or other group's datasets. Be concise, but express yourself clearly.
    Sources of error
    List sources of error. Indicate whether each source causes a systematic or random distortion in the data. (The uncertainty from a random error decreases with additional experimental runs; systematic error does not.)
  2. Instrument documentation
    Block diagram
    Include component values, relevant distances, and possibly a photographs or two. It is not necessary to document construction details.
    Signal to noise measurement
    Divide the signal magnitude (size of the signal with a reference sample minus the size with a null sample such as water) by the average
    Design evolution
    Bullet point summary of changes you made to your instrument design to address problems in the lab.

References

  1. SYBR Green I online datasheet
  2. Cree part number Cree XLamp(TM) 7090WBL
  3. <a href=" http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=484200">Zipper H, Brunner H, Bernhagen J, Vitzthum F. Investigations on DNA intercalation and surface binding by SYBR Green I, its structure determination and methodological implications. Nucleic Acids Res. 2004;32:e103–10.</a>
  4. From SYBR Green online datasheet SYBR Green Datasheet
  5. Datasheet for the USB-6212
  6. Datasheet for the USB-6341

Datasheets

  1. National Instruments data acquisition card user manual
  2. SYBR Green I datasheet
  3. Op-amp datasheet
  4. Relay datasheet
  5. Darlington transistor datasheet