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
+29-79Lines changed: 29 additions & 79 deletions
Original file line number
Diff line number
Diff line change
@@ -56,18 +56,18 @@ Note: The Oddball and Fish-Shark scripts include lines to add necessary file pat
56
56
57
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.
58
58
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
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.
60
60
1. Click "Run" on the MATLAB editor window with the script open.
61
61
1. Input the requested information in the Command Window at the bottom of the MATLAB screen.
62
62
63
63
- All inputs are case sensitive.
64
64
- Do not put quotes around any inputs.
65
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)
66
+
1. SRS-ERP-Oddball Repository: the local path to the [Oddball processing repository](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-ERP-Oddball)
67
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`
68
+
- Within the HAPPE folder, this file is in the `1. pre-process` folder, so the full path should be similar to `C:/Users/hawkid/Documents/GitHub/HAPPE/1. pre-process/HAPPE_v4.m`
69
69
1. HAPPE Threshold: "Hard" for hard threshold (preferred) or "Soft" for soft threshold
70
-
-**Case-sensitive**--first letter must be capitalized.
70
+
-**Casesensitive**--first letter must be capitalized.
71
71
- Do not include quotation marks.
72
72
- The soft threshold is less strict with artifact removal, and the hard threshold is more strict.
73
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)
@@ -417,7 +417,7 @@ These actions will take place automatically upon completion of the HAPPE pipelin
417
417
418
418
## FishShark Processing Pipeline
419
419
420
-
### Recommended Folder Strucure
420
+
### Folder Strucure
421
421
422
422
1.`0 - Raw`
423
423
1.`1a - Files for HAPPE`
@@ -435,67 +435,33 @@ The following section describes the MATLAB scripts used to manage HAPPE input an
435
435
**The first two steps described in this section are the same as those described for Oddball processing.**
436
436
**Processing actions specific to FishSharks task begin in Step 3.**
437
437
438
-
1. Open the `eegProccessingFishshark.m` file (accessible via Git [here](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-DataProcessing/-/blob/master/6.%20MATLAB%20EEG%20Pipeline/eegProcessingFishshark.m)) in MATLAB
439
-
1.Update all thresholds and filepaths in script file (must be done BEFORE running the script)
440
-
- In the fifth 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.
441
-
Additional thresholds can also be set for things like number of channels retained, but these are not currently in use.
442
-
-Note that setting these parameters occurs later in the FishSharks script than the one for Oddball;
443
-
this is because FishSharks files require additional processing before they are ready for HAPPE (see step 3 for details)
438
+
1. Open the `eegProccessingFishshark.m` file (accessible via Git [here](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-DataProcessing/-/blob/master/6.%20MATLAB%20EEG%20Pipeline/eegProcessingFishshark.m)) in MATLAB.
439
+
1.Click "Run" on the MATLAB editor window with the script open.
440
+
1. Input the requested information in the Command Window at the bottom of the MATLAB screen.
441
+
442
+
-All inputs are case sensitive.
443
+
- Do not put quotes around any inputs.
444
444
445
-
```
446
-
% Set quality threshold parameters
447
-
trialCutoff = 10;
448
-
```
449
-
- We also set environment variables with all of the filepaths that are relevant for managing HAPPE output files and tracking processed data.
450
-
The following paths should be checked and updated as necessary to reflect the organization of processing on your computer.
451
-
-`passPath` is the location you wish to have files that meet or exceed the above-defined thresholds to be saved
452
-
-`allPath` is the location you wish to have ALL files outputted from HAPPE saved to (regardless of whether threshold is met or not)
453
-
-`failPath` is the location you wish to have files that do not meet the above-defined thresholds to be copied to
454
-
- .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
455
-
-`summPath` is the location you wish to save the file that lists all files processed through HAPPE in the current batch
456
-
- 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
457
-
-`manPath` is the location you wish to save the file that lists all files that do not meet the above-defined thresholds
458
-
- 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
459
-
460
-
```
461
-
% Set paths for file sorting
462
-
passPath = 'V:\Processing-Repo\Folder Structure\3 - Files for PCA'; %location for .txt output files
463
-
allPath = 'V:\Processing-Repo\Folder Structure\2 - Processed Files'; %location for all processed files to end up
464
-
failPath = 'V:\Processing-Repo\Folder Structure\1b - Manual Processing'; %location to copy unsuccessful .mff to for manual process
% Set path for summary of files to process manually
470
-
manPath = 'Z:\Shared Server\Study Folder\Data Processing\6. MATLAB EEG Pipeline\Processing To Do\Cases to Process Manually\Lists of Cases by Batch';
471
-
```
472
-
1. Update raw (.mff) files' condition tags with accuracy information
445
+
1. Raw Files: the full path to the folder containing the raw data files
446
+
1. Updated Files: the full path to the folder to store the data files after accuracy coding (folder must exist before running script)
447
+
1. SRS-ERP-FishSharks Repository: the local path to the [Fish-Sharks processing repository](https://research-git.uiowa.edu/PetersenLab/SRS/SRS-ERP-FishSharks)
448
+
1. HAPPE Pre-Processing File: the **full** file path to HAPPE_v4.m
449
+
- Within the HAPPE folder, this file is in the `1. pre-process` folder, so the full path should be similar to `C:/Users/hawkid/Documents/GitHub/HAPPE/1. pre-process/HAPPE_v4.m`
450
+
1. HAPPE Threshold: "Hard" for hard threshold (preferred) or "Soft" for soft threshold
451
+
-**Case sensitive##--first letter must be capitalized.
452
+
- Do not include quotation marks.
453
+
- The soft threshold is less strict with artifact removal, and the hard threshold is more strict.
454
+
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)
455
+
456
+
1. Update raw (.mff) files' condition tags with accuracy information.
473
457
- Unlike the Passive Oddball task, FishSharks trials can be either correct or incorrect.
474
458
Whether or not a trial was "responded to" correctly is relevant to the nature of the extracted ERP.
475
459
Because the event tags in our .mff files do not inherently contain information about whether each trial was responded to correctly, we need to add it ourselves.
476
460
This process can be done manually in NetStation, but it can also be automated using the MATLAB code detailed below.
477
-
- NOTE: This code requires eeglab.
478
-
**Before running the code, open eeglab in your MATLAB session by typing `eeglab` into the console.**
479
-
You can close it as soon as it opens, but this step ensures that eeglab is loaded into your current session and helps prevent the subsequent code from erroring out.
480
-
481
-
1. Set the filepaths for raw and updated .mff files
482
-
- This section is set to rely on user inputs.
483
-
Click "Run" in the MATLAB editor to start the processing.
484
-
- A message will appear in the console prompting you to enter two filepaths:
485
-
the first is the location of the raw .mff files, and the second is the location you would like the updated files to save in.
486
-
- **Note: the filepaths inputted should NOT be in quotes**
487
-
488
-
```
489
-
% User input for location of raw files
490
-
pathRaw = input('Enter the full path to the folder containing the raw files:\n> ','s');
491
-
492
-
% User input for destination of subsetted files
493
-
pathSub = input('Enter the full path to the folder in which to save the updated files:\n> ','s');
494
-
```
495
-
At this point, there will be no user input/actions necessary until all of the .mff files in the `pathRaw` directory have been updated and saved into the `pathSub` directory.
496
-
The code that asks the user for the path to HAPPE will run when that process has finished.
497
-
The following section will describe the code used to automate the process of updating .mff event tags to include accuracy information at the trial level.
498
-
Move on to Step 4 (Run the HAPPE Pipeline) when the process has completed.
461
+
At this point, there will be no user input/actions necessary until all of the .mff files in the Raw Files directory have been updated and saved into the Updated Files directory provided in the previous step.
462
+
This part of the script may take a few minutes to run.
463
+
The following section will describe the code used to automate the process of updating .mff event tags to include accuracy information at the trial level.
464
+
Move on to Step 4 (Run the HAPPE Pipeline) when the process has completed.
499
465
500
466
1. Gather and manage information from the directory housing the raw (.mff) files
501
467
@@ -508,7 +474,7 @@ The following section describes the MATLAB scripts used to manage HAPPE input an
508
474
dirInfo(noName, :) = [];
509
475
```
510
476
1. Generate variables necessary for managing raw and updated files
511
-
- This code will generate the full filepaths (including file name) necessary for reading in each .mff file and saving its updated counterpart
477
+
- This code will generate the full file paths (including file name) necessary for reading in each .mff file and saving its updated counterpart
512
478
- It will also generate an ID variable for joining purposes based on the expected location of the subject name in the name of each file
513
479
514
480
```
@@ -641,23 +607,7 @@ The following section describes the MATLAB scripts used to manage HAPPE input an
641
607
pop_mffexport(EEGraw, char(subFolder))
642
608
end
643
609
```
644
-
645
-
646
-
1. Run the HAPPE Pipeline
647
-
- This section is designed to rely on user input.
648
-
- When the prior steps have finsihed, 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
649
-
- Once the path is entered, MATLAB will run the file
650
-
- **Note: the filepath inputted should NOT be in quotes**
651
-
652
-
```
653
-
% Set path to HAPPE pre-processing script
654
-
happeRun = input('Enter the full path to the HAPPE pre-processing file:\n> ','s') ;
655
-
656
-
% Call and run HAPPE pre-processing script
657
-
run(happeRun);
658
-
```
659
-
1. Enter HAPPE inputs
660
-
- See the following section for HAPPE inputs for the Fish/Shark task
610
+
1. Enter HAPPE inputs.
661
611
662
612
After the HAPPE inputs are entered, no more user interaction is required for the script to do its job.
663
613
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.
0 commit comments