%Mat file generation of intensity data for use in statistical analysis %Author: Jordan Rolsma - University of California, Riverside %Features: %Designed to work with data generated from %example_NucCytSeg_IntQuant_v1_JLR_20240130.m. %Cleans up, clarifies, and consolidates data (removes NaNs, calculates %averages for use in statistical analysis, etc.) %Housekeeping clearvars close all clc %Loads raw mat file load 20231026_ASC_GFP_MitoLocal_MAHS_T4_DAPI_GFP_Phalloidin554_MitoView640_TS6x6_20x_JLR_data.mat %Specifies file length lengthtotal = length(intDataCyt); %Extracts number of reported values in each tilescan micrograph image for i = 1:lengthtotal %remove NaNs from consideration intDataCyt{i,1} = rmmissing(intDataCyt{i,1}); intDataNuc{i,1} = rmmissing(intDataNuc{i,1}); intDataRat{i,1} = rmmissing(intDataRat{i,1}); %number of reported values minus NaNs nummeasure_cyt{i,1} = height(intDataCyt{i,1}); nummeasure_nuc{i,1} = height(intDataNuc{i,1}); nummeasure_rat{i,1} = height(intDataRat{i,1}); end %Calculates average value for each image for i = 1:lengthtotal sum_cyt{i,1} = sum(intDataCyt{i,1}); sum_nuc{i,1} = sum(intDataNuc{i,1}); sum_rat{i,1} = sum(intDataRat{i,1}); avgval_cyt{i,1} = sum_cyt{i,1}/nummeasure_cyt{i,1}; avgval_nuc{i,1} = sum_nuc{i,1}/nummeasure_nuc{i,1}; avgval_rat{i,1} = sum_rat{i,1}/nummeasure_rat{i,1}; end %Calculates total average cyt, nuc, and int rates for entire lif file for i = 1:lengthtotal totalavg_cyt = mean(avgval_cyt{i,1}); totalavg_nuc = mean(avgval_nuc{i,1}); totalavg_rat = mean(avgval_rat{i,1}); end %Clear unneeded variables clear avgval_cyt avgval_nuc avgval_rat i intDataCyt intDataNuc intDataRat... lengthtotal nummeasure_cyt nummeasure_nuc nummeasure_rat Sname sum_cyt... sum_nuc sum_rat %Save new mat file save(sprintf('20231026_ASC_GFP_MitoLocal_MAHS_T4_IntQuant_JLR_data_final.mat'))