You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: eegERP.qmd
+19-59Lines changed: 19 additions & 59 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ title: "EEG and ERP Processing and Analysis"
29
29
- You should have the following subfolders in your `MatLab` folder:
30
30
-`EP_Toolkit`
31
31
-`Fieldtrip-[version number]`
32
+
1. Add GitLab repositories: [Oddball](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-ERP-Oddball) and [Fish-Shark](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-ERP-FishSharks)
32
33
33
34
## MATLAB Scripts to Manage HAPPE Files {#sec-matlabScripts}
34
35
@@ -37,21 +38,11 @@ These actions can be done manually as well, but the MATLAB scripts make the proc
37
38
The scripts will also generate a "log" of all of the files processed through HAPPE to facilitate tracking of EEG data processing.
38
39
The sections below detail the code used to perform these actions as well as the instructions for using the current scripts.
39
40
40
-
Note: Before using the scripts/code detailed below, ensure that all filepaths used are in your MATLAB path collection.
41
-
These may include:
42
-
43
-
- The location where the automatic scripts are stored (for our lab, this is under `/Data Processing/6. MATLAB EEG Pipeline`)
44
-
- The location where the HAPPE pre-processing script is stored
45
-
- The location of the raw data (to be processed)
46
-
- The location(s) of any intermediate files for processing (e.g., the updated .mff files that contain accuracy information in FishShark)
47
-
- The location(s) for any files outputted by HAPPE and/or places you wish to use the script to move them to
48
-
49
-
To add a file path, click on Home/Set Path/Add Folder in MATLAB.
50
-
You don't need to specify the file name, just its containing folder.
41
+
Note: The Oddball and Fish-Shark scripts include lines to add necessary file paths to your MATLAB path collection.
51
42
52
43
## Oddball Processing Pipeline
53
44
54
-
### Recommended Folder Strucure
45
+
### Folder Strucure
55
46
56
47
1.`1a - Files for HAPPE`
57
48
1.`1b - Manual Processing`
@@ -66,56 +57,25 @@ You don't need to specify the file name, just its containing folder.
66
57
The following section describes the MATLAB scripts used to manage HAPPE output files for the Oddball task data. If you are running HAPPE manually (i.e., without integrating these scripts), skip to the [Oddball HAPPE inputs](#sec-inputOddballHAPPE) section.
67
58
68
59
1. Open the `eegProccessingOddball.m` file (accessible via Git [here](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-DataProcessing/-/blob/master/6.%20MATLAB%20EEG%20Pipeline/eegProcessingOddball.m)) in MATLAB
69
-
1. Update all thresholds and filepaths in script file (must be done BEFORE running the script)
70
-
- In the second section of our script file, we set our "threshold" for the minimum number of trials that need to be retained after pre-processing for a subject's data to be eligible for PCA.
71
-
Additional thresholds can also be set for things like number of channels retained, but these are not currently in use.
72
-
73
-
```
74
-
% Set quality threshold parameters
75
-
trialCutoff = 10;
76
-
```
77
-
- We also set environment variables with all of the filepaths that are relevant for managing HAPPE output files and tracking processed data.
78
-
The following paths should be checked and updated as necessary to reflect the organization of processing on your computer.
79
-
-`passPath` is the location you wish to have files that meet or exceed the above-defined thresholds to be saved
80
-
-`allPath` is the location you wish to have ALL files outputted from HAPPE saved to (regardless of whether threshold is met or not)
81
-
-`failPath` is the location you wish to have files that do not meet the above-defined thresholds to be copied to
82
-
- .mff files that do not meet threshold will be copied here as an indication that they should be processed manually to see if they meet threshold afterward
83
-
-`summPath` is the location you wish to save the file that lists all files processed through HAPPE in the current batch
84
-
- We currently use this to save the "processing log" to a location that all team members/computers have access to so it is easier to determine which files require processing when EEG data are not stored on a shared server
85
-
-`manPath` is the location you wish to save the file that lists all files that do not meet the above-defined thresholds
86
-
- We currently use this to save the "to process manually" list to a location that all team members/computers have access to so it is easier to determine which files require manual processing because the copied .mff file would not be acessible via our shared server
87
-
88
-
```
89
-
% Set paths for file sorting
90
-
passPath = 'V:\Processing-Repo\Folder Structure\3 - Files for PCA'; %location for .txt output files
91
-
allPath = 'V:\Processing-Repo\Folder Structure\2 - Processed Files'; %location for all processed files to end up
92
-
failPath = 'V:\Processing-Repo\Folder Structure\1b - Manual Processing'; %location to copy unsuccessful .mff to for manual process
1. Click "Run" on the MATLAB editor window with the script open.
61
+
1. Input the requested information in the Command Window at the bottom of the MATLAB screen.
96
62
97
-
% Set path for summary of files to process manually
98
-
manPath = 'Z:\Shared Server\Study Folder\Data Processing\6. MATLAB EEG Pipeline\Processing To Do\Cases to Process Manually\Lists of Cases by Batch';
99
-
```
100
-
1. Run the HAPPE Pipeline
101
-
- This first section is designed to rely on user input.
102
-
Click "Run" on the MATLAB editor window with the file open to begin the process.
103
-
- A message will appear in the console prompting you to enter the filepath to the location of the HAPPE pre-processing file you wish to run
104
-
- Once the path is entered, MATLAB will run the file
105
-
- **Note: the filepath inputted should NOT be in quotes**
106
-
107
-
```
108
-
% Set path to HAPPE pre-processing script
109
-
happeRun = input('Enter the full path to the HAPPE pre-processing file:\n> ','s') ;
110
-
111
-
% Call and run HAPPE pre-processing script
112
-
run(happeRun);
113
-
```
114
-
1. Enter HAPPE inputs
115
-
- See the following section for HAPPE user inputs for Oddball
63
+
- All inputs are case sensitive.
64
+
- Do not put quotes around any inputs.
65
+
66
+
1. SRS-ERP-Oddball Repository: the local path to the [Oddball processing repo](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-ERP-Oddball)
67
+
1. HAPPE Pre-Processing File: the **full** file path to HAPPE_v4.m
68
+
- Within the HAPPE folder, this file is in the `1. pre-process` folder, so the full path should be similar to `Documents/GitHub/HAPPE/1. pre-process/HAPPE_v4.m`
69
+
1. HAPPE Threshold: "Hard" for hard threshold (preferred) or "Soft" for soft threshold
70
+
-**Case-sensitive**--first letter must be capitalized.
71
+
- Do not include quotation marks.
72
+
- The soft threshold is less strict with artifact removal, and the hard threshold is more strict.
73
+
1. Trial Cutoff: the minimum number of trials that need to be retained after processing for a particular recording to be eligible for PCA (default is 10)
74
+
75
+
1. Enter [HAPPE inputs](#sec-inputOddballHAPPE).
116
76
117
77
After the HAPPE inputs are entered, no more user interaction is required for the script to do its job.
118
-
The HAPPE pipeline will run, and the remaining MATLAB code in the script file will evaluate the files outputted by HAPPE and move them to the appropriate locations based on this evaluation.
78
+
The HAPPE pipeline will run, and the remaining MATLAB code in the script file will evaluate the files produced by HAPPE and move them to the appropriate locations based on this evaluation.
119
79
See [Oddball Post-HAPPE Steps](#sec-oddballPost) for a detailed explanation of the code used to accomplish this.
0 commit comments