-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.asv
109 lines (61 loc) · 5.92 KB
/
README.asv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# RSN
[Code from](https://github.com/valeriajaramillo/RSN/)
required toolboxes:
- [eeglab v2021.1](https://sccn.ucsd.edu/eeglab/download.php)
- [fieldtrip revision ebc13229d](https://www.fieldtriptoolbox.org/)
- [circular statistics](https://uk.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics)
- [eBOSC](https://github.com/jkosciessa/eBOSC)
# preprocessing
- sleep: preprocessing scripts for sleep data, run in order A-G
1. A1_writeedf_for_scoring: write .edf file that is used for sleep scoring (re-referencing 8 EEG channels used for sleep scoring to mastoids), you need to export .eeg file as .edf file using BrainVisionRecorder before running this script (.edf file is needed)
2. A2_extract_triggers: extract AEP and CLAS triggers from .eeg file (raw data, provided), save in _nm.mat file
3. B1_load_filter_data: load and filter sleep EEG data from .eeg file (raw data, provided), save as _fil.fdt and .set file
4. C1_artcorr_extract_REM: load filtered data, sleep scoring, and phasic/tonic scoring data, visualize REM sleep EEG using eeglab, visually identify and interpolate bad channels, visually mark segments that contain artefacts, save _goodREM.fdt and .set files that only contain 'good' (artefact-free) REM samples, save _goodREM.mat file containing information about sleep and phasic/tonic scoring, bad channels, and artefacts
5. D_ICA: perform ICA on _goodREM data using eeglab using AMICA1.6 plugin
6. E_manual_ICA: visualize independent components using eeglab, visually identify eye movement, cardiac, muscle activity, and channel noise components and remove those components, save as _manual_ICA.fdt and .set files
7. F_insert_REM_after_ICA_rereferencing: put back cleaned REM sleep data (after ICA) into the whole-night data and re-reference to the average across all channels
8. G_goodtrigs: save triggers that occurred during a 'good' REM sample in _nm_good.mat
- wake: preprocessing scripts for wake data, run in order A-G
1. A_load_filter_data_wake: load and filter wake EEG data from .eeg file (raw data, provided), save as _fil.fdt and .set file
2. B_extract_triggers_wake: extract AEP triggers from .eeg file (raw data, provided), save in _nm.mat file
3. C_artcorr_wake: load filtered data, visualize EEG using eeglab, visually identify and interpolate bad channels, visually mark segments that contain artefacts, save _goodwake.fdt and .set files that only contain 'good' (artefact-free) wake samples, save _goodwake.mat file containing information about bad channels, and artefacts
4. D_ICA_wake: perform ICA on _goodwake data using eeglab using AMICA1.6 plugin
5. E_manual_ICA: visualize independent components using eeglab, visually identify eye movement, cardiac, muscle activity, and channel noise components and remove those components, save as _manual_ICA.fdt and .set files
6. F_insert_wake_after_ICA_rereferencing: re-reference wake data to the average across all channels
7. G_goodtrigs: save triggers that occurred during a 'good' wake sample in _nm_good.mat
# analyses
- connectivity: perform connectivity analyses, run in order A-D
1. A_phase_connectivity: calculate the phase using Hilbert transform for trial data
2. B_PLV_sub: calculate PLV and PLI for all channel pairs for each participant
3. C_PLV_allsub: save PLV and PLI for all participants
4. D_cluster_analysis_SnPM_connectivity: calculate lme for each electrode with cluster correction for alpha CLAS
4. D_cluster_analysis_SnPM_connectivity_theta: calculate lme for each electrode with cluster correction for theta CLAS
- eBOSC: detect oscillations to determine individual peak frequency, run in order A-B
1. A_eBOSC: detect oscillations for each epoch
2. B_eBOSC: extract oscillations with at least 3 cycles and 300 ms duration, plot histogram and detect peak
- ERP: perform AEP analyses for REM and wake data, run in order A-B
1. A_ERP_sub_REM: extract AEP REM data for each participant
1. A_ERP_sub_wake: extract AEP wake data for each participant
2. B_ERP_allsub_REM: save AEP REM data for all participants
2. B_ERP_allsub_wake: save AEP wake data for all participants
- frequency: perform frequency analyses, run in order A-C
1. A_instantaneous_frequency: calculate instantaneous frequency for REM and wake data for each participant
2. B_freq_allsub: calculate frequency for ON and OFF windows and save for all participants
3. C_cluster_analysis_SnPM_frequency: calculate lme for each electrode with cluster correction for alpha CLAS
3. C_cluster_analysis_SnPM_frequency_theta: calculate lme for each electrode with cluster correction for theta CLAS
- ISI: calculate inter-stimulus-intervals (ISI)
1. A_ISI_allsub_allch: calculate ISI's and save for all participants
- psd: perform power analyses
1. A1_Power_ON_OFF_goodREM: perform power and phase analysis for all trials of each condition and for each participant
2. B_Power_ON_OFF_allsub_allch: average across all good trials, all good phasic and all good tonic trials and save for all participants
3. C_cluster_analysis_SnPM_power: calculate lme for each electrode with cluster correction for alpha CLAS
3. C_cluster_analysis_SnPM_power_theta: calculate lme for each electrode with cluster correction for theta CLAS
- resultant: perform phase-locking accuracy analyses
1. A_resultant_allsub_allch: calculate resultant and mean phase for each participant, condition and channel and save for all participants
- sleep_parameters: calculate sleep stage and phasic/tonic percentages
1. A_Sleep_parameters: calculate classical sleep parameters
2. B_phasic_tonic_conditions: calculate percentage of phasic and tonic REM sleep for each participant and for ON and OFF windows for each condition, save for all participants
# Figures
1. Figure1C_phasic_tonic_epoch: plot example 10-s data for phasic and tonic REM sleep
2. Figure1D_ntrials_across_night_erps: make boxplots for number of AEP and CLAS trials (all and phasic)
3. Figure2_phasic_tonic_psd_AEPs: plot power spectrum for phasic, tonic and wake EO and EC