biopsykit.protocols.tsst module

Module representing the Trier Social Stress Test (TSST) protocol.

class biopsykit.protocols.tsst.TSST(name=None, structure=None, **kwargs)[source]

Bases: biopsykit.protocols.base.BaseProtocol

Class representing the Trier Social Stress Test (TSST).

The general structure of the TSST can be specified by passing a structure dict to the constructor.

Up to three nested structure levels are supported:
  • 1st level: study part: Different parts of the study where the TSST was conducted, such as: “Pre”, “TSST”, and “Post”.

  • 2nd level: phase: Different TSST phases that belong to the same study part, such as: “Preparation”, “Talk”, “Math” (for study part “TSST”) or “Questionnaires”, “Rest” (for study part “Pre”).

  • 3rd level: subphase: Different TSST subphases that belong to the same phase.

Parameters
  • name (str) – name of protocol or None to use “TSST” as default name. Default: None

  • structure (dict, optional) –

    nested dictionary specifying the structure of the TSST study.

    Up to three nested structure levels are supported:

    • 1st level: study part: Different parts of the study where the TSST was conducted, such as: “Pre”, “TSST”, and “Post”.

    • 2nd level: phase: Different TSST phases that belong to the same study part, such as: “Preparation”, “Talk”, “Math” (for study part “TSST”) or “Questionnaires”, “Rest” (for study part “Pre”).

    • 3rd level: subphase: Different TSST subphases that belong to the same phase.

    If a study part has no division into finer phases (or a phase has no division into finer subphases) the dictionary value can be set to None.

  • **kwargs

    additional parameters to be passed to MIST and its superclass, BaseProtocol, such as:

Examples

>>> from biopsykit.protocols import TSST
>>> # Example: TSST study consisting of three parts. Only the TSST part consists of different phases
>>> structure = {
>>>     "Pre": None,
>>>     "TSST": {
>>>         "Preparation": 300,
>>>         "Talk": 300,
>>>         "Math": 300
>>>     },
>>>     "Post": None
>>> }
>>> TSST(name="TSST", structure=structure)

References

Kirschbaum, C., Pirke, K.-M., & Hellhammer, D. H. (1993). The “Trier Social Stress Test” - A Tool for Investigating Psychobiological Stress Responses in a Laboratory Setting. Neuropsychobiology, 28, 76-81. https://doi.org/10.1159/000119004

name: str

Study or protocol name

structure: Dict[str, Any]

Structure of protocol, i.e., whether protocol is divided into different parts, phases, or subphases.

If protocol is not divided into different parts protocol_structure is set to None.

saliva_types: Sequence[str]

List of saliva data types present in the study.

test_times: Sequence[int]

Start and end time of psychological test (in minutes).

If no psychological test was performed in the protocol test_times is set to [0, 0].

sample_times: Dict[str, Sequence[int]]

Dictionary with sample times of saliva samples (in minutes).

Sample times are either provided explicitly using the sample_times parameter in add_saliva_data() or by extracting it from the saliva data (if a time column is present).

saliva_data: Dict[str, SalivaRawDataFrame]

Dictionary with saliva data collected during the study.

Data in SalivaRawDataFrame format can be added using add_saliva_data().

hr_data: Dict[str, HeartRateSubjectDataDict]

Dictionary with heart rate data collected during the study. If the study consists of multiple study parts each part has its own HeartRateSubjectDataDict. If the study has no individual study parts (only different phases), the name of the one and only study part defaults to Study (to ensure consistent dictionary structure).

Data in HeartRateSubjectDataDict format can be added using add_hr_data().

rpeak_data: Dict[str, SubjectDataDict]

Dictionary with R peak data collected during the study. If the study consists of multiple study parts each part has its own SubjectDataDict. If the study has no individual study parts (only different phases), the name of the one and only study part defaults to Study (to ensure consistent dictionary structure).

Data in SubjectDataDict format can be added using add_hr_data().

hr_results: Dict[str, pd.DataFrame]

Dictionary with heart rate results.

Dict keys are the identifiers that are specified when computing results from hr_data using compute_hr_results().

hr_above_baseline_results: Dict[str, pd.DataFrame]

Dictionary with heart rate above baseline results.

Dict keys are the identifiers that are specified when computing results from hr_data using compute_hr_above_baseline().

hrv_results: Dict[str, pd.DataFrame]

Dictionary with heart rate variability ensemble.

Dict keys are the identifiers that are specified when computing ensemble from rpeak_data using compute_hrv_results().

hrv_above_baseline_results: Dict[str, pd.DataFrame]

Dictionary with heart rate variability above baseline results.

Dict keys are the identifiers that are specified when computing results from rpeak_data using compute_hrv_above_baseline().

hr_ensemble: Dict[str, Dict[str, pd.DataFrame]]

Dictionary with merged heart rate data for heart rate ensemble plot.

Dict keys are the identifiers that are specified when computing ensemble HR data from hr_data using compute_hr_ensemble().

See also

hr_ensemble_plot()

heart rate ensemble plot

saliva_plot_params: Dict[str, Any]

Plot parameters for customizing the general saliva plot for a specific psychological protocol.

See also

saliva_plot()

saliva plot

hr_mean_plot_params: Dict[str, Any]

Plot parameters for customizing the general HR mean plot for a specific psychological protocol.

See also

hr_mean_plot()

HR mean plot

hr_ensemble_plot_params: Dict[str, Any]

Plot parameters for customizing the general HR ensemble plot for a specific psychological protocol.

See also

hr_ensemble_plot()

HR ensemble plot