clear all; close all; %====================== % Barry Canton, March 2006 % % This code reads a results text file that is output by the Victor 3 % plate reader. It expects that there are only two labels being % measured, the first of which is absorbance, the second is % fluorescence. the start of the text file should look like this - %Plate Repeat Well Type Time OD600 (A) Time GFP-separated (Counts) %1 1 F01 M 00:00:26.27 0.076 00:00:51.68 977 %1 1 F02 M 00:00:26.59 0.069 00:00:52.04 914 % %There is extra data at the bottom of the results text file but once the format is %no longer as that shown above, this code will stop reading. %To use this code, just enter your input file prefix here - filename = 'E70102firstscreen'; %and the path to where your data should be saved - outputpath = '~/Desktop/Chassis-System/Data/PlateReader/DedicatedTranslation/'; %====================== fullname = strcat(filename,'.txt'); fid=fopen(fullname); % C is a cell array that contains each of the data columns from the result % file, it skips 1 header row. C = textscan(fid, '%n %n %s %s %s %n %s %n','headerLines',1); fclose(fid); %Extract the useful information from the data - Repeats = C{2}; Time = C{5}; Absorbance = C{6}; Fluorescence = C{8}; %====================== %Wells %====================== %Work out what the wells are called and store them in a string array Wells = C{3}; WellNames = unique(Wells); WellNames = cell2mat(WellNames); %====================== %Time %====================== %Process the time mins, starting from 0 TimeVec = datevec(Time); TimeSerial = datenum(TimeVec); %change time format TimeData = TimeSerial*24*60;%convert to mins TimeData = TimeData-TimeData(1); %set the start time to 0mins %find one time point for each repeat. This gets the last time point %recorded for each repeat, use that as the single time point for each label %and for each well. [Steps, index, junk] = unique(Repeats); TimeData = TimeData(index); %====================== %Absorbance & Fluorescence %====================== %Rearrange both of the data arrays so that each well has its own column. %This will fail if for some reason all wells don't have the same number of %repeats, for example, if you terminate the plate reader while its %measuring wells. If so you should use the loop that is commented out %below. Repeats = max(Repeats); %find the number of repeats AbsorbanceData = reshape(Absorbance,[length(Absorbance)/Repeats,Repeats])'; FluorescenceData = reshape(Fluorescence,[length(Fluorescence)/Repeats,Repeats])'; %for i = 1:length(WellNames) % indices = strmatch(WellNames{i},Wells); % AbsorbanceData(:,i) = Absorbance(indices); % FluorescenceData(:,i) = Fluorescence(indices); %end %====================== %Save data %====================== %Save the processed data to a .mat file location = strcat(outputpath,filename,'processed'); save(location,'TimeData','AbsorbanceData','FluorescenceData','Wells');