-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
702f13e
commit 5cedcbd
Showing
12 changed files
with
223 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
clc; | ||
mcrsght_info('LOAD CONTACT EVENTS FROM SAVED EXPERIMENT - BRIEF ANALYSIS.'); | ||
mcrsght_info('This demo uses the experiment in [./DATA/ctrlvshot3/demo2_*],'); | ||
mcrsght_info('and performs a simple T-test and boxplots. '); | ||
|
||
basefilename = fullfile(MACROHOME_,'DATA','ctrlvshot3'); | ||
dataStructure = load(fullfile(basefilename, 'demo2_angleChanges.mat')); | ||
dataTable = readtable(fullfile(basefilename, 'demo2_angleChanges.xlsx')); | ||
|
||
mcrsght_info('Loaded variables:'); | ||
disp(dataStructure); | ||
|
||
controltrackfeatures = dataStructure.controltrackfeatures; | ||
mutanttrackfeatures = dataStructure.mutanttrackfeatures; | ||
setnames = {dataStructure.generalinfocontrol(1).typeExperiment ... | ||
dataStructure.generalinfomutant(1).typeExperiment}; | ||
|
||
|
||
|
||
[boxdata,boxgroups] = getBoxplotComparisonData(controltrackfeatures, mutanttrackfeatures); | ||
|
||
subplot(141) | ||
boxplot(boxdata.clumpsize, boxgroups); | ||
ylabel('clumpsize'); | ||
title('Boxplot example - 1'); | ||
|
||
subplot(142) | ||
boxplot(boxdata.thx, boxgroups); | ||
ylabel('anglechange'); | ||
title('Boxplot example - 2'); | ||
|
||
subplot(143) | ||
boxplot(abs(boxdata.thx), boxgroups); | ||
ylabel('abs(anglechange)'); | ||
title('Boxplot example - 3'); | ||
|
||
subplot(144) | ||
hold on; | ||
for ix=1:2 | ||
scatter(boxdata.clumpsize(boxgroups==ix), abs(boxdata.thx(boxgroups==ix)), 110); | ||
end | ||
legend(setnames); | ||
xlabel('clumpsize'); | ||
ylabel('abs(angle change)'); | ||
title('Scatterplot example'); | ||
|
||
set(gcf, 'Position', [560 579 983 369]); | ||
|
||
[M, SD, H, P] = compareAngleChanges(controltrackfeatures, mutanttrackfeatures, setnames); | ||
mcrsght_info(sprintf('SET: [%s] MEAN(STDev) = %2.2f(%2.2f) ', ... | ||
setnames{1}, M.(setnames{1}), SD.(setnames{1})), 'RESULTS'); | ||
mcrsght_info(sprintf('SET: [%s] MEAN(STDev) = %2.2f(%2.2f) ', ... | ||
setnames{2}, M.(setnames{2}), SD.(setnames{2})), 'RESULTS'); | ||
mcrsght_info(sprintf('TESTS: T-test p-value = %2.2f ', P.ttest), 'RESULTS'); | ||
mcrsght_info(sprintf('TESTS: Wilcoxon p-value = %2.2f ', P.wilcoxon), 'RESULTS'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
function [M, SD, H, P] = compareAngleChanges(trackfeatures_set1, trackfeatures_set2, setnames, absbool) | ||
% | ||
|
||
if nargin < 3 | ||
setnames = {'set1', 'set2'}; | ||
absbool = true; | ||
elseif nargin < 4 | ||
absbool = true; | ||
end | ||
|
||
if absbool | ||
mcrsght_info('ABS(Angle)'); | ||
else | ||
mcrsght_info('Angles unchanged'); | ||
end | ||
|
||
angleContact = vertcat(trackfeatures_set1.thx); | ||
angleNoContact = vertcat(trackfeatures_set2.thx); | ||
|
||
|
||
if absbool | ||
angleContact = abs(angleContact); | ||
angleNoContact = abs(angleNoContact); | ||
end | ||
|
||
m = [mean(angleContact) mean(angleNoContact)]; | ||
sd = [std(angleContact) std(angleNoContact)]; | ||
|
||
[pwill, hwill] = ranksum(angleContact, angleNoContact); | ||
[httest, pttest] = ttest2(angleContact, angleNoContact); | ||
|
||
if hwill==1 | ||
rejwill = 'reject'; | ||
else | ||
rejwill = sprintf('nope\t'); | ||
end | ||
if httest==1 | ||
rejttest = 'reject'; | ||
else | ||
rejttest = sprintf('nope\t'); | ||
end | ||
|
||
M.(setnames{1}) = m(1); | ||
M.(setnames{2}) = m(2); | ||
|
||
SD.(setnames{1}) = sd(1); | ||
SD.(setnames{2}) = sd(2); | ||
|
||
H.ttest = httest; | ||
H.wilcoxon = hwill; | ||
|
||
P.ttest = pttest; | ||
P.wilcoxon = pwill; | ||
|
||
|
||
if nargout == 0 | ||
mcrsght_info(sprintf(' & With cell-cell & NO contact & WILLCOXON & T-TEST &')); | ||
mcrsght_info(sprintf('mean (std) & mean (std) & p-value & Can reject? & p-value & Can reject? &')); | ||
|
||
mcrsght_info(sprintf('& %3.2f (%2.2f) & %3.2f (%2.2f) & %2.2f & %s & %2.2f & %s &', ... | ||
m(1), sd(1), m(2), sd(2), pwill, rejwill, pttest, rejttest)); | ||
|
||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function [boxdata, boxgroups] = getBoxplotComparisonData(varargin) | ||
% GET DATA FOR BOXPLOTS AND STATISTICAL ANALYSIS. | ||
% | ||
|
||
numGroups = length(varargin); | ||
fnames = fieldnames(varargin{1}); | ||
|
||
boxgroups = []; | ||
for ix=1:length(fnames) | ||
Tab = []; | ||
for jx=1:numGroups | ||
thisVector = vertcat(varargin{jx}.(fnames{ix})); | ||
Tab = [Tab; thisVector]; | ||
if ix==1 | ||
boxgroups = [boxgroups; jx.*ones(size(thisVector))]; | ||
end | ||
end | ||
boxdata.(fnames{ix}) = Tab; | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters