Skip to content

Commit a26fef1

Browse files
committed
add connectivity ord multiplex group average folder
1 parent ff32d51 commit a26fef1

File tree

3 files changed

+153
-0
lines changed

3 files changed

+153
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
%% ¡header!
2+
AnalyzeGroup_CON_OMP_GA_WU < AnalyzeGroup (a, graph analysis with connectivity ordinal multiplex data) is a graph analysis using connectivity ordinal multiplex data.
3+
4+
%% ¡description!
5+
This graph analysis uses connectivity ordinal multiplex data and
6+
analyzes them using weighted undirected graphs.
7+
8+
%%% ¡seealso!
9+
SubjectCON_MP, OrderedMultiplexWU, AnalyzeEnsemble_CON_MP_GA_WU.
10+
11+
%% ¡props_update!
12+
13+
%%% ¡prop!
14+
TEMPLATE (parameter, item) is the analysis template to set the parameters.
15+
%%%% ¡settings!
16+
'AnalyzeGroup_CON_OMP_GA_WU'
17+
18+
%%% ¡prop!
19+
GR (data, item) is the subject group, which also defines the subject class SubjectCON_MP.
20+
%%%% ¡default!
21+
Group('SUB_CLASS', 'SubjectCON_MP')
22+
23+
%%% ¡prop!
24+
G (result, item) is the average graph (OrderedMultiplexWU) obtained from this analysis.
25+
%%%% ¡settings!
26+
'OrderedMultiplexWU'
27+
%%%% ¡default!
28+
OrderedMultiplexWU()
29+
%%%% ¡calculate!
30+
gr = a.get('GR');
31+
subjects_number = gr.get('SUB_DICT').length();
32+
33+
A_conmp = cell(1, 2);
34+
for i = 1:1:subjects_number
35+
sub = gr.get('SUB_DICT').getItem(i);
36+
CON_MP = sub.getr('CON_MP');
37+
L = sub.get('L');
38+
39+
for j = 1:1:L
40+
data = CON_MP{j};
41+
42+
if i == 1
43+
A_conmp(j) = {data};
44+
else
45+
A_conmp(j) = {A_conmp{j} + data};
46+
end
47+
end
48+
end
49+
50+
ba = BrainAtlas();
51+
if ~isempty(gr) && ~isa(gr, 'NoValue') && subjects_number > 0
52+
ba = gr.get('SUB_DICT').getItem(1).get('BA');
53+
end
54+
55+
L = length(A_conmp);
56+
g = OrderedMultiplexWU( ...
57+
'ID', ['g ' gr.get('ID')], ...
58+
'B', cellfun(@(a) a/subjects_number, A_conmp, 'UniformOutput', false), ... % % % 'LAYERTICKS', [1:1:L], ...
59+
'LAYERLABELS', cell2str(cellfun(@(x) ['L' num2str(x)], num2cell([1:1:L]), 'UniformOutput', false)), ...
60+
'BAS', ba ...
61+
);
62+
value = g;
63+
64+
%% ¡tests!
65+
66+
%%% ¡test!
67+
%%%% ¡name!
68+
Example
69+
%%%% ¡code!
70+
example_CON_OMP_GA_WU
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
%EXAMPLE_CON_OMP_GA_WU
2+
% Script example pipeline CON OMP GA WU
3+
4+
clear variables %#ok<*NASGU>
5+
6+
%% Load BrainAtlas
7+
im_ba = ImporterBrainAtlasXLS( ...
8+
'FILE', [fileparts(which('example_CON_MP_WU')) filesep 'example data CON_MP' filesep 'aal90_atlas.xlsx'], ...
9+
'WAITBAR', true ...
10+
);
11+
12+
ba = im_ba.get('BA');
13+
14+
%% Load Groups of SubjectCON_MP
15+
im_gr1 = ImporterGroupSubjectCON_MP_XLS( ...
16+
'DIRECTORY', [fileparts(which('example_CON_MP_WU')) filesep 'example data CON_MP' filesep 'xls' filesep 'GroupName1'], ...
17+
'BA', ba, ...
18+
'WAITBAR', true ...
19+
);
20+
21+
gr1 = im_gr1.get('GR');
22+
23+
im_gr2 = ImporterGroupSubjectCON_MP_XLS( ...
24+
'DIRECTORY', [fileparts(which('example_CON_MP_WU')) filesep 'example data CON_MP' filesep 'xls' filesep 'GroupName2'], ...
25+
'BA', ba, ...
26+
'WAITBAR', true ...
27+
);
28+
29+
gr2 = im_gr2.get('GR');
30+
31+
%% Analysis CON_OMP GA WU
32+
a_WU1 = AnalyzeEnsemble_CON_OMP_GA_WU( ...
33+
'GR', gr1 ...
34+
);
35+
36+
a_WU2 = AnalyzeEnsemble_CON_OMP_GA_WU( ...
37+
'GR', gr2 ...
38+
);
39+
40+
% measure calculation
41+
g_WU1 = a_WU1.get('G');
42+
mcommunities_WU1 = g_WU1.getMeasure('MultilayerCommunityStructure').get('M');
43+
44+
g_WU2 = a_WU2.get('G');
45+
mcommunities_WU2 = g_WU2.getMeasure('MultilayerCommunityStructure').get('M');
46+
47+
% comparison
48+
c_WU = CompareGroup( ...
49+
'P', 10, ...
50+
'A1', a_WU1, ...
51+
'A2', a_WU2, ...
52+
'WAITBAR', true, ...
53+
'VERBOSE', false, ...
54+
'MEMORIZE', true ...
55+
);
56+
57+
overlappingdegree_WU_diff = c_WU.getComparison('OverlappingDegree').get('DIFF');
58+
overlappingdegree_WU_p1 = c_WU.getComparison('OverlappingDegree').get('P1');
59+
overlappingdegree_WU_p2 = c_WU.getComparison('OverlappingDegree').get('P2');
60+
overlappingdegree_WU_cil = c_WU.getComparison('OverlappingDegree').get('CIL');
61+
overlappingdegree_WU_ciu = c_WU.getComparison('OverlappingDegree').get('CIU');
62+
63+
overlappingdegree_av_WU_diff = c_WU.getComparison('OverlappingDegreeAv').get('DIFF');
64+
overlappingdegree_av_WU_p1 = c_WU.getComparison('OverlappingDegreeAv').get('P1');
65+
overlappingdegree_av_WU_p2 = c_WU.getComparison('OverlappingDegreeAv').get('P2');
66+
overlappingdegree_av_WU_cil = c_WU.getComparison('OverlappingDegreeAv').get('CIL');
67+
overlappingdegree_av_WU_ciu = c_WU.getComparison('OverlappingDegreeAv').get('CIU');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
%% Pipeline Connectivity Ordered-Multiplex Analysis WU
2+
3+
% This is the pipeline script to analyze a group of subjects using connectivity ordinal multiplex data and a weighted undirected graph.
4+
% 1. It loads a brain atlas from an XLS file (e.g., aal90_atlas.xlsx).
5+
% 2.1 It loads the connectivity data of one group of subjects from two directories (e.g., GroupName1 and GroupName2) containing XLS files of each subject.
6+
% 2.2 It loads the connectivity data of one group of subjects from two directories (e.g., GroupName1 and GroupName2) containing XLS files of each subject.
7+
% 3. It analyzes the data using connectivity ordered-multiplex analysis (CON_MP) based on weighted undirected graphs (WU).
8+
9+
%% Brain Atlas
10+
ba = ImporterBrainAtlasXLS('WAITBAR', true).get('BA'); % Load Brain Atlas XLS % Brain Atlas
11+
12+
%% Group
13+
gr = ImporterGroupSubjectCON_MP_XLS('BA', ba, 'WAITBAR', true).get('GR'); % Load Group CON OMP XLS % Group CON MP
14+
15+
%% Analysis
16+
a_WU = AnalyzeEnsemble_CON_OMP_WU('GR', gr); % Analyze Group % Analyzed Group

0 commit comments

Comments
 (0)