Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.
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] § 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] § 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] § 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] § 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] § 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
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- Statistical analyses for the activity EF project
- This script contains all statistical analyses for the project on activity and executive functioning in glioma patients.
- """
- __author__ = "Christina Ulrich & Mona Zimmermann"
- __contact__ = "[email hidden]"
- __date__ = "23/05/23" ### Date it was created
- __status__ = "Final"
- ####################
- # Review History #
- ####################
- # Reviewed by
- ## Script for Statistical Analysis ##
- ####################
- # LIBRARIES #
- ####################
- # Standard imports ###
- import numpy as np
- import pandas as pd
- from scipy import stats
- from scipy.stats import shapiro, ttest_rel, wilcoxon
- import statsmodels.api as sm
- import os
- import pyreadstat
- import matplotlib.pyplot as plt
- from statsmodels.stats.outliers_influence import variance_inflation_factor
- from statsmodels.compat import lzip
- import statsmodels.stats.api as sms
- import seaborn as sns
- # Third party imports ###
- # Internal imports ###
- #%%
- ####################
- # DATAFRAME IMPORT #
- ####################
- #ATTENTION>>> to review this code it is easiest to first run the create_df_masks_overlaps.py
- #script ,for the patient data, and then use the created variables for the statistical analyses below.
- #For the healthy control data we can use the dataframes previously created by Christina, see below.
- #%%
- ### HCs Hemispheric FPN ###
- #HCs (N=25)
- df_HC_Left = pd.read_csv("/path/to/average_HC_Left_df.csv")
- df_HC_Right = pd.read_csv("/path/to/average_HC_Right_df.csv")
- ### HC Info (i.e. info on EF scores and covariates)
- HC_info = pd.read_csv('/path/to/HC_subject_info_after_matching.csv')
- #Prepare HC_info df to match other dfs
- HC_info.rename(columns = {"Case_ID": "sub"}, inplace = True)
- HC_info['sub'] = HC_info['sub'].astype(int).astype(str)
- HC_info['sub'] = HC_info['sub'].str.replace('110+', '') #edit sub_ID (remove leading 110)
- HC_info['sub'] = HC_info['sub'].astype(int) #change sub back into int to match other dfs
- ### Dataframe with all HC data (left and right FPN) ###
- HCs_std = pd.read_csv("/path/to/df_activity_standardized_HC.csv") #all regions
- #%%
- #%%
- ### Patient info and EF scores ###
- patient_info = pyreadstat.read_sav("/path/to/info/file/.sav")[0]
- patient_info['Case_ID'] = 'sub-' + patient_info['Case_ID'].astype(int).astype(str).str.zfill(4)
- # Rename colums of EF_score in patient_info file so that both CST and WFT names match"
- patient_info.rename(columns = {'flu_dier_corrected_1_zscore' : 'flu_dier_corrected_1_Zscore',
- 'flu_dier_corrected_2_zscore' : 'flu_dier_corrected_2_Zscore' }, inplace = True )
- ### Lateralization
- li_subs = pd.read_csv("/path/to/all_subs_list.csv")
- #%%
- ####################
- # --- ttest to analyze changes in activity (T1-->T2) --- #
- ####################
- def paired_ttest (df_combined, activity_metrics, area, alpha = 0.05 ):
- '''
- Paramters
- ---------
- df_combined : pd.DataFrame,
- dataframe containing data on activityfor both baseline and FU
- activity_metrics: str,
- activity that should be investigated (i.e. bbp or offset)
- area: str,
- determines the area that is being investigated (i.e. peritumoral, ipislateral FPN, contralateral FPN)
- alpha : float
- set to 0.05
- '''
- #Remove patients from DFs that have progression before FU
- #filter patient_info df based on progression before FU
- patient_info_filtered = patient_info[patient_info['progression_before_FU'] == 2]
- print(patient_info_filtered.shape)
- print(len(patient_info[patient_info['progression_before_FU'] == 1]))
- df_combined_filt = df_combined[df_combined['sub'].isin(patient_info_filtered['Case_ID'])]
- print(df_combined_filt)
- # calculate differences between the paired T1 and T2 measurements
- differences = df_combined_filt[f"{activity_metrics}_T2"] - df_combined_filt[f"{activity_metrics}_T1"]
- #testing normality of differnces
- stat, p = stats.shapiro(differences)
- if p > alpha: # null hypothesis (differences has a normal distribution), use paried t-test
- print ("The null hypothesis cannot be rejected --> x has normal distribution")
- print ("Use paired t-test")
- #stat_t, p_t = stats.ttest_rel(df_baseline_filtered[activity_metrics], df_FU_filtered[activity_metrics])
- stat_t, p_t = stats.ttest_rel(df_combined_filt[f"{activity_metrics}_T1"], df_combined_filt[f"{activity_metrics}_T2"])
- if p_t < alpha:
- print('Paired t-test: Reject H0 --> there is a significant difference')
- else:
- print ('Paired t-test: Fail to reject H0 --> there is no significant difference')
- print ('T1 vs T2 t = ', str(round(stat_t, 2)), ' p_t = ', str(round(p_t, 4)))
- else: # Differences are not normally distributed, use Wilcoxon signed rank test
- print ("The null hypothesis can be rejected --> x is not normally distributed")
- print ("Use Wilcoxon signed-rank test")
- #stat_w, p_w = stats.wilcoxon(df_baseline_filtered[activity_metrics], df_FU_filtered[activity_metrics])
- stat_w, p_w = stats.wilcoxon(df_combined_filt[f"{activity_metrics}_T1"],df_combined_filt[f"{activity_metrics}_T2"])
- if p_w < alpha:
- print ('Wilcoxon signed rank test: Reject H0 --> there is a significant difference')
- else:
- print ('Wilcoxon signed rank test: Fail to reject H0 --> no significant difference')
- print ('T1 vs T2 t = ', str(round(stat_w, 2)), ' p = ', str(round(p_w, 4)))
- #%%
- #%%
- ####################
- ### Patient paired t-test analysis to investigate change between T1 and T2 ###
- ####################
- #Peritumoral area
- paired_ttest(df_peri_combined, 'offset_z', 'peritumoral', alpha = 0.05)
- paired_ttest(df_peri_combined, 'BB_welch_z', 'peritumoral', alpha = 0.05)
- #%%
- #Peri-resection area
- paired_ttest(df_cavity_combined, 'offset_z', 'peritumoral', alpha = 0.05)
- paired_ttest(df_cavity_combined, 'BB_welch_z', 'peritumoral', alpha = 0.05)
- #%%
- #Ipsilateral FPN
- result_ipsi_offset = paired_ttest(df_ipsi_combined, 'offset_z', 'ipsilateral', alpha = 0.05)
- result_ipsi_bbp = paired_ttest(df_ipsi_combined,'BB_welch_z', 'ipsilateral', alpha = 0.05)
- #%%
- #Contralateral FPN
- result_contra_offset = paired_ttest(df_contra_combined, 'offset_z', 'contralateral', alpha = 0.05)
- result_contra_bbp = paired_ttest(df_contra_combined, 'BB_welch_z', 'contralateral', alpha = 0.05)
- #%%
- ####################
- ### Post-hoc patient paired t-test analysis for the different freq bands ###
- ####################
- #load in frequency specific data
- df_peri_baseline_freqs = pd.read_csv('/path/to/20240517_std_rel_power_baseline.csv')
- df_peri_FU_freqs = pd.read_csv('/path/to/20240517_std_rel_power_FU_all.csv')
- df_peri_combined_freqs = pd.merge(df_peri_baseline_freqs, df_peri_FU_freqs, on='sub', suffixes=('_T1', '_T2'))
- #%%
- #paired t-test for the various frequency bands
- result_alpha1 = paired_ttest(df_peri_combined_freqs, 'alpha1_z', 'peritumor', alpha = 0.05)
- #%%
- result_alpha2 = paired_ttest(df_peri_combined_freqs, 'alpha2_z', 'peritumor', alpha = 0.05)
- #%%%
- result_beta = paired_ttest(df_peri_combined_freqs, 'beta_z', 'peritumor', alpha = 0.05)
- #%%
- result_delta = paired_ttest(df_peri_combined_freqs, 'delta_z', 'peritumor',alpha = 0.05)
- #%%
- result_gamma = paired_ttest(df_peri_combined_freqs, 'gamma_z', 'peritumor', alpha = 0.05)
- #%%
- result_theta = paired_ttest(df_peri_combined_freqs, 'theta_z', 'peritumor', alpha = 0.05)
- #%%
- #### Test to test whether activity in the FPN is higher or lower than in HCs ####
- def test_activity(df_patients, df_HCs_left, df_HCs_right,df_lateralization, area, activity, time):
- """
- Function to test for a difference in activity between the ipsilateral or contralateral and HC hemispheres.
- Always matches with the right lateralization (i.e. right ipsilateral matches with right HCs hemisphere).
- Uses the normal unpaired t-test when normality and equality of variances is confirmed. Uses the Welch test when the normality
- is assumed but variances are unequal. If normality is violated uses the Mann-Whitney U test.
- Parameters
- ----------
- df_patients : pd.DataFrame,
- dataframe containing all patient data
- df_HCs_left : pd.Dataframe,
- HC dataframe with only left FPN regions
- df_HCs_right : pd.DataFrame,
- HC dataframe with only right FPN regions
- df_lateralization : pd.DataFrame,
- dataframe contiaining info on tumor lateralization (left or right)
- area : str,
- ipsilateral or contralateral: do we compare the ipsilaeral or contralateral hemisphere to HCs?
- activity : str,
- offset_z or BB_welch_z: do we look at offset or bbp?
- time : str,
- baseline or FU, do we look at the baseline measurement or FU?
- Returns
- -------
- pd.DataFrame,
- results dataframe
- """
- df_lat = pd.merge(df_patients, df_lateralization, left_on = "sub", right_on = "Case_ID")
- right_tumor = df_lat['lateralization'] == 'right'
- left_tumor = df_lat['lateralization'] == 'left'
- #filter for subjects that have a right/left tumor
- df_right = df_lat[right_tumor]
- df_left = df_lat[left_tumor]
- if area == 'ipsilateral':
- ### Statistical tests ###
- ### Right ipsilateral vs. Right FPN HCs
- results_df_right = ind_ttest(df_right, df_HCs_right,area, activity, 'right_ipsi (i.e. right tumor hemisphere)' )
- ### Left ipsilateral vs. Left FPN HCs
- results_df_left = ind_ttest(df_left, df_HCs_left, area, activity, 'left_ipsi (i.e. left tumor hemisphere)')
- #results_all = pd.concat([results_df_right,results_df_left])
- elif area == 'contralateral':
- ### Statistical tests ###
- ### Right ipsilateral vs. Right FPN HCs
- results_df_right= ind_ttest(df_right, df_HCs_left,area, activity, 'right_contra (i.e. left non-tumor hemisphere)' )
- ### Left ipsilateral vs. Left FPN HCs
- results_df_left = ind_ttest(df_left, df_HCs_right,area, activity, 'left contra (i.e. right non-tumor hemisphere)')
- #results_all = pd.concat([results_df_right,results_df_left])
- #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')
- #return(results_all)
- #%%
- def ind_ttest(df_pat, df_HCs, area, activity, lateralization):
- """
- Function to test for differences with the correct test (after checking the assumptions of the data).
- Used in function test_activity.
- Parameters
- ----------
- df_pat : pd.DataFrame
- dataframe containing patient data.
- df_HCs : pd.DataFrame,
- dataframe containing HCs data.
- area : str,
- ipsilateral or contralateral
- activity : str,
- offset_z or BB_welch_z
- lateralization : str,
- indicates which area of patients is tested against HCs
- Returns
- -------
- None.
- """
- results_df = pd.DataFrame(columns= ['Area', 'activity', 'Lateralization', 'Test', 'T-value', 'pvalue'])
- ### Caclculate mean and std of patients and HCs ###
- mean_pat = df_pat[activity].mean()
- std_pat = df_pat[activity].std()
- mean_HC = df_HCs[activity].mean()
- std_HC = df_HCs[activity].std()
- #testing normality of data
- stat_pat, p_pat = stats.shapiro(df_pat[activity])
- stat_HCs, p_HCs = stats.shapiro(df_HCs[activity])
- if (p_pat <0.05) or (p_HCs<0.05):
- print('Assumption of normality violated: Doing Mann Whitney U test')
- results = stats.mannwhitneyu(df_pat[activity], df_HCs[activity])
- print(results)
- else:
- print('Assumption of normality not violated: testing for unequal variances now')
- #Testing for equal variances of the two samples (with unequal sample size)
- res = stats.levene(df_pat[activity], df_HCs[activity])
- if res.pvalue >0.5:
- print('Samples have equal variances, doing normal t-test')
- results = stats.ttest_ind(a=df_pat[activity], b=df_HCs[activity], equal_var=True)
- print(results)
- else:
- print('Samples have unequal variances, doing Welchs test')
- results = stats.ttest_ind(a=df_pat[activity], b=df_HCs[activity], equal_var=False)
- print(results)
- #%%
- ### Testing activity against HCs ###
- ### Offset_z
- #Baseline
- test_activity(df_ipsi_averaged, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'offset_z', 'baseline')
- test_activity(df_contra_averaged, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'offset_z', 'baseline')
- #%%
- #FU
- test_activity(df_ipsi_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'offset_z', 'FU')
- test_activity(df_contra_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'offset_z', 'FU')
- ### BBP
- #Baseline
- test_activity(df_ipsi_averaged, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'BB_welch_z', 'baseline')
- test_activity(df_contra_averaged, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'BB_welch_z', 'baseline')
- #FU
- test_activity(df_ipsi_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'ipsilateral', 'BB_welch_z', 'FU')
- test_activity(df_contra_averaged_FU, df_HC_Left, df_HC_Right, li_subs, 'contralateral', 'BB_welch_z', 'FU')
- #%%
- ####################
- # --- Linear regressions --- # --> Multiple Linear Regression
- ####################
- ####################
- ### 1) to test relationship Activity vs EF (T1) ###
- ####################
- def run_multiple_linear_regression(df_activity, df_ef, EF_Score, area, output_dir, covariates=[]):
- """
- Parameters:
- df_activity: pandas.DataFrame,
- the dataframe containing the activity_metrics (bbp and offset)
- df_ef: pandas.DataFrame,
- the dataframe containing the patient characteristics (EF scores and covariates)
- EF_Score: str,
- the column name in df representing the dependent variable (i.e. EF Z scores: either CST or WFT)
- area: str,
- determines the area that is being investigated (i.e. preitumoral, ipsilateral FPN, contralateral FPN)
- output_dir: str,
- path to directory where results should be stored
- covariates: list of str,
- a list of column names in df representing the covariates (default: [])
- """
- li = []
- for activity_metrics in ["BB_welch_z", "offset_z"]:
- # Merge the two dataframes based on sub_ID
- merge_df = pd.merge(df_activity, df_ef, left_on='sub', right_on='Case_ID')
- print(merge_df.shape)
- print(len(np.unique(merge_df["sub"])))
- assert all(merge_df["sub"] == merge_df["Case_ID"])
- #In case EF_Score = CST is analzyed --> remove sub-xxx and sub-xxx from DF
- if EF_Score == "cstc_corrected_1_Zscore":
- merge_df.drop(merge_df[(merge_df["sub"] == "sub-xxx")|(merge_df["sub"] == "sub-0087")].index, inplace = True)
- merge_df.reset_index(inplace = True)
- #Check to see if correct participant was excluded
- print(merge_df["sub"])
- print(merge_df["Case_ID"])
- else:
- #Check to see if correct participant are still included for WFT
- print(merge_df["sub"])
- print(merge_df["Case_ID"])
- # Define the dependent variable (outcome) and independent variables
- X_cols = [activity_metrics] + covariates
- print(X_cols)
- X = merge_df[X_cols]
- y = merge_df[EF_Score]
- #Check if X inludes corect columns
- print(X)
- #Check if Y inludes corect columns
- print(y)
- # Add a constant term to the independent variables
- X = sm.add_constant(X)
- # Create a multiple linear regression model
- model = sm.OLS(y, X)
- # Fit the model to the data
- results = model.fit()
- # Print the regression coefficients and other results
- print(f"Results for {activity_metrics} vs {EF_Score} in {area}:")
- print (results.summary())
- ### --- Testing Assumption of Multiple Linear Regression --- ###
- print ('--- Testing Assumptions of Multiple Linear Regression ---')
- #Extract the independent variables (IV) only
- X_IV = X.drop(columns=['const'])
- print(X_IV.head())
- # 1) Linear Relationship (between Indepentent and target variables)
- print('1) Testing for Linear Relationship: See Graphs')
- for IVs in X_IV.columns:
- plt.scatter(X[IVs], y)
- plt.xlabel(IVs)
- plt.ylabel(EF_Score)
- plt.title(f"Scatter Plot of {IVs} vs {EF_Score}")
- plt.show()
- # 2) No Multicollinearity
- print ('2) Testing for Multicollinearity')
- #Caculate the correlation matrix
- corr_matrix = X_IV.corr()
- print(corr_matrix)
- # Check for variables with high correlation coefficients
- high_corr = set()
- for i in range(len(corr_matrix.columns)):
- for j in range(i):
- if abs(corr_matrix.iloc[i, j])> 0.7:
- colname = corr_matrix.columns[i]
- high_corr.add(colname)
- print("Variables with high correlation coefficients:", high_corr)
- #Calculate VIF scores for each independent variable (IVs)
- vif_scores = pd.DataFrame()
- vif_scores["feature"] = X_IV.columns
- vif_scores["VIF"] = [variance_inflation_factor(X_IV.values, i) for i in range(X_IV.shape[1])]
- print(vif_scores)
- #3) Homoscedasticity - constant variance
- print ("3) Testing Homoscedasticity: See Graph")
- residuals = results.resid
- fitted_vals=results.predict(X)
- plt.scatter(fitted_vals, residuals)
- plt.xlabel('Fitted Values')
- plt.ylabel('Residuals')
- plt.title("Scatter Plot to test Homoscedasticity")
- plt.show()
- name = ['Lagranage multiplier statistic', 'p-value', 'f-value', 'f p-value']
- test = sms.het_breuschpagan(results.resid, results.model.exog)
- print(lzip(name, test))
- #4) No Autocorrelation of errors
- print ("4) Testing Autocorrelation of errors: See Graph")
- plt.plot(residuals.index, residuals)
- plt.title("Plot to test Autocorrelation of errors")
- plt.show()
- #5) Residual Normality
- print("5) Testing Residual Normality: See Graph")
- sns.distplot(residuals).set(title ="Residual plot: Testing Normality")
- print('residual mean:')
- print(np.mean(residuals))
- stat, p = stats.shapiro(results.resid)
- print('Shapiro test:')
- print(stat, p)
- #6) Checking for outliers
- print("6) Checking for Residual relation with independent variables/ outliers: See Graph")
- fig, axs = plt.subplots(ncols=X_IV.shape[1], figsize=(15, 5))
- for i, col in enumerate (X_IV.columns):
- axs[i].scatter(X_IV[col], results.resid)
- axs[i].set_xlabel(col)
- axs[i].set_ylabel("Residuals")
- plt.title("Checking for outliers")
- plt.show()
- #or
- residuals =results.resid
- sm.qqplot(residuals, line='s')
- plt.title('Residuals Q-Q')
- plt.show()
- #Calculate Cook's distance values
- influence = results.get_influence()
- cooks = influence.cooks_distance[0]
- #Plot the Cook's distance values against the obersvation numbers
- plt.plot(cooks, 'o')
- plt.xlabel('Observation number')
- plt.ylabel("Cook's distance")
- plt.title("Observation number vs Cook's distance")
- plt.show()
- #Identify influential observations
- # n= len(y)
- # threshold = 4/n
- # influential_observations = np.where(cooks >= threshold)[0]
- # print('Influential observations:', influential_observations)
- print("--- Testing Assumptions of Multiple Linear Regression Completed --- ")
- # get the summary table of the results
- table1 = results.summary2().tables[0]
- table2 = results.summary2().tables[1]
- table2.reset_index(inplace=True)
- summary_df = pd.concat([table1, table2], axis=1)
- summary_df = summary_df.reset_index()
- #Append results to the dataframe
- li.append(summary_df)
- results_df = pd.concat(li, axis=0)
- # Save the dataframe to CSV
- #results_df.to_csv(f'{output_dir}linear_regression_baseline_{area}_{EF_Score}_20250701.csv')
- #return(results_df)
- #%%
- ###############################
- ### Patient linear regression_baseline analysis ###
- ###############################
- output_dir = '/path/to/outputdir/'
- #Peritumoral
- #CST
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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"])
- #%%
- output_dir = '/path/to/outputdir'
- #WFT
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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'])
- #%%
- #Ipsilateral FPN
- #CST
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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"])
- #%%
- #WFT
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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'])
- #%%
- #Contralateral FPN
- #CST#
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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"])
- #%%
- #WFT
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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'])
- #%%
- ####################
- ### 2) to test relationship Activity vs EF (longitudinally) ###
- ####################
- def run_delta_regression(df_activity, df_ef, EF_Score, area, output_dir, covariates=[]):
- """
- Parameters:
- df_activity: pandas.DataFrame,
- the dataframe containing the activity_metrics (bbp and offset) for both timepoints (baseline and FU)
- df_ef: pandas.DataFrame,
- the dataframe containing the patient characteristics (EF scores and covariates)
- EF_Score: str,
- the column name in df representing the dependent variable (i.e. EF Z scores: either CST or WFT)
- area: str,
- determines the area that is being investigated (i.e. preitumoral, ipsilateral FPN, contralateral FPN)
- output_dir: str,
- path to directory where results should be stored
- covariates: list of str,
- a list of column names in df representing the covariates (default: [])
- """
- li = []
- for activity_metrics in ["BB_welch_z", "offset_z"]:
- # Merge the two dataframes based on sub_ID
- merge_df = pd.merge(df_activity, df_ef, left_on='sub', right_on='Case_ID')
- print(merge_df.shape)
- print(len(np.unique(merge_df["sub"])))
- print(len(np.unique(merge_df["Case_ID"])))
- #In case EF_Score = CST is analzyed --> remove sub-xxx and sub-xxx from DF
- if EF_Score == "cstc_corrected":
- merge_df.drop(merge_df[(merge_df["sub"] == "sub-xxx")|(merge_df["sub"] == "sub-xxx")].index, inplace = True)
- merge_df.reset_index(inplace = True)
- #Check to see if correct participant was excluded
- print(merge_df["sub"])
- print(merge_df["Case_ID"])
- #In case EF_Score = WFT is analyzed --> remove sub-xxx from DF
- else:
- #Check to see if correct participant are still included for WFT
- merge_df.drop(merge_df[(merge_df["sub"] == "sub-xxx")].index, inplace = True)
- merge_df.reset_index(inplace = True)
- #Check to see if correct participant was excluded
- print(merge_df["sub"])
- print(merge_df["Case_ID"])
- #Remove patients from DF that have progression before FU
- prog_filt = merge_df["progression_before_FU"] == 1
- merge_df = merge_df[~prog_filt]
- merge_df.reset_index(inplace = True)
- #Check to see if correct participants and correct columns are included in the final version
- print(merge_df["sub"])
- print(merge_df.columns)
- # Calculate delta values
- merge_df[f'delta_{activity_metrics}'] = merge_df[activity_metrics + '_T2'] - merge_df[activity_metrics + '_T1']
- merge_df[f'delta_{EF_Score}']= merge_df[EF_Score + "_2_Zscore"] - merge_df[EF_Score + "_1_Zscore"]
- print(merge_df[f'delta_{EF_Score}'])
- # Define the dependent variable (outcome) and independent variables
- if len(covariates) > 0:
- X = pd.concat([merge_df[f'delta_{activity_metrics}'], merge_df[covariates]], axis=1)
- else:
- X = merge_df[f'delta_{activity_metrics}']
- print(X)
- Y = merge_df[f'delta_{EF_Score}']
- print(Y)
- #Add a constant term to the independent variables
- X = sm.add_constant(X)
- # Create a multiple linear regression model
- model = sm.OLS(Y, X)
- #Fit the model to the data
- results = model.fit()
- # Print the regression coefficients and other results
- print(f"Results for delta {activity_metrics} vs delta {EF_Score} in {area}:")
- print (results.summary())
- ### --- Testing Assumption of Multiple Linear Regression --- ###
- print ('--- Testing Assumptions of Multiple Linear Regression ---')
- #Extract the independent variables (IV) only
- X_IV = X.drop(columns=['const'])
- print(X_IV.head())
- # 1) Linear Relationship (between Indepentent and target variables)
- print('1) Testing for Linear Relationship: See Graphs')
- for IVs in X_IV.columns:
- plt.scatter(X[IVs], Y)
- plt.xlabel(IVs)
- plt.ylabel(EF_Score)
- plt.title(f"Scatter Plot of {IVs} vs {EF_Score}")
- plt.show()
- # 2) No Multicollinearity
- print ('2) Testing for Multicollinearity')
- #Caculate the correlation matrix
- corr_matrix = X_IV.corr()
- print(corr_matrix)
- # Check for variables with high correlation coefficients
- high_corr = set()
- for i in range(len(corr_matrix.columns)):
- for j in range(i):
- if abs(corr_matrix.iloc[i, j])> 0.7:
- colname = corr_matrix.columns[i]
- high_corr.add(colname)
- print("Variables with high correlation coefficients:", high_corr)
- #Calculate VIF scores for each independent variable (IVs)
- vif_scores = pd.DataFrame()
- vif_scores["feature"] = X_IV.columns
- vif_scores["VIF"] = [variance_inflation_factor(X_IV.values, i) for i in range(X_IV.shape[1])]
- print(vif_scores)
- #3) Homoscedasticity - constant variance
- print ("3) Testing Homoscedasticity: See Graph")
- residuals = results.resid
- fitted_vals=results.predict(X)
- plt.scatter(fitted_vals, residuals)
- plt.xlabel('Fitted Values')
- plt.ylabel('Residuals')
- plt.plot(Y, [0]*len(Y))
- plt.title("Scatter Plot to test Homoscedasticity")
- plt.show()
- name = ['Lagranage multiplier statistic', 'p-value', 'f-value', 'f p-value']
- test = sms.het_breuschpagan(results.resid, results.model.exog)
- print(lzip(name, test))
- #4) No Autocorrelation of errors
- print ("4) Testing Autocorrelation of errors: See Grahp")
- plt.plot(residuals.index, residuals)
- plt.title("Plot to test Autocorrelation of errors")
- plt.show()
- #5) Residual Normality
- print("5) Testing Residual Normality: See Graph")
- sns.distplot(residuals).set(title ="Residual plot: Testing Normality")
- print('residual mean:')
- #print(np.mean(residuals))
- stat, p = stats.shapiro(results.resid)
- print('Shapiro test:')
- print(stat, p)
- #6) Checking for outliers
- print("6) Checking for Residual relation with independent variables/ outliers: See Graph")
- fig, axs = plt.subplots(ncols=X_IV.shape[1], figsize=(15, 5))
- for i, col in enumerate (X_IV.columns):
- axs[i].scatter(X_IV[col], results.resid)
- axs[i].set_xlabel(col)
- axs[i].set_ylabel("Residuals")
- plt.title("Checking for outliers")
- plt.show()
- #or
- residuals =results.resid
- sm.qqplot(residuals, line='s')
- plt.title('Residuals Q-Q')
- plt.show()
- print("--- Testing Assumptions of Multiple Linear Regression Completed --- ")
- # get the summary table of the results
- table1 = results.summary2().tables[0]
- table2 = results.summary2().tables[1]
- table2.reset_index(inplace=True)
- summary_df = pd.concat([table1, table2], axis=1)
- summary_df = summary_df.reset_index()
- #Append results to the dataframe
- li.append(summary_df)
- results_delta_df = pd.concat(li, axis=0)
- # Save the dataframe to CSV
- results_delta_df.to_csv(f'{output_dir}/linear_regression_delta_scores_{area}_{EF_Score}_20250701.csv')
- #return(results_delta_df)
- #%%
- ###############################
- ### Patient linear regression_delta_scores analysis ###
- ###############################
- output_dir = "/path/to/outputdir/"
- #Peritumoral
- #CST
- 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"])
- #%%
- #WFT
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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'])
- #%%
- output_dir = "/path/to/output_dir/"
- #Ipsilateral FPN
- #CST
- 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"])
- #%%
- #WFT
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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'])
- #%%
- #Contralateral FPN
- output_dir = "/path/to/outputdir/"
- #CST
- 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"])
- #%%
- #WFT
- #rerun 01-07-2025 with improved covariate frontal or not (no variables taken out for multicollinearity)
- 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'])
- #%%
- ####################
- ### 3) to test relationship Activity vs EF in HCs ###
- ####################
- def run_HC_linear_regression(df_activity, df_ef, EF_Score, area, output_dir, covariates=[]):
- """
- Parameters:
- df_activity: pandas.DataFrame,
- the dataframe containing the activity_metrics (bbp and offset)
- df_ef: pandas.DataFrame,
- the dataframe containing the patient characteristics (EF scores and covariates)
- EF_Score: str,
- the column name in df representing the dependent variable (i.e. EF Z scores: either CST or WFT)
- area: str,
- determines the area that is being investigated (i.e. left or right FPN)
- output_dir: str,
- path to directory where results should be stored
- covariates: list of str,
- a list of column names in df_ef representing the covariates (default: [])
- """
- li = []
- for activity_metrics in ["BB_welch_z", "offset_z"]:
- # Merge the two dataframes based on sub_ID
- merged_df = pd.merge(df_activity, df_ef, on='sub')
- print(merged_df.head)
- print(merged_df[[activity_metrics, EF_Score]])
- # Define the dependent variable (outcome) and independent variables
- X_cols = [activity_metrics] + covariates
- X = merged_df[X_cols]
- y = merged_df[EF_Score]
- #Check if X inludes corect columns
- print(X)
- #Check if Y inludes corect columns
- print(y)
- # Add a constant term to the independent variables
- X = sm.add_constant(X)
- # Create a multiple linear regression model
- model = sm.OLS(y, X)
- # Fit the model to the data
- results = model.fit()
- # Print the regression coefficients and other results
- print(f"Results for {activity_metrics} vs {EF_Score} in {area}:")
- print (results.summary())
- ### --- Creating Graphs --- ###
- sns.lmplot(x=X.columns[1], y=EF_Score, data=merged_df, scatter_kws={'alpha':0.5})
- plt.title(f'for HCs: {activity_metrics} vs. {EF_Score}_in {area}')
- plt.axhline(y= -1.5, linestyle ='--', color ='grey')
- # 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")
- plt.show()
- ### --- Testing Assumption of Multiple Linear Regression --- ###
- print ('--- Testing Assumptions of inear Regression ---')
- #Extract the independent variables (IV) only
- X_IV = X.drop(columns=['const'])
- print(X_IV.head())
- # 1) Linear Relationship (between Indepentent and target variables)
- print('1) Testing for Linear Relationship: See Graphs')
- for IVs in X_IV.columns:
- plt.scatter(X[IVs], y)
- plt.xlabel(IVs)
- plt.ylabel(EF_Score)
- plt.title(f"Scatter Plot of {IVs} vs {EF_Score}")
- plt.show()
- #2) Homoscedasticity - constant variance
- print ("2) Testing Homoscedasticity: See Graph")
- residuals = results.resid
- fitted_vals=results.predict(X)
- plt.scatter(fitted_vals, residuals)
- plt.xlabel('Fitted Values')
- plt.ylabel('Residuals')
- plt.plot(y, [0]*len(y))
- plt.title("Scatter Plot to test Homoscedasticity")
- plt.show()
- name = ['Lagranage multiplier statistic', 'p-value', 'f-value', 'f p-value']
- test = sms.het_breuschpagan(results.resid, results.model.exog)
- print(lzip(name, test))
- #3) Independence of observations
- #create plot of the residuals against the independent variable
- print('3) Testing for Independence: See Graphs')
- for IVs in X_IV.columns:
- plt.scatter(X[IVs], residuals)
- plt.xlabel(IVs)
- plt.ylabel('residuals')
- plt.title(f"Scatter Plot of {IVs} vs residuals")
- plt.show()
- #4) No Autocorrelation of errors
- print ("4) Testing Autocorrelation of errors: See Grahp")
- plt.plot(residuals.index, residuals)
- plt.title("Plot to test Autocorrelation of errors")
- plt.show()
- #5) Residual Normality
- print("5) Testing Residual Normality: See Graph")
- sns.distplot(residuals).set(title ="Residual plot: Testing Normality")
- print('residual mean:')
- print(np.mean(residuals))
- stat, p = stats.shapiro(results.resid)
- print('Shapiro test:')
- print(stat, p)
- #6) Checking for outliers
- print("6) Checking for outliers: See Graph")
- residuals =results.resid
- sm.qqplot(residuals, line='s')
- plt.title('Residuals Q-Q')
- plt.show()
- print("--- Testing Assumptions of Linear Regression Completed --- ")
- # get the summary table of the results
- table1 = results.summary2().tables[0]
- table2 = results.summary2().tables[1]
- table2.reset_index(inplace=True)
- summary_df = pd.concat([table1, table2], axis=1)
- summary_df = summary_df.reset_index()
- li.append(summary_df)
- results_HC_df = pd.concat(li, axis=0)
- # Save the dataframe to CSV
- results_HC_df.to_csv(output_dir + f'/linear_regression_HC_{area}_{EF_Score}.csv')
- #return(results_HC_df)
- #%%
- ###############################
- ### HC linear regression_baseline analysis ###
- ###############################
- output_dir = '/path/to/output_dir/'
- #Left Hemisphere FPN
- #CST
- run_HC_linear_regression(df_HC_Left, HC_info, 'CST_Zscore_shifting', 'left_FPN', output_dir, covariates=[])
- #WFT
- run_HC_linear_regression(df_HC_Left, HC_info, 'AnimalFluency_Zscore', 'left_FPN', output_dir, covariates=[])
- #Rigt Hemisphere FPN
- #CST
- run_HC_linear_regression(df_HC_Right, HC_info, 'CST_Zscore_shifting', 'right_FPN', output_dir, covariates=[])
- #WFT
- 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
- Amsterdam UMC, Vrije Universiteit Amsterdam, Department of Psychiatry, de Boelelaan 1117, Amsterdam, the Netherlands
- Amsterdam UMC, Vrije Universiteit Amsterdam, Department of Anatomy & Neurosciences, de Boelelaan 1117, Amsterdam, the Netherlands
- Amsterdam Public Health, Amsterdam, the Netherlands
- GGZ inGeest, Amsterdam, the Netherlands
- Amsterdam Neuroscience, Compulsivity, Impulsivity & Attention program, Amsterdam, the Netherlands
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/
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/
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
704ca7e4d769d5d77dc2a14aef0ad67ebaa2d765, 17 September 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
83 files
- KPS_prediction_2026/
src_modeling/ , Python, 281 lines01_model_train_xgbordreg .py - KPS_prediction_2026/
src_modeling/ , Python, 206 lines02_model_comparison.py - KPS_prediction_2026/
src_modeling/ , Python, 166 lines03_model_test_held-out_s et.py - KPS_prediction_2026/
src_modeling/ , Python, 267 lines04_mcp_prediction.py - KPS_prediction_2026/
src_modeling/ , Python, 38 lines05_EDA.py - KPS_prediction_2026/
src_modeling/ , Python, 2,600 linesutils.py - KPS_prediction_2026/
src_preprocessing/ , Python, 104 lines00_combine_gsi_rads_repo rts.py - KPS_prediction_2026/
src_preprocessing/ , Python, 125 lines01_brain_imaging_subj_se lection_gsi_reports.py - KPS_prediction_2026/
src_preprocessing/ , Python, 234 lines02_clinical_merge_datase ts_fill_nans.py - KPS_prediction_2026/
src_preprocessing/ , Python, 86 lines03_clinical_subj_selecti on.py - KPS_prediction_2026/
src_preprocessing/ , Python, 94 lines04_overlap_subjs_brain_i maging_clinical.py - KPS_prediction_2026/
src_preprocessing/ , Python, 135 lines05_clinical_EDA.py - KPS_prediction_2026/
src_preprocessing/ , Python, 86 lines06_tumor_volume_componen ts.py - KPS_prediction_2026/
src_preprocessing/ , Python, 118 lines07_tumor_volume_componen ts_corrections.py - KPS_prediction_2026/
src_preprocessing/ , Python, 170 lines08_combine_gsi_rads_outp ut.py - KPS_prediction_2026/
src_preprocessing/ , Python, 183 lines09_combine_all_features. py - KPS_prediction_2026/
src_preprocessing/ , Python, 246 lines10_external_holdout_clin ical_set.py - KPS_prediction_2026/
src_preprocessing/ , Python, 91 lines11_final_EDA_patient_tab le.py - KPS_prediction_2026/
src_preprocessing/ , Python, 415 linesutils.py - LENS_paper_2022/
LENS_git_20220425_revisi , MATLAB, 673 lineson.m - LENS_paper_2022/
SpinPermuFS.m , MATLAB, 78 lines - LENS_paper_2022/
SpinTest.m , MATLAB, 104 lines, 1 match - LENS_paper_2022/
cortical2surface.m , MATLAB, 176 lines - LENS_paper_2022/
syntax_LENS_20220415.sps , SPSS, 263 lines - activity_EF_projects_202
4/ , R, 209 linesanova_cavity.R - activity_EF_projects_202
4/ , R, 119 linesanova_enhancing_tumor.R - activity_EF_projects_202
4/ , R, 452 linesanova_peritumoral.R - activity_EF_projects_202
4/ , R, 57 linescox_model.R - activity_EF_projects_202
4/ , Python, 687 linescreate_df.py - activity_EF_projects_202
4/ , Python, 162 linescreate_freq_df.py - activity_EF_projects_202
4/ , Python, 190 linespost_hoc_FPN.py - activity_EF_projects_202
4/ , Python, 1,036 lines, 1 matchstatistics.py - activity_network_project
_2023/ , Python, 193 linesEC_CC_pipeline.py - activity_network_project
_2023/ , Python, 289 linesPLI.py - activity_network_project
_2023/ , Python, 157 linesmasks.py - activity_network_project
_2023/ , Python, 701 linesmaster_df.py - activity_network_project
_2023/ , Python, 49 linesspin-test_binom.py - activity_network_project
_2023/ , Python, 994 linesstatistics_network_activ ity_github.py - activity_network_project
_2023/ , Python, 530 linesstatistics_profiles_gith ub.py - clustering_paper_2021/
results_manuscript_AECc_ , MATLAB, 350 linesnew_HCs_JD_SK.m - clustering_paper_2021/
results_manuscript_PLI_n , MATLAB, 603 linesew_HCs_2020.m - clustering_paper_2021/
shuf_cl_pl.m , MATLAB, 146 lines - fatigue_glioma_manuscrip
t_2022/ , R, 390 linesCode.Rmd - glioblastoma_embedding_2
026/ , Python, 291 linesmain.py - glioblastoma_embedding_2
026/ , MATLAB, 58 linessrc/ dTOR_compute_fiber_weigh ts.m - glioblastoma_embedding_2
026/ , Python, 1,331 linessrc/ data_loading.py - glioblastoma_embedding_2
026/ , R, 84 linessrc/ mixed_anovas.r - glioblastoma_embedding_2
026/ , Python, 373 linessrc/ statistics.py - glioblastoma_embedding_2
026/ , MATLAB, 95 linessrc/ tumor_tract_density_indi ces.m - glioblastoma_embedding_2
026/ , MATLAB, 77 linessrc/ whole_brain_tdm.m - meetomes_2022/
correlations.py , Python, 318 lines - modelling_paper_2021/
step1/ , MATLAB, 99 linesJansen_network_RK2.m - modelling_paper_2021/
step1/ , MATLAB, 37 linesenvelopecorr.m - modelling_paper_2021/
step1/ , MATLAB, 31 linesfft_filt.m - modelling_paper_2021/
step1/ , MATLAB, 39 linesphaselockvalue_leak.m - modelling_paper_2021/
step1/ , MATLAB, 23 linespli_matteo.m - modelling_paper_2021/
step1/ , MATLAB, 9 linesrangenorm.m - modelling_paper_2021/
step1/ , MATLAB, 164 lines, 1 matchrun_model.m - modelling_paper_2021/
step2/ , MATLAB, 113 linesaverage_SC_emp_all.m - modelling_paper_2021/
step2/ , MATLAB, 107 linescorr_sim_mod.m - modelling_paper_2021/
step2/ , MATLAB, 10 linesvectorise.m - modelling_paper_2021/
step3/ , MATLAB, 59 linescheck_higher_coupling_ra nges.m - modelling_paper_2021/
step3/ , MATLAB, 46 linestest_FC_measures_max_cor relations.m - modelling_paper_2021/
step3/ , MATLAB, 39 linestest_between_maximum_cou pling_values.m - modelling_paper_2021/
step4/ , MATLAB, 233 linesRandom_coupling.m - modelling_paper_2021/
step5/ , Python, 124 linespaired_rainclouds.py - multilayer_EC_glioma_202
3/ , MATLAB, 226 linesSupra_adjacencymatrix_gi thub.m - multilayer_EC_glioma_202
3/ , Python, 854 linesadjusted_multilayer_main _code.py - multilayer_EC_glioma_202
3/ , MATLAB, 31 linesfft_filt_BNA.m - multilayer_EC_glioma_202
3/ , MATLAB, 81 lines, 1 matchkruskal_algorithm.m - multilayer_EC_glioma_202
3/ , MATLAB, 23 linespli_matteo.m - multiscale_integration_c
ortex_2021/ , MATLAB, 76 lineskruskal_algorithm.m - multiscale_integration_c
ortex_2021/ , MATLAB, 1,131 linesmultiscale_integration_m emory_tle_final.m - mumo_paper_2021/
data/ , SPSS, 52 linesmumo_manuscript_syntax.s ps - mumo_paper_2021/
functions/ , MATLAB, 31 linesfft_filt_BNA.m - mumo_paper_2021/
functions/ , MATLAB, 81 lineskruskal_algorithm.m - mumo_paper_2021/
functions/ , MATLAB, 23 linespli_matteo.m - mumo_paper_2021/
functions/ , MATLAB, 171 linesremove_empty_regions.m - mumo_paper_2021/
script/ , MATLAB, 639 linesmumo_script_clean.m - physical_fitness_2024/
analyses_MB_SF36_CIS20_p , R, 1,188 linesart1_2_Github.Rmd - physical_fitness_2024/
analyses_MB_SF36_CIS20_p , R, 1,442 linesart3_Github.Rmd - symptomnetwork_glioma_pa
per_2022/ , R, 421 linescode.Rmd - LICENSE, License, 21 lines
multinetlab-amsterdam/data_analysis
e8a057a5247b4a698792a3fedc7c9107cd08d781, 26 August 2022Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
3 files
- MST/
MST_kruskal.py , Python, 173 lines, 1 match - fooof/
alternative_Compute_broa , Python, 727 linesdband.py - LICENSE, License, 21 lines
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://
BibTeX
@article{fitzsimmons2026
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/
url = {https://
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/
VL - 50
SP - 104012
SN - 2213-1582
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"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":
"volume": "50",
"page": "104012",
"DOI": "10.1016/
"PMID": "42217473",
"PMCID": "PMC13241641",
"ISSN": "2213-1582",
"publisher": "Elsevier",
"URL": "https://
"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 biologyIn common: imbalanced-learn, survival, nlme, 18 other tools
- [2] doi:10.7554/elife.103097 [code]
- Canonical neurodevelopmental trajectories of structural and functional manifolds.Journal: eLifeIn 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 consciousnessIn 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 communicationsIn 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 dataIn 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 dataIn 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 navigationJournal: n/aIn 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 neuroscienceIn 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 biologyIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 84 scripts, and 5 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:f5e7d6b5b5b5b69a…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
