Skip to content

Commit

Permalink
adjusting dataset link in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
tahatt13 committed Jul 10, 2024
2 parents 35141f1 + e0d7a90 commit d41d7c4
Showing 1 changed file with 77 additions and 113 deletions.
190 changes: 77 additions & 113 deletions moabb/datasets/erpcore2021.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Erpcore2021 dataset
ErpCore2021 dataset
# Author: Taha Habib <[email protected]>
Expand Down Expand Up @@ -47,7 +47,6 @@
"ERN": "q6gwp/providers/osfstorage/600dfa3eb6416f01b7b0467f?",
}


DATASET_PARAMS = {
task: dict(
archive_name=f"ERPCORE2021_{task}.zip",
Expand All @@ -60,9 +59,7 @@
for task, osf in OSF_IDS.items()
}


class Erpcore2021(BaseDataset):
"""Abstract base dataset class for Erpcore2021.
_docstring_head = """
Datasets [1]_ from the article [2]_.
Expand All @@ -77,7 +74,38 @@ class Erpcore2021(BaseDataset):
(MMN), N2pc, N400, P3, Lateralized Readiness Potential (LRP), and Error-Related Negativity
(ERN). These experiments were conducted to standardize ERP paradigms and protocols across
studies.
"""
_docstring_tail = """
The continuous EEG was recorded using a Biosemi ActiveTwo recording system with active
electrodes (Biosemi B.V., Amsterdam, the Netherlands). Recording from 30 scalp electrodes,
mounted in an elastic cap and placed according to the International 10/20 System (FP1, F3,
F7, FC3, C3, C5, P3, P7, P9, PO7, PO3, O1, Oz, Pz, CPz, FP2, Fz, F4, F8, FC4, FCz, Cz, C4,
C6, P4, P8, P10, PO8, PO4, O2; see Supplementary Fig. S1). The common mode sense (CMS)
electrode was located at PO1, and the driven right leg (DRL) electrode was located at PO2.
The horizontal electrooculogram (HEOG) was recorded from electrodes placed lateral to the
external canthus of each eye. The vertical electrooculogram (VEOG) was recorded from an
electrode placed below the right eye. Signals were incidentally also recorded from 37 other
sites, but these sites were not monitored during the recording and are not included in
the ERP CORE data set. All signals were low-pass filtered using a fifth order sinc filter
with a half-power cutoff at 204.8 Hz and then digitized at 1024 Hz with 24 bits of resolution.
The signals were recorded in single-ended mode (i.e., measuring the voltage between the active
and ground electrodes without the use of a reference), and referencing was performed offline.
References
----------
.. [1] Emily S. Kappenman, Jaclyn L. Farrens, Wendy Zhang, Andrew X. Stewart, Steven J. Luck.
(2020). ERP CORE: An open resource for human event-related potential research. NeuroImage.
DOI: https://doi.org/10.18115/D5JW4R
.. [2] Emily S. Kappenman, Jaclyn L. Farrens, Wendy Zhang, Andrew X. Stewart, Steven J. Luck.
ERP CORE: An open resource for human event-related potential research.
DOI: https://doi.org/10.1016/j.neuroimage.2020.117465
"""


class ErpCore2021(BaseDataset):
__doc__ = f"""Abstract base dataset class the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedures**:
- **N170**: Subjects viewed faces and objects to elicit the N170 component. In this task,
an image of a face, car, scrambled face, or scrambled car was presented on each trial in
Expand All @@ -103,33 +131,7 @@ class Erpcore2021(BaseDataset):
sides by arrowheads that pointed in the same direction (congruent trials) or the opposite
direction (incongruent trials). Participants indicated the direction of the central
arrowhead on each trial with a left- or right-hand buttonpress.
The continuous EEG was recorded using a Biosemi ActiveTwo recording system with active
electrodes (Biosemi B.V., Amsterdam, the Netherlands). Recording from 30 scalp electrodes,
mounted in an elastic cap and placed according to the International 10/20 System (FP1, F3,
F7, FC3, C3, C5, P3, P7, P9, PO7, PO3, O1, Oz, Pz, CPz, FP2, Fz, F4, F8, FC4, FCz, Cz, C4,
C6, P4, P8, P10, PO8, PO4, O2; see Supplementary Fig. S1). The common mode sense (CMS)
electrode was located at PO1, and the driven right leg (DRL) electrode was located at PO2.
The horizontal electrooculogram (HEOG) was recorded from electrodes placed lateral to the
external canthus of each eye. The vertical electrooculogram (VEOG) was recorded from an
electrode placed below the right eye. Signals were incidentally also recorded from 37 other
sites, but these sites were not monitored during the recording and are not included in
the ERP CORE data set. All signals were low-pass filtered using a fifth order sinc filter
with a half-power cutoff at 204.8 Hz and then digitized at 1024 Hz with 24 bits of resolution.
The signals were recorded in single-ended mode (i.e., measuring the voltage between the active
and ground electrodes without the use of a reference), and referencing was performed offline.
References
----------
.. [1] Emily S. Kappenman, Jaclyn L. Farrens, Wendy Zhang, Andrew X. Stewart, Steven J. Luck.
(2020). ERP CORE: An open resource for human event-related potential research. NeuroImage.
DOI: https://doi.org/10.18115/D5JW4R
.. [2] Emily S. Kappenman, Jaclyn L. Farrens, Wendy Zhang, Andrew X. Stewart, Steven J. Luck.
ERP CORE: An open resource for human event-related potential research.
DOI: https://doi.org/10.1016/j.neuroimage.2020.117465
{_docstring_tail}
"""

def __init__(self, task):
Expand Down Expand Up @@ -163,7 +165,7 @@ def __init__(self, task):
subjects=list(range(1, 40 + 1)),
sessions_per_subject=1,
events=events,
code=f"Erpcore2021-{task}",
code=f"ErpCore2021-{task}",
interval=interval,
paradigm="p300",
doi="10.1016/j.neuroimage.2020.117465",
Expand Down Expand Up @@ -417,26 +419,18 @@ def encoding(self, events_df: pd.DataFrame):
"""


class Erpcore2021_N170(Erpcore2021):
"""
.. admonition:: Dataset summary
================== ======== ======= ================= =============== =============== ===========
Name #Subj #Chan #Trials / class Trials length Sampling rate #Sessions
================== ======== ======= ================= =============== =============== ===========
Erpcore2021_N170 40 30 240 NT / 80 T 4s 1024Hz 1
================== ======== ======= ================= =============== =============== ===========
Description of the task:
class ErpCore2021_N170(ErpCore2021):
__doc__ = f"""N170 events of the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedure**:
Subjects viewed faces and objects to elicit the N170 component. In this task,
an image of a face, car, scrambled face, or scrambled car was presented on each trial in
the center of the screen, and participants responded whether the stimulus was an “object”
(face or car) or a “texture” (scrambled face or scrambled car).
{_docstring_tail}
"""

__init__ = partialmethod(Erpcore2021.__init__, "N170")
__init__ = partialmethod(ErpCore2021.__init__, "N170")

@staticmethod
def encode_event(row):
Expand Down Expand Up @@ -468,23 +462,18 @@ def encoding(self, events_df):
return encoded_column.values, mapping


class Erpcore2021_MMN(Erpcore2021):
"""
================= ======== ======= ================= =============== =============== ===========
Name #Subj #Chan #Trials / class Trials length Sampling rate #Sessions
================= ======== ======= ================= =============== =============== ===========
Erpcore2021_MMN 40 30 800 NT / 200 T 1s 1024Hz 1
================= ======== ======= ================= =============== =============== ===========
Description of the task:
class ErpCore2021_MMN(ErpCore2021):
__doc__ = f"""MMN events of the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedure**:
Subjects were exposed to a sequence of auditory stimuli to evoke the mismatch
negativity response, indicating automatic detection of deviant sounds. Standard tones
(presented at 80 dB, with p = .8) and deviant tones (presented at 70 dB, with p = .2)
were presented over speakers while participants watched a silent video and ignored the tones.
{_docstring_tail}
"""

__init__ = partialmethod(Erpcore2021.__init__, "MMN")
__init__ = partialmethod(ErpCore2021.__init__, "MMN")

@staticmethod
def encode_event(row):
Expand Down Expand Up @@ -512,22 +501,17 @@ def encoding(self, events_df):
return encoded_column.values, mapping


class Erpcore2021_N2pc(Erpcore2021):
"""
================== ======== ======= ================= =============== =============== ===========
Name #Subj #Chan #Trials / class Trials length Sampling rate #Sessions
================== ======== ======= ================= =============== =============== ===========
Erpcore2021_N2pc 40 30 160 NT / 160 T 1s 1024Hz 1
================== ======== ======= ================= =============== =============== ===========
Description of the task:
class ErpCore2021_N2pc(ErpCore2021):
__doc__ = f"""N2pc events of the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedure**:
Participants were given a target color of pink or blue at the beginning of a
trial block, and responded on each trial whether the gap in the target color square was
on the top or bottom.
{_docstring_tail}
"""

__init__ = partialmethod(Erpcore2021.__init__, "N2pc")
__init__ = partialmethod(ErpCore2021.__init__, "N2pc")

@staticmethod
def encode_event(row):
Expand Down Expand Up @@ -576,25 +560,20 @@ def encoding(self, events_df):
return encoded_column.values, mapping


class Erpcore2021_P3(Erpcore2021):
"""
================ ======== ======= ================= =============== =============== ===========
Name #Subj #Chan #Trials / class Trials length Sampling rate #Sessions
================ ======== ======= ================= =============== =============== ===========
Erpcore2021_P3 40 30 160 NT / 40 T 1s 1024Hz 1
================ ======== ======= ================= =============== =============== ===========
Description of the task:
class ErpCore2021_P3(ErpCore2021):
__doc__ = f"""P3 events of the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedure**:
The letters A, B, C, D, and E were presented in random order (p = .2 for each
letter). One letter was designated the target for a given block of trials, and the other
4 letters were non-targets. Thus, the probability of the target category was .2, but the
same physical stimulus served as a target in some blocks and a nontarget in others.
Participants responded whether the letter presented on each trial was the target or a
non-target for that block.
{_docstring_tail}
"""

__init__ = partialmethod(Erpcore2021.__init__, "P3")
__init__ = partialmethod(ErpCore2021.__init__, "P3")

@staticmethod
# Keeping only the stimulus without the response
Expand Down Expand Up @@ -693,22 +672,17 @@ def encoding(self, events_df):
return encoded_column.values, mapping


class Erpcore2021_N400(Erpcore2021):
"""
================== ======== ======= ================= =============== =============== ===========
Name #Subj #Chan #Trials / class Trials length Sampling rate #Sessions
================== ======== ======= ================= =============== =============== ===========
Erpcore2021_N400 40 30 60 NT / 60 T 1s 1024Hz 1
================== ======== ======= ================= =============== =============== ===========
Description of the task:
class ErpCore2021_N400(ErpCore2021):
__doc__ = f"""N400 events of the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedure**:
On each trial, a red prime word was followed by a green target word.
Participants responded whether the target word was semantically related or unrelated
to the prime word.
{_docstring_tail}
"""

__init__ = partialmethod(Erpcore2021.__init__, "N400")
__init__ = partialmethod(ErpCore2021.__init__, "N400")

@staticmethod
def encode_event(row):
Expand Down Expand Up @@ -748,23 +722,18 @@ def encoding(self, events_df):
return encoded_column.values, mapping


class Erpcore2021_ERN(Erpcore2021):
"""
================= ======== ======= ================= =============== =============== ===========
Name #Subj #Chan #Trials / class Trials length Sampling rate #Sessions
================= ======== ======= ================= =============== =============== ===========
Erpcore2021_ERN 40 30 ~ 400 All 1s 1024Hz 1
================= ======== ======= ================= =============== =============== ===========
Description of the task:
class ErpCore2021_ERN(ErpCore2021):
__doc__ = f"""ERN events of the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedure**:
A central arrowhead pointing to the left or right was flanked on both
sides by arrowheads that pointed in the same direction (congruent trials) or the opposite
direction (incongruent trials). Participants indicated the direction of the central
arrowhead on each trial with a left- or right-hand buttonpress.
{_docstring_tail}
"""

__init__ = partialmethod(Erpcore2021.__init__, "ERN")
__init__ = partialmethod(ErpCore2021.__init__, "ERN")

@staticmethod
def encode_event(row):
Expand Down Expand Up @@ -835,23 +804,18 @@ def encoding(self, events_df):
return encoded_column.values, mapping


class Erpcore2021_LRP(Erpcore2021):
"""
================= ======== ======= ================= =============== =============== ===========
Name #Subj #Chan #Trials / class Trials length Sampling rate #Sessions
================= ======== ======= ================= =============== =============== ===========
Erpcore2021_LRP 40 30 ~ 400 All 1s 1024Hz 1
================= ======== ======= ================= =============== =============== ===========
Description of the task:
class ErpCore2021_LRP(ErpCore2021):
__doc__ = f"""LRP events of the ERP CORE dataset by Kappenman et al. 2020.
{_docstring_head}
**Experimental procedure**:
A central arrowhead pointing to the left or right was flanked on both
sides by arrowheads that pointed in the same direction (congruent trials) or the opposite
direction (incongruent trials). Participants indicated the direction of the central
arrowhead on each trial with a left- or right-hand buttonpress.
{_docstring_tail}
"""

__init__ = partialmethod(Erpcore2021.__init__, "LRP")
__init__ = partialmethod(ErpCore2021.__init__, "LRP")

@staticmethod
def encode_event(row):
Expand Down

0 comments on commit d41d7c4

Please sign in to comment.