%Chaitanya Athale, iiser pune, div. of biology
%2013-11-22
% OCTAVE code
% 1. read in and plot input data
% 2. call function of dna-melting model to fit delta-G and delta-H
% 3. use fitting routine to extract params
close all; clear all;
%ipath = ''; %this folder is the path to look for the data file
A= csvread('dna-melt-stdev3.txt');
T=A(:,1)
dnaAv=A(:,2);
dnaSd=A(:,3);
figure(1), errorbar(T,dnaAv,dnaSd),  xlabel('Temp. (^{o}C)'),ylabel('A_{norm} 260 nm'), ...
title('Mean +/- stdev');
tempNew = min(T):0.1:max(T);
dnaNew= interp1(T,dnaAv,tempNew,'cubic');
dadt = diff(dnaNew);
figure(2),subplot(1,2,1), plot(tempNew, dnaNew),...
xlabel('Temp. (^{o}C)'),ylabel('A_{norm} 260 nm')
figure(2),subplot(1,2,2), plot(tempNew(1,1:end-1),diff(dnaNew)),...
xlabel('Temp. (^{o}C)'),ylabel('dA/dT');
print -dpdf abs-temp.pdf
