OSCR

Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.

Code ↔ Paper

5 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 5 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § Material and methods › Statistical analyses ↔ activity_EF_projects_2024/statistics.py, lines 879–1016 · score 0.69 · linear regression, independent variable, covariates, alpha, models, score
  2. [2] § Material and methods › Graph analyses and network measure extraction ↔ multilayer_EC_glioma_2023/kruskal_algorithm.m, lines 1–58 · score 0.54 · minimum spanning tree, strongest, MST, weighted, Graph, Multilayer
  3. [3] § Material and methods › rsfMRI processing ↔ LENS_paper_2022/SpinTest.m, the whole file · a weak match · score 0.53 · FreeSurfer, Pearson, Parcellation, cortical, atlas, correlations
  4. [4] § Material and methods › Graph analyses and network measure extraction ↔ MST/MST_kruskal.py, lines 110–173 · score 0.51 · spanning tree, strongest, MST, weighted, Graph, connect
  5. [5] § Material and methods › rsfMRI processing ↔ modelling_paper_2021/step1/run_model.m, lines 44–60 · score 0.50 · bandpass filtering, noise, smoothing, network

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 1,036 lines · 39 KB · MIT · 1 match

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. Statistical analyses for the activity EF project
  5. This script contains all statistical analyses for the project on activity and executive functioning in glioma patients.
  6. """
  7. __author__ = "Christina Ulrich & Mona Zimmermann"
  8. __contact__ = "[email hidden]"
  9. __date__ = "23/05/23" ### Date it was created
  10. __status__ = "Final"
  11. ####################
  12. # Review History #
  13. ####################
  14. # Reviewed by
  15. ## Script for Statistical Analysis ##
  16. ####################
  17. # LIBRARIES #
  18. ####################
  19. # Standard imports ###
  20. import numpy as np
  21. import pandas as pd
  22. from scipy import stats
  23. from scipy.stats import shapiro, ttest_rel, wilcoxon
  24. import statsmodels.api as sm
  25. import os
  26. import pyreadstat
  27. import matplotlib.pyplot as plt
  28. from statsmodels.stats.outliers_influence import variance_inflation_factor
  29. from statsmodels.compat import lzip
  30. import statsmodels.stats.api as sms
  31. import seaborn as sns
  32. # Third party imports ###
  33. # Internal imports ###
  34. #%%
  35. ####################
  36. # DATAFRAME IMPORT #
  37. ####################
  38. #ATTENTION>>> to review this code it is easiest to first run the create_df_masks_overlaps.py
  39. #script ,for the patient data, and then use the created variables for the statistical analyses below.
  40. #For the healthy control data we can use the dataframes previously created by Christina, see below.
  41. #%%
  42. ### HCs Hemispheric FPN ###
  43. #HCs (N=25)
  44. df_HC_Left = pd.read_csv("/path/to/average_HC_Left_df.csv")
  45. df_HC_Right = pd.read_csv("/path/to/average_HC_Right_df.csv")
  46. ### HC Info (i.e. info on EF scores and covariates)
  47. HC_info = pd.read_csv('/path/to/HC_subject_info_after_matching.csv')
  48. #Prepare HC_info df to match other dfs
  49. HC_info.rename(columns = {"Case_ID": "sub"}, inplace = True)
  50. HC_info['sub'] = HC_info['sub'].astype(int).astype(str)
  51. HC_info['sub'] = HC_info['sub'].str.replace('110+', '') #edit sub_ID (remove leading 110)
  52. HC_info['sub'] = HC_info['sub'].astype(int) #change sub back into int to match other dfs
  53. ### Dataframe with all HC data (left and right FPN) ###
  54. HCs_std = pd.read_csv("/path/to/df_activity_standardized_HC.csv") #all regions
  55. #%%
  56. #%%
  57. ### Patient info and EF scores ###
  58. patient_info = pyreadstat.read_sav("/path/to/info/file/.sav")[0]
  59. patient_info['Case_ID'] = 'sub-' + patient_info['Case_ID'].astype(int).astype(str).str.zfill(4)
  60. # Rename colums of EF_score in patient_info file so that both CST and WFT names match"
  61. patient_info.rename(columns = {'flu_dier_corrected_1_zscore' : 'flu_dier_corrected_1_Zscore',
  62. 'flu_dier_corrected_2_zscore' : 'flu_dier_corrected_2_Zscore' }, inplace = True )
  63. ### Lateralization
  64. li_subs = pd.read_csv("/path/to/all_subs_list.csv")
  65. #%%
  66. ####################
  67. # --- ttest to analyze changes in activity (T1-->T2) --- #
  68. ####################
  69. def paired_ttest (df_combined, activity_metrics, area, alpha = 0.05 ):
  70. '''
  71. Paramters
  72. ---------
  73. df_combined : pd.DataFrame,
  74. dataframe containing data on activityfor both baseline and FU
  75. activity_metrics: str,
  76. activity that should be investigated (i.e. bbp or offset)
  77. area: str,
  78. determines the area that is being investigated (i.e. peritumoral, ipislateral FPN, contralateral FPN)
  79. alpha : float
  80. set to 0.05
  81. '''
  82. #Remove patients from DFs that have progression before FU
  83. #filter patient_info df based on progression before FU
  84. patient_info_filtered = patient_info[patient_info['progression_before_FU'] == 2]
  85. print(patient_info_filtered.shape)
  86. print(len(patient_info[patient_info['progression_before_FU'] == 1]))
  87. df_combined_filt = df_combined[df_combined['sub'].isin(patient_info_filtered['Case_ID'])]
  88. print(df_combined_filt)
  89. # calculate differences between the paired T1 and T2 measurements
  90. differences = df_combined_filt[f"{activity_metrics}_T2"] - df_combined_filt[f"{activity_metrics}_T1"]
  91. #testing normality of differnces
  92. stat, p = stats.shapiro(differences)
  93. if p > alpha: # null hypothesis (differences has a normal distribution), use paried t-test
  94. print ("The null hypothesis cannot be rejected --> x has normal distribution")
  95. print ("Use paired t-test")
  96. #stat_t, p_t = stats.ttest_rel(df_baseline_filtered[activity_metrics], df_FU_filtered[activity_metrics])
  97. stat_t, p_t = stats.ttest_rel(df_combined_filt[f"{activity_metrics}_T1"], df_combined_filt[f"{activity_metrics}_T2"])
  98. if p_t < alpha:
  99. print('Paired t-test: Reject H0 --> there is a significant difference')
  100. else:
  101. print ('Paired t-test: Fail to reject H0 --> there is no significant difference')
  102. print ('T1 vs T2 t = ', str(round(stat_t, 2)), ' p_t = ', str(round(p_t, 4)))
  103. else: # Differences are not normally distributed, use Wilcoxon signed rank test
  104. print ("The null hypothesis can be rejected --> x is not normally distributed")
  105. print ("Use Wilcoxon signed-rank test")
  106. #stat_w, p_w = stats.wilcoxon(df_baseline_filtered[activity_metrics], df_FU_filtered[activity_metrics])
  107. stat_w, p_w = stats.wilcoxon(df_combined_filt[f"{activity_metrics}_T1"],df_combined_filt[f"{activity_metrics}_T2"])
  108. if p_w < alpha:
  109. print ('Wilcoxon signed rank test: Reject H0 --> there is a significant difference')
  110. else:
  111. print ('Wilcoxon signed rank test: Fail to reject H0 --> no significant difference')
  112. print ('T1 vs T2 t = ', str(round(stat_w, 2)), ' p = ', str(round(p_w, 4)))
  113. #%%
  114. #%%
  115. ####################
  116. ### Patient paired t-test analysis to investigate change between T1 and T2 ###
  117. ####################
  118. #Peritumoral area
  119. paired_ttest(df_peri_combined, 'offset_z', 'peritumoral', alpha = 0.05)
  120. paired_ttest(df_peri_combined, 'BB_welch_z', 'peritumoral', alpha = 0.05)
  121. #%%
  122. #Peri-resection area
  123. paired_ttest(df_cavity_combined, 'offset_z', 'peritumoral', alpha = 0.05)
  124. paired_ttest(df_cavity_combined, 'BB_welch_z', 'peritumoral', alpha = 0.05)
  125. #%%
  126. #Ipsilateral FPN
  127. result_ipsi_offset = paired_ttest(df_ipsi_combined, 'offset_z', 'ipsilateral', alpha = 0.05)
  128. result_ipsi_bbp = paired_ttest(df_ipsi_combined,'BB_welch_z', 'ipsilateral', alpha = 0.05)
  129. #%%
  130. #Contralateral FPN
  131. result_contra_offset = paired_ttest(df_contra_combined, 'offset_z', 'contralateral', alpha = 0.05)
  132. result_contra_bbp = paired_ttest(df_contra_combined, 'BB_welch_z', 'contralateral', alpha = 0.05)
  133. #%%
  134. ####################
  135. ### Post-hoc patient paired t-test analysis for the different freq bands ###
  136. ####################
  137. #load in frequency specific data
  138. df_peri_baseline_freqs = pd.read_csv('/path/to/20240517_std_rel_power_baseline.csv')
  139. df_peri_FU_freqs = pd.read_csv('/path/to/20240517_std_rel_power_FU_all.csv')
  140. df_peri_combined_freqs = pd.merge(df_peri_baseline_freqs, df_peri_FU_freqs, on='sub', suffixes=('_T1', '_T2'))
  141. #%%
  142. #paired t-test for the various frequency bands
  143. result_alpha1 = paired_ttest(df_peri_combined_freqs, 'alpha1_z', 'peritumor', alpha = 0.05)
  144. #%%
  145. result_alpha2 = paired_ttest(df_peri_combined_freqs, 'alpha2_z', 'peritumor', alpha = 0.05)
  146. #%%%
  147. result_beta = paired_ttest(df_peri_combined_freqs, 'beta_z', 'peritumor', alpha = 0.05)
  148. #%%
  149. result_delta = paired_ttest(df_peri_combined_freqs, 'delta_z', 'peritumor',alpha = 0.05)
  150. #%%
  151. result_gamma = paired_ttest(df_peri_combined_freqs, 'gamma_z', 'peritumor', alpha = 0.05)
  152. #%%
  153. result_theta = paired_ttest(df_peri_combined_freqs, 'theta_z', 'peritumor', alpha = 0.05)
  154. #%%
  155. #### Test to test whether activity in the FPN is higher or lower than in HCs ####
  156. def test_activity(df_patients, df_HCs_left, df_HCs_right,df_lateralization, area, activity, time):
  157. """
  158. Function to test for a difference in activity between the ipsilateral or contralateral and HC hemispheres.
  159. Always matches with the right lateralization (i.e. right ipsilateral matches with right HCs hemisphere).
  160. Uses the normal unpaired t-test when normality and equality of variances is confirmed. Uses the Welch test when the normality
  161. is assumed but variances are unequal. If normality is violated uses the Mann-Whitney U test.
  162. Parameters
  163. ----------
  164. df_patients : pd.DataFrame,
  165. dataframe containing all patient data
  166. df_HCs_left : pd.Dataframe,
  167. HC dataframe with only left FPN regions
  168. df_HCs_right : pd.DataFrame,
  169. HC dataframe with only right FPN regions
  170. df_lateralization : pd.DataFrame,
  171. dataframe contiaining info on tumor lateralization (left or right)
  172. area : str,
  173. ipsilateral or contralateral: do we compare the ipsilaeral or contralateral hemisphere to HCs?
  174. activity : str,
  175. offset_z or BB_welch_z: do we look at offset or bbp?
  176. time : str,
  177. baseline or FU, do we look at the baseline measurement or FU?
  178. Returns
  179. -------
  180. pd.DataFrame,
  181. results dataframe
  182. """
  183. df_lat = pd.merge(df_patients, df_lateralization, left_on = "sub", right_on = "Case_ID")
  184. right_tumor = df_lat['lateralization'] == 'right'
  185. left_tumor = df_lat['lateralization'] == 'left'
  186. #filter for subjects that have a right/left tumor
  187. df_right = df_lat[right_tumor]
  188. df_left = df_lat[left_tumor]
  189. if area == 'ipsilateral':
  190. ### Statistical tests ###
  191. ### Right ipsilateral vs. Right FPN HCs
  192. results_df_right = ind_ttest(df_right, df_HCs_right,area, activity, 'right_ipsi (i.e. right tumor hemisphere)' )
  193. ### Left ipsilateral vs. Left FPN HCs
  194. results_df_left = ind_ttest(df_left, df_HCs_left, area, activity, 'left_ipsi (i.e. left tumor hemisphere)')
  195. #results_all = pd.concat([results_df_right,results_df_left])
  196. elif area == 'contralateral':
  197. ### Statistical tests ###
  198. ### Right ipsilateral vs. Right FPN HCs
  199. results_df_right= ind_ttest(df_right, df_HCs_left,area, activity, 'right_contra (i.e. left non-tumor hemisphere)' )
  200. ### Left ipsilateral vs. Left FPN HCs
  201. results_df_left = ind_ttest(df_left, df_HCs_right,area, activity, 'left contra (i.e. right non-tumor hemisphere)')
  202. #results_all = pd.concat([results_df_right,results_df_left])
  203. #results_all.to_csv(f'/data/anw/anw-work/MULTINET/m.zimmermann/01_projects/2023_activity_EF/02_analysis/04_results/test_against_HCs_{activity}_{area}_{time}.csv')
  204. #return(results_all)
  205. #%%
  206. def ind_ttest(df_pat, df_HCs, area, activity, lateralization):
  207. """
  208. Function to test for differences with the correct test (after checking the assumptions of the data).
  209. Used in function test_activity.
  210. Parameters
  211. ----------
  212. df_pat : pd.DataFrame
  213. dataframe containing patient data.
  214. df_HCs : pd.DataFrame,
  215. dataframe containing HCs data.
  216. area : str,
  217. ipsilateral or contralateral
  218. activity : str,
  219. offset_z or BB_welch_z
  220. lateralization : str,
  221. indicates which area of patients is tested against HCs
  222. Returns
  223. -------
  224. None.
  225. """
  226. results_df = pd.DataFrame(columns= ['Area', 'activity', 'Lateralization', 'Test', 'T-value', 'pvalue'])
  227. ### Caclculate mean and std of patients and HCs ###
  228. mean_pat = df_pat[activity].mean()
  229. std_pat = df_pat[activity].std()
  230. mean_HC = df_HCs[activity].mean()
  231. std_HC = df_HCs[activity].std()
  232. #testing normality of data
  233. stat_pat, p_pat = stats.shapiro(df_pat[activity])
  234. stat_HCs, p_HCs = stats.shapiro(df_HCs[activity])
  235. if (p_pat <0.05) or (p_HCs<0.05):
  236. print('Assumption of normality violated: Doing Mann Whitney U test')
  237. results = stats.mannwhitneyu(df_pat[activity], df_HCs[activity])
  238. print(results)
  239. else:
  240. print('Assumption of normality not violated: testing for unequal variances now')
  241. #Testing for equal variances of the two samples (with unequal sample size)
  242. res = stats.levene(df_pat[activity], df_HCs[activity])
  243. if res.pvalue >0.5:
  244. print('Samples have equal variances, doing normal t-test')
  245. results = stats.ttest_ind(a=df_pat[activity], b=df_HCs[activity], equal_var=True)
  246. print(results)
  247. else:
  248. print('Samples have unequal variances, doing Welchs test')
  249. results = stats.ttest_ind(a=df_pat[activity], b=df_HCs[activity], equal_var=False)
  250. print(results)
  251. #%%
  252. ### Testing activity against HCs ###
  253. ### Offset_z
  254. #Baseline
  255. test_activity(df_ipsi_averaged, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'offset_z', 'baseline')
  256. test_activity(df_contra_averaged, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'offset_z', 'baseline')
  257. #%%
  258. #FU
  259. test_activity(df_ipsi_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'offset_z', 'FU')
  260. test_activity(df_contra_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'offset_z', 'FU')
  261. ### BBP
  262. #Baseline
  263. test_activity(df_ipsi_averaged, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'BB_welch_z', 'baseline')
  264. test_activity(df_contra_averaged, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'BB_welch_z', 'baseline')
  265. #FU
  266. test_activity(df_ipsi_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'BB_welch_z', 'FU')
  267. test_activity(df_contra_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'BB_welch_z', 'FU')
  268. #%%
  269. ####################
  270. # --- Linear regressions --- # --> Multiple Linear Regression
  271. ####################
  272. ####################
  273. ### 1) to test relationship Activity vs EF (T1) ###
  274. ####################
  275. def run_multiple_linear_regression(df_activity, df_ef, EF_Score, area, output_dir, covariates=[]):
  276. """
  277. Parameters:
  278. df_activity: pandas.DataFrame,
  279. the dataframe containing the activity_metrics (bbp and offset)
  280. df_ef: pandas.DataFrame,
  281. the dataframe containing the patient characteristics (EF scores and covariates)
  282. EF_Score: str,
  283. the column name in df representing the dependent variable (i.e. EF Z scores: either CST or WFT)
  284. area: str,
  285. determines the area that is being investigated (i.e. preitumoral, ipsilateral FPN, contralateral FPN)
  286. output_dir: str,
  287. path to directory where results should be stored
  288. covariates: list of str,
  289. a list of column names in df representing the covariates (default: [])
  290. """
  291. li = []
  292. for activity_metrics in ["BB_welch_z", "offset_z"]:
  293. # Merge the two dataframes based on sub_ID
  294. merge_df = pd.merge(df_activity, df_ef, left_on='sub', right_on='Case_ID')
  295. print(merge_df.shape)
  296. print(len(np.unique(merge_df["sub"])))
  297. assert all(merge_df["sub"] == merge_df["Case_ID"])
  298. #In case EF_Score = CST is analzyed --> remove sub-xxx and sub-xxx from DF
  299. if EF_Score == "cstc_corrected_1_Zscore":
  300. merge_df.drop(merge_df[(merge_df["sub"] == "sub-xxx")|(merge_df["sub"] == "sub-0087")].index, inplace = True)
  301. merge_df.reset_index(inplace = True)
  302. #Check to see if correct participant was excluded
  303. print(merge_df["sub"])
  304. print(merge_df["Case_ID"])
  305. else:
  306. #Check to see if correct participant are still included for WFT
  307. print(merge_df["sub"])
  308. print(merge_df["Case_ID"])
  309. # Define the dependent variable (outcome) and independent variables
  310. X_cols = [activity_metrics] + covariates
  311. print(X_cols)
  312. X = merge_df[X_cols]
  313. y = merge_df[EF_Score]
  314. #Check if X inludes corect columns
  315. print(X)
  316. #Check if Y inludes corect columns
  317. print(y)
  318. # Add a constant term to the independent variables
  319. X = sm.add_constant(X)
  320. # Create a multiple linear regression model
  321. model = sm.OLS(y, X)
  322. # Fit the model to the data
  323. results = model.fit()
  324. # Print the regression coefficients and other results
  325. print(f"Results for {activity_metrics} vs {EF_Score} in {area}:")
  326. print (results.summary())
  327. ### --- Testing Assumption of Multiple Linear Regression --- ###
  328. print ('--- Testing Assumptions of Multiple Linear Regression ---')
  329. #Extract the independent variables (IV) only
  330. X_IV = X.drop(columns=['const'])
  331. print(X_IV.head())
  332. # 1) Linear Relationship (between Indepentent and target variables)
  333. print('1) Testing for Linear Relationship: See Graphs')
  334. for IVs in X_IV.columns:
  335. plt.scatter(X[IVs], y)
  336. plt.xlabel(IVs)
  337. plt.ylabel(EF_Score)
  338. plt.title(f"Scatter Plot of {IVs} vs {EF_Score}")
  339. plt.show()
  340. # 2) No Multicollinearity
  341. print ('2) Testing for Multicollinearity')
  342. #Caculate the correlation matrix
  343. corr_matrix = X_IV.corr()
  344. print(corr_matrix)
  345. # Check for variables with high correlation coefficients
  346. high_corr = set()
  347. for i in range(len(corr_matrix.columns)):
  348. for j in range(i):
  349. if abs(corr_matrix.iloc[i, j])> 0.7:
  350. colname = corr_matrix.columns[i]
  351. high_corr.add(colname)
  352. print("Variables with high correlation coefficients:", high_corr)
  353. #Calculate VIF scores for each independent variable (IVs)
  354. vif_scores = pd.DataFrame()
  355. vif_scores["feature"] = X_IV.columns
  356. vif_scores["VIF"] = [variance_inflation_factor(X_IV.values, i) for i in range(X_IV.shape[1])]
  357. print(vif_scores)
  358. #3) Homoscedasticity - constant variance
  359. print ("3) Testing Homoscedasticity: See Graph")
  360. residuals = results.resid
  361. fitted_vals=results.predict(X)
  362. plt.scatter(fitted_vals, residuals)
  363. plt.xlabel('Fitted Values')
  364. plt.ylabel('Residuals')
  365. plt.title("Scatter Plot to test Homoscedasticity")
  366. plt.show()
  367. name = ['Lagranage multiplier statistic', 'p-value', 'f-value', 'f p-value']
  368. test = sms.het_breuschpagan(results.resid, results.model.exog)
  369. print(lzip(name, test))
  370. #4) No Autocorrelation of errors
  371. print ("4) Testing Autocorrelation of errors: See Graph")
  372. plt.plot(residuals.index, residuals)
  373. plt.title("Plot to test Autocorrelation of errors")
  374. plt.show()
  375. #5) Residual Normality
  376. print("5) Testing Residual Normality: See Graph")
  377. sns.distplot(residuals).set(title ="Residual plot: Testing Normality")
  378. print('residual mean:')
  379. print(np.mean(residuals))
  380. stat, p = stats.shapiro(results.resid)
  381. print('Shapiro test:')
  382. print(stat, p)
  383. #6) Checking for outliers
  384. print("6) Checking for Residual relation with independent variables/ outliers: See Graph")
  385. fig, axs = plt.subplots(ncols=X_IV.shape[1], figsize=(15, 5))
  386. for i, col in enumerate (X_IV.columns):
  387. axs[i].scatter(X_IV[col], results.resid)
  388. axs[i].set_xlabel(col)
  389. axs[i].set_ylabel("Residuals")
  390. plt.title("Checking for outliers")
  391. plt.show()
  392. #or
  393. residuals =results.resid
  394. sm.qqplot(residuals, line='s')
  395. plt.title('Residuals Q-Q')
  396. plt.show()
  397. #Calculate Cook's distance values
  398. influence = results.get_influence()
  399. cooks = influence.cooks_distance[0]
  400. #Plot the Cook's distance values against the obersvation numbers
  401. plt.plot(cooks, 'o')
  402. plt.xlabel('Observation number')
  403. plt.ylabel("Cook's distance")
  404. plt.title("Observation number vs Cook's distance")
  405. plt.show()
  406. #Identify influential observations
  407. # n= len(y)
  408. # threshold = 4/n
  409. # influential_observations = np.where(cooks >= threshold)[0]
  410. # print('Influential observations:', influential_observations)
  411. print("--- Testing Assumptions of Multiple Linear Regression Completed --- ")
  412. # get the summary table of the results
  413. table1 = results.summary2().tables[0]
  414. table2 = results.summary2().tables[1]
  415. table2.reset_index(inplace=True)
  416. summary_df = pd.concat([table1, table2], axis=1)
  417. summary_df = summary_df.reset_index()
  418. #Append results to the dataframe
  419. li.append(summary_df)
  420. results_df = pd.concat(li, axis=0)
  421. # Save the dataframe to CSV
  422. #results_df.to_csv(f'{output_dir}linear_regression_baseline_{area}_{EF_Score}_20250701.csv')
  423. #return(results_df)
  424. #%%
  425. ###############################
  426. ### Patient linear regression_baseline analysis ###
  427. ###############################
  428. output_dir = '/path/to/outputdir/'
  429. #Peritumoral
  430. #CST
  431. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  432. run_multiple_linear_regression(df_peri_averaged, patient_info, 'cstc_corrected_1_Zscore', 'peritumoral', output_dir, covariates=["Dummy_frontal_or_not_20250627_final", 'Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted',"epilepsy_dich.1"])
  433. #%%
  434. output_dir = '/path/to/outputdir'
  435. #WFT
  436. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  437. run_multiple_linear_regression(df_peri_averaged, patient_info, 'flu_dier_corrected_1_Zscore', 'peritumoral', output_dir, covariates=["Dummy_frontal_or_not_20250627_final", 'Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted'])
  438. #%%
  439. #Ipsilateral FPN
  440. #CST
  441. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  442. run_multiple_linear_regression(df_ipsi_averaged, patient_info, 'cstc_corrected_1_Zscore', 'ipsilateral', output_dir, covariates =["Dummy_frontal_or_not_20250627_final", 'Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted', "epilepsy_dich.1"])
  443. #%%
  444. #WFT
  445. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  446. run_multiple_linear_regression(df_ipsi_averaged, patient_info, 'flu_dier_corrected_1_Zscore', 'ipsilateral', output_dir, covariates=["Dummy_frontal_or_not_20250627_final", 'Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted'])
  447. #%%
  448. #Contralateral FPN
  449. #CST#
  450. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  451. run_multiple_linear_regression(df_contra_averaged, patient_info, 'cstc_corrected_1_Zscore', 'contralateral', output_dir, covariates=["Dummy_frontal_or_not_20250627_final", 'Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted', "epilepsy_dich.1"])
  452. #%%
  453. #WFT
  454. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  455. run_multiple_linear_regression(df_contra_averaged, patient_info, 'flu_dier_corrected_1_Zscore', 'contralateral', output_dir, covariates=["Dummy_frontal_or_not_20250627_final", 'Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted'])
  456. #%%
  457. ####################
  458. ### 2) to test relationship Activity vs EF (longitudinally) ###
  459. ####################
  460. def run_delta_regression(df_activity, df_ef, EF_Score, area, output_dir, covariates=[]):
  461. """
  462. Parameters:
  463. df_activity: pandas.DataFrame,
  464. the dataframe containing the activity_metrics (bbp and offset) for both timepoints (baseline and FU)
  465. df_ef: pandas.DataFrame,
  466. the dataframe containing the patient characteristics (EF scores and covariates)
  467. EF_Score: str,
  468. the column name in df representing the dependent variable (i.e. EF Z scores: either CST or WFT)
  469. area: str,
  470. determines the area that is being investigated (i.e. preitumoral, ipsilateral FPN, contralateral FPN)
  471. output_dir: str,
  472. path to directory where results should be stored
  473. covariates: list of str,
  474. a list of column names in df representing the covariates (default: [])
  475. """
  476. li = []
  477. for activity_metrics in ["BB_welch_z", "offset_z"]:
  478. # Merge the two dataframes based on sub_ID
  479. merge_df = pd.merge(df_activity, df_ef, left_on='sub', right_on='Case_ID')
  480. print(merge_df.shape)
  481. print(len(np.unique(merge_df["sub"])))
  482. print(len(np.unique(merge_df["Case_ID"])))
  483. #In case EF_Score = CST is analzyed --> remove sub-xxx and sub-xxx from DF
  484. if EF_Score == "cstc_corrected":
  485. merge_df.drop(merge_df[(merge_df["sub"] == "sub-xxx")|(merge_df["sub"] == "sub-xxx")].index, inplace = True)
  486. merge_df.reset_index(inplace = True)
  487. #Check to see if correct participant was excluded
  488. print(merge_df["sub"])
  489. print(merge_df["Case_ID"])
  490. #In case EF_Score = WFT is analyzed --> remove sub-xxx from DF
  491. else:
  492. #Check to see if correct participant are still included for WFT
  493. merge_df.drop(merge_df[(merge_df["sub"] == "sub-xxx")].index, inplace = True)
  494. merge_df.reset_index(inplace = True)
  495. #Check to see if correct participant was excluded
  496. print(merge_df["sub"])
  497. print(merge_df["Case_ID"])
  498. #Remove patients from DF that have progression before FU
  499. prog_filt = merge_df["progression_before_FU"] == 1
  500. merge_df = merge_df[~prog_filt]
  501. merge_df.reset_index(inplace = True)
  502. #Check to see if correct participants and correct columns are included in the final version
  503. print(merge_df["sub"])
  504. print(merge_df.columns)
  505. # Calculate delta values
  506. merge_df[f'delta_{activity_metrics}'] = merge_df[activity_metrics + '_T2'] - merge_df[activity_metrics + '_T1']
  507. merge_df[f'delta_{EF_Score}']= merge_df[EF_Score + "_2_Zscore"] - merge_df[EF_Score + "_1_Zscore"]
  508. print(merge_df[f'delta_{EF_Score}'])
  509. # Define the dependent variable (outcome) and independent variables
  510. if len(covariates) > 0:
  511. X = pd.concat([merge_df[f'delta_{activity_metrics}'], merge_df[covariates]], axis=1)
  512. else:
  513. X = merge_df[f'delta_{activity_metrics}']
  514. print(X)
  515. Y = merge_df[f'delta_{EF_Score}']
  516. print(Y)
  517. #Add a constant term to the independent variables
  518. X = sm.add_constant(X)
  519. # Create a multiple linear regression model
  520. model = sm.OLS(Y, X)
  521. #Fit the model to the data
  522. results = model.fit()
  523. # Print the regression coefficients and other results
  524. print(f"Results for delta {activity_metrics} vs delta {EF_Score} in {area}:")
  525. print (results.summary())
  526. ### --- Testing Assumption of Multiple Linear Regression --- ###
  527. print ('--- Testing Assumptions of Multiple Linear Regression ---')
  528. #Extract the independent variables (IV) only
  529. X_IV = X.drop(columns=['const'])
  530. print(X_IV.head())
  531. # 1) Linear Relationship (between Indepentent and target variables)
  532. print('1) Testing for Linear Relationship: See Graphs')
  533. for IVs in X_IV.columns:
  534. plt.scatter(X[IVs], Y)
  535. plt.xlabel(IVs)
  536. plt.ylabel(EF_Score)
  537. plt.title(f"Scatter Plot of {IVs} vs {EF_Score}")
  538. plt.show()
  539. # 2) No Multicollinearity
  540. print ('2) Testing for Multicollinearity')
  541. #Caculate the correlation matrix
  542. corr_matrix = X_IV.corr()
  543. print(corr_matrix)
  544. # Check for variables with high correlation coefficients
  545. high_corr = set()
  546. for i in range(len(corr_matrix.columns)):
  547. for j in range(i):
  548. if abs(corr_matrix.iloc[i, j])> 0.7:
  549. colname = corr_matrix.columns[i]
  550. high_corr.add(colname)
  551. print("Variables with high correlation coefficients:", high_corr)
  552. #Calculate VIF scores for each independent variable (IVs)
  553. vif_scores = pd.DataFrame()
  554. vif_scores["feature"] = X_IV.columns
  555. vif_scores["VIF"] = [variance_inflation_factor(X_IV.values, i) for i in range(X_IV.shape[1])]
  556. print(vif_scores)
  557. #3) Homoscedasticity - constant variance
  558. print ("3) Testing Homoscedasticity: See Graph")
  559. residuals = results.resid
  560. fitted_vals=results.predict(X)
  561. plt.scatter(fitted_vals, residuals)
  562. plt.xlabel('Fitted Values')
  563. plt.ylabel('Residuals')
  564. plt.plot(Y, [0]*len(Y))
  565. plt.title("Scatter Plot to test Homoscedasticity")
  566. plt.show()
  567. name = ['Lagranage multiplier statistic', 'p-value', 'f-value', 'f p-value']
  568. test = sms.het_breuschpagan(results.resid, results.model.exog)
  569. print(lzip(name, test))
  570. #4) No Autocorrelation of errors
  571. print ("4) Testing Autocorrelation of errors: See Grahp")
  572. plt.plot(residuals.index, residuals)
  573. plt.title("Plot to test Autocorrelation of errors")
  574. plt.show()
  575. #5) Residual Normality
  576. print("5) Testing Residual Normality: See Graph")
  577. sns.distplot(residuals).set(title ="Residual plot: Testing Normality")
  578. print('residual mean:')
  579. #print(np.mean(residuals))
  580. stat, p = stats.shapiro(results.resid)
  581. print('Shapiro test:')
  582. print(stat, p)
  583. #6) Checking for outliers
  584. print("6) Checking for Residual relation with independent variables/ outliers: See Graph")
  585. fig, axs = plt.subplots(ncols=X_IV.shape[1], figsize=(15, 5))
  586. for i, col in enumerate (X_IV.columns):
  587. axs[i].scatter(X_IV[col], results.resid)
  588. axs[i].set_xlabel(col)
  589. axs[i].set_ylabel("Residuals")
  590. plt.title("Checking for outliers")
  591. plt.show()
  592. #or
  593. residuals =results.resid
  594. sm.qqplot(residuals, line='s')
  595. plt.title('Residuals Q-Q')
  596. plt.show()
  597. print("--- Testing Assumptions of Multiple Linear Regression Completed --- ")
  598. # get the summary table of the results
  599. table1 = results.summary2().tables[0]
  600. table2 = results.summary2().tables[1]
  601. table2.reset_index(inplace=True)
  602. summary_df = pd.concat([table1, table2], axis=1)
  603. summary_df = summary_df.reset_index()
  604. #Append results to the dataframe
  605. li.append(summary_df)
  606. results_delta_df = pd.concat(li, axis=0)
  607. # Save the dataframe to CSV
  608. results_delta_df.to_csv(f'{output_dir}/linear_regression_delta_scores_{area}_{EF_Score}_20250701.csv')
  609. #return(results_delta_df)
  610. #%%
  611. ###############################
  612. ### Patient linear regression_delta_scores analysis ###
  613. ###############################
  614. output_dir = "/path/to/outputdir/"
  615. #Peritumoral
  616. #CST
  617. run_delta_regression(df_peri_combined, patient_info, 'cstc_corrected', 'peritumoral', output_dir, covariates=['Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted',"Dummy_CT_during_FU", "Interval_surgery_NPA"])
  618. #%%
  619. #WFT
  620. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  621. run_delta_regression(df_peri_combined, patient_info, 'flu_dier_corrected', 'peritumoral', output_dir, covariates=['Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted','Syntax_dummy_only_RTH', 'Syntax_dummy_RTHandXT'])
  622. #%%
  623. output_dir = "/path/to/output_dir/"
  624. #Ipsilateral FPN
  625. #CST
  626. run_delta_regression(df_ipsi_combined, patient_info, 'cstc_corrected', 'ipsilateral', output_dir, covariates=['Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted',"Dummy_CT_during_FU", "Interval_surgery_NPA"])
  627. #%%
  628. #WFT
  629. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  630. run_delta_regression(df_ipsi_combined, patient_info, 'flu_dier_corrected', 'ipsilateral', output_dir, covariates=['Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted','Syntax_dummy_only_RTH', 'Syntax_dummy_RTHandXT'])
  631. #%%
  632. #Contralateral FPN
  633. output_dir = "/path/to/outputdir/"
  634. #CST
  635. run_delta_regression(df_contra_combined, patient_info, 'cstc_corrected', 'contralateral', output_dir, covariates=['Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted',"Dummy_CT_during_FU", "Interval_surgery_NPA"])
  636. #%%
  637. #WFT
  638. #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
  639. run_delta_regression(df_contra_combined, patient_info, 'flu_dier_corrected', 'contralateral', output_dir, covariates=['Dummy_IDH_WT', 'Dummy_IDHmut_noncodeleted','Syntax_dummy_only_RTH', 'Syntax_dummy_RTHandXT'])
  640. #%%
  641. ####################
  642. ### 3) to test relationship Activity vs EF in HCs ###
  643. ####################
  644. def run_HC_linear_regression(df_activity, df_ef, EF_Score, area, output_dir, covariates=[]):
  645. """
  646. Parameters:
  647. df_activity: pandas.DataFrame,
  648. the dataframe containing the activity_metrics (bbp and offset)
  649. df_ef: pandas.DataFrame,
  650. the dataframe containing the patient characteristics (EF scores and covariates)
  651. EF_Score: str,
  652. the column name in df representing the dependent variable (i.e. EF Z scores: either CST or WFT)
  653. area: str,
  654. determines the area that is being investigated (i.e. left or right FPN)
  655. output_dir: str,
  656. path to directory where results should be stored
  657. covariates: list of str,
  658. a list of column names in df_ef representing the covariates (default: [])
  659. """
  660. li = []
  661. for activity_metrics in ["BB_welch_z", "offset_z"]:
  662. # Merge the two dataframes based on sub_ID
  663. merged_df = pd.merge(df_activity, df_ef, on='sub')
  664. print(merged_df.head)
  665. print(merged_df[[activity_metrics, EF_Score]])
  666. # Define the dependent variable (outcome) and independent variables
  667. X_cols = [activity_metrics] + covariates
  668. X = merged_df[X_cols]
  669. y = merged_df[EF_Score]
  670. #Check if X inludes corect columns
  671. print(X)
  672. #Check if Y inludes corect columns
  673. print(y)
  674. # Add a constant term to the independent variables
  675. X = sm.add_constant(X)
  676. # Create a multiple linear regression model
  677. model = sm.OLS(y, X)
  678. # Fit the model to the data
  679. results = model.fit()
  680. # Print the regression coefficients and other results
  681. print(f"Results for {activity_metrics} vs {EF_Score} in {area}:")
  682. print (results.summary())
  683. ### --- Creating Graphs --- ###
  684. sns.lmplot(x=X.columns[1], y=EF_Score, data=merged_df, scatter_kws={'alpha':0.5})
  685. plt.title(f'for HCs: {activity_metrics} vs. {EF_Score}_in {area}')
  686. plt.axhline(y= -1.5, linestyle ='--', color ='grey')
  687. # plt.savefig(f'/data/anw/anw-work/MULTINET/culrich/03_analysis/05_Graphs/04_HC_Linear_Regression/Plot of {activity_metrics} vs {EF_Score} in HCs in {area}".png', bbox_inches = "tight")
  688. plt.show()
  689. ### --- Testing Assumption of Multiple Linear Regression --- ###
  690. print ('--- Testing Assumptions of inear Regression ---')
  691. #Extract the independent variables (IV) only
  692. X_IV = X.drop(columns=['const'])
  693. print(X_IV.head())
  694. # 1) Linear Relationship (between Indepentent and target variables)
  695. print('1) Testing for Linear Relationship: See Graphs')
  696. for IVs in X_IV.columns:
  697. plt.scatter(X[IVs], y)
  698. plt.xlabel(IVs)
  699. plt.ylabel(EF_Score)
  700. plt.title(f"Scatter Plot of {IVs} vs {EF_Score}")
  701. plt.show()
  702. #2) Homoscedasticity - constant variance
  703. print ("2) Testing Homoscedasticity: See Graph")
  704. residuals = results.resid
  705. fitted_vals=results.predict(X)
  706. plt.scatter(fitted_vals, residuals)
  707. plt.xlabel('Fitted Values')
  708. plt.ylabel('Residuals')
  709. plt.plot(y, [0]*len(y))
  710. plt.title("Scatter Plot to test Homoscedasticity")
  711. plt.show()
  712. name = ['Lagranage multiplier statistic', 'p-value', 'f-value', 'f p-value']
  713. test = sms.het_breuschpagan(results.resid, results.model.exog)
  714. print(lzip(name, test))
  715. #3) Independence of observations
  716. #create plot of the residuals against the independent variable
  717. print('3) Testing for Independence: See Graphs')
  718. for IVs in X_IV.columns:
  719. plt.scatter(X[IVs], residuals)
  720. plt.xlabel(IVs)
  721. plt.ylabel('residuals')
  722. plt.title(f"Scatter Plot of {IVs} vs residuals")
  723. plt.show()
  724. #4) No Autocorrelation of errors
  725. print ("4) Testing Autocorrelation of errors: See Grahp")
  726. plt.plot(residuals.index, residuals)
  727. plt.title("Plot to test Autocorrelation of errors")
  728. plt.show()
  729. #5) Residual Normality
  730. print("5) Testing Residual Normality: See Graph")
  731. sns.distplot(residuals).set(title ="Residual plot: Testing Normality")
  732. print('residual mean:')
  733. print(np.mean(residuals))
  734. stat, p = stats.shapiro(results.resid)
  735. print('Shapiro test:')
  736. print(stat, p)
  737. #6) Checking for outliers
  738. print("6) Checking for outliers: See Graph")
  739. residuals =results.resid
  740. sm.qqplot(residuals, line='s')
  741. plt.title('Residuals Q-Q')
  742. plt.show()
  743. print("--- Testing Assumptions of Linear Regression Completed --- ")
  744. # get the summary table of the results
  745. table1 = results.summary2().tables[0]
  746. table2 = results.summary2().tables[1]
  747. table2.reset_index(inplace=True)
  748. summary_df = pd.concat([table1, table2], axis=1)
  749. summary_df = summary_df.reset_index()
  750. li.append(summary_df)
  751. results_HC_df = pd.concat(li, axis=0)
  752. # Save the dataframe to CSV
  753. results_HC_df.to_csv(output_dir + f'/linear_regression_HC_{area}_{EF_Score}.csv')
  754. #return(results_HC_df)
  755. #%%
  756. ###############################
  757. ### HC linear regression_baseline analysis ###
  758. ###############################
  759. output_dir = '/path/to/output_dir/'
  760. #Left Hemisphere FPN
  761. #CST
  762. run_HC_linear_regression(df_HC_Left, HC_info, 'CST_Zscore_shifting', 'left_FPN', output_dir, covariates=[])
  763. #WFT
  764. run_HC_linear_regression(df_HC_Left, HC_info, 'AnimalFluency_Zscore', 'left_FPN', output_dir, covariates=[])
  765. #Rigt Hemisphere FPN
  766. #CST
  767. run_HC_linear_regression(df_HC_Right, HC_info, 'CST_Zscore_shifting', 'right_FPN', output_dir, covariates=[])
  768. #WFT
  769. run_HC_linear_regression(df_HC_Right, HC_info, 'AnimalFluency_Zscore', 'right_FPN', output_dir, covariates=[])

statistics.py at commit 704ca7e, under MIT · at the source

Overview

Authors: Sophie MDD Fitzsimmons1,2, Coen Coomans1,2, Lucas Breedt2, Neeltje M Batelaan1,2,3,4, Ysbrand D van der Werf2,5, Odile A van den Heuvel1,2,5, Linda Douw2, Chris Vriend1,2,5
  1. Amsterdam UMC, Vrije Universiteit Amsterdam, Department of Psychiatry, de Boelelaan 1117, Amsterdam, the Netherlands
  2. Amsterdam UMC, Vrije Universiteit Amsterdam, Department of Anatomy & Neurosciences, de Boelelaan 1117, Amsterdam, the Netherlands
  3. Amsterdam Public Health, Amsterdam, the Netherlands
  4. GGZ inGeest, Amsterdam, the Netherlands
  5. Amsterdam Neuroscience, Compulsivity, Impulsivity & Attention program, Amsterdam, the Netherlands
Institutions: Amsterdam University Medical Centers (Netherlands); Vrije Universiteit Amsterdam (Netherlands); Amsterdam Public Health (Netherlands); GGZ inGeest (Netherlands); Amsterdam Neuroscience (Netherlands)
Journal: NeuroImage. Clinical, volume 50, article 104012
Dates: received 5 December 2025; accepted 25 May 2026; published online 26 May 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1016/j.nicl.2026.104012 · PMID 42217473 · PMCID PMC13241641 · OpenAlex W7162471095
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), fMRI (modality), other (modality), human (organism), other condition (population)
Methods: Spectral & time-frequency, Statistics, Smoothing, state filtering, decompositions, Evoked potentials, Connectivity, Graphs, fMRI & imaging
Keywords: Repetitive transcranial magnetic stimulation, Obsessive–compulsive disorder, Graph analysis, Multilayer networks, Functional MRI, Diffusion MRI
MeSH: Brain*, Nerve Net*, Obsessive-Compulsive Disorder*, Psychotherapy*, Transcranial Magnetic Stimulation*, Adult, Combined Modality Therapy, Dorsolateral Prefrontal Cortex, Female, Humans, Magnetic Resonance Imaging, Male, Middle Aged, Treatment Outcome, Young Adult (* major topic)
Topic: Transcranial Magnetic Stimulation Studies (Neurology, Neuroscience), according to OpenAlex
Funding: Dutch Research Council (NWO) (016.176.306, 198.015); ZonMw
Citations: not cited yet (Europe PMC); 61 references in the paper

Abstract

Background: Repetitive transcranial magnetic stimulation (rTMS) is a promising treatment for obsessive–compulsive disorder (OCD), but response rates are variable. Pre-treatment characteristics of the stimulated region can influence rTMS outcome.

Objective/hypothesis: We investigated the relationship between network features of the rTMS stimulation location and treatment outcome in a randomised trial of rTMS combined with exposure and response prevention psychotherapy (ERP) for OCD, using graph analysis of single-layer functional and structural brain networks, and of structural–functional multilayer networks.

Methods: We analysed data from 58 treatment-refractory adult OCD patients. Participants received either: high frequency (HF) rTMS to the left dorsolateral prefrontal cortex (DLPFC) (n = 19); HF rTMS to the left pre-supplementary motor area (preSMA) (n = 21); or control rTMS to the vertex (n = 18), all combined with ERP. We used pre-treatment resting state functional MRI (rs-fMRI) and diffusion MRI (dMRI) scans to construct single-layer and structural–functional multilayer networks for each participant. We computed various centrality measures of the stimulated location and subnetwork, and examined their relationship with treatment outcome.

Results: We found no associations between functional/structural single-layer network characteristics and treatment outcome. However, higher average multilayer betweenness centrality of the stimulated subnetwork in the DLPFC rTMS group (but not in the preSMA/vertex groups) was associated with symptom reduction (p = 0.013).

Conclusions: Participants with greater integration of the stimulated subnetwork with the rest of the structural–functional network showed greater improvement following DLPFC rTMS-ERP. Our exploratory results give a preliminary indication of the importance of the interplay between structural and functional networks for rTMS outcome.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.

multinetlab-amsterdam/projects

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 704ca7e4d769d5d77dc2a14aef0ad67ebaa2d765, 17 September 2026
Languages: Python (36), MATLAB (35), R (9), SPSS (2)
Size: 119 files, 82 scripts
Software Heritage: not archived
Found in: the text, “Graph analyses and network measure extraction”
Holds: license file, environment (activity_EF_projects_2024/requirements.txt, activity_network_project_2023/requirements.txt, glioblastoma_embedding_2026/requirements.txt), 4 notebooks
Not found: README, CITATION.cff, tests, continuous integration, documentation
Tools: pandas (35 files), NumPy (28 files), Matplotlib (21 files), seaborn (15 files), SciPy (13 files), tidyverse (9 files), statsmodels (7 files), Brain Connectivity Toolbox (6 files), Signal Processing Toolbox (6 files), scikit-learn (6 files), NiBabel (5 files), ggpubr (4 files), Statistics and Machine Learning Toolbox (4 files), rstatix (4 files), SHAP (4 files), car (3 files), ggplot2 (3 files), FreeSurfer (2 files), lme4 (2 files), NetworkX (2 files), nlme (2 files), SPM (2 files), afex (1 file), imbalanced-learn (1 file), lmerTest (1 file), Image Processing Toolbox (1 file), Pingouin (1 file), psych (1 file), reshape2 (1 file), survival (1 file), XGBoost (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
83 files

multinetlab-amsterdam/data_analysis

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: e8a057a5247b4a698792a3fedc7c9107cd08d781, 26 August 2022
Languages: Python (2)
Size: 5 files, 2 scripts
Software Heritage: archived
Found in: the text, “Graph analyses and network measure extraction”
Holds: license file
Not found: README, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (2 files), Matplotlib (1 file), pandas (1 file), SciPy (1 file), specparam (formerly FOOOF) (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
3 files

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 84 scripts, each with its path and the digest of its content;
  • 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

The authors do not have permission to share data.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 28 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 8 authors, 6 keywords, 15 MeSH terms, 2 funders, 59 references.

Cite

This paper

Fitzsimmons, S. M., Coomans, C., Breedt, L., Batelaan, N. M., van der Werf, Y. D., van den Heuvel, O. A., Douw, L., & Vriend, C. (2026). Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder. NeuroImage. Clinical, 50, 104012. https://doi.org/10.1016/j.nicl.2026.104012

BibTeX

@article{fitzsimmons2026structural,
author = {Fitzsimmons, Sophie MDD and Coomans, Coen and Breedt, Lucas and Batelaan, Neeltje M and van der Werf, Ysbrand D and van den Heuvel, Odile A and Douw, Linda and Vriend, Chris},
title = {{Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder}},
journal = {NeuroImage. Clinical},
year = {2026},
month = may,
volume = {50},
pages = {104012},
publisher = {Elsevier},
issn = {2213-1582},
doi = {10.1016/j.nicl.2026.104012},
url = {https://doi.org/10.1016/j.nicl.2026.104012},
pmid = {42217473},
pmcid = {PMC13241641}
}

RIS

TY - JOUR
AU - Fitzsimmons, Sophie MDD
AU - Coomans, Coen
AU - Breedt, Lucas
AU - Batelaan, Neeltje M
AU - van der Werf, Ysbrand D
AU - van den Heuvel, Odile A
AU - Douw, Linda
AU - Vriend, Chris
TI - Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder
T2 - NeuroImage. Clinical
J2 - Neuroimage Clin
PY - 2026
DA - 2026/05/26
VL - 50
SP - 104012
SN - 2213-1582
PB - Elsevier
DO - 10.1016/j.nicl.2026.104012
UR - https://doi.org/10.1016/j.nicl.2026.104012
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.nicl.2026.104012",
"type": "article-journal",
"title": "Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder",
"container-title": "NeuroImage. Clinical",
"author": [
{
"family": "Fitzsimmons",
"given": "Sophie MDD"
},
{
"family": "Coomans",
"given": "Coen"
},
{
"family": "Breedt",
"given": "Lucas"
},
{
"family": "Batelaan",
"given": "Neeltje M"
},
{
"family": "van der Werf",
"given": "Ysbrand D"
},
{
"family": "van den Heuvel",
"given": "Odile A"
},
{
"family": "Douw",
"given": "Linda"
},
{
"family": "Vriend",
"given": "Chris"
}
],
"container-title-short": "Neuroimage Clin",
"volume": "50",
"page": "104012",
"DOI": "10.1016/j.nicl.2026.104012",
"PMID": "42217473",
"PMCID": "PMC13241641",
"ISSN": "2213-1582",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.nicl.2026.104012",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
26
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: imbalanced-learn, survival, nlme, 18 other tools
[2] doi:10.7554/elife.103097 [code]
Canonical neurodevelopmental trajectories of structural and functional manifolds.
Journal: eLife
In common: Brain Connectivity Toolbox, Pingouin, reshape2, 10 other tools, structural MRI / diffusion, 10 references
[3] doi:10.1093/nc/niag029 [code]
A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.
Journal: Neuroscience of consciousness
In common: afex, Pingouin, car, 16 other tools, 2 references
[4] doi:10.1038/s41467-026-74565-0 [code]
The functional neurobiology of dispositions towards negative emotions.
Journal: Nature communications
In common: afex, Brain Connectivity Toolbox, nlme, 13 other tools, 1 reference
[5] doi:10.1162/imag.a.1245 [code]
Towards precision EEG connectomics: Evaluating the benefits of dense sampling.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Pingouin, psych, rstatix, 15 other tools, 1 reference
[6] doi:10.1038/s41597-026-07377-y [code]
An open-access multi-site fMRI dataset for investigating conscious visual perception.
Journal: Scientific data
In common: afex, Pingouin, car, 14 other tools, fMRI
[7] doi:10.1038/s41597-026-07350-9 [code]
An open multi-center MEG-EEG dataset for studying conscious visual perception.
Journal: Scientific data
In common: afex, Pingouin, car, 14 other tools, structural MRI / diffusion
[8] doi:10.1162/imag.a.105 [code]
Right posterior theta reflects human parahippocampal phase resetting by salient cues during goal-directed navigation
Journal: n/a
In common: Pingouin, psych, car, 14 other tools, fMRI
[9] doi:10.1038/s41593-026-02228-w [code]
Circuit response to neuromodulation characterized with simultaneous deep brain stimulation and precision neuroimaging in humans.
Journal: Nature neuroscience
In common: Pingouin, rstatix, FreeSurfer, 14 other tools, fMRI
[10] doi:10.1038/s42003-026-10276-y [code]
The cellular correlates and adolescent reorganisation of cortical myelination networks in the common marmoset.
Journal: Communications biology
In common: Brain Connectivity Toolbox, Pingouin, FreeSurfer, 13 other tools, structural MRI / diffusion, 1 reference

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.