%This m-file is used to extract the data produced by Telomere-App. %Input: A particular Population Doubling PD and a parameter opt, set opt==1 %if A histogram with of the lengths of telomeres is desired. %Output: A 1000X92 Matrix. The rows of the matrix contains the lengths of %the 92 telomeres of every cell in the sample, i.e. the length of the %telomere j of cell i is stored in L(i,j). function[L,p]= load_telomere_data(PD, opt) fid= fopen('/param_matlab.dat','rb'); p= fread(fid,5,'double'); fclose(fid); N_tel= p(1); %p(2)= N_pts, p(3)= p1, p(4)= y Pop_target= p(5); s= Pop_target*N_tel; str= '/pop_doubling_'; str= [str int2str(PD) '.dat']; fid= fopen(str,'rb'); L= fread(fid,s,'double'); fclose(fid); L= L*60/1000; if opt==1 [dist,xout]= hist(L); freq= dist/s; figure; hold on; bar(xout,freq); xlabel('telomere length (kbp)'); ylabel('frequency'); str= 'Telomere length distribution at PD= '; str= [str int2str(PD)]; title(str); end reshape(L,Pop_target,N_tel); end