Git repository for HMM based beta event analysis. Separate folders for scripts run with Matlab and Python.
Structure of this repository is as follows:
beta_event_dynamics
│
└─── Python_scripts
│ └─── A_manuscript_results -> This consists all plots and statistical testings
│ └─── plot_spatial_characteristics -> Spatial maps of FO, SLT, rate and AE
│ └─── plot_rate_source.py
│ └─── plot_dispersion_source.py
│ └─── plot_event_amplitude_source.py
│ └─── plot_FO_source.py
│ └─── plot_SLT_source.py
│ └─── plot_spatial_cluster_test -> Spatio-temporal test for the FO evoked curve
│ └─── spatio_temporal_clustering_motor.py
│ └─── plot_significant_motor_clusters.py
│ └─── plot_evoked_FOs_different_areas -> singel evoked FO curved plotted in different areas
│ └─── plot_evoked_FO_and_statistics.py
│ └─── get_mean_FO_path.py
│ └─── state_transitions
│ └─── transition_direction.py
│ └─── chi-square_test.py
│ └─── event_coincidence
│ └─── save_coincidenced_task.py
│ └─── plot_sub_reb_coincidences_coarse_grained.py
│ └─── plot_sub_reb_coincidences.py
│ └─── save_coincidences_rest.py
│ └─── plot_event_characteristics
│ └─── moving_rate_plot.py
│ └─── moving_SLT_plot.py
│ └─── moving_AE_plot.py
└─── make_characteristics -> Make csv of characteristics during rest, required for spatial mapping
│ └─── csv_event_amplitudes.py
│ └─── csv_FO.py
│ └─── csv_disp_rate.py
│ └─── csv_SLT.py
│ └─── csv_commands.sh
└─── subject_text_files
│ └─── list_of_subjects.txt
└───settings_hmm_beta.py
└─── process_raw_data -> Preprocessing of the data and source transformation
│ └─── ica_annotations
│ └─── make_annotations.py
│ └─── make_ica.py
│ └─── 1_covariance.py
│ └─── 02_forward.py
│ └─── 03_inverse.py
│ └─── 04_extract_matfile.py
└───functions_preprocessing.py
└─── functions_make_characteristics.py
└───fnames.py
└─── config.pyconfig.py
└───Matlab_scripts
│ └───dual_model -> Individual subject and parcel specific model training
│ └───get_slt.m
│ └─── get_data_paths.m
│ └─── make_dual_model.m
│ └─── get_options_dual.m
│ └─── bash_dual_run.sh
│ └─── list_of_subjects.txt
│ └─── group_model -> group model training
│ └─── func_make_group_model.m
│ └─── list_of_subjects.txt
│ └─── make_group_model.m
│ └─── get_data_paths.m
│ └─── get_options_group.m
│ └─── bash_group_run.sh
Python scripts contains basically the MEG data preprocessing steps and data transformation from the sensor level to the source level. In addition the Python scipts contains the plotting routines and implementations for the statistical testing.
Matlab codes includes the scripts to make HMM group model and the indivudual trained models.
Data is assumed to be organized as follows:
└─── MRI -> MRI images of the subject
| └─── subject-01
└─── processed -> Processed files od the subjects
| └─── subject-01
| └─── ses-01
| └─── noise_cov
| └─── forward
| └─── HMM_output
| └─── stcs
| └─── annot
| └─── inverse
| └─── ica
| └─── data_mat
| └─── characteristics_csvs -> CSVs of the characteristics
| └─── EA_csv
| └─── SLT_csv
| └─── dispersion_csv
| └─── rate_csv
| └─── FO_csv
| └─── coincidences -> files needed for the coincidence calculations
| └─── coincidence_maps
| └─── spatial_clusters
└─── BIDS -> BIDSified data
| └─── subject-01
| └─── ses-01
| └─── meg
|____group_model_1.mat -> group model
The codes were developed using Python version 3.10.14 and mne-python version 1.7.0.