
for i = 1:length(minis.ctrl)
    cellavg.ctrl.mean(i,1) = nanmean(minis.ctrl{i,1}(:,feature.datcol));
    cellavg.ctrl.n(i,1) = length(minis.ctrl{i,1}(:,feature.datcol));
    cellavg.ctrl.std(i,1) = nanstd(minis.ctrl{i,1}(:,feature.datcol));
    cellavg.ctrl.feature = feature;
    cellavg.ctrl.name{i,1} = minis.ctrl{i,2};
end
ctrlCellName = cellavg.ctrl.name(cellavg.ctrl.n>=n_cutoff);
ctrlCellAvg = cellavg.ctrl.mean(cellavg.ctrl.n>=n_cutoff);

%%
cultureID = 'dojo1';
nanmean(ctrlCellAvg(strcmp(cultureID,ctrlCellName)))

%%
for i = 1:length(minis.TTX)
    cellavg.TTX.mean(i,1) = nanmean(minis.TTX{i,1}(:,feature.datcol));
    cellavg.TTX.n(i,1) = length(minis.TTX{i,1}(:,feature.datcol));
    cellavg.TTX.std(i,1) = nanstd(minis.TTX{i,1}(:,feature.datcol));
    cellavg.TTX.feature = feature;
    cellavg.TTX.name{i,1} = minis.TTX{i,2};
end
TTXCellName = cellavg.TTX.name(cellavg.TTX.n>=n_cutoff);
TTXCellAvg = cellavg.TTX.mean(cellavg.TTX.n>=n_cutoff);

%%
cultureID = 'stimpy6';
nanmean(TTXCellAvg(strcmp(cultureID,TTXCellName)))

%%
for i = 1:length(minis.CNQX)
    cellavg.CNQX.mean(i,1) = nanmean(minis.CNQX{i,1}(:,feature.datcol));
    cellavg.CNQX.n(i,1) = length(minis.CNQX{i,1}(:,feature.datcol));
    cellavg.CNQX.std(i,1) = nanstd(minis.CNQX{i,1}(:,feature.datcol));
    cellavg.CNQX.feature = feature;
    cellavg.CNQX.name{i,1} = minis.CNQX{i,2};
end
CNQXCellName = cellavg.CNQX.name(cellavg.CNQX.n>=n_cutoff);
CNQXCellAvg = cellavg.CNQX.mean(cellavg.CNQX.n>=n_cutoff);

%%
cultureID = 'dojo22493';
nanmean(CNQXCellAvg(strcmp(cultureID,CNQXCellName)))




%%
for i = 1:length(minis.CNQXstim1X)
    cellavg.CNQXstim1X.mean(i,1) = nanmean(minis.CNQXstim1X{i,1}(:,feature.datcol));
    cellavg.CNQXstim1X.n(i,1) = length(minis.CNQXstim1X{i,1}(:,feature.datcol));
    cellavg.CNQXstim1X.std(i,1) = nanstd(minis.CNQXstim1X{i,1}(:,feature.datcol));
    cellavg.CNQXstim1X.feature = feature;
    cellavg.CNQXstim1X.name{i,1} = minis.CNQXstim1X{i,2};
end
CNQXstim1XCellName = cellavg.CNQXstim1X.name(cellavg.CNQXstim1X.n>=n_cutoff);
CNQXstim1XCellAvg = cellavg.CNQXstim1X.mean(cellavg.CNQXstim1X.n>=n_cutoff);

%%
cultureID = 'xinhai22471';
nanmean(CNQXstim1XCellAvg(strcmp(cultureID,CNQXstim1XCellName)))

%%
for i = 1:length(minis.TTXCTZ)
    cellavg.TTXCTZ.mean(i,1) = nanmean(minis.TTXCTZ{i,1}(:,feature.datcol));
    cellavg.TTXCTZ.n(i,1) = length(minis.TTXCTZ{i,1}(:,feature.datcol));
    cellavg.TTXCTZ.std(i,1) = nanstd(minis.TTXCTZ{i,1}(:,feature.datcol));
    cellavg.TTXCTZ.feature = feature;
    cellavg.TTXCTZ.name{i,1} = minis.TTXCTZ{i,2};
end
TTXCTZCellName = cellavg.TTXCTZ.name(cellavg.TTXCTZ.n>=n_cutoff);
TTXCTZCellAvg = cellavg.TTXCTZ.mean(cellavg.TTXCTZ.n>=n_cutoff);

%%
cultureID = 'stimpy5';
nanmean(TTXCTZCellAvg(strcmp(cultureID,TTXCTZCellName)))
