@@ -21,19 +21,33 @@ def load_abcd():
21
21
)
22
22
23
23
24
- def load_local_tle ():
24
+ def load_multi_tle ():
25
25
"""
26
- Load local TLE (EpiC x MICs x NKG ) data
26
+ Load multisite TLE (ENIGMA ) data
27
27
28
28
Returns:
29
- numpy.ndarray: The loaded data containing age, sex, dataset, focus, and ct information.
29
+ numpy.ndarray: The loaded data containing age, sex, dataset, group, focus, and ct information.
30
30
"""
31
31
return util .load_data (
32
- "../../data/processed/local_tle_data.npz" ,
33
- ["age" , "sex" , "dataset" , "focus" , "ct" ],
32
+ "../../data/processed/multi_tle_data.npz" ,
33
+ ["age" , "sex" , "focus" , "ct" ],
34
+ )
35
+
36
+
37
+ def load_multi_ige ():
38
+ """
39
+ Load multisite IGE (ENIGMA) data
40
+
41
+ Returns:
42
+ numpy.ndarray: The loaded data containing age, sex, dataset, group, focus, and ct information.
43
+ """
44
+ return util .load_data (
45
+ "../../data/processed/multi_ige_data.npz" ,
46
+ ["age" , "sex" , "group" , "ct" ],
34
47
)
35
48
36
49
50
+
37
51
# Main analysis
38
52
def main ():
39
53
# Load data
@@ -72,30 +86,7 @@ def main():
72
86
73
87
# Lobe indices
74
88
lobe_names = ["whole" , "frontal" , "limbic" , "occipital" , "parietal" , "temporal" ]
75
- frontal = [
76
- 17 ,
77
- 18 ,
78
- 25 ,
79
- 16 ,
80
- 22 ,
81
- 2 ,
82
- 26 ,
83
- 10 ,
84
- 12 ,
85
- 30 ,
86
- 15 ,
87
- 46 ,
88
- 64 ,
89
- 60 ,
90
- 49 ,
91
- 44 ,
92
- 59 ,
93
- 52 ,
94
- 50 ,
95
- 56 ,
96
- 36 ,
97
- 51 ,
98
- ]
89
+ frontal = [17 , 18 , 25 , 16 , 22 , 2 , 26 , 10 , 12 , 30 , 15 , 46 , 64 , 60 , 49 , 44 , 59 , 52 , 50 , 56 , 36 , 51 ,]
99
90
limbic = [8 , 21 , 1 , 24 , 33 , 58 , 35 , 55 , 42 , 67 ]
100
91
occipital = [11 , 19 , 9 , 3 , 45 , 53 , 37 , 43 ]
101
92
parietal = [20 , 27 , 29 , 6 , 23 , 54 , 61 , 40 , 63 , 57 ]
@@ -182,49 +173,27 @@ def main():
182
173
print ("Comparison to case-control atrophy" )
183
174
print ("----------------------------------" )
184
175
# Generate atrophy for each site:
185
- age , sex , dataset , focus , ct = load_local_tle ()
186
- local_tle_atrophy = util .load_result (
187
- "../../data/results/03_atrophyAssociation/local_atrophy.pkl" , ["atrophy" ]
176
+ epilepsy_atrophy = {}
177
+
178
+ multi_tle_atrophy = util .load_result (
179
+ "../../data/results/03_atrophyAssociation/multi_atrophy.pkl" , ["atrophy" ]
188
180
)[0 ]
189
- # Combined
190
- tle_atrophy = {}
191
- tle_atrophy ["lh_all" ] = local_tle_atrophy ["ltle" ]
192
- tle_atrophy ["rh_all" ] = local_tle_atrophy ["rtle" ]
193
-
194
- # Across different datasets
195
- for d in ["EpiC" , "MICs" ]:
196
- dataset_idx = dataset == d
197
- dataset_ct = ct [dataset_idx , :]
198
- dataset_age = age [dataset_idx ]
199
- dataset_sex = sex [dataset_idx ]
200
- dataset_focus = focus [dataset_idx ]
201
-
202
- x = util .zscore_flip (dataset_ct , dataset_focus , "C" , "R" )
203
- for hemi in ["L" , "R" ]:
204
- covar = pd .DataFrame ({"age" : dataset_age , "sex" : dataset_sex })
205
- tle_atrophy [f"{ hemi .lower ()} h_{ d .lower ()} " ] = util .casecontrol_difference (
206
- x , covar , dataset_focus , "C" , hemi
207
- )
208
-
209
- print (f"{ d } atrophy done" )
210
-
211
- site_labels = [
212
- "lh_all" ,
213
- "lh_epic" ,
214
- "lh_mics" ,
215
- "rh_all" ,
216
- "rh_epic" ,
217
- "rh_mics" ,
218
- ]
219
- atrophy_similarity_r = np .zeros ((len (thresholds ), len (site_labels )))
220
- atrophy_similarity_p = np .zeros ((len (thresholds ), len (site_labels )))
181
+ epilepsy_atrophy ["ltle" ] = multi_tle_atrophy ["ltle" ]
182
+ epilepsy_atrophy ["rtle" ] = multi_tle_atrophy ["rtle" ]
183
+
184
+ multi_ige_atrophy = util .load_result (
185
+ "../../data/results/s02_igeSpecificity/ige_atrophy.pkl" , ["atrophy" ]
186
+ )[0 ]
187
+ epilepsy_atrophy ["ige" ] = multi_ige_atrophy ["ige" ]
188
+
189
+ atrophy_similarity_r = np .zeros ((len (thresholds ), len (epilepsy_atrophy )))
190
+ atrophy_similarity_p = np .zeros ((len (thresholds ), len (epilepsy_atrophy )))
221
191
for i in range (len (thresholds )):
222
192
map1 = regional_association [thresholds [i ]]
223
- for site in site_labels :
224
- map2 = tle_atrophy [site ]
225
- atrophy_similarity_r [i , j ], atrophy_similarity_p [i , j ], _ = (
226
- util .spatial_correlation (map1 .t , map2 .t , n_rot = 5000 )
227
- )
193
+ for j , subtype in enumerate (epilepsy_atrophy ):
194
+ map2 = epilepsy_atrophy [subtype ]
195
+ atrophy_similarity_r [i , j ], atrophy_similarity_p [i , j ], _ = util .spatial_correlation (map1 .t , map2 .t , n_rot = 5000 )
196
+
228
197
229
198
print ()
230
199
print ("Save results" )
0 commit comments