# Task data (individual subjects)
Data for each participant are in a separate folder, named with their subject ID (e.g. "S01", "S47").
## Task performance data
Each folder should contain multiple `.txt` files, named in the following way: "AB_`SUBJECTID`\_`VISITNR` `POLARITY`_`BLOCK`.txt", where:
* `SUBJECTID` is the same as the folder name (e.g. "S01", "S47")
* `VISITNR` is either 1 (first time subject came to the lab), or 2 (second time subject came to the lab)
* `POLARITY` codes for the tDCS polarity they received during this visit (see the `doc/tDCS_blinding.md` file for more information:
- _Anodal_ is coded as 'B' from S01--S21 and 'D' from S22 onwards.
- _Cathodal_ is coded as 'D' from S01--S21 and 'I' from S22 onwards.
* `BLOCK` is whether the data is from the block before tDCS (_pre_), during tDCS (_tDCS_) or after tDCS (_post_).
Each file contains a table with the following columns:
* __totalTrial__: trial number
* __block__: block number
* __trial__: trial number within each block (1--39)
* __T1pos__: position of T1 in the letter stream (fixed to 5)
* __T1letter__: identity of T1
* __T1resp__: participant's response to T1 question
* __T2letter__: identity of T2
* __T2resp__: participant's response to T2 question
* __T1acc__: 1 if participant was correct (T1letter = T1resp), 0 if incorrect
* __T2acc__: 1 if participant was correct (T2letter = T2resp), 0 if incorrect
* __T1T2acc__:
- 3 = both incorrect: T1 and T2 identities were swapped
- 1 = both incorrect: T1 identity given as T2 answer
- 2 = both incorrect: T2 identity given as T1 answer
- 0 = both incorrect: otherwise
- 13 = both correct (no-blink trial)
- 11 = only T1 correct (blink trial)
- 12 = only T2 correct
N.B. Sometimes there are multiple files with the same name, followed by a number (e.g. "AB_S02_2B_tDCS.txt" and "AB_S02_2B_tDCS2.txt"). This was due to a bug that sometimes caused the task program to crash. It would then have to be restarted, creating a new `.txt` file (these are simply concatenated in the data analysis).
## Task log files
Each `.txt` file will have its associated `.log` file written automatically by [Presentation](https://www.neurobs.com/presentation), containing info on the stimulus timing among other things.
# Metadata
* `subject_info.csv`: table with the following columns:
1. **subject**: subject ID
2. **session**: is either 1 (first time subject came to the lab), or 2 (second time subject came to the lab)
3. **polarity**: Whether subject received _anodal_ or _cathodal_ stimulation in this session
4. **time**: Date-time the session was scheduled to start, in `WEEKDAY DD.MM.YY HH:MM` format format (e.g. "Fri 10.06.2016 14:00")
5. **gender**
6. **age**: in years
7. **sleep_hours**: amount of sleep gotten the night before, in hours
8. **sleep_quality**: quality of sleep, rated 1 (bad), 2 (subpar), 3 (OK), 4 (good), or 5 (very good)
9. **alcohol_glasses**: number of alcoholic drinks consumed day before the session (or day of the session, though I certainly hope not)
10. **smoker**: whether participant considers themselves a smoker, _yes_ or _no_
11. **caffeine_today**: number of cups of coffee/black tea consumed on day of the session
12. **caffeine_usual**: number of cups of coffee/black tea participant would typically consume
13. **contacts_glasses**: whether participants wears _contacts_, _glasses_ or neither (_no_). Unfortunately some (n = 6) also simply answered _yes_, without specifying. This data was collected because participants with contacts might have a higher spontaneous eye blink rate. However, even when counting all the _yes_ responses as contacts-wearers, this would probably leave too few too properly analyze (n = 11).
14. **EEG_experience**: whether participant previously participated in an EEG study, _yes_ or _no_. This data was collected because participants with EEG experience might remember the instruction that blinks are bad for the signal, and would thus have a lower spontaneous eye blink rate. Only a handful (n=6) participants answered _yes_ here though.
Items 7--13 were measured with the _sEBR questionnaire_ (see the `records/questionnaires` folder). Item 14 was asked verbally during the setup of the recordings.
# tDCS adverse events
* `tdcs_AE.csv`: data from the tDCS side effects questionnaire administered at the end each session. They were asked to which degree the following sensations were present during stimulation: *tingling*, *itching sensation*, *burning sensation*, *pain*, *headache*, *fatigue*, *dizziness* and *nausea*. Each was rated on a scale from 0-4:
1. none
2. a little
3. moderate
4. strong
5. very strong
They also rated their confidence *that the sensations were caused by the stimulation* on a scale from 0-4 (columns starting with `conf.`):
1. n/a (meaning they rated the sensation a 0 on the previous scale)
2. unlikely
3. possibly
4. likely
5. very likely
Finally, any other remarks participants wrote down are in the *notes* column.
# sEBR
`sEBR.csv` contains the final spontaneous Eye Blink Rate values. This file was generated by the `src/read_sEBR.m` script, which reads the sEBR value from each individual `*`_processed.mat_ in the `sEBR/processed` folder (see below). It contains the following columns:
* __subject__: is the subject ID ("S01", "S47", etc.)
* __session__: is either 1 (first time subject came to the lab), or 2 (second time subject came to the lab)
* __tDCS_code__: codes for the tDCS polarity they received during this visit (see the `records/tDCS_blinding.md` file for more information:
* _Anodal_ is coded as 'B' from S01--S21 and 'D' from S22 onwards.
* _Cathodal_ is coded as 'D' from S01--S21 and 'I' from S22 onwards.
* __sEBR__: spontaneous Eye Blink Rate in blinks per minute (based on 6 minutes of data)
## Raw data
The `sEBR/raw` folder contains the recorded EEG data in Biosemi `.bdf` format. Data for each participant are in a separate folder, named with their subject ID (e.g. "S01", "S47").
Each folder should contain two .bdf files (some participants only have one file because they only completed one session), using the "`SUBJECTID`\_`VISITNR` `POLARITY`_sEBR.bdf" naming format, where:
- `SUBJECTID` is the subject ID ("S01", "S47", etc.)
- `VISITNR` is either 1 (first time subject came to the lab), or 2 (second time subject came to the lab)
- `POLARITY` codes for the tDCS polarity they received during this visit (see the `records/tDCS_blinding.md` file for more information:
* _Anodal_ is coded as 'B' from S01--S21 and 'D' from S22 onwards.
* _Cathodal_ is coded as 'D' from S01--S21 and 'I' from S22 onwards.
## Processed data
The `processed` folder contains the results of running the `src/sEBR.m` (part 1 and 2) scripts on the raw data.
The file names follow the same format of the raw data (starting with "`SUBJECTID`\_`VISITNR` `POLARITY`_sEBR"; see above, denoted as `*` below). There should be four different files for each single raw `.bdf` file:
* `*`\_ICA.mat: MATLAB data file containing the processed EEG data, up to and including the Independent Component Analysis (ICA) step (see `src/sEBR_part1.m`). These contain an [EEGLAB](https://sccn.ucsd.edu/eeglab/index.php) `EEG` structure.
* `*`\_blinkIC`NR`.txt: Text file with the time series of the single independent component that captured the eye blinks. `NR` is the number of the component (these are sorted by descending order of explained variance, so usually this will be a low number, as blinks are large in amplitude). (see `src/sEBR_part2.m`)
* `*`\_processed.mat: MATLAB data file saved after all the eye blinks were identified, containing data on their timing and the parameters used to identify them (see `src/sEBR_part2.m`)
* `*`\_blinkIC`NR`.txt\_ibis.txt: Text file with Inter Blink Intervals (not analyzed).