clear all; %To use this code, just enter your input file prefix here - filename = '081706 Blank Test Turned'; %and the path to where your data should be saved. If you don't specify an %output location, it will use the current directory. % outputpath = '~/Desktop/Chassis-System/Data/PlateReader/DedicatedTranslation/'; [TimeData, LabelData] = platereaderread2MG(filename); %% %============ %set smoothing parameters %============ method = 'fb'; if method == 'fb' | method == 'ff' cutofffreq = 0.15; neighbors = []; elseif method == 'co' cutofffreq = 0.15; neighbors = 9; elseif method == 'ma' cutofffreq = []; neighbors = 9; end plotunsmooth = 0; plotsmooth = 1; Absbackgroundsamples = []; GFPbackgroundsamples = []; experimentsamples = [1:32]; names = ['A 1:3 ';... 'A 4:6 ';... 'A 7:9 ';... 'A 10:12 ';... 'B 1:3 ';... 'B 4:6 ';... 'B 7:9 ';... 'B 10:12 ';... 'C 1:3 ';... 'C 4:6 ';... 'C 7:9 ';... 'C 10:12 ';... 'D 1:3 ';... 'D 4:6 ';... 'D 7:9 ';... 'D 10:12 ';... 'E 1:3 ';... 'E 4:6 ';... 'E 7:9 ';... 'E 10:12 ';... 'F 1:3 ';... 'F 4:6 ';... 'F 7:9 ';... 'F 10:12 ';... 'G 1:3 ';... 'G 4:6 ';... 'G 7:9 ';... 'G 10:12 ';... 'H 1:3 ';... 'H 4:6 ';... 'H 7:9 ';... 'H 10:12 ']; wellnames = cellstr(names(experimentsamples,:)); replicates = 3; samples = [experimentsamples,GFPbackgroundsamples,Absbackgroundsamples]; % Extract the data that we are interested in into three new variables. By % default, consider all timepoints and wells % timepoints = [1:size(LabelData,1)-1]; wells = [1:size(LabelData,2)]; timepoints = [5]; % wells = [1:6]; % rawGFP = LabelData(timepoints,wells,2); rawAbs = LabelData(timepoints,wells,1); Time = TimeData(timepoints); %If your data has a fixed number of replicates for each sample and control, %and the replicates are in adjacent wells, use this code to reshape both %matrices so that the third dimension represents the different replicates orderedAbs = reshape(rawAbs,[size(rawAbs,1),replicates,size(rawAbs,2)/replicates]); % orderedGFP = reshape(rawGFP,[size(rawGFP,1),replicates,size(rawGFP,2)/replicates]); %reorder the dimensions of the array so that the third dimension is the %number of replicates. orderedAbs = permute(orderedAbs,[1,3,2]); % orderedGFP = permute(orderedGFP,[1,3,2]); orderedAbs = orderedAbs(:,samples,:); % orderedGFP = orderedGFP(:,samples,:); %Background subtraction %If you are subtracting one time course from another as a background %subtraction, it would be better to wait until after the data has been %filtered. For now, we'll just subtract the mean of a media only well from %the absorbance. if ~isempty(Absbackgroundsamples) Absbackground = mean(orderedAbs(:,end,:),3); cellAbs = orderedAbs - repmat(Absbackground,[1,size(orderedAbs,2),size(orderedAbs,3)]); else cellAbs = orderedAbs; end cellOD = 3.113.*cellAbs-0.0158; % cellOD = cellAbs; %============================== %Data Smoothing %Put the data to be smoothed into a cell array so the function can handle %arbitrary numbers of labels. if ~isempty(method) timeseries{1} = cellOD; % timeseries{2} = orderedGFP; [smoothtimeseries] = platereadersmooth(timeseries,method,cutofffreq,neighbors); %now get the smoothed data back out into individual arrays. fOD = smoothtimeseries{1}; OD = cellOD; % fGFP = smoothtimeseries{2}; % GFP = orderedGFP; else fOD = cellOD; % fGFP = orderedGFP; end smoothOD = mean(fOD,1); smoothOD = squeeze(smoothOD); smoothOD = smoothOD'; asmoothOD = mean(smoothOD,2); %averagedplatelayout = [asmoothOD(1:4)';0,0,0,0;asmoothOD(5:8)';asmoothOD(9:12)';asmoothOD(13:16)';asmoothOD(17:20)';0,0,0,0;asmoothOD(21:24)']; fullplatelayout = [smoothOD(1:12);smoothOD(13:24);smoothOD(25:36);smoothOD(37:48);smoothOD(49:60);smoothOD(61:72) smoothOD(73:84);smoothOD(85:96)]; %timeandreplicatesmeanOD = mean(asmoothOD) %deviation = std(asmoothOD) % newOD = mean(fOD,3) % newOD2 = newOD(5,:) % avOD = mean(newOD2) % deviation = std(newOD2) clims = [.01 .3] figure(6) imagesc(fullplatelayout,clims) axis image colorbar title('081706 Media OD Turned TP 5'); % figure(5) % imagesc(averagedplatelayout([1 3 4 5 6 8],:)) % axis image % colorbar % % figure(6) % bar3(averagedplatelayout([1 3 4 5 6 8],:)) % zlabel('OD') % xlabel('Row') % ylabel('Column')