How to organize and analyze my excel files in matlab?

4 views (last 30 days)
Hi I am new to matlab.
I use CellProfiler software to output large excel files(.csv).
Basically what I usually do is load a bunch of images from a bunch of wells across 5 or so treatment conditions. Each image has 20-30 bunch of biological cells labled with a fluorescent marker in ch00, ch01, ch02,ch03 etc..
I first segment the cells ( called objects) and make a shit ton of measurements on them ( e.g. size, mean intensity of a particular color channel, form factor etc...).
All I need to do is take mean and median values on all the measurements according to treatment and measurement type so I can stick them in graph pad prism to make figures.
I'd like a versatile script to account for changes in the types and numbers of measurements I am taking as well as the types and numbers of treatment conditions...
However, I am new to matlab so any help appreciated!
See attached for example file.

Answers (1)

Jacob Wood
Jacob Wood on 23 Feb 2020
Hi Randy,
readtable() might be a nice place to start. https://www.mathworks.com/help/matlab/ref/readtable.html
After the data is in Matlab you can use some of the helpful grouping functionality to do what you are trying to do: https://www.mathworks.com/help/matlab/matlab_prog/grouping-variables-for-splitting-data.html
Alternatively, you can use logical indexing. An example of this is below.
One example, to read the data and plot the mean 'Correlation_Correlation_Cx43_FActin' for each 'ImageNumber' would look something like this (liable to be buggy as I don't have Matlab here so this is untested):
file_name = 'IF66NewBorder.csv';
selected_column = 'Correlation_Correlation_Cx43_FActin';
T = readtable(file_name);
images = unique(T.ImageNumber);
means = NaN(size(images));
for ii = 1:numel(images)
image_num = images(ii);
selected_rows = T.ImageNumber==image_num;
means(ii) = mean(T.(selected_column));
end
figure
plot(images,means,'.-')
xlabel('ImageNumber')
ylabel(['Mean of ' selected_column])

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!