Commit 9c1d4732 authored by tk11br's avatar tk11br
Browse files

Update new diagnostics to include more info

parent e5ae41ed
......@@ -8,7 +8,7 @@ function main_diagnostics(filePath)
fOut = fopen(fName,'w');
% Update this eventually...
header = 'fname,nbchan,pnts,srate,manual,ch_s_sd-m,ch_s_sd_b-m,ch_s_sd_b-m-ch_sd_b,ch_s_sd_b-m-ic_sd1_b,ch_sd-m,ch_sd_b-m,ch_sd_b-m-ic_sd1_b,low_r-m,ic_sd1-m,ic_sd1_b-m,ic_sd2,ch_s_sd,ch_sd,low_r,bridge,LtModelMean,LtModelStd,quant_0.05,quant_0.15,quant_0.25,quant_0.5,quant_0.75,quant_0.85,quant_0.95,pre_qc_comp';
header = 'fname,nbchan,pnts,srate,manual,ch_s_sd-m,ch_s_sd_b-m,ch_s_sd_b-m-ch_sd_b,ch_s_sd_b-m-ic_sd1_b,ch_sd-m,ch_sd_b-m,ch_sd_b-m-ic_sd1_b,low_r-m,ic_sd1-m,ic_sd1_b-m,ic_sd2,ch_s_sd,ch_sd,low_r,bridge,LtModelMean,LtModelStd,Lt_quant_0.05,Lt_quant_0.15,Lt_quant_0.25,Lt_quant_0.5,Lt_quant_0.75,Lt_quant_0.85,Lt_quant_0.95,manual_comp_1,ic_rt_1,linkpvaluesMean,linkpvaluesStd,lpv_quant_0.05,lpv_quant_0.15,lpv_quant_0.25,lpv_quant_0.5,lpv_quant_0.75,lpv_quant_0.85,lpv_quant_0.95';
fprintf(fOut,'%s\n',header);
% Read line by line of the specified diag list
......
......@@ -6,6 +6,9 @@ function single_diagnostic(fOutID, singleSetFile)
% a buffer. Line starts with filename.
outString = [singleSetFile, ','];
% Quantile breakdown used as a constant:
quantBreakdown = [0.05,0.15,0.25,0.5,0.75,0.85,0.95];
% Load:
EEG = pop_loadset('filepath','','filename',singleSetFile);
EEG = eeg_checkset( EEG );
......@@ -49,12 +52,29 @@ function single_diagnostic(fOutID, singleSetFile)
% Amica diagnostic info:
outString = [outString, num2str(mean(EEG.amica(2).models.Lt)), ','];
outString = [outString, num2str(std(EEG.amica(2).models.Lt)), ','];
quants = quantile(EEG.amica(2).models.Lt,[0.05,0.15,0.25,0.5,0.75,0.85,0.95]);
quants = quantile(EEG.amica(2).models.Lt,quantBreakdown);
for i=1:length(quants)
outString = [outString, num2str(quants(i)), ','];
end
% Pre QC comp count:
outString = [outString, num2str(length(EEG.icachansind)), ','];
% Manual QC comp count:
outString = [outString, num2str(length(find(EEG.marks.comp_info(1).flags == 1))), ','];
% Components marked as ic_rt
outString = [outString, num2str(length(find(EEG.marks.comp_info(2).flags == 1))), ','];
% ISCtest:
a = [];
for i=2:length(EEG.amica);
a(:,:,i-1)=EEG.amica(i).models(1).A;
end
[~,~,linkpvalues,~] = isctest(a,0.05,0.05,'mixing');
outString = [outString, num2str(mean(linkpvalues)), ','];
outString = [outString, num2str(std(linkpvalues)), ','];
quants = quantile(linkpvalues,quantBreakdown);
for i=1:length(quants)
outString = [outString, num2str(quants(i)), ','];
end
% disp('hold');
% Final write - includes newline
fprintf(fOutID,'%s\n',outString);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment