Repository: neuropsychology/NeuroKit (language: python)

Issue:
Creation of Uneven Epochs
Hi friends,

Thank you for creating such an amazing kit for easy analysis of data.

I was just wondering how we might be able to create epochs that are uneven for the time-related analysis of data. I noticed a note 

I propose to include a variable in the source code for the function epochs_create() named "event_duration" that accesses the "duration" array created by the events_find() function.

Subsequently, we can assign the end of the event as event_start + "duration". 

I'm not an expert on coding but your team might be able to make this work. Hope to see this capability appear soon!

Thanks a bunch!

[Feature] Updated Error Bar Request

# Description

This PR aims at adding this feature: Error bars in the summary plot method to illustrate standard error of each bin.

# Proposed Changes

I changed the function "Summary_Plot" to take in an bool errorbar parameter that if true will display the error bar and if false will not display errorbar.


# Checklist

Here are some things to check before creating the PR. If you encounter any issues, do let us know :)

- [ X] I have read the [CONTRIBUTING](https://github.com/neuropsychology/NeuroKit/blob/master/.github/CONTRIBUTING.rst#structure-and-code) file.
- [X ] My PR is targetted at the **dev branch** (and not towards the master branch).
- [X ] I ran the [CODE CHECKS](https://github.com/neuropsychology/NeuroKit/blob/master/.github/CONTRIBUTING.rst#run-code-checks) on the files I added or modified and fixed the errors.
![image](https://user-images.githubusercontent.com/48297976/107886202-34dc8280-6eb3-11eb-8fc8-4e370c27aa18.png)

Fix nk.standardize() to exclude data that are strings
Potentially have it check for data.dtypes. TODO


Discussion / hints:

Fix patch:
diff --git a/NEWS.rst b/NEWS.rst
index f193e81dc5..e260ee42c3 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -6,3 +6,20 @@ News
 -------------------
 
 * First release on PyPI.
+
+0.1.1
+-------------------
+
+New Features
++++++++++++++
+
+* Use duration from `nk.events_find()` as `epochs_end` in `nk.epochs_create()`
+* Add `nk.find_outliers()` to identify outliers (abnormal values)
+* Add utility function - `nk.check_type()` to return appropriate boolean values of input (integer, list, ndarray, pandas dataframe or pandas series)
+* (experimental) Add error bars in the summary plot method to illustrate standard error of each bin
+
+Fix Bugs
++++++++++++++
+
+* Fix type of value in `signal_formatpeaks()` to ensure slice assignment is done on the same type
+
diff --git a/neurokit2/__init__.py b/neurokit2/__init__.py
index 0e2f74fdf3..dc8b9f89ed 100644
--- a/neurokit2/__init__.py
+++ b/neurokit2/__init__.py
@@ -31,7 +31,7 @@
 
 
 # Info
-__version__ = "0.1.0"
+__version__ = "0.1.1"
 
 
 # Maintainer info
@@ -41,15 +41,16 @@
 
 # Citation
 __bibtex__ = r"""
-@misc{neurokit2,
-  doi = {10.5281/ZENODO.3597887},
-  url = {https://github.com/neuropsychology/NeuroKit},
-  author = {Makowski, Dominique and Pham, Tam and Lau, Zen J. and Brammer, Jan C. and Lesspinasse,
-            Fran\c{c}ois and Pham, Hung and Schölzel, Christopher and S H Chen, Annabel},
-  title = {NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing},
-  publisher = {Zenodo},
-  month={Mar},
-  year = {2020},
+@article{Makowski2021neurokit,
+    author={Makowski, Dominique and Pham, Tam and Lau, Zen J. and Brammer, Jan C. and Lespinasse, Fran{\c{c}}ois and Pham, Hung and Sch{\"o}lzel, Christopher and Chen, S. H. Annabel},
+    title={NeuroKit2: A Python toolbox for neurophysiological signal processing},
+    journal={Behavior Research Methods},
+    year={2021},
+    month={Feb},
+    day={02},
+    issn={1554-3528},
+    doi={10.3758/s13428-020-01516-y},
+    url={https://doi.org/10.3758/s13428-020-01516-y}
 }
 """
 
diff --git a/neurokit2/bio/bio_analyze.py b/neurokit2/bio/bio_analyze.py
index 3c49217d8e..a8085a363d 100644
--- a/neurokit2/bio/bio_analyze.py
+++ b/neurokit2/bio/bio_analyze.py
@@ -215,9 +215,17 @@ def _bio_analyze_rsa_event(data, rsa={}):
         rsa = pd.DataFrame.from_dict(rsa, orient="index")
 
     elif isinstance(data, pd.DataFrame):
-        rsa["RSA_P2T"] = np.nanmean(data.groupby("Label")["RSA_P2T"])
-        rsa["RSA_Gates"] = np.nanmean(data.groupby("Label")["RSA_Gates"])
-        # TODO Needs further fixing
+
+        # Convert back to dict
+        for label, df in data.groupby('Label'):
+            rsa[label] = {}
+            epoch = df.set_index('Time')
+            rsa[label] = _bio_analyze_rsa_epoch(epoch, rsa[label])
+        rsa = pd.DataFrame.from_dict(rsa, orient="index")
+        # Fix index sorting to combine later with features dataframe
+        rsa.index = rsa.index.astype(int)
+        rsa = rsa.sort_index().rename_axis(None)
+        rsa.index = rsa.index.astype(str)
 
     return rsa
 
diff --git a/neurokit2/eda/eda_eventrelated.py b/neurokit2/eda/eda_eventrelated.py
index bf0238d9ce..5b8f8bbed7 100644
--- a/neurokit2/eda/eda_eventrelated.py
+++ b/neurokit2/eda/eda_eventrelated.py
@@ -164,7 +164,6 @@ def _eda_eventrelated_scr(epoch, output={}):
     peak_amplitude = epoch["SCR_Amplitude"][epoch.index > 0].iloc[first_activation]
     output["SCR_Peak_Amplitude"] = peak_amplitude
     output["SCR_Peak_Amplitude_Time"] = epoch["SCR_Amplitude"][epoch.index > 0].index[first_activation]
-
     # Rise Time
     rise_time = epoch["SCR_RiseTime"][epoch.index > 0].iloc[first_activation]
     output["SCR_RiseTime"] = rise_time
diff --git a/neurokit2/eda/eda_peaks.py b/neurokit2/eda/eda_peaks.py
index b1190bdfd6..da93565f3c 100644
--- a/neurokit2/eda/eda_peaks.py
+++ b/neurokit2/eda/eda_peaks.py
@@ -109,13 +109,13 @@ def _eda_peaks_getfeatures(info, eda_phasic, sampling_rate=1000, recovery_percen
 
     # Sanity checks -----------------------------------------------------------
 
-    # Peaks (remove peaks with no onset)
+    # Peaks (remove peaks before first onset)
     valid_peaks = np.logical_and(
         info["SCR_Peaks"] > np.nanmin(info["SCR_Onsets"]), ~np.isnan(info["SCR_Onsets"])
     )  # pylint: disable=E1111
     peaks = info["SCR_Peaks"][valid_peaks]
 
-    # Onsets (remove onsets with no peaks)
+    # Onsets (remove onsets with after last peak)
     valid_onsets = ~np.isnan(info["SCR_Onsets"])
     valid_onsets[valid_onsets] = info["SCR_Onsets"][valid_onsets] < np.nanmax(info["SCR_Peaks"])
     onsets = info["SCR_Onsets"][valid_onsets].astype(int)
@@ -132,7 +132,7 @@ def _eda_peaks_getfeatures(info, eda_phasic, sampling_rate=1000, recovery_percen
     amplitude = np.full(len(info["SCR_Height"]), np.nan)
     amplitude[valid_peaks] = info["SCR_Height"][valid_peaks] - eda_phasic[onsets]
 
-    # Rise times
+    # Rise times (in seconds)
     risetime = np.full(len(info["SCR_Peaks"]), np.nan)
     risetime[valid_peaks] = (peaks - onsets) / sampling_rate
 
diff --git a/neurokit2/epochs/epochs_create.py b/neurokit2/epochs/epochs_create.py
index fe52d9f420..ab9519f697 100644
--- a/neurokit2/epochs/epochs_create.py
+++ b/neurokit2/epochs/epochs_create.py
@@ -11,7 +11,7 @@ def epochs_create(
     events=None,
     sampling_rate=1000,
     epochs_start=0,
-    epochs_end=1,
+    epochs_end="from_events",
     event_labels=None,
     event_conditions=None,
     baseline_correction=False,
@@ -31,11 +31,17 @@ def epochs_create(
         will chunk the signal into successive blocks of the set duration.
     sampling_rate : int
         The sampling frequency of the signal (in Hz, i.e., samples/second).
-    epochs_start : int
+    epochs_start : int, list
         Epochs start relative to events_onsets (in seconds). The start can be negative to
         start epochs before a given event (to have a baseline for instance).
-    epochs_end : int
+        An integer can be specified to have the same start for all epochs.
+        A list of equal length to the events can be specified to have a different start for each epoch.
+    epochs_end : int, list
         Epochs end relative to events_onsets (in seconds).
+        An integer can be specified to have the same end for all epochs.
+        A list of equal length to the events can be specified to have a different end for each epoch.
+        If "from_events", events must be a dict (from ``events_find()`).
+        Duration from events will be used as epochs_end.
     event_labels : list
         A list containing unique event identifiers. If `None`, will use the event index number.
     event_conditions : list
@@ -106,6 +112,8 @@ def epochs_create(
         event_conditions = list(events["condition"])
 
     # Create epochs
+    if epochs_end == "from_events":
+        epochs_end = list(events["duration"])
     parameters = listify(
         onset=event_onsets, label=event_labels, condition=event_conditions, start=epochs_start, end=epochs_end
     )
diff --git a/neurokit2/events/events_find.py b/neurokit2/events/events_find.py
index c319f86439..58d4318965 100644
--- a/neurokit2/events/events_find.py
+++ b/neurokit2/events/events_find.py
@@ -158,7 +158,7 @@ def _events_find_label(events, event_labels=None, event_conditions=None, functio
             "NeuroKit error: "
             + function_name
             + "(): oops, it seems like you provided "
-            + str(n)
+            + str(len(event_labels))
             + " `event_labels`, but "
             + str(n)
             + " events got detected :(. Check your event names or the event signal!"
@@ -173,7 +173,7 @@ def _events_find_label(events, event_labels=None, event_conditions=None, functio
                 "NeuroKit error: "
                 + function_name
                 + "(): oops, it seems like you provided "
-                + str(n)
+                + str(len(event_conditions))
                 + " `event_conditions`, but "
                 + str(n)
                 + " events got detected :(. Check your event conditions or the event signal!"
diff --git a/neurokit2/hrv/hrv.py b/neurokit2/hrv/hrv.py
index a46487d356..7b633d5351 100644
--- a/neurokit2/hrv/hrv.py
+++ b/neurokit2/hrv/hrv.py
@@ -10,7 +10,7 @@
 from .hrv_utils import _hrv_get_rri, _hrv_sanitize_input
 
 
-def hrv(peaks, sampling_rate=1000, show=False):
+def hrv(peaks, sampling_rate=1000, show=False, **kwargs):
     """Computes indices of Heart Rate Variability (HRV).
 
     Computes HRV indices in the time-, frequency-, and nonlinear domain. Note that a minimum duration
@@ -81,12 +81,12 @@ def hrv(peaks, sampling_rate=1000, show=False):
         # Indices for plotting
         out_plot = out.copy(deep=False)
 
-        _hrv_plot(peaks, out_plot, sampling_rate)
+        _hrv_plot(peaks, out_plot, sampling_rate, **kwargs)
 
     return out
 
 
-def _hrv_plot(peaks, out, sampling_rate=1000):
+def _hrv_plot(peaks, out, sampling_rate=1000, **kwargs):
 
     fig = plt.figure(constrained_layout=False)
     spec = gs.GridSpec(ncols=2, nrows=2, height_ratios=[1, 1], width_ratios=[1, 1])
@@ -107,7 +107,7 @@ def _hrv_plot(peaks, out, sampling_rate=1000):
     # Distribution of RR intervals
     peaks = _hrv_sanitize_input(peaks)
     rri = _hrv_get_rri(peaks, sampling_rate=sampling_rate, interpolate=False)
-    ax_distrib = summary_plot(rri, ax=ax_distrib)
+    ax_distrib = summary_plot(rri, ax=ax_distrib, **kwargs)
 
     # Poincare plot
     out.columns = [col.replace("HRV_", "") for col in out.columns]
diff --git a/neurokit2/hrv/hrv_time.py b/neurokit2/hrv/hrv_time.py
index 6f3dbb95dd..a1799030eb 100644
--- a/neurokit2/hrv/hrv_time.py
+++ b/neurokit2/hrv/hrv_time.py
@@ -8,7 +8,7 @@
 from .hrv_utils import _hrv_get_rri, _hrv_sanitize_input
 
 
-def hrv_time(peaks, sampling_rate=1000, show=False):
+def hrv_time(peaks, sampling_rate=1000, show=False, **kwargs):
     """Computes time-domain indices of Heart Rate Variability (HRV).
 
      See references for details.
@@ -119,7 +119,7 @@ def hrv_time(peaks, sampling_rate=1000, show=False):
     out["HTI"] = len(rri) / np.max(bar_y)  # HRV Triangular Index
 
     if show:
-        _hrv_time_show(rri)
+        _hrv_time_show(rri, **kwargs)
 
     out = pd.DataFrame.from_dict(out, orient="index").T.add_prefix("HRV_")
     return out
diff --git a/neurokit2/misc/__init__.py b/neurokit2/misc/__init__.py
index 7afb403850..9f49c4db37 100644
--- a/neurokit2/misc/__init__.py
+++ b/neurokit2/misc/__init__.py
@@ -8,6 +8,8 @@
 from .type_converters import as_vector
 from .replace import replace
 from .warnings import NeuroKitWarning
+from .check_type import check_type
+from .find_outliers import find_outliers
 
 
 __all__ = [
@@ -19,4 +21,6 @@
     "expspace",
     "replace",
     "NeuroKitWarning",
+    "check_type",
+    "find_outliers"
 ]
diff --git a/neurokit2/misc/check_type.py b/neurokit2/misc/check_type.py
new file mode 100644
index 0000000000..3864a5c65c
--- /dev/null
+++ b/neurokit2/misc/check_type.py
@@ -0,0 +1,48 @@
+import numpy as np
+import pandas as pd
+
+
+def check_type(x, what="str"):
+    """Check type of input.
+
+    Creates a list of boolean values to check if the input is of the target type.
+
+    Parameters
+    ----------
+    x : int, list, pd.DataFrame, pd.Series, np.ndarray
+        Target of checking
+    what : str
+        Compare the dtype of target with what.
+
+    Returns
+    -------
+    array
+        An array of boolean values.
+
+    Examples
+    ---------
+    >>> import neurokit2 as nk
+    >>> check_type([1, 2, 3, "hello"], what="str")
+    array([False, False, False,  True])
+    >>> check_type(pd.DataFrame({"A": [3, 1, 2, 4, 6, np.nan],
+    ...                          "B": [3, 1, 2, "hello", 6, 5]}), what="str")
+    array([False,  True])
+    """
+
+    if what == "str":
+        out = is_string(x)
+    return out
+
+
+def is_string(x):
+    if isinstance(x, list):
+        out = [isinstance(member, str) for member in x]
+    elif isinstance(x, pd.DataFrame):
+        out = [member == 'object' for member in list(x.dtypes)]
+    elif isinstance(x, pd.Series):
+        out = [x.dtype == "object"]
+    elif isinstance(x, np.ndarray):
+        out = [x.dtype == "U1"]
+    else:
+        out = isinstance(x, str)
+    return np.array(out)
diff --git a/neurokit2/misc/find_outliers.py b/neurokit2/misc/find_outliers.py
new file mode 100644
index 0000000000..56869ff10d
--- /dev/null
+++ b/neurokit2/misc/find_outliers.py
@@ -0,0 +1,41 @@
+import numpy as np
+import scipy
+from ..stats import standardize
+
+def find_outliers(data, exclude=0.05, side="both"):
+    """
+    Identify outliers (abnormal values).
+
+    Parameters
+    ----------
+    data : list or ndarray
+        Data array
+    exclude : int, float
+        Proportion of extreme observation to be excluded.
+    side: str
+        Can be "both", "left" or "right". If exclude=0.05 and side="both", 2.5% of extreme
+        observation of each side will be marked as outliers.
+
+    Returns
+    ----------
+    outliers : ndarray
+        A list of True/False with True being the outliers.
+
+    Example
+    ----------
+    >>> import neurokit2 as nk
+    >>> outliers = nk.find_outliers([1, 2, 1, 5, 666, 4, 1 ,3, 5])
+    """
+
+    z = np.array(standardize(data))
+    if side == "both":
+        outliers = abs(z) > scipy.stats.norm.ppf(1 - (exclude / 2))
+    elif side == "left":
+        outliers = z < -scipy.stats.norm.ppf(1 - exclude)
+    elif side == "right":
+        outliers = z > scipy.stats.norm.ppf(1 - exclude)
+    else:
+        raise ValueError("side must be 'both', 'left' or 'right'.")
+
+    outliers = np.array(outliers)
+    return outliers
diff --git a/neurokit2/signal/signal_formatpeaks.py b/neurokit2/signal/signal_formatpeaks.py
index a8f6f1cef6..fa9b80df91 100644
--- a/neurokit2/signal/signal_formatpeaks.py
+++ b/neurokit2/signal/signal_formatpeaks.py
@@ -10,14 +10,14 @@ def signal_formatpeaks(info, desired_length, peak_indices=None):
 
     signals = {}
     for feature, values in info.items():
-        if any(x in str(feature) for x in ["Peak", "Onset", "Offset", "Trough", "Recovery"]):
+        if feature != "SCR_RecoveryTime" and any(x in str(feature) for x in ["Peak", "Onset", "Offset", "Trough", "Recovery"]):
             signals[feature] = _signal_from_indices(values, desired_length, 1)
+            signals[feature] = signals[feature].astype('int64')  # indexing of feature using 1 and 0
         else:
             signals[feature] = _signal_from_indices(peak_indices, desired_length, values)
     signals = pd.DataFrame(signals)
     return signals
 
-
 # =============================================================================
 # Internals
 # =============================================================================
@@ -29,7 +29,7 @@ def _signal_from_indices(indices, desired_length=None, value=1):
     Used in *_findpeaks to transform vectors of peak indices to signal.
 
     """
-    signal = np.zeros(desired_length, dtype=int)
+    signal = np.zeros(desired_length, dtype=float)
 
     if isinstance(indices, list) and (not indices):    # skip empty lists
         return signal
diff --git a/neurokit2/signal/signal_power.py b/neurokit2/signal/signal_power.py
index 61349e28ac..61e21bbfb7 100644
--- a/neurokit2/signal/signal_power.py
+++ b/neurokit2/signal/signal_power.py
@@ -44,8 +44,8 @@ def signal_power(signal, frequency_band, sampling_rate=1000, continuous=False, s
     >>> import numpy as np
     >>>
     >>> # Instant power
-    >>> signal = nk.signal_simulate(frequency=5) + 0.5*nk.signal_simulate(frequency=20)
-    >>> power_plot = nk.signal_power(signal, frequency_band=[(18, 22), (10, 14)], method="welch", show=True)
+    >>> signal = nk.signal_simulate(duration=60, frequency=10) + 3*nk.signal_simulate(duration=60, frequency=20)
+    >>> power_plot = nk.signal_power(signal, frequency_band=[(8, 12), (18, 22)], method="welch", show=True)
     >>> power_plot #doctest: +SKIP
     >>>
     >>> # Continuous (simulated signal)
diff --git a/neurokit2/stats/standardize.py b/neurokit2/stats/standardize.py
index 8097b93fc3..16407357cd 100644
--- a/neurokit2/stats/standardize.py
+++ b/neurokit2/stats/standardize.py
@@ -1,9 +1,11 @@
 # -*- coding: utf-8 -*-
+from warnings import warn
 import numpy as np
 import pandas as pd
 
 from .mad import mad
-
+from ..misc import NeuroKitWarning
+from ..misc.check_type import is_string
 
 def standardize(data, robust=False, window=None, **kwargs):
     """Standardization of data.
@@ -59,15 +61,42 @@ def standardize(data, robust=False, window=None, **kwargs):
     """
     # Return appropriate type
     if isinstance(data, list):
-        data = list(_standardize(np.array(data), robust=robust, window=window, **kwargs))
+        if any(is_string(data)):
+            out = data
+            warn(
+                "The data is not standardized."
+                "Some elements in the list is of string type.",
+                category=NeuroKitWarning
+            )
+        else:
+            out = list(_standardize(np.array(data), robust=robust, window=window, **kwargs))
+
     elif isinstance(data, pd.DataFrame):
-        data = pd.DataFrame(_standardize(data, robust=robust, window=window, **kwargs))
+        # only standardize columns that are not string and are not nan
+        _data = data.loc[:, ~is_string(data) & ~np.array(data.isnull().all())]
+        to_append = data.loc[:, is_string(data) | np.array(data.isnull().all())]
+        out = pd.DataFrame(_standardize(_data, robust=robust, window=window, **kwargs))
+        out = pd.concat([to_append, out], axis=1)
+
     elif isinstance(data, pd.Series):
-        data = pd.Series(_standardize(data, robust=robust, window=window, **kwargs))
+        if is_string(data):
+            out = data
+            warn(
+                "The data is not standardized as it is of string type.",
+                category=NeuroKitWarning)
+        else:
+            out = pd.Series(_standardize(data, robust=robust, window=window, **kwargs))
+
     else:
-        data = _standardize(data, robust=robust, window=window, **kwargs)
+        if is_string(data):
+            out = data
+            warn(
+                "The data is not standardized as it is of string type.",
+                category=NeuroKitWarning)
+        else:
+            out = _standardize(data, robust=robust, window=window, **kwargs)
 
-    return data
+    return out
 
 
 # =============================================================================
diff --git a/neurokit2/stats/summary.py b/neurokit2/stats/summary.py
index cfc9fc6878..20a3b93d56 100644
--- a/neurokit2/stats/summary.py
+++ b/neurokit2/stats/summary.py
@@ -1,12 +1,13 @@
 # -*- coding: utf-8 -*-
 import matplotlib.pyplot as plt
 import numpy as np
+import scipy.stats as st
 
 from .density import density
 from .rescale import rescale
 
 
-def summary_plot(x, **kwargs):
+def summary_plot(x, errorbars=0, **kwargs):
     """Descriptive plot.
 
     Visualize a distribution with density, histogram, boxplot and rugs plots all at once.
@@ -31,6 +32,10 @@ def summary_plot(x, **kwargs):
 
     # Histogram
     counts, bins = np.histogram(x, **kwargs)
+    bin_centers = 0.5*(bins[1:] + bins[:-1])
+    if errorbars > 0:
+        samperr = np.std(counts) / np.sqrt(counts) * (st.norm.ppf(1-(1-errorbars)/2))
+        ax.errorbar(bin_centers, counts, yerr=samperr, ecolor="#FF8C00", fmt='.', capsize=5, capthick=2)
     ax.hist(bins[:-1], bins, weights=counts, color="#2196F3", edgecolor="white", zorder=1, **kwargs)
 
     # Density
diff --git a/paper/bibliography.bib b/paper/bibliography.bib
deleted file mode 100644
index 9a45156521..0000000000
--- a/paper/bibliography.bib
+++ /dev/null
@@ -1,630 +0,0 @@
-@article{Valenza2020,
-    author = {Valenza, Gaetano and Passamonti, Luca and Duggento, Andrea and Toschi, Nicola and Barbieri, Riccardo},
-    doi = {10.1098/rsif.2019.0878},
-    mendeley-groups = {Central},
-    number = {March},
-    title = {{Uncovering complex central autonomic networks at rest : a functional magnetic resonance imaging study on complex cardiovascular oscillations}},
-    year = {2020}
-}
-
-@article{roy2019deep,
-  title={Deep learning-based electroencephalography analysis: a systematic review},
-  author={Roy, Yannick and Banville, Hubert and Albuquerque, Isabela and Gramfort, Alexandre and Falk, Tiago H and Faubert, Jocelyn},
-  journal={Journal of neural engineering},
-  volume={16},
-  number={5},
-  pages={051001},
-  year={2019},
-  publisher={IOP Publishing}
-}
-@inproceedings{gomes2019pyhrv,
-  title={pyHRV: Development and evaluation of an open-source python toolbox for heart rate variability (HRV)},
-  author={Gomes, P and Margaritoff, P and Silva, H},
-  booktitle={Proc. Int’l conf. On electrical, electronic and computing engineering (icetran)},
-  pages={822--828},
-  year={2019}
-}
-
-@article{maizey2019barriers,
-  title={Barriers and solutions for early career researchers in tackling the reproducibility crisis in cognitive neuroscience},
-  author={Maizey, Leah and Tzavella, Loukia},
-  journal={Cortex},
-  volume={113},
-  pages={357--359},
-  year={2019},
-  publisher={Elsevier}
-}
-
-@article{khodadad2018optimized,
-  title={Optimized breath detection algorithm in Electrical Impedance Tomography},
-  author={Khodadad, Davood and Nordebo, Sven and Mueller, Beat and Waldmann, Andreas and Yerworth, Rebecca and Becher, Tobias and Frerichs, Inez and Sophocleous, Louiza and Van Kaam, Anton and Miedema, Martijn and others},
-  journal={Physiological measurement},
-  volume={39},
-  number={9},
-  pages={094001},
-  year={2018},
-  publisher={IOP Publishing}
-}
-
-@article{Yoo2018,
-    abstract = {Previous research has shown associations between brain structure and resting state high-frequency heart rate variability (HF HRV). Age affects both brain structure and HF HRV. Therefore, we sought to examine the relationship between brain structure and HF HRV as a function of age. Data from two independent studies were used for the present analysis. Study 1 included 19 older adults (10 males, age range 62–78 years) and 19 younger adults (12 males, age range 19–37). Study 2 included 23 older adults (12 males; age range 55–75) and 27 younger adults (17 males; age range 18–34). The root-mean-square of successive R–R-interval differences (RMSSD) from ECG recordings was used as time-domain measure of HF HRV. MRI scans were performed on a 3.0-T Siemens Magnetom Trio scanner. Cortical reconstruction and volumetric segmentation were performed with the Freesurfer image analysis suite, including 12 regions as regions of interests (ROI). Zero-order and partial correlations were used to assess the correlation of RMSSD with cortical thickness in selected ROIs. Lateral orbitofrontal cortex (OFC) cortical thickness was significantly associated with RMSSD. Further, both studies, in line with previous research, showed correlations between RMSSD and anterior cingulate cortex (ACC) cortical thickness. Meta-analysis on adjusted correlation coefficients from individual studies confirmed an association of RMSSD with the left rostral ACC and the left lateral OFC. Future longitudinal studies are necessary to trace individual trajectories in the association of HRV and brain structure across aging.},
-    author = {Yoo, Hyun Joo and Thayer, Julian F. and Greening, Steven and Lee, Tae Ho and Ponzio, Allison and Min, Jungwon and Sakaki, Michiko and Nga, Lin and Mather, Mara and Koenig, Julian},
-    doi = {10.1007/s00429-017-1519-7},
-    isbn = {0042901715},
-    issn = {18632661},
-    journal = {Brain Structure and Function},
-    keywords = {Age,Brain structure,Cortical thickness,Heart rate variability,Vagal activity},
-    mendeley-groups = {Central,Affect-comp_emotion},
-    number = {2},
-    pages = {727--737},
-    publisher = {Springer Berlin Heidelberg},
-    title = {{Brain structural concomitants of resting state heart rate variability in the young and old: evidence from two independent samples}},
-    volume = {223},
-    year = {2018}
-}
-
-
-@InProceedings{Jupyter2018,
-  author    = { {P}roject {J}upyter and {M}atthias {B}ussonnier and {J}essica {F}orde and {J}eremy {F}reeman and {B}rian {G}ranger and {T}im {H}ead and {C}hris {H}oldgraf and {K}yle {K}elley and {G}ladys {N}alvarte and {A}ndrew {O}sheroff and {M} {P}acer and {Y}uvi {P}anda and {F}ernando {P}erez and {B}enjamin {R}agan-{K}elley and {C}arol {W}illing },
-  title     = { {B}inder 2.0 - {R}eproducible, interactive, sharable environments for science at scale },
-  booktitle = { {P}roceedings of the 17th {P}ython in {S}cience {C}onference },
-  pages     = { 113 - 120 },
-  year      = { 2018 },
-  editor    = { {F}atih {A}kici and {D}avid {L}ippa and {D}illon {N}iederhut and {M} {P}acer },
-  doi       = { 10.25080/Majora-4af1f417-011 }
-}
-
-@article{milkowski2018replicability,
-  title={Replicability or reproducibility? On the replication crisis in computational neuroscience and sharing only relevant detail},
-  author={Mi{\l}kowski, Marcin and Hensel, Witold M and Hohol, Mateusz},
-  journal={Journal of computational neuroscience},
-  volume={45},
-  number={3},
-  pages={163--172},
-  year={2018},
-  publisher={Springer}
-}
-
-@article{holzmann2017_meta,
-  title={Heart rate variability indices as bio-markers of top-down self-regulatory mechanisms: A meta-analytic review},
-  author={Holzman, Jacob B and Bridgett, David J},
-  journal={Neuroscience \& biobehavioral reviews},
-  volume={74},
-  pages={233--255},
-  year={2017},
-  publisher={Elsevier}
-}
-
-@incollection{Gratton2017,
-    address = {Cambridge},
-    author = {Gratton, Garbiele and Fabiani, Monica},
-    booktitle = {Handbook of Psychophysiology},
-    chapter = {29},
-    editor = {Cacioppo, John T and Berntson, Gary G and Tassinary, Louis G.},
-    mendeley-groups = {fMRI-ECG},
-    pages = {834--857},
-    title = {{Biosignal Processing in Psychophysiology: principles and current developments}},
-    year = {2017}
-}
-
-
-@article{yuehong2016internet,
-  title={The internet of things in healthcare: An overview},
-  author={Yuehong, YIN and Zeng, Yan and Chen, Xing and Fan, Yuanjie},
-  journal={Journal of Industrial Information Integration},
-  volume={1},
-  pages={3--13},
-  year={2016},
-  publisher={Elsevier}
-}
-
-
-@article{Quintana2016,
-  title={Guidelines for Reporting Articles on Psychiatry and Heart rate variability (GRAPH): recommendations to advance research communication},
-  author={Quintana, DS and Alvares, Gail A and Heathers, JAJ},
-  journal={Translational psychiatry},
-  volume={6},
-  number={5},
-  pages={e803--e803},
-  year={2016},
-  publisher={Nature Publishing Group}
-}
-
-@article{pep8,
-  title={PEP 8: style guide for Python code},
-  author={Van Rossum, Guido and Warsaw, Barry and Coghlan, Nick},
-  journal={Python. org},
-  volume={1565},
-  year={2001}
-}
-
-@article{Jennings2016,
-    abstract = {Resting high-frequency heart rate variability (HF-HRV) relates to cardiac vagal control and predicts individual differences in health and longevity, but its functional neural correlates are not well defined. The medial prefrontal cortex (mPFC) encompasses visceral control regions that are components of intrinsic networks of the brain, particularly the default mode network (DMN) and the salience network (SN). Might individual differences in resting HF-HRV covary with resting state neural activity in the DMN and SN, particularly within the mPFC? This question was addressed using fMRI data from an eyes-open, five-minute rest period during which echoplanar brain imaging yielded blood oxygen level dependent (BOLD) time series. Independent components analysis (ICA) yielded functional connectivity estimates defining the DMN and SN. HF-HRV was measured in a rest period outside of the scanner. Midlife (52% female) adults were assessed in two studies (Study 1, N = 107; Study 2, N = 112). Neither overall DMN nor SN connectivity strength was related to HF-HRV. However, HF-HRV related to connectivity of one region within mPFC shared by the DMN and SN; namely, the perigenual anterior cingulate cortex (pgACC), an area with connectivity to other regions involved in autonomic control. In sum, HF-HRV does not seem directly related to global resting state activity of intrinsic brain networks, but rather to more localized connectivity. A mPFC region was of particular interest as connectivity related to HF-HRV was shared by the DMN and SN. These findings may indicate a functional basis for the coordination of autonomic cardiac control with engagement and disengagement from the environment. Keywords default mode network; salience network; resting state fMRI; high-frequency heart rate variability Rest and activity are biobehavioral states that appear both separable and largely non-overlapping in time. From a historical perspective, the contrast between rest and activity was},
-    author = {Jennings, J Richard and Sheu, Lei K and Kuan, Dora C-H and Manuck, Stephen B and Gianaros, Peter J},
-    doi = {10.1111/psyp.12586},
-    isbn = {4122466210},
-    journal = {Psychophysiology},
-    number = {4},
-    pages = {444--454},
-    title = {{Resting state connectivity of the medial prefrontal cortex covaries with individual differences in high-frequency heart rate variability HHS Public Access}},
-    volume = {53},
-    year = {2016}
-}
-
-
-
-@inproceedings{kluyver2016jupyter,
-  title={Jupyter Notebooks-a publishing format for reproducible computational workflows.},
-  author={Kluyver, Thomas and Ragan-Kelley, Benjamin and P{\'e}rez, Fernando and Granger, Brian E and Bussonnier, Matthias and Frederic, Jonathan and Kelley, Kyle and Hamrick, Jessica B and Grout, Jason and Corlay, Sylvain and others},
-  booktitle={ELPUB},
-  pages={87--90},
-  year={2016}
-}
-
-@article{greco2015cvxeda,
-  title={cvxEDA: A convex optimization approach to electrodermal activity processing},
-  author={Greco, Alberto and Valenza, Gaetano and Lanata, Antonio and Scilingo, Enzo Pasquale and Citi, Luca},
-  journal={IEEE Transactions on Biomedical Engineering},
-  volume={63},
-  number={4},
-  pages={797--804},
-  year={2015},
-  publisher={IEEE}
-}
-
-@article{Kiverstein2015,
-  title={The embodied brain: towards a radical embodied cognitive neuroscience},
-  author={Kiverstein, Julian and Miller, Mark},
-  journal={Frontiers in human neuroscience},
-  volume={9},
-  pages={237},
-  year={2015},
-  publisher={Frontiers}
-}
-
-@article{topalidou2015long,
-  title={A long journey into reproducible computational neuroscience},
-  author={Topalidou, Meropi and Leblois, Arthur and Boraud, Thomas and Rougier, Nicolas P},
-  journal={Frontiers in computational neuroscience},
-  volume={9},
-  pages={30},
-  year={2015},
-  publisher={Frontiers}
-}
-
-
-@article{open2015estimating,
-  title={Estimating the reproducibility of psychological science},
-  author={Brian A. Nosek and Johanna Cohoon and Mallory Kidwell and Jeffrey Robert Spies},
-  journal={Science},
-  volume={349},
-  number={6251},
-  pages={aac4716},
-  year={2015},
-  publisher={American Association for the Advancement of Science}
-}
-
-@article{tarvainen2014kubios,
-  title={Kubios HRV--heart rate variability analysis software},
-  author={Tarvainen, Mika P and Niskanen, Juha-Pekka and Lipponen, Jukka A and Ranta-Aho, Perttu O and Karjalainen, Pasi A},
-  journal={Computer methods and programs in biomedicine},
-  volume={113},
-  number={1},
-  pages={210--220},
-  year={2014},
-  publisher={Elsevier}
-}
-
-@article{marchewka2014nencki,
-  title={The Nencki Affective Picture System (NAPS): Introduction to a novel, standardized, wide-range, high-quality, realistic picture database},
-  author={Marchewka, Artur and {\.Z}urawski, {\L}ukasz and Jednor{\'o}g, Katarzyna and Grabowska, Anna},
-  journal={Behavior research methods},
-  volume={46},
-  number={2},
-  pages={596--610},
-  year={2014},
-  publisher={Springer}
-}
-
-@article{gramfort2013meg,
-  title={MEG and EEG data analysis with MNE-Python},
-  author={Gramfort, Alexandre and Luessi, Martin and Larson, Eric and Engemann, Denis A and Strohmeier, Daniel and Brodbeck, Christian and Goj, Roman and Jas, Mainak and Brooks, Teon and Parkkonen, Lauri and others},
-  journal={Frontiers in neuroscience},
-  volume={7},
-  pages={267},
-  year={2013},
-  publisher={Frontiers}
-}
-
-
-@article{Lazarus1975,
-    abstract = {Argues that emotional processes and their self-regulation are products of mediating cognitive appraisals about the significance of an event for a person's well-being and that the control of somatic processes is an integral aspect of emotional states and their self-regulation. (33 ref) (PsycINFO Database Record (c) 2010 APA, all rights reserved)},
-    author = {Lazarus, R. S.},
-    doi = {10.1037/h0076649},
-    isbn = {1935-990X (Electronic); 0003-066X (Print)},
-    issn = {0003066X},
-    journal = {The American psychologist},
-    number = {5},
-    pages = {553--561},
-    pmid = {1147365},
-    title = {{A cognitively oriented psychologist looks at biofeedback.}},
-    volume = {30},
-    year = {1975}
-}
-
-
-@inproceedings{clifton2012machine,
-  title={Machine learning and software engineering in health informatics},
-  author={Clifton, David A and Gibbons, Jeremy and Davies, Jim and Tarassenko, Lionel},
-  booktitle={2012 First International Workshop on Realizing AI Synergies in Software Engineering (RAISE)},
-  pages={37--41},
-  year={2012},
-  organization={IEEE}
-}
-
-@article{numpy,
-  title={The NumPy array: a structure for efficient numerical computation},
-  author={Van Der Walt, Stefan and Colbert, S Chris and Varoquaux, Gael},
-  journal={Computing in Science \& Engineering},
-  volume={13},
-  number={2},
-  pages={22},
-  year={2011},
-  publisher={IEEE Computer Society}
-}
-
-@article{harris2020array,
-  title={Array programming with NumPy},
-  author={Harris, Charles R and Millman, K Jarrod and van der Walt, St{\'e}fan J and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J and others},
-  journal={Nature},
-  volume={585},
-  number={7825},
-  pages={357--362},
-  year={2020},
-  publisher={Nature Publishing Group}
-}
-
-@inproceedings{pandas,
-  title={Data structures for statistical computing in python},
-  author={McKinney, Wes and others},
-  booktitle={Proceedings of the 9th Python in Science Conference},
-  volume={445},
-  pages={51--56},
-  year={2010},
-  organization={Austin, TX}
-}
-
-@article{scikit-learn,
- title={Scikit-learn: Machine Learning in {P}ython},
- author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V.
-         and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P.
-         and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and
-         Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.},
- journal={Journal of Machine Learning Research},
- volume={12},
- pages={2825--2830},
- year={2011}
-}
-
-@article{matplotlib,
-  title={Matplotlib: A 2D graphics environment},
-  author={Hunter, John D},
-  journal={Computing in science \& engineering},
-  volume={9},
-  number={3},
-  pages={90--95},
-  year={2007},
-  publisher={IEEE}
-}
-
-@misc{neurokit1,
-  title={Neurokit: A python toolbox for statistics and neurophysiological signal processing (EEG, EDA, ECG, EMG...)},
-  url={https://github.com/neuropsychology/NeuroKit.py},
-  journal={GitHub},
-  author={Makowski, Dominique},
-  year={2020},
-  month={Mar}}
-
-@ARTICLE{scipy,
-       author = {{Virtanen}, Pauli and {Gommers}, Ralf and {Oliphant},
-         Travis E. and {Haberland}, Matt and {Reddy}, Tyler and
-         {Cournapeau}, David and {Burovski}, Evgeni and {Peterson}, Pearu
-         and {Weckesser}, Warren and {Bright}, Jonathan and {van der Walt},
-         St{\'e}fan J.  and {Brett}, Matthew and {Wilson}, Joshua and
-         {Jarrod Millman}, K.  and {Mayorov}, Nikolay and {Nelson}, Andrew
-         R.~J. and {Jones}, Eric and {Kern}, Robert and {Larson}, Eric and
-         {Carey}, CJ and {Polat}, {\.I}lhan and {Feng}, Yu and {Moore},
-         Eric W. and {Vand erPlas}, Jake and {Laxalde}, Denis and
-         {Perktold}, Josef and {Cimrman}, Robert and {Henriksen}, Ian and
-         {Quintero}, E.~A. and {Harris}, Charles R and {Archibald}, Anne M.
-         and {Ribeiro}, Ant{\^o}nio H. and {Pedregosa}, Fabian and
-         {van Mulbregt}, Paul and {Contributors}, SciPy 1. 0},
-        title = "{SciPy 1.0: Fundamental Algorithms for Scientific
-                  Computing in Python}",
-      journal = {Nature Methods},
-      year = "2020",
-      volume={17},
-      pages={261--272},
-      adsurl = {https://rdcu.be/b08Wh},
-      doi = {https://doi.org/10.1038/s41592-019-0686-2},
-}
-
-@article{HeartPy,
-	doi = {10.1016/j.trf.2019.09.015},
-	url = {https://doi.org/10.1016%2Fj.trf.2019.09.015},
-	year = 2019,
-	month = {oct},
-	publisher = {Elsevier {BV}},
-	volume = {66},
-	pages = {368--378},
-	author = {Paul van Gent and Haneen Farah and Nicole van Nes and Bart van Arem},
-	title = {{HeartPy}: A novel heart rate algorithm for the analysis of noisy signals},
-	journal = {Transportation Research Part F: Traffic Psychology and Behaviour}
-}
-
-
-@book{python3,
- author = {Van Rossum, Guido and Drake, Fred L.},
- title = {Python 3 Reference Manual},
- year = {2009},
- isbn = {1441412697},
- publisher = {CreateSpace},
- address = {Scotts Valley, CA}
-}
-
-@incollection{PySiology,
-	doi = {10.1007/978-981-13-8950-4_35},
-	url = {https://doi.org/10.1007%2F978-981-13-8950-4_35},
-	year = 2019,
-	month = {sep},
-	publisher = {Springer Singapore},
-	pages = {395--402},
-	author = {Giulio Gabrieli and Atiqah Azhari and Gianluca Esposito},
-	title = {{PySiology}: A Python Package for Physiological Feature Extraction},
-	booktitle = {Neural Approaches to Dynamics of Signal Exchanges}
-}
-
-@Misc{biosppy,
-  author = {Carlos Carreiras and Ana Priscila Alves and Andr\'{e} Louren\c{c}o and Filipe Canento and Hugo Silva and Ana Fred and others},
-  title = {{BioSPPy}: Biosignal Processing in {Python}},
-  year = {2015},
-  url = "https://github.com/PIA-Group/BioSPPy/",
-  note = {[Online; accessed <today>]}
-}
-
-@Misc{Systole,
-  author = {Nicolas Legrand and Micah Allen},
-  title = {{Systole}: A python toolbox for preprocessing, analyzing, and synchronizing cardiac data},
-  year = {2020},
-  url = "https://github.com/embodied-computation-group/systole",
-  note = {[Online; accessed <today>]}
-}
-
-
-@Misc{nolds,
-  author       = {Schölzel, Christopher},
-  title        = {Nonlinear measures for dynamical systems},
-  month        = jun,
-  year         = 2019,
-  publisher    = {Zenodo},
-  version      = {0.5.2},
-  doi          = {10.5281/zenodo.3814723},
-  url          = {https://doi.org/10.5281/zenodo.3814723}
-}
-
-@Manual{R-base,
-  title = {R: A Language and Environment for Statistical Computing},
-  author = {{R Core Team}},
-  organization = {R Foundation for Statistical Computing},
-  address = {Vienna, Austria},
-  year = {2019},
-  url = {https://www.R-project.org/},
-}
-@Manual{R-kableExtra,
-  title = {kableExtra: Construct Complex Table with 'kable' and Pipe Syntax},
-  author = {Hao Zhu},
-  year = {2019},
-  note = {R package version 1.1.0},
-  url = {https://CRAN.R-project.org/package=kableExtra},
-}
-@Manual{R-papaja,
-  author = {Frederik Aust and Marius Barth},
-  title = {{papaja}: {Create} {APA} manuscripts with {R Markdown}},
-  year = {2020},
-  note = {R package version 0.1.0.9942},
-  url = {https://github.com/crsh/papaja},
-}
-@Manual{R-reticulate,
-  title = {reticulate: Interface to 'Python'},
-  author = {Kevin Ushey and JJ Allaire and Yuan Tang},
-  year = {2019},
-  note = {R package version 1.14},
-  url = {https://CRAN.R-project.org/package=reticulate},
-}
-@Article{R-bayestestR,
-  title = {bayestestR: Describing Effects and their Uncertainty, Existence and Significance within the Bayesian Framework.},
-  author = {Dominique Makowski and Mattan S. Ben-Shachar and Daniel Lüdecke},
-  journal = {Journal of Open Source Software},
-  doi = {10.21105/joss.01541},
-  year = {2019},
-  number = {40},
-  volume = {4},
-  pages = {1541},
-  url = {https://joss.theoj.org/papers/10.21105/joss.01541},
-}
-@Article{R-correlation,
-  title = {Methods for Correlation Analysis.},
-  author = {Dominique Makowski and Mattan S. Ben-Shachar and Indrajeet Patil and Daniel Lüdecke},
-  journal = {CRAN},
-  year = {2020},
-  url = {https://github.com/easystats/correlation},
-}
-@Manual{R-dplyr,
-  title = {dplyr: A Grammar of Data Manipulation},
-  author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller},
-  year = {2019},
-  note = {R package version 0.8.3},
-  url = {https://CRAN.R-project.org/package=dplyr},
-}
-@Manual{R-easystats,
-  title = {easystats: Jump in the easyverse},
-  author = {Daniel Lüdecke and Dominique Makowski},
-  note = {R package version 0.2.0},
-  url = {https://github.com/easystats/easystats},
-}
-@Article{R-effectsize,
-  title = {Compute and interpret indices of effect size},
-  author = {Dominique Makowski and Mattan S. Ben-Shachar and Daniel Lüdecke},
-  journal = {CRAN},
-  year = {2019},
-  note = {R package},
-  url = {https://github.com/easystats/effectsize},
-}
-@Manual{R-forcats,
-  title = {forcats: Tools for Working with Categorical Variables (Factors)},
-  author = {Hadley Wickham},
-  year = {2019},
-  note = {R package version 0.4.0},
-  url = {https://CRAN.R-project.org/package=forcats},
-}
-@Book{R-ggplot2,
-  author = {Hadley Wickham},
-  title = {ggplot2: Elegant Graphics for Data Analysis},
-  publisher = {Springer-Verlag New York},
-  year = {2016},
-  isbn = {978-3-319-24277-4},
-  url = {https://ggplot2.tidyverse.org},
-}
-@Article{R-insight,
-  title = {insight: A Unified Interface to Access Information from Model Objects in R.},
-  volume = {4},
-  doi = {10.21105/joss.01412},
-  number = {38},
-  journal = {Journal of Open Source Software},
-  author = {Daniel Lüdecke and Philip Waggoner and Dominique Makowski},
-  year = {2019},
-  pages = {1412},
-}
-@Manual{R-modelbased,
-  title = {modelbased: Estimation of Model-Based Predictions, Contrasts and Means},
-  author = {Dominique Makowski and Daniel Lüdecke and Mattan S. Ben-Shachar},
-  note = {R package version 0.1.2},
-  url = {https://github.com/easystats/modelbased},
-}
-@Article{R-parameters,
-  title = {Describe and understand your model’s parameters},
-  author = {Dominique Makowski and Mattan S. Ben-Shachar and Daniel Lüdecke},
-  journal = {CRAN},
-  year = {2019},
-  note = {R package},
-  url = {https://github.com/easystats/parameters},
-}
-@Manual{R-performance,
-  title = {performance: Assessment of Regression Models Performance},
-  author = {Daniel Lüdecke and Dominique Makowski and Philip Waggoner},
-  note = {R package version 0.4.4.1},
-  url = {https://easystats.github.io/performance/},
-}
-@Manual{R-purrr,
-  title = {purrr: Functional Programming Tools},
-  author = {Lionel Henry and Hadley Wickham},
-  year = {2019},
-  note = {R package version 0.3.3},
-  url = {https://CRAN.R-project.org/package=purrr},
-}
-@Manual{R-readr,
-  title = {readr: Read Rectangular Text Data},
-  author = {Hadley Wickham and Jim Hester and Romain Francois},
-  year = {2018},
-  note = {R package version 1.3.1},
-  url = {https://CRAN.R-project.org/package=readr},
-}
-@Article{R-report,
-  title = {The report package for R: Ensuring the use of best practices for results reporting},
-  author = {{Makowski} and {Dominique} and {Lüdecke} and {Daniel}},
-  journal = {CRAN},
-  year = {2019},
-  note = {R package},
-  url = {https://github.com/easystats/report},
-}
-@Manual{R-see,
-  title = {see: Visualisation Toolbox for 'easystats' and Extra Geoms, Themes and Color Palettes for 'ggplot2'},
-  author = {Daniel Lüdecke and Dominique Makowski and Philip Waggoner and Mattan S. Ben-Shachar},
-  note = {R package version 0.4.1.1},
-  url = {https://easystats.github.io/see/},
-}
-@Manual{R-stringr,
-  title = {stringr: Simple, Consistent Wrappers for Common String Operations},
-  author = {Hadley Wickham},
-  year = {2019},
-  note = {R package version 1.4.0},
-  url = {https://CRAN.R-project.org/package=stringr},
-}
-@Manual{R-tibble,
-  title = {tibble: Simple Data Frames},
-  author = {Kirill Müller and Hadley Wickham},
-  year = {2019},
-  note = {R package version 2.1.3},
-  url = {https://CRAN.R-project.org/package=tibble},
-}
-@Manual{R-tidyr,
-  title = {tidyr: Tidy Messy Data},
-  author = {Hadley Wickham and Lionel Henry},
-  year = {2019},
-  note = {R package version 1.0.0},
-  url = {https://CRAN.R-project.org/package=tidyr},
-}
-@Article{R-tidyverse,
-  title = {Welcome to the {tidyverse}},
-  author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D'Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani},
-  year = {2019},
-  journal = {Journal of Open Source Software},
-  volume = {4},
-  number = {43},
-  pages = {1686},
-  doi = {10.21105/joss.01686},
-}
-
-@article{benedek2010continuous,
-  title={A continuous measure of phasic electrodermal activity},
-  author={Benedek, Mathias and Kaernbach, Christian},
-  journal={Journal of neuroscience methods},
-  volume={190},
-  number={1},
-  pages={80--91},
-  year={2010},
-  publisher={Elsevier}
-}
-
-@article{bach2014head,
-  title={A head-to-head comparison of SCRalyze and Ledalab, two model-based methods for skin conductance analysis},
-  author={Bach, Dominik R},
-  journal={Biological psychology},
-  volume={103},
-  pages={63--68},
-  year={2014},
-  publisher={Elsevier}
-}
-
-@article{bizzego2019pyphysio,
-  title={pyphysio: A physiological signal processing library for data science approaches in physiology},
-  author={Bizzego, Andrea and Battisti, Alessandro and Gabrieli, Giulio and Esposito, Gianluca and Furlanello, Cesare},
-  journal={SoftwareX},
-  volume={10},
-  pages={100287},
-  year={2019},
-  publisher={Elsevier}
-}
-
-@article{HRV,
-  doi = {10.21105/joss.01867},
-  url = {https://doi.org/10.21105/joss.01867},
-  year = {2020},
-  publisher = {The Open Journal},
-  volume = {5},
-  number = {51},
-  pages = {1867},
-  author = {Rhenan Bartels and Tiago Pecanha},
-  title = {HRV: a Pythonic package for Heart Rate Variability Analysis},
-  journal = {Journal of Open Source Software}
-}
diff --git a/paper/figures/features.png b/paper/figures/features.png
deleted file mode 100644
index 205843c996..0000000000
Binary files a/paper/figures/features.png and /dev/null differ
diff --git a/paper/figures/figure.pptx b/paper/figures/figure.pptx
deleted file mode 100644
index 2025858612..0000000000
Binary files a/paper/figures/figure.pptx and /dev/null differ
diff --git a/paper/figures/nk_architecture.pdf b/paper/figures/nk_architecture.pdf
deleted file mode 100644
index 5d1a13ce5b..0000000000
Binary files a/paper/figures/nk_architecture.pdf and /dev/null differ
diff --git a/paper/make_figures.R b/paper/make_figures.R
deleted file mode 100644
index 7f751df592..0000000000
--- a/paper/make_figures.R
+++ /dev/null
@@ -1,153 +0,0 @@
-library(tidyverse)
-library(easystats)
-
-# Setup python - you need to change the path to your python distribution
-library(reticulate)
-# reticulate::use_python("C:/Users/Zen Juen/Downloads/WPy-3710b/python-3.7.1.amd64/")
-reticulate::use_python("D:/Downloads/WPy64-3810/python-3.8.1.amd64/")
-matplotlib <- import("matplotlib")
-# matplotlib$use("Agg", force = TRUE)
-
-
-
-
-# Python ------------------------------------------------------------------
-reticulate::repl_python()
-
-import neurokit2 as nk
-import pandas as pd
-import numpy as np
-
-# Data
-data = nk.data("bio_resting_8min_100hz").drop(['PhotoSensor', 'Unnamed: 0'], axis=1)
-
-Photosensor = list(np.full(len(data)-4, 0))
-Photosensor.insert(100, 5)
-Photosensor.insert(500, 5)
-Photosensor.insert(900, 5)
-Photosensor.insert(1300, 5)
-Photosensor = pd.DataFrame(Photosensor).rename({0: 'Photosensor'}, axis=1)
-data = pd.concat([data, Photosensor], axis=1)
-
-exit
-
-
-
-# Plot ----------------------------------------------------------------------
-
-df_p <- py$data %>%
-  slice(0:2000) %>%
-  standardize() %>%
-  mutate(Time = 1:n() / 100) %>%
-  pivot_longer(1:3) %>%
-  mutate(name = fct_relevel(name, c("ECG", "RSP", "EDA")))
-
-
-plot <- df_p %>%
-  ggplot(aes(x=Time, y=value)) +
-
-  # shaded areas
-  annotate("rect", xmin = 2.5, xmax = 5.5, ymin = -Inf, ymax = Inf, fill = "#FF9800", alpha = 0.5) +
-  annotate("rect", xmin = 8.5, xmax = 11.5, ymin = -Inf, ymax = Inf, fill = "#FF9800", alpha = 0.5) +
-  annotate("rect", xmin = 14.5, xmax = 17.5, ymin = -Inf, ymax = Inf, fill = "#FF9800", alpha = 0.5) +
-  geom_rect(aes(xmin = 0, xmax = 0, ymin = 0, ymax = 0, fill = "Event-related Analysis"), alpha = 1, size=0) +
-  # geom_rect(aes(xmin = 8.5, xmax = 11.5, ymin = -Inf, ymax = Inf, fill = "Event-related Analysis"), alpha = 0.1, size=0) +
-  # geom_rect(aes(xmin = 14.5, xmax = 17.5, ymin = -Inf, ymax = Inf, fill = "Event-related Analysis"), alpha = 0.1, size=0) +
-
-  geom_rect(aes(xmin = 0, xmax = 0, ymin = 0, ymax =0, fill = "Interval-related Analysis"), alpha = 1, size=0) +
-  annotate("rect", xmin = 0.5, xmax = 19.5, ymin = -Inf, ymax = Inf, fill = "#4CAF50", size=0, alpha = 0.15) +
-  # geom_rect(aes(xmin = 0.5, xmax = 19.5, ymin = -Inf, ymax = Inf, fill = "Interval-related Analysis"), alpha = 0, color="darkgrey") +
-
-  # signals
-  geom_line(aes(color=name, size=name)) +
-
-  # event markers
-  geom_vline(xintercept=c(3.5, 9.5, 15.5), linetype="dashed", size=0.5) +
-  annotate("text", label = "Event Markers", x = 3.20, y = 5, angle=90) +
-
-  # aesthetics
-  theme_modern() +
-  scale_color_manual('Signal type',
-                     values=c("ECG"="red", "EDA"="#9C27B0", "RSP"="#2196F3", "Photosensor"="#FF9800")) +
-  scale_size_manual(values=c("ECG"=0.33, "EDA"=1, "RSP"=1), guide=FALSE) +
-  scale_fill_manual('Regions of interest',
-                    values =c("Event-related Analysis"="#FF9800",
-                              "Interval-related Analysis"="#4CAF50"),
-                    guide=guide_legend(override.aes = list(alpha=0.2,
-                                       # colour=c("#FF9800", "#4CAF50"),
-                                       size=0))) +
-  theme(axis.title.y = element_blank(),
-        axis.text.y = element_blank(),
-        legend.position = "right") +
-  guides(color = guide_legend(override.aes = list(size = 1))) +
-  xlab("Time (s)") +
-  ggtitle("Domains of interest in physiological analyses")
-
-plot
-ggsave("figures/features.png", plot, height=6, width=6 * 1.618034, dpi=600)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Tables
-# py$event_table <- py$event_table %>%
-#   mutate(ECG_Rate_Mean = round(ECG_Rate_Mean, 2),
-#          RSP_Rate_Mean = round(RSP_Rate_Mean, 2))
-# py$interval_table <- py$interval_table %>%
-#   mutate_at(c(1:5, 7), funs(round(., 2)))
-
-# eventrelated <- ggtexttable(py$event_table, rows = NULL,
-#                             theme = ttheme("mOrange"))
-# intervalrelated <- ggtexttable(py$interval_table, rows = NULL)
-
-
-
-
-table <- data.frame("A" = c("ECG Rate Characteristics: Mean, Amplitude",
-                            "Heart Rate Variability (HRV) indices",
-                            "Respiratory Rate Variability (RRV) indices",
-                            "Respiratory Sinus Arrhythmia (RSA) indices",
-                            "Number of SCR Peaks and mean amplitude"),
-
-                    "B" = c("ECG Rate Changes: Min, Mean, Max, Time of Min and  Max, Trend (Linear, Quadratic, R2)",
-                            "RSP Rate Changes: Min, Mean, Max, Time of Min and Max",
-                            "RSP Amplitude Measures: Min, Mean, Max",
-                            "ECG and RSP Phase: Type (Inspiration/Expiration, Systole/Diastole), Completion",
-                            "SCR peak and its characteristics (amplitude, rise time, recovery time)"))
-
-colnames(table) <- c("Event-related Features", "Interval-related Features")
-
-
-
-
-table_features <- ggtexttable(table, rows = NULL, theme = ttheme("default"))
-
-p <- ggarrange(plot, table_features,
-               ncol=1, nrow=2,
-               heights=c(1, 0.5))
-p
-
-
-figheight <- 6
-figwidth <- 6 * 1.618034
-# ggsave("figures/features.png", p, height=figwidth, width=figwidth*1.5, dpi=600)
diff --git a/paper/make_figures.Rmd b/paper/make_figures.Rmd
deleted file mode 100644
index 1a69016af6..0000000000
--- a/paper/make_figures.Rmd
+++ /dev/null
@@ -1,205 +0,0 @@
----
-title: 'NeuroKit Figures'
-documentclass     : "apa6"
-classoption       : "man"
-output:
-  papaja::apa6_pdf:
-    keep_tex: FALSE
-    latex_engine: xelatex
-  papaja::apa6_word:
-    keep_tex: FALSE
-header-includes:
-   - \usepackage[labelfont=bf, font={color=gray,small}]{caption}
-   - \usepackage{float}
-   - \usepackage[document]{ragged2e}
-editor_options:
-  chunk_output_type: console
----
-
-\justify
-
-```{r r_setup, include = FALSE, warning=FALSE, message=FALSE}
-library("papaja")
-library("kableExtra")
-options(knitr.kable.NA = 'None')
-
-library(tidyverse)
-library(easystats)
-library(formattable)
-
-# Setup python - you need to change the path to your python distribution
-library(reticulate)
-# reticulate::use_python("C:/Users/Zen Juen/Downloads/WPy-3710b/python-3.7.1.amd64/")
-reticulate::use_python("D:/Downloads/WPy64-3810/python-3.8.1.amd64/")
-matplotlib <- import("matplotlib")
-matplotlib$use("Agg", force = TRUE)
-reticulate::repl_python()
-
-
-figheight <- 6
-figwidth <- 6 * 1.618034
-
-knitr::opts_chunk$set(
-   comment = ">",
-   dpi = 500,
-   fig.path = "figures/",
-   tidy = TRUE,
-   fig.height=figheight,
-   fig.width=figwidth,
-   fig.align = "center"
- )
-```
-
-
-
-# Download Data
-```{python, include=TRUE, eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-import pandas as pd
-import numpy as np
-
-# Data
-data = nk.data("bio_resting_8min_100hz").drop(['PhotoSensor', 'Unnamed: 0'], axis=1)
-```
-
-
-# Manually create photosensor input
-```{python, include=TRUE, eval=TRUE, echo = TRUE}
-Photosensor = list(np.full(len(data)-4, 0))
-Photosensor.insert(100, 5)
-Photosensor.insert(500, 5)
-Photosensor.insert(900, 5)
-Photosensor.insert(1300, 5)
-Photosensor = pd.DataFrame(Photosensor).rename({0: 'Photosensor'}, axis=1)
-data = pd.concat([data, Photosensor], axis=1)
-
-```
-
-
-
-
-<!-- # Process and Epoch -->
-<!-- ```{python, include=TRUE, eval=TRUE, echo = TRUE} -->
-<!-- # Process the data -->
-<!-- df, info = nk.bio_process(ecg=data["ECG"], rsp=data["RSP"], eda=data["EDA"], sampling_rate=100) -->
-
-<!-- # Find events -->
-<!-- events = nk.events_find(event_channel=data["Photosensor"], -->
-<!--                         threshold_keep='above') -->
-
-<!-- # Epoch the data -->
-<!-- epochs = nk.epochs_create(data=df, -->
-<!--                           events=events, -->
-<!--                           sampling_rate=100, -->
-<!--                           epochs_start=-0.1, -->
-<!--                           epochs_end=1.9) -->
-
-<!-- ``` -->
-
-
-<!-- # Event-related Analysis -->
-<!-- ```{python, include=TRUE, eval=TRUE, echo = TRUE} -->
-<!-- # Extract event related features -->
-<!-- results = nk.bio_analyze(epochs, sampling_rate=100) -->
-
-<!-- # Show subset of results -->
-<!-- #event_table = results[["Label", "ECG_Rate_Mean", "ECG_Atrial_Phase", "ECG_Ventricular_Phase", "RSP_Rate_Mean", "RSP_Phase", "EDA_SCR", "SCR_Peak_Amplitude"]] -->
-<!-- ``` -->
-
-
-# Interval-related analysis
-```{python, include=TRUE, eval=TRUE, echo = TRUE}
-# Extract features
-results = nk.bio_analyze(df, sampling_rate=100)
-
-# Show subset of results
-#interval_table = results[["ECG_Rate_Mean", "HRV_RMSSD", "RSP_Rate_Mean", "RSP_Amplitude_Mean", "RRV_SDBB", "SCR_Peaks_N", "SCR_Peaks_Amplitude_Mean"]]
-```
-
-
-
-# Visualize
-```{r include=TRUE, eval=TRUE, echo = FALSE, fig.width=10, fig.height=6, fig.cap="Visualize 10s of the dataset showing one event (in orange) and the other physiological signals."}
-library(ggpubr)
-theme_set(theme_pubr())
-
-df_p <- py$data %>%
-  slice(0:2000) %>% 
-  standardize() %>%
-  mutate(Time = 1:n() / 100) %>%
-  pivot_longer(1:3) %>%
-  mutate(name = fct_relevel(name, c("ECG", "RSP", "EDA")))
-
-plot <- df_p %>% 
-  ggplot(aes(x=Time, y=value, color=name, size=name)) +
-  
-  # shaded areas
-  geom_rect(aes(xmin = 0, xmax = 2, ymin = -Inf, ymax = Inf, fill = "Event-related Analysis"), alpha = 0, color="#FF9800") +
-  geom_rect(aes(xmin = 4, xmax = 6, ymin = -Inf, ymax = Inf, fill = "Event-related Analysis"), alpha = 0, color="#FF9800") +
-  geom_rect(aes(xmin = 8, xmax = 10, ymin = -Inf, ymax = Inf, fill = "Event-related Analysis"), alpha = 0, color="#FF9800") +
-  geom_rect(aes(xmin = 12, xmax = 14, ymin = -Inf, ymax = Inf, fill = "Event-related Analysis"), alpha = 0, color="#FF9800") +
-  geom_rect(aes(xmin = 0, xmax = 20, ymin = min(df_p$value), ymax = max(df_p$value), fill = "Interval-related Analysis"), alpha = 0, color="darkgrey") +
-  
-  # signals
-  geom_line() +
-  
-  # event markers
-  geom_vline(xintercept=1, linetype="dashed", size=1) +
-  geom_vline(xintercept=5, linetype="dashed", size=1) +
-  geom_vline(xintercept=9, linetype="dashed", size=1) +
-  geom_vline(xintercept=13, linetype="dashed", size=1) +
-  annotate("text", label = "Event Markers", x = 4.8, y = 5, angle=90) +
-  
-  # aesthetics
-  theme_modern() +
-  scale_color_manual('Signal type',
-                     values=c("ECG"="red", "EDA"="#9C27B0", "RSP"="#2196F3", "Photosensor"="#FF9800")) +
-  scale_size_manual(values=c("ECG"=0.66, "EDA"=2, "RSP"=2), guide=FALSE) +
-  scale_fill_manual('Analysis type',
-                    values =c("Event-related Analysis"="orange",
-                              "Interval-related Analysis"="darkgrey"),
-                    guide=guide_legend(override.aes = list(colour=c("#FF9800", "darkgrey")))) +
-  theme(axis.title.y = element_blank(),
-        axis.text.y = element_blank(),
-        legend.position = "right") +
-  ylab("Time (s)") +
-  ggtitle("Physiological Signals")
-
-# Tables
-# py$event_table <- py$event_table %>% 
-#   mutate(ECG_Rate_Mean = round(ECG_Rate_Mean, 2),
-#          RSP_Rate_Mean = round(RSP_Rate_Mean, 2))
-# py$interval_table <- py$interval_table %>% 
-#   mutate_at(c(1:5, 7), funs(round(., 2)))
-        
-# eventrelated <- ggtexttable(py$event_table, rows = NULL, 
-#                             theme = ttheme("mOrange"))
-# intervalrelated <- ggtexttable(py$interval_table, rows = NULL)
-
-intervalrelated <- c("ECG Rate Characteristics: Mean, Amplitude", "Heart Rate Variability (HRV) metrices", "Respiratory Rate Variability (RRV) metrices", "Respiratory Sinus Arrhythmia (RSA) metrices", "Number of SCR Peaks", "Mean of SCR Peaks Amplitude")
-
-
-
-eventrelated <- c("ECG Rate Changes: Min, Mean, Max, Time of Min and  Max, Trend (Linear, Quadratic, R2)", "RSP Rate Changes: Min, Mean, Max, Time of Min and Max", "RSP Amplitude Measures: Min, Mean, Max", "ECG and RSP Phase Measures: Type (Inspiration/Expiration, Systole/Diastole), Completion", "EDA Phasic Max Peak Amplitude", "Number of SCRs and first SCR characteristics (Peak Amplitude, Risetime, Recovery time)")
-
-table <- data.frame(cbind(eventrelated, intervalrelated))
-colnames(table) <- c("Event-related Features", "Interval-related Features")
-table_features <- ggtexttable(table, rows = NULL, theme = ttheme("default"))
-
-p <- ggarrange(plot, table_features,
-               ncol=1, nrow=2,
-               heights=c(1, 0.5))
-p
-
-ggsave("figures/features.png", p, height=figwidth, width=figwidth*1.5, dpi=600)
-
-# ggarrange(plot, eventrelated, intervalrelated, 
-#           ncol = 1, nrow = 3,
-#           heights = c(1, 0.3, 0.1))
-
-# Save plot
-#ggsave("plot.png")
-
-```
-
diff --git a/paper/manuscript_v3.pdf b/paper/makowski2021neurokit.pdf
similarity index 78%
rename from paper/manuscript_v3.pdf
rename to paper/makowski2021neurokit.pdf
index 4c8197c510..5a8ca99368 100644
Binary files a/paper/manuscript_v3.pdf and b/paper/makowski2021neurokit.pdf differ
diff --git a/paper/manuscript_v0.Rmd b/paper/manuscript_v0.Rmd
deleted file mode 100644
index b9f4444b16..0000000000
--- a/paper/manuscript_v0.Rmd
+++ /dev/null
@@ -1,329 +0,0 @@
----
-title: '**NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing**'
-shorttitle        : "NeuroKit2"
-author:
-  - name          : "Dominique Makowski"
-    affiliation   : " 1,*"
-    corresponding : no    # Define only one corresponding author
-    address       : "HSS 04-18, 48 Nanyang Avenue, Singapore"
-    email         : "dmakowski@ntu.edu.sg"
-  - name          : "Tam Pham"
-    affiliation   : " 1"
-  - name          : "Zen J. Lau"
-    affiliation   : " 1"
-  - name          : "Jan C. Brammer"
-    affiliation   : " 2"
-  - name          : "Hung Pham"
-    affiliation   : " 3"
-  - name          : "Francois Lespinasse"
-    affiliation   : " 4"
-  - name          : "Christopher Sch\\\"{o}lzel"
-    affiliation   : " 5"
-  - name          : "S.H. Annabel Chen"
-    affiliation   : " 1, 6, 7"
-affiliation:
-  - id            : "1"
-    institution   : "School of Social Sciences, Nanyang Technological University, Singapore"
-  - id            : "2"
-    institution   : "???"
-  - id            : "3"
-    institution   : "???"
-  - id            : "4"
-    institution   : "Departement de psychologie, Universite de Montreal, Montreal, Canada"
-  - id            : "5"
-    institution   : "Life Science Informatics, THM University of Applied Sciences, Gisslen, Germany"
-  - id            : "6"
-    institution   : "Centre for Research and Development in Learning, Nanyang Technological University, Singapore"
-  - id            : "7"
-    institution   : "Lee Kong Chian School of Medicine, Nanyang Technological University, Singapore"
-authornote: |
-  * Correspondence concerning this article should be addressed to Dominique Makowski (HSS 04-18, 48 Nanyang Avenue, Singapore; dmakowski@ntu.edu.sg).
-abstract: |
-   NeuroKit2 is an open-source, user-friendly Python package dedicated to neurophysiological signal processing. It developed from a collaborative project aimed at offering programming ease both for novice and advanced users to perform elaborate analyses of electrocardiogram (ECG), respiratory (RSP), electrodermal activity (EDA), and electromyography (EMG) data. It comprises of a consistent set of user-friendly, high-level functions that implement an all-in-one cleaning, preprocessing, and processing pipeline with sensible defaults. At the same time, greater flexibility and parametric control can be achieved by using Neurokit2's mid-level functions to build a custom analysis pipeline. With the current lack of open-source tools needed for comprehensive signal processing, Neurokit2 presents new opportunities for researchers to move away from unreadable black-box algorithms and towards greater control over their results, improving reproducibility in research. (talk about novelty? or cutting-edge measure extraction? or reproducibility?)
-keywords          : "Neurophysiology, Biosignals, Python, ECG, EDA, EMG, RSP"
-wordcount         : ""
-bibliography      : ["bibliography.bib"]
-floatsintext      : yes
-figsintext        : yes
-figurelist        : no
-tablelist         : no
-footnotelist      : no
-linenumbers       : yes
-mask              : no
-draft             : no
-documentclass     : "apa6"
-classoption       : "man"
-output:
-  papaja::apa6_pdf:
-    keep_tex: FALSE
-    latex_engine: xelatex
-  papaja::apa6_word:
-    keep_tex: FALSE
-header-includes:
-   - \usepackage[labelfont=bf, font={color=gray,small}]{caption}
-   - \usepackage{float}
-   - \usepackage[document]{ragged2e}
-editor_options:
-  chunk_output_type: console
----
-
-\justify
-
-```{r r_setup, include = FALSE, warning=FALSE, message=FALSE}
-library("papaja")
-library("kableExtra")
-options(knitr.kable.NA = 'None')
-
-library(tidyverse)
-library(easystats)
-
-# Setup python - you need to change the path to your python distribution
-library(reticulate)
-reticulate::use_python("D:/Downloads/WPy64-3810/python-3.8.1.amd64/")
-matplotlib <- import("matplotlib")
-matplotlib$use("Agg", force = TRUE)
-```
-
-
-
-<!-- Research gap -->
-Cognitive neuroscience and psychology are increasingly relying on neurophysiological methods to assess brain and bodily activity. These approaches include electroencephalography (EEG), electrocardiography (ECG), electromyography (EMG) and electrodermal activity (EDA) signals. This trend was driven not only by theoretical motivations [e.g., the growth of embodied or affective neuroscience; @Kiverstein2015], but also by practical reasons including low monetary cost (especially compared with other imaging techniques, such as MRI or MEG), high user convenience (e.g., portability, setup speed), and the increasing availability of recording devices [e.g., in smart watches; @yuehong2016internet]. Together with the developpment of recording tools, advancements in the fields of signal processing and computational data science bolstered the emergence of new processing algorithms [@clifton2012machine; @roy2019deep], in turn offering a myriad of novel methods for users to process and analyze neurophysiological signals. 
-
-Unfortunately, because most of the algorithms are implemented as code, neurophysiological data processing remains a challenge for many researchers without a formal training or experience in programming. Moreover, many existing implementations are also limited to one type of signals (for instance, focused on ECG or EDA), which makes it inconvenient for researchers who might have to learn and concurrently rely on different software to process multimodal data.
-
-
-
-<!-- Response to gap -->
-*NeuroKit2* aims at addressing these challenges by offering a free, user-friendly, and <!--complete--> comprehensive solution for neurophysiological data processing. It is an open-source Python package, developed in a collaborative environment that continues to welcome contributors from different countries and fields. Historically, *NeuroKit2* is the re-forged successor *NeuroKit.py* (*https://github.com/neuropsychology/NeuroKit.py*), a PhD side project that ended up attracting a lot of users (248 GitHub stars as of 09-04-2020). The new version takes on its best features and design choices, and re-implements them in a professional and well-thought way. It aims at being 1) accessible and well-documented, 2) reliable and cutting-edge, and most importantly, 3) flexible and powerful. <!--hmmmm powerful sounds abit too fluffy, robust seems like a more concrete description-->.<!--robust can be interpreted in different ways--> 
-
-<!-- Accessibility and documentation -->
-As the package is available for Python 3 [@python3], one of the most popular programming language, users benefit from an important amount of existing tutorials and a large online community. *NeuroKit2* is also relatively lightweight, using mainly standard dependencies [@scipy] such as *NumPy*, *pandas*, *SciPy*, *scikit-learn* and *MatplotLib* (with an additional system of optional dependencies), enabling its use as a dependency in other software. The package source code is available under a permissive license on GitHub (*https://github.com/neuropsychology/NeuroKit*). Its documentation, automatically built and rendered from the code [@sphinx-tobe-added], is hosted at *https://neurokit2.readthedocs.io/*. Apart from guides for installation and contribution, and a decription of the package's functions, the documentation also includes several "hands-on" examples and tutorials providing a walk-through on how to address specific issues (e.g., how to extract and visualize individual heartbeats, how to analyze event-related data). New examples can be easily added by users simply by uploading a Python notebook file [@kluyver2016jupyter] to the repository. This file will be automatically transformed into a webpage and displayed on the website, ensuring a transparent and evolutive documentation. Moreover, these examples can be used interactively via a cloud-based *Binder* environment [@Jupyter2018], allowing users to try out the features directly in their browser. Finally, the accessibility for newcomers is reinforced by the issue tracker of GitHub, where users can create public issues to inquire for help.
-
-<!-- Reliability and Evolution -->
-The package aims at being reliable and trustworthy, including peer-reviewed processing pipelines and functions tested against existing implementations of established reference software such as *BioSPPy* [@biosppy], *hrv* [*under review*](https://github.com/openjournals/joss-reviews/issues/1867), *PySiology* [@PySiology], *HeartPy* [@HeartPy], *systole* [@Systole] or *nolds* [@nolds]. The code itself includes a comprehensive test suite using continuous integration tools [e.g., @travis-tobe-added] to ensure stability and prevent errors. Moreover, users are able to easily report any bugs and be notified of their fixes via the issue tracker. <!--the issue tracker allows users to easily report any bugs and track their fixation. monitor related updates.--> <!--Thanks LOL--> *NeuroKit2* will remain abreast of the latest developments in the field as it builds upon a modular organization within an open, collaborative environment, where contributers can easily implement new processing alogrithms and integrate them into its existing processing pipeline. In other words, its ability to evolve, adapt, and integrate new methods as they are emerging will allow it to remain cutting-edge in the long term.
-
-<!--Thanks to its collaborative and open development, as well as its modular organization, *NeuroKit2* is being developed with a longterm perspective in mind, aiming at remaining cutting-edge through its ability to evolve, adapt, and integrate new methods as they are emerging.-->
-
-<!-- Powerful and flexible: API -->
-Finally, we believe that the design philosophy of *NeuroKit2* contributes to a powerful (i.e., allowing to achieve a lot with few functions) <!--another word for powerlful?--> yet flexible (i.e., enabling fine control and precision over what is done) user interface (API) <!--the parenthesis are okay IMO, as they specify what we mean by each adjective-->. This is described and illustrated with two examples of common use-cases, namely event-related and resting state paradigms. We <!--will--> conclude by discussing how *NeuroKit2* contributes to neurophysiological research by <!--heightening--> raising the standards for validity, reproducibility and accessibility.
-<!--powerful yet flexible -- might want to reconsider this term--> 
-
-
-# Design Philosophy
-
-*NeuroKit2* aims at being accessible to beginners and, at the same time, offering a maximal level of control to experienced users. This is achieved by allowing beginning users to implement complex processing and analyses pipelines with very few functions, while still enabling fine-tuned control and precision to more experienced users. <!--this portion might be better in the previous paragraph as it directly describes what you mean by powerful and flexible--> In concrete terms, this trade-off is allowed by the implementation of 3 abstract levels of functions.
-
-
-## Low-level: Base Utilities for Signal Processing
-
-The basic building blocks are functions to facilitate general signal processing, i.e., to do filtering, resampling, interpolating, peak detection, etc. These functions are signal-agnostic, and include a lot of tweakable parameters. For instance, one can change the filtering method, frequencies, order etc. Most of these functions are based on validated algorithms present in *scipy* [@scipy]. Examples of such functions include `signal_filter()`, `signal_interpolate()`, `signal_resample()`, `signal_detrend()`, and `signal_findpeaks()`.
-
-
-## Mid-level: Neurophysiological Processing Steps
-
-The signal processing utilities are then used by functions specific to the different types of physiological signals (i.e., ECG, RSP, EDA, EMG, PPG). These functions aim at taking care of specific steps of physiological data processing, such as cleaning, peak detection, phase classification or rate computation. Critically, for each type of signals, the same function names are called (in the form `signaltype_functiongoal()`) to achieve equivalent goals, e.g., `*_clean()`, `*_findpeaks()`, `*_process()`, `*_plot()`, making it intuitive and consistent accross different modalities.
-
-For example, the `rsp_clean()` function uses `signal_filter()` and `signal_detrend()`, with different possible sets of default parameters that can be switched via a "method" argument (corresponding to different published or validated pipelines). For instance, setting `method="khodadad2018"` will use the cleaning workflow described in @khodadad2018optimized. However, if a user wants to build its own custom cleaning pipeline, she or he can use the cleaning function as a template, and directly tweak the parameters in the low-level signal processing operations.
-
-
-## High-level Wrappers for Processing and Analysis
-
-These steps are then assembled in "master" functions, that are usually the entry point for new users. For instance, the `ecg_process()` function uses `ecg_clean()`, `ecg_findpeaks()`, `ecg_rate()`. A general processing pipeline can be selected via the `method` argument, that is then propagated throughout its lower-level functions. Easily switching between processing pipelines allows for the comparison of different methods, and streamlines critical but time-consuming steps in reproducible research, such as the validation of data preparation and quality control [@Quintana2016]. Finally, the package includes convenience meta-functions (e.g., `bio_process`) that enable the combined processing of multiple types of signals at once (e.g., `bio_process(ecg=ecg_signal, eda=eda_signal)`).
-
-Performing a set of operations with sensible default parameters can be rewarding, especially for beginners, allowing them to perform cutting-edge processing or replication of research steps without requiring a programming expertise. Moreover, it contributes to the demystification of the usage of "pure" programming tools (as opposed to GUI-based software such as *SPSS*, *Kubios*, or *Acqknowledge*), providing a welcoming framework to further understand the frontend, backend and the in-betweens of physiological data processing. Importantly, more advanced users can again very easily build their own custom analysis pipeline by using the mid-level functions, allowing for a finer control over the processing parameters.
-
-Overall, we believe that this code structure offers a calibrated trade-off between flexibility and user-friendliness. We hope that it may further encourage researchers to become part of a supportive open-science community construed of many expertises - rather than relying on closed and proprietary softwares - to achieve their goals.
-
-
-# Example
-
-In this section, we present two examples that illustrate the most common use-cases. The first example is an event-related paradigm, in which the interest lies in the momentarily short-term physiological changes related to specific stimuli, whereas the second shows how to extract the characteristics (features) of physiological activity during a longer period of time (not necessarily tied to a specific and suddent event). The example datasets are made available with the package and can be downloaded using the `data()` function.
-
-
-## Event-related Paradigm
-
-This example dataset contains ECG, RSP and EDA signals of one participant to whom were presented four emotional images [from the NAPS database; @marchewka2014nencki], in a typical (albeit highly shortened) experimental psychology paradigm.
-
-Signals are 2.5 minutes long and are recorded at a frequency of 100Hz [note that the sampling rate is low for storage purposes and should be higher in actual recordings, see @Quintana2016]. It has 4 channels including three physiological signals, and one corresponding to the marking of events via a photosensor (which signal decreased when a stimulus was displayed on the screen).
-
-
-```{python eventrelated_data, include=TRUE, eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download example dataset
-data = nk.data("bio_eventrelated_100hz")
-
-# Visualize 10 seconds of data (on the same scale)
-nk.signal_plot(data[900:1900], standardize=True)
-```
-
-```{r include=TRUE, eval=TRUE, echo = FALSE, fig.width=10, fig.height=6, fig.cap="Subset of the dataset showing one event (in orange) and the other physiological signals."}
-py$data %>%
-  standardize() %>%
-  mutate(Time = 1:n() / 100) %>%
-  slice(900:1900) %>%
-  pivot_longer(1:4) %>%
-  mutate(name = fct_relevel(name, c("ECG", "RSP", "EDA", "Photosensor"))) %>%
-  ggplot(aes(x=Time, y=value, color=name, size=name)) +
-  geom_line() +
-  theme_modern() +
-  scale_color_manual(values=c("ECG"="red", "EDA"="#9C27B0", "RSP"="#2196F3", "Photosensor"="#FF9800")) +
-  scale_size_manual(values=c("ECG"=0.66, "EDA"=2, "RSP"=2, "Photosensor"=2)) +
-  theme(axis.title.y = element_blank(),
-        axis.text.y = element_blank(),
-        legend.title = element_blank(),
-        legend.position = "top") +
-  ylab("Time (s)") +
-  guides(size = guide_legend(override.aes = list(size = 2)))
-```
-
-```{python epochs_creation, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Step 1: Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          eda=data["EDA"],
-                          sampling_rate=100)
-
-# Step 2: Find events
-conditions = ["Negative", "Neutral", "Neutral", "Negative"]
-events = nk.events_find(event_channel=data["Photosensor"],
-                        threshold_keep='below',
-                        event_conditions=conditions)
-
-# Step 3: Epoch the data
-epochs = nk.epochs_create(data=df,
-                          events=events,
-                          sampling_rate=100,
-                          epochs_start=-0.1,
-                          epochs_end=4)
-```
-<!-- why don't we plot epochs here instead of plotting an arbitrary slice ?-->
-```{python eventrelated_analysis, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Step 4: Extract event related features
-results = nk.bio_analyze(epochs)
-
-# Show subset of results
-results[["Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude"]]
-```
-
-```{r table1word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="markdown", digits = 3, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", row.names = FALSE)
-```
-```{r table1pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-<!--consider whether we want to show all the columns in the epoch features? e.g. SCR_N and ECG Phase etc.-->
-
-In this example, after loading the package and the example dataset, each physiological signal is processed using `bio_process()`. Data from the photosensor is processed separetely with `events_find()`, that locates the <!--changes in the signal corresponding to stimuli onsets.--> stimuli onsets.
-
-Event-related features can be extracted with three steps.
-
-<!--Though event-related paradigms are often employed, standardized and reproducible pipelines for biosignal analyses are still not common practice. As a symbol of this lack of consensus, the chapter dedicated to biosignal processing in the go-to *Handbook of psychophysiology* does not even mention this issue [@Gratton2017]--><!-- Tone feels abit harsh, maybe rephrase and say why it is important. Also perhaps this paragraph if needed should be after the example is explained->. <!--We are suggesting-->  In step 1, the package is imported and the data is loaded. In step 2, conditions can be easily intialized by giving a list representing the order of presentation of stimuli to the `event_conditions` argument. In step 3, the timeseries can then be segmented from the data into epochs with `epochs_create()`. This function will take the processed data in `df` and <!--keep-->generate a dictionary containing only segments of the dataframe corresponding to the time window around `events`. In step 4, relevant features are computed by giving our `epochs` dictionary of dataframes to `bio_analyze()`. More details about parameters can be found in the package Documentation (github.com/neurokit2.readthedocs.io).
-<!-- Should these comments be shortened/summarized and then commented together with the python code instead, for ease of readability? Or we can refer them to the NK documentation--> The features include the changes in rates of ECG and RSP signals (e.g. maximum, minimum and mean rate after stimulus onset, and the time at which they occur), and the peak characteristics of EDA signal (e.g., occurrence of skin conductance response (SCR), and if SCR is present, its corresponding peak amplitude, time of peak, rise and recovery time). In addition, respiration and cardiac cycle phases are also extracted (i.e.,  the respiration phase - inspiration/expiration - and cardiac phase - systole/diastole - occuring at the onset of event).
-
-This example shows the straightforward process of extracting short-term features of physiological responses/activity. This pipeline can also scale up with little-or-no effort to group-level analysis by aggregating the mean of features accross subjects. We believe these steps are easy for beginners to memorize and implement, <!-- as well as intuitive--> as much as they are sufficiently flexible for the more advanced to tweak parameters to suit their desired goal. <!-- One might say that it could speed up the process between data collection and analysis-->.
-
-<!--Description is clear, now we need to say how this pipeline facilitates valid interpretations and how it reveals crucial physiological processes that are linked to cognition and affectivity-->
-
-In addition to streamlining data analyses, *NeuroKit2* aims to provide researchers an exhaustive <!--exhaustive or extensive??-->suite of signal features, to allow for meaningful <!--more valid-->interpretations of physiological activity. In this example (Table 1), exposure to negative stimuli is related to stronger cardiac deceleration, higher skin conductance response, and accelerated breathing rate, as compared to neutral stimuli.
-
-<!--*NeuroKit2's* signal processing pipeline is thus able 
-to delineate such physiological processes that are crucial in generating conclusions about spontaneous or stimulated cognition and affectivity alongside behavioural data.--> <!--We believe that using *NeuroKit2* to analyze public databases of event-related experiments is a logical next step to ensure that its usability is replicable.-->
-
-
-
-
-
-## Resting-state Features
-
-The `interval related dataset` represents physiological activity of a human at rest (eyes-closed in a sitted position). It contains three channels (ECG, PPG and RSP) sampled at a frequency of 100Hz during five minutes. In this example, one would be interested in computing features of rate variability and longer-term activation patterns.
-
-<!--Step 1. -->
-```{python intervalrelated, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Step 1: Download example dataset
-data = nk.data("bio_resting_5min_100hz")
-
-# Step 2: Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          sampling_rate=100)
-```
-<!--Step 2 NOTE: I would add ecg_hrv(), because if I remember correctly, HRV is not computed by bio_process() -->
-```{python intervalrelated, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-#<!-- HRV included in step 3 of bio_analyze -->
-# hrv = nk.ecg_hrv(ecg_rate=df["ECG_Rate"], sampling_rate=100, show=True)
-
-# Step 3: Extract features
-results = nk.bio_analyze(df)
-
-# DAppend results and HRV  <!-- don't need to do this anymore --> 
-#results = results.append(hrv)
-
-# Show subset of results
-results[["ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean"]]
-```
-
-```{r table2word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="markdown", digits = 3, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state", row.names = FALSE)
-```
-```{r table2pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-In step 1, the dataset is loaded along with the package then processed with the same function previously used. In step 2, the processing function outputs dataframe `df` including continuous respiratory and heart rate signals in addition to raw and cleaned signals. It also outputs `info` which represents a dictionary of detected peaks and troughs of RSP and ECG signals. <!--In Step 2, HRV is computed over the 5 minutes of processed heart rate signal. It is computed separetely --> Finally in step 3, `df` is directly passed to the `bio_analyze` function, which computes the mean of heart and breathing rate, as well as several metrices of heart rate variability and respiratory sinus arrythmia. <!--Results from `ecg_hrv()` and `bio_analyze()` can be appended to the same dataframe, and a subset of them can be chosen for outputting a table.-->
-
-As resting-state paradigms are widely used in human neuroscience, our analysis pipeline would be a convenient and effective tool to extract relevant features of physiological activity for these experiments. As meta-analytic research highlight the importance of controlling the quality of physiological data to assess brain-heart interactions [@Yoo2018, @Jennings2016], a stable and reproducible pipeline may lead to more convergent and valid results. <!--this sentence doesn't seem coherent/understandable enough: why is it relevant that there are relations between high frequency HRV and brain structure and connectivity?--> Otherwise, the increased accesibility of recording instruments combined together with this easy to run pipeline can be interesting to amateurs who wish to analyze their own physiological activty. Perhaps, practitioners who use biofeedback systems could also benefit from an open-access and stable pipeline for their data processing. Moreover, one could envision that these tools will facilitate the establishment of psychotherapy and meditation sessions assisted by these sytems. <!-- paragraph's tone also needs revision - I revisited some aspects i wanted to mention other possible use-cases for this pipeline-->
-
-
-#  Future Directions
-
-Despite not having a Graphical User Interface (GUI), *NeuroKit2* is accessible to people with very little knowledge of python or programming in general, thanks to its design choices focusing on user-experience. Naturally, our design philosophy extends to our collaborative community in developing this package. *Neurokit2* is a pragmatic solution to a problem beyond specific research questions: it addresses the need for transparent and accessible methods in neurophysiology. We believe this will not only help researchers answer important scientific questions, but it will also allow for less experienced users to build experimentations and applications that they sought to conceptualize, but had difficulty materializing it <!--just never thought they could-->.
-
-Future evolution will mostly be driven by the community and the advances in related fields. Possible directions include extending the support for other types of bodily signals (e.g., electrogastrography - EGG, electrooculography - EOG) and strenghtening the efficiency of the code to obtain performance gains for large datasets.  As previously mentionned, testing *Neurokit2* against existing pipelines using public databases from diverse fields of study would be a logical next step. In addition, to further commit to reproducibility principles in science, any standardized data structure outputs (e.g. Bids, phys2bids) could be integrated to accelerate data import
-
-*Neurokit2* seeks to promote areas such as <!--these are only examplesbiofeedback, -assisted psychotherapy, affective computing -->. It seeks to promote the autonomy of users vis-à-vis neurophysiological methods. We believe their increased accesibility can help forge new ground for therapy-related applications. More than four decades ago, @Lazarus1975 mentionned the importance of biofeedback in clinical contexts to support self-regulation, i.e. because it offers "informational aid" about bodily processes and helps recognizing that they can be "volitionally regulated". We believe this approach can speak to many practitioners who are interested by these tools, but did not get proper training in programming.
-
-# Conclusion
-
-Thanks to its well-documented API and reliable community, begginners can use our tools in an informed manner, while being supported by people of diverse backgrounds. Taken together, we have to acknowledge the importance of investigating bodily processes to provide novel insights to human psychological research. In fact, biosignals and related complexity measurements have significant potential to inform models of brain activity, being essential in decribing activity from autonomic nervous system [@Valenza2020]. Perhaps the full integration of these methods will help reveal inner-workings of the intricacies between cognitive, affective and behavioral processes.
-
-All in all, we think *Neurokit2* provides essential tools for novice as well as senior researchers, amateurs, and even simply tech-enthousiasts who investigate either human health or (neuro)psychological processes at different scales. Whether the data is produced by "smart health devices" or academic research-grade equipment, *Neurokit2* wants users to access reproducible data processing and analysis methods. After all, *Neurokit2* is a community dedicated to educating one another about neurophysiological methods and relted topics.
-
-# Conflict of Interest
-
-The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
-
-# Acknowledgements
-
-We would like to thank all the contributors (https://neurokit2.readthedocs.io/en/latest/authors.html), and the users for their support.
-
-
-
-
-
-
-
-
-\newpage
-
-# References
-```{r create_r-references}
-r_refs(file = "bibliography.bib")
-```
-
-\begingroup
-\setlength{\parindent}{-0.5in}
-\setlength{\leftskip}{0.5in}
-
-<div id = "refs"></div>
-\endgroup
diff --git a/paper/manuscript_v1.Rmd b/paper/manuscript_v1.Rmd
deleted file mode 100644
index e4db053ce3..0000000000
--- a/paper/manuscript_v1.Rmd
+++ /dev/null
@@ -1,296 +0,0 @@
----
-title: '**NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing**'
-shorttitle        : "NeuroKit2"
-author:
-  - name          : "Dominique Makowski"
-    affiliation   : " 1,*"
-    corresponding : no    # Define only one corresponding author
-    address       : "HSS 04-18, 48 Nanyang Avenue, Singapore"
-    email         : "dmakowski@ntu.edu.sg"
-  - name          : "Tam Pham"
-    affiliation   : " 1"
-  - name          : "Zen J. Lau"
-    affiliation   : " 1"
-  - name          : "Jan C. Brammer"
-    affiliation   : " 2"
-  - name          : "Francois Lespinasse"
-    affiliation   : " 3"
-  - name          : "Hung Pham"
-    affiliation   : " 4"
-  - name          : "Christopher Sch\\\"{o}lzel"
-    affiliation   : " 5"
-  - name          : "S.H. Annabel Chen"
-    affiliation   : " 1, 6, 7"
-affiliation:
-  - id            : "1"
-    institution   : "School of Social Sciences, Nanyang Technological University, Singapore"
-  - id            : "2"
-    institution   : "Behavioural Science Institute, Radboud University, Netherlands"
-  - id            : "3"
-    institution   : "Departement de psychologie, Universite de Montreal, Canada"
-  - id            : "4"
-    institution   : "Eureka Robotics, Singapore"
-  - id            : "5"
-    institution   : "Life Science Informatics, THM University of Applied Sciences, Germany"
-  - id            : "6"
-    institution   : "Centre for Research and Development in Learning, Nanyang Technological University, Singapore"
-  - id            : "7"
-    institution   : "Lee Kong Chian School of Medicine, Nanyang Technological University, Singapore"
-authornote: |
-  * Correspondence concerning this article should be addressed to Dominique Makowski (HSS 04-18, 48 Nanyang Avenue, Singapore; dmakowski@ntu.edu.sg).
-abstract: |
-   NeuroKit2 is an open-source, community-driven, and user-friendly Python package dedicated to neurophysiological signal processing (e.g., ECG, EDA, EMG, ...). Its design philosophy is centred on user-experience and accessibility to both novice and advanced users. The package provides high-level functions that enable data processing in a few lines of code using validated pipelines, as well as low-level tools dedicated to specific processing steps. NeuroKit2 aims at improving transparency and reproducibility in neurophysiological research, as well as enabling exploration and innovation.  
-keywords          : "Neurophysiology, Biosignals, Python, ECG, EDA, EMG"
-wordcount         : ""
-bibliography      : ["bibliography.bib"]
-floatsintext      : yes
-figsintext        : yes
-figurelist        : no
-tablelist         : no
-footnotelist      : no
-linenumbers       : yes
-mask              : no
-draft             : no
-documentclass     : "apa6"
-classoption       : "man"
-output:
-  papaja::apa6_pdf:
-    keep_tex: FALSE
-    latex_engine: xelatex
-  papaja::apa6_word:
-    keep_tex: FALSE
-header-includes:
-   - \usepackage[labelfont=bf, font={color=gray,small}]{caption}
-   - \usepackage{float}
-   - \usepackage[document]{ragged2e}
-editor_options:
-  chunk_output_type: console
----
-
-\justify
-
-```{r r_setup, include = FALSE, warning=FALSE, message=FALSE}
-library("papaja")
-library("kableExtra")
-options(knitr.kable.NA = 'None')
-
-library(tidyverse)
-library(easystats)
-
-# Setup python - you need to change the path to your python distribution
-library(reticulate)
-reticulate::use_python("D:/Downloads/WPy64-3810/python-3.8.1.amd64/")
-matplotlib <- import("matplotlib")
-matplotlib$use("Agg", force = TRUE)
-```
-
-
-
-<!-- Research gap -->
-Neurophysiological measurements increasingly gain popularity in the study of cognition and behavior. These measurements include electroencephalography (EEG), electrocardiography (ECG), electromyography (EMG) and electrodermal activity (EDA). Their popularity is driven by theoretical motivations [e.g., the growth of embodied or affective neuroscience; @Kiverstein2015] as well as practical reasons. The latter include low costs (especially compared with other imaging techniques, such as MRI or MEG), ease of use (e.g., portability, setup speed), and the increasing availability of recording devices [e.g., wearables; @yuehong2016internet]. Moreover, the extraction of meaningful information from neurophysiological signals is facilitated by current advances in signal processing algorithms [@clifton2012machine; @roy2019deep]. 
-
-Unfortunately, these algorithms are mostly inaccessible to researchers without experience in programming and signal processing. Moreover, many software tools for neurophysiological analyses are limited to one type of signal (for instance, focused on ECG). This makes using those tools inconvenient for researchers who whish to analyse datasets containing multiple physiological modalities.
-
-<!-- Response to gap -->
-*NeuroKit2* adresses these challenges by offering a free, user-friendly, and comprehensive solution for neurophysiological data processing. It is an open-source Python package, developed by a multi-disciplinary team that actively invites new colaborators. *NeuroKit2* aims at being accessible, well-documented, well-tested, cutting-edge, flexible and efficient.
-
-<!-- Accessibility and documentation -->
-The package is implemented in Python 3 [@python3], which means that *NeuroKit2's* users benefit from an large amount of learning resources and a vibrant community. *NeuroKit2* depends on relatively few, well established and robust packages from the Python data analysis ecosystem [@scipy, @NumPy, @pandas, @SciPy, @scikit-learn, @MatplotLib].
-
-
-*NeuroKit2's* source code is available under the permissive MIT license on GitHub (*https://github.com/neuropsychology/NeuroKit*). Its documentation (*https://neurokit2.readthedocs.io/*) is automatically built and rendered from the code and includes guides for installation and contribution, a description of the package's functions, as well as several "hands-on" examples and tutorials (e.g., how to extract and visualize individual heartbeats, how to analyze event-related data etc.). 
-
-
-Users can add new examples by simply uploading a Python notebook [@kluyver2016jupyter] to the Github repository. The notebook will automatically be displayed on the website, ensuring easily accessible and evolving documentation. Moreover, users can try out the example notebooks directly in their browser via a cloud-based *Binder* environment [@Jupyter2018]. Finally, the issue tracker on GitHub offers a convenient and public forum that allows newcomers and potential collaborators to get help and insight into the development of the package.
-
-<!-- Reliability and Evolution -->
-*NeuroKit2* aims at being reliable and trustworthy, including peer-reviewed processing pipelines and functions tested against implementations of established software such as *BioSPPy* [@biosppy], *hrv* [*under review*](https://github.com/openjournals/joss-reviews/issues/1867), *PySiology* [@PySiology], *HeartPy* [@HeartPy], *systole* [@Systole] or *nolds* [@nolds]. The repository leverages a comprehensive test suite and continuous integration [e.g., travis CI] to ensure stability and prevent errors. Thanks to its collaborative and open development as well as its modular organization, *NeuroKit2* can continuously evolve, adapt, and integrate cutting-edge methods as they are emerging.
-
-
-<!-- Powerful and flexible: API -->
-
-# Design Philosophy
-We strive for a flexible user interface (API) which offers both, high-level abstractions as well as fine-grained control. 
-This allows us to adress the needs of beginners as well as experienced users. Beginning users can implement complex analyses in very few lines of code, while more experienced users can leverage low-level functionality. Concretely, our functions are implemented in three layers of abstraction.
-
-
-## Low-level: Base Utilities for Signal Processing
-
-The basic building blocks are functions for general signal processing, i.e., filtering, resampling, interpolation, peak detection, etc.. These functions are signal-agnostic, and include a lot of parameters. For instance, one can change the filtering -method, -frequencies, and -order. Most of these functions are based on established algorithms implemented in *scipy* [@scipy]. Examples of such functions include `signal_filter()`, `signal_interpolate()`, `signal_resample()`, `signal_detrend()`, and `signal_findpeaks()`.
-
-
-## Mid-level: Neurophysiological Processing Steps
-
-The base utilities are used by mid-level functions specific to the different physiological modalities (i.e., ECG, RSP, EDA, EMG, PPG). These functions carry out modality-specific signal processing steps, such as cleaning, peak detection, phase classification or rate computation. Critically, for each type of signal, the same function names are called (in the form `signaltype_functiongoal()`) to achieve equivalent goals, e.g., `*_clean()`, `*_findpeaks()`, `*_process()`, `*_plot()`, making the implementation intuitive and consistent across different modalities.
-
-For example, the `rsp_clean()` function uses `signal_filter()` and `signal_detrend()`, with different sets of default parameters that can be switched with a "method" argument (corresponding to different published or validated pipelines). For instance, setting `method="khodadad2018"` will use the cleaning workflow described in @khodadad2018optimized. However, if a user wants to build their own custom cleaning pipeline, they can use the cleaning function as a template, and directly tweak the parameters in the low-level signal processing operations.
-
-
-## High-level Wrappers for Processing and Analysis
-
-The mid-level functions are assembled in high-level "master" functions, that are convenient entry points for new users. For instance, the `ecg_process()` function internally chains the mid-level functions `ecg_clean()`, `ecg_findpeaks()`, `ecg_rate()`. A specific processing pipeline can be selected with the `method` argument, that is then propagated throughout the internal functions. Easily switching between processing pipelines allows for the comparison of different methods, and streamlines critical but time-consuming steps in reproducible research, such as the validation of data preparation and quality control [@Quintana2016]. Finally, the package includes convenience meta-functions (e.g., `bio_process`) that enable the combined processing of multiple types of signals at once (e.g., `bio_process(ecg=ecg_signal, eda=eda_signal)`).
-
-Performing a set of operations with sensible default parameters can be rewarding, especially for beginners, allowing them to perform cutting-edge processing or replication of research steps without requiring much programming expertise. Moreover, it contributes to the demystification of the usage of APIs (as opposed to GUI-based software such as *SPSS*, *Kubios*, or *Acqknowledge*), providing a welcoming framework to further explore physiological data processing at all levels of detail. Importantly, more advanced users can easily build custom analysis pipelines by using the mid-level functions, allowing for a finer control over the processing parameters. We believe that this implementation is a well-calibrated trade-off between flexibility and user-friendliness. 
-
-
-# Examples
-
-In this section, we present two examples that illustrate the most common use-cases. The first example is an event-related paradigm, in which the interest lies in short-term physiological changes related to specific events. The second example shows how to extract characteristic features of physiological activity during a longer period of time (not necessarily tied to a specific and sudden event). The example datasets are made available with the package and can be downloaded using the `data()` function.
-
-
-## Event-related Paradigm
-
-This example dataset contains ECG, RSP and EDA signals of one participant who was presented with four emotional images [from the NAPS database; @marchewka2014nencki], in a typical (albeit highly shortened) experimental psychology paradigm.
-
-Signals are 2.5 minutes long and are recorded at a frequency of 100Hz [note that the sampling rate is low for storage purposes and should be higher in actual recordings, see @Quintana2016]. It has 4 channels including three physiological signals, and one corresponding to the marking of events with a photosensor (which signal decreases when a stimulus appeared on the screen).
-
-
-
-```{python eventrelated_data, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_eventrelated_100hz")
-
-# Figure 1. Visualize 10 seconds of data (on the same scale)
-nk.signal_plot(data[900:1900], standardize=True)
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          eda=data["EDA"],
-                          sampling_rate=100)
-
-# Find events
-conditions = ["Negative", "Neutral", "Neutral", "Negative"]
-events = nk.events_find(event_channel=data["Photosensor"],
-                        threshold_keep='below',
-                        event_conditions=conditions)
-
-# Epoch the data
-epochs = nk.epochs_create(data=df,
-                          events=events,
-                          sampling_rate=100,
-                          epochs_start=-0.1,
-                          epochs_end=4)
-
-# Extract event related features
-results = nk.bio_analyze(epochs)
-
-# Show subset of results
-results[["Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude"]]
-```
-
-```{r include=TRUE, eval=TRUE, echo = FALSE, fig.width=10, fig.height=6, fig.cap="Subset of the dataset showing one event (in orange) and the other physiological signals."}
-py$data %>%
-  standardize() %>%
-  mutate(Time = 1:n() / 100) %>%
-  slice(900:1900) %>%
-  pivot_longer(1:4) %>%
-  mutate(name = fct_relevel(name, c("ECG", "RSP", "EDA", "Photosensor"))) %>%
-  ggplot(aes(x=Time, y=value, color=name, size=name)) +
-  geom_line() +
-  theme_modern() +
-  scale_color_manual(values=c("ECG"="red", "EDA"="#9C27B0", "RSP"="#2196F3", "Photosensor"="#FF9800")) +
-  scale_size_manual(values=c("ECG"=0.66, "EDA"=2, "RSP"=2, "Photosensor"=2)) +
-  theme(axis.title.y = element_blank(),
-        axis.text.y = element_blank(),
-        legend.title = element_blank(),
-        legend.position = "top") +
-  ylab("Time (s)") +
-  guides(size = guide_legend(override.aes = list(size = 2)))
-```
-```{r table1word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="markdown", digits = 3, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", row.names = FALSE)
-```
-```{r table1pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-In this example, after loading the package and the example dataset, each physiological signal is processed using `bio_process()`. Stimulus onsets in the photosensor are detected separately with `events_find()`. Once we have the preprocessed signals and the location of events, we can slice the data into segments corresponding to a time window (ranging from -0.1 to 4 seconds) around each stimulus with `epochs_create()`. Finally, relevant features are computed for each epoch (i.e., each stimulus) by passing them to `bio_analyze()`.
-
-The features include for example the changes in rate of ECG and RSP signals (e.g. maximum, minimum and mean rate after stimulus onset, and the time at which they occur), and the peak characteristics of the EDA signal (e.g., occurrence of skin conductance response (SCR), and if SCR is present, its corresponding peak amplitude, time of peak, rise and recovery time). In addition, respiration and cardiac cycle phases are extracted (i.e., the respiration phase - inspiration/expiration - and cardiac phase - systole/diastole - occurring at the onset of event).
-
-This example shows the straightforward process of extracting features of physiological responses. This pipeline can easily scale up to group-level analysis by aggregating the average of features across subjects. In addition to streamlining data analyses, *NeuroKit2* aims to provide researchers an extensive suite of signal features, allowing for precise interpretations in terms of relationship between physiological activity and neurocognitive processes. In this example (see **Table 1**), exposure to negative stimuli, as compared to neutral stimuli, is related to stronger cardiac deceleration, higher skin conductance response, and accelerated breathing rate (note that statistically, this illustrative interpretation is purely descriptive).
-
-
-
-## Resting-state Features
-
-The second dataset corresponds to 5 minutes of physiological activity of a human participant at rest (eyes-closed in a seated position), under no specific set of instructions. It contains three channels (ECG, PPG and RSP) sampled at a frequency of 100Hz.
-
-```{python intervalrelated, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_resting_5min_100hz")
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          sampling_rate=100)
-
-# Extract features
-results = nk.bio_analyze(df)
-
-# Show subset of results
-results[["ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean"]]
-```
-
-```{r table2word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="markdown", digits = 3, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state", row.names = FALSE)
-```
-```{r table2pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-
-In this example, the steps of the analysis are identical to the previous example, including loading the package, the dataset and processing the data. The difference is that there is no epoching, as we want to compute features related to the whole dataset. Thus, we can directly pass the dataframe to `bio_analyze()`, which will detect that these are not epochs, and compute the appropriate features accordingly. These include for instance the average heart and breathing rate, as well as indices of heart rate variability (HRV) and respiratory sinus arrhythmia (RSA).
-
-
-This example illustrates a second type of physiological analysis, that we refer to as interval-related. Interval-related analyses compute features of signal variability and activation patterns over a longer-term period of time (typically minutes). *NeuroKit2* allows for the fast creation of a standardized and reproducible pipeline to describe this kind of physiological activity.
-
-
-
-# Discussion
-
-*NeuroKit2* offers neurophysiological signal processing software to people with all levels of programming experience. Its development is focused on an intuitive user-experience and a collaborative community. It is also a pragmatic answer to the broader need for transparent and reproducible methods in neurophysiology. Its modular organization not only facilitates the use of existing and validated processing pipelines, but is also suitable for experimentation and innovation.
-
-We expect the packages' future evolution to be driven by the communities' needs and the advances in related fields. Possible directions include extending the support for other types of bodily signals (e.g., electrogastrography - EGG, electrooculography - EOG) and achieving performance gains for large datasets by using efficient algorithms. Further validation of the available processing pipelines could be made through the (re)analysis of public databases. In line with this objective, the support of standardized data structure formats (e.g. WFDB, BIDS, ...) could be extended.
-
-In conclusion, we believe that *NeuroKit2* provides useful tools for anyone who is interested in analyzing data from wearables, "smart health devices", or research-grade hardware. This makes the package useful beyond academic research in neuroscience and psychology, including personal health monitoring and exercise science. By providing free, open-source solutions we hope to increase the autonomy of researchers and shorten the delay between data acquisition and analysis. Finally, we hope that *NeuroKit2* encourages users to become part of a supportive open-science community with diverse areas of expertise - rather than relying on closed-source and proprietary software. 
-
-
-# Conflict of Interest
-
-The authors declare that the research was conducted in the absence of commercial or financial relationships that could constitute a conflict of interest.
-
-# Acknowledgements
-
-We would like to thank Prof. C. F. Xavier for inspiration, all the contributors (https://neurokit2.readthedocs.io/en/latest/authors.html), and the users for their support.
-
-
-
-\newpage
-
-# References
-```{r create_r-references}
-r_refs(file = "bibliography.bib")
-```
-
-\begingroup
-\setlength{\parindent}{-0.5in}
-\setlength{\leftskip}{0.5in}
-
-<div id = "refs"></div>
-\endgroup
diff --git a/paper/manuscript_v2.Rmd b/paper/manuscript_v2.Rmd
deleted file mode 100644
index 96f683c861..0000000000
--- a/paper/manuscript_v2.Rmd
+++ /dev/null
@@ -1,310 +0,0 @@
----
-title: '**NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing**'
-shorttitle        : "NeuroKit2"
-author:
-  - name          : "Dominique Makowski"
-    affiliation   : " 1,*"
-    corresponding : no    # Define only one corresponding author
-    address       : "HSS 04-18, 48 Nanyang Avenue, Singapore"
-    email         : "dmakowski@ntu.edu.sg"
-  - name          : "Tam Pham"
-    affiliation   : " 1"
-  - name          : "Zen J. Lau"
-    affiliation   : " 1"
-  - name          : "Jan C. Brammer"
-    affiliation   : " 2"
-  - name          : "Francois Lespinasse"
-    affiliation   : " 3, 8"
-  - name          : "Hung Pham"
-    affiliation   : " 4"
-  - name          : "Christopher Sch\\\"{o}lzel"
-    affiliation   : " 5"
-  - name          : "S.H. Annabel Chen"
-    affiliation   : " 1, 6, 7"
-affiliation:
-  - id            : "1"
-    institution   : "School of Social Sciences, Nanyang Technological University, Singapore"
-  - id            : "2"
-    institution   : "Behavioural Science Institute, Radboud University, Netherlands"
-  - id            : "3"
-    institution   : "Departement de psychologie, Universite de Montreal, Canada"
-  - id            : "4"
-    institution   : "Eureka Robotics, Singapore"
-  - id            : "5"
-    institution   : "Life Science Informatics, THM University of Applied Sciences, Germany"
-  - id            : "6"
-    institution   : "Centre for Research and Development in Learning, Nanyang Technological University, Singapore"
-  - id            : "7"
-    institution   : "Lee Kong Chian School of Medicine, Nanyang Technological University, Singapore"
-  - id            : "8"
-    institution   : "Centre de Recherche de l'Institut Universitaire Geriatrique de Montreal"
-authornote: |
-  * Correspondence concerning this article should be addressed to Dominique Makowski (HSS 04-18, 48 Nanyang Avenue, Singapore; dmakowski@ntu.edu.sg).
-abstract: |
-   NeuroKit2 is an open-source, community-driven, and user-friendly Python package dedicated to neurophysiological signal processing (e.g., ECG, EDA, EMG, ...). Its design philosophy is centred on user-experience and accessibility to both novice and advanced users. The package provides general functions that enable data processing in a few lines of code using validated pipelines, as well as tools dedicated to specific processing steps, offering a trade-off between efficiency and fine-tuned control. NeuroKit2 aims at improving transparency and reproducibility in neurophysiological research, as well as fostering exploration and innovation.  
-keywords          : "Neurophysiology, Biosignals, Python, ECG, EDA, EMG"
-wordcount         : "2440"
-bibliography      : ["bibliography.bib"]
-floatsintext      : yes
-figsintext        : yes
-figurelist        : no
-tablelist         : no
-footnotelist      : no
-linenumbers       : yes
-mask              : no
-draft             : no
-documentclass     : "apa6"
-classoption       : "man"
-output:
-  papaja::apa6_pdf:
-    keep_tex: FALSE
-    latex_engine: xelatex
-  papaja::apa6_word:
-    keep_tex: FALSE
-header-includes:
-   - \usepackage[labelfont=bf, font={color=gray,small}]{caption}
-   - \usepackage{float}
-   - \usepackage[document]{ragged2e}
-editor_options:
-  chunk_output_type: console
----
-
-\justify
-
-```{r r_setup, include = FALSE, warning=FALSE, message=FALSE}
-library("papaja")
-library("kableExtra")
-options(knitr.kable.NA = 'None')
-
-library(tidyverse)
-library(easystats)
-
-# Setup python - you need to change the path to your python distribution
-library(reticulate)
-reticulate::use_python("D:/Downloads/WPy64-3810/python-3.8.1.amd64/")
-matplotlib <- import("matplotlib")
-matplotlib$use("Agg", force = TRUE)
-```
-
-
-
-<!-- Research gap 1 -->
-Neurophysiological measurements increasingly gain popularity in the study of cognition and behavior.
-These measurements include electroencephalography (EEG), electrocardiography (ECG), electromyography (EMG) and electrodermal activity (EDA).
-Their popularity is driven by theoretical motivations [e.g., the growth of embodied or affective neuroscience; @Kiverstein2015] as well as practical reasons.
-The latter include low costs (especially compared with other imaging techniques, such as MRI or MEG), ease of use (e.g., portability, setup speed), and the increasing availability of recording devices [e.g., wearables; @yuehong2016internet].
-Moreover, the extraction of meaningful information from neurophysiological signals is facilitated by current advances in signal processing algorithms [@clifton2012machine; @roy2019deep].
-Unfortunately, these algorithms are mostly inaccessible to researchers without experience in programming and signal processing.
-Moreover, many software tools for neurophysiological analyses are limited to one type of signal (for instance, focused on ECG).
-This makes it inconvenient for researchers who might have to learn and concurrently rely on different software to process multimodal data.
-
-<!-- Research gap 2 -->
-Another important issue existing in psychology and neuroscience has been coined as the "reproducibility crisis" [@topalidou2015long; @open2015estimating; @milkowski2018replicability; @maizey2019barriers], and has lead to a profound questioning and reassessment from different actors involved (researchers, publishers, fund agencies, ...).
-One of the main identified contributing factor is the actual opacity of data processing, where analysis pipelines are not described in enough details to ensure a full and exact reproduction.
-One of the suggested response to that issue has been to provide, alongside the study, the analysis script, which in turns opens new challenges.
-Indeed, these scripts must be shareable (not always feasible with closed-source and proprietary software or programming languages), accessible (enticing documented and well-organized scripts) and reproducible (which is inherently difficult for many software relying on a graphical user interface - GUI - in which the manual point-and-click sequence is hard to automate).
-
-<!-- Response to gap -->
-*NeuroKit2* addresses these challenges by offering a free, user-friendly, and comprehensive solution for neurophysiological data processing.
-It is an open-source Python package, developed by a multi-disciplinary team that actively invites new collaborators.
-It aims at being accessible, well-documented, well-tested, cutting-edge, flexible and efficient, allowing users to select from a wide range of validated analysis pipelines as well as creating their own.
-Historically, *NeuroKit2* is the re-forged successor *NeuroKit1* [@neurokit1], taking on its most successful features and design choices, and re-implementing them in a professional and well-thought way.
-
-<!-- Accessibility and documentation -->
-The package is implemented in Python 3 [@python3], which means that *NeuroKit2's* users benefit from an large amount of learning resources and a vibrant community. The package depends on relatively few, well established and robust packages from the Python data analysis ecosystem [@scipy] such as *NumPy*, *pandas*, *SciPy*, *scikit-learn* and *MatplotLib* (with an additional system of optional dependencies), making *NeuroKit2* itself a viable dependency in other software.
-
-*NeuroKit2's* source code is available under the permissive MIT license on GitHub (*https://github.com/neuropsychology/NeuroKit*). Its documentation (*https://neurokit2.readthedocs.io/*) is automatically built and rendered from the code and includes guides for installation and contribution, a description of the package's functions, as well as several "hands-on" examples and tutorials (e.g., how to extract and visualize individual heartbeats, how to analyze event-related data etc.). Importantly, users can add new examples by simply uploading a Python notebook [@kluyver2016jupyter] to the GitHub repository. The notebook will automatically be displayed on the website, ensuring easily accessible and evolving documentation. Moreover, users can try out the example notebooks directly in their browser via a cloud-based *Binder* environment [@Jupyter2018]. Finally, the issue tracker on GitHub offers a convenient and public forum that allows newcomers and potential collaborators to report bugs, get help and gain insight into the development of the package.
-
-
-<!-- Reliability and Evolution -->
-*NeuroKit2* aims at being reliable and trustworthy, including peer-reviewed processing pipelines and functions tested against established software such as *BioSPPy* [@biosppy], *hrv* [*under review*](https://github.com/openjournals/joss-reviews/issues/1867), *PySiology* [@PySiology], *HeartPy* [@HeartPy], *systole* [@Systole] or *nolds* [@nolds]. The repository leverages a comprehensive test suite and continuous integration to ensure stability and prevent errors. Thanks to its collaborative and open development, *NeuroKit2* can remain cutting-edge and continuously evolve, adapt, and integrate new methods as they are emerging.
-
-
-<!-- Powerful and flexible: API -->
-Finally, we believe that the design philosophy of *NeuroKit2* contributes to an efficient (i.e., allowing to achieve a lot with few functions)  yet flexible (i.e., enabling fine control and precision over what is done) user interface (API). We will illustrate these claims with two examples of common use-cases (the analysis of event-related and resting state data), and will conclude by discussing how *NeuroKit2* contributes to neurophysiological research by raising the standards for validity, reproducibility and accessibility.
-
-
-# Design Philosophy
-
-As stated above, *NeuroKit2* aims at being accessible to beginners and, at the same time, offering a maximal level of control to experienced users. This is achieved by allowing beginning users to implement complex processing and analyses pipelines with very few functions, while still enabling fine-tuned control and precision over arguments and parameters to more experienced users. In concrete terms, this trade-off is allowed by a API structure organized in three three layers of abstraction.
-
-
-## Low-level: Base Utilities for Signal Processing
-
-The basic building blocks are functions for general signal processing, i.e., filtering, resampling, interpolation, peak detection, etc. These functions are signal-agnostic, and include a lot of parameters (e.g., one can change the filtering method, frequencies, and order, by overwriting the default arguments). Most of these functions are based on established algorithms implemented in *scipy* [@scipy]. Examples of such functions include `signal_filter()`, `signal_interpolate()`, `signal_resample()`, `signal_detrend()`, and `signal_findpeaks()`.
-
-
-## Mid-level: Neurophysiological Processing Steps
-
-The base utilities are used by mid-level functions specific to the different physiological modalities (i.e., ECG, RSP, EDA, EMG, PPG). These functions carry out modality-specific signal processing steps, such as cleaning, peak detection, phase classification or rate computation. Critically, for each type of signal, the same function names are called (in the form `signaltype_functiongoal()`) to achieve equivalent goals, e.g., `*_clean()`, `*_findpeaks()`, `*_process()`, `*_plot()`, making the implementation intuitive and consistent across different modalities.
-
-For example, the `rsp_clean()` function uses `signal_filter()` and `signal_detrend()`, with different sets of default parameters that can be switched with a "method" argument (corresponding to different published or established pipelines). For instance, setting `method="khodadad2018"` will use the cleaning workflow described in @khodadad2018optimized. However, if a user wants to build their own custom cleaning pipeline, they can use the cleaning function as a template, and tweak the parameters to their desires in the low-level signal processing operations.
-
-
-## High-level Wrappers for Processing and Analysis
-
-The mid-level functions are assembled in high-level "master" functions, that are convenient entry points for new users. For instance, the `ecg_process()` function internally chains the mid-level functions `ecg_clean()`, `ecg_findpeaks()`, `ecg_rate()`. A specific processing pipeline can be selected with the `method` argument, that is then propagated throughout the internal functions. Easily switching between processing pipelines allows for the comparison of different methods, and streamlines critical but time-consuming steps in reproducible research, such as the validation of data preparation and quality control [@Quintana2016]. Finally, the package includes convenience meta-functions (e.g., `bio_process`) that enable the combined processing of multiple types of signals at once (e.g., `bio_process(ecg=ecg_signal, eda=eda_signal)`).
-
-Performing an entire set of operations with sensible default parameters in one function can be rewarding, especially for beginners, allowing them to perform cutting-edge processing or replication of research steps without requiring much programming expertise. Moreover, it contributes to the demystification of the usage of "pure" programming tools (as opposed to GUI-based software such as *SPSS*, *Kubios*, or *Acqknowledge*), providing a welcoming framework to further explore the complexities of physiological data processing. Importantly, more advanced users can easily build custom analysis pipelines by using the mid-level functions, allowing for a finer control over the processing parameters. We believe that this implementation is a well-calibrated trade-off between flexibility and user-friendliness.
-
-
-
-# Examples
-
-In this section, we present two examples that illustrate the most common use-cases. The first example is an event-related paradigm, in which the interest lies in short-term physiological changes related to specific events. The second example shows how to extract the characteristics of physiological activity during a longer period of time (not necessarily tied to a specific and sudden event). The example datasets are made available with the package and can be downloaded using the `data()` function.
-
-
-## Event-related Paradigm
-
-This example dataset contains ECG, RSP and EDA signals of one participant who was presented with four emotional images [from the NAPS database; @marchewka2014nencki], in a typical (albeit highly shortened) experimental psychology paradigm.
-
-Signals are 2.5 minutes long and are recorded at a frequency of 100Hz [note that the sampling rate is low for storage purposes and should be higher in actual recordings, see @Quintana2016]. It has 4 channels including three physiological signals, and one corresponding to the marking of events with a photosensor (which signal decreases when a stimulus appeared on the screen).
-
-
-
-```{python eventrelated_data, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_eventrelated_100hz")
-
-# Figure 1. Visualize 10 seconds of data (on the same scale)
-nk.signal_plot(data[900:1900], standardize=True)
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          eda=data["EDA"],
-                          sampling_rate=100)
-
-# Find events
-conditions = ["Negative", "Neutral", "Neutral", "Negative"]
-events = nk.events_find(event_channel=data["Photosensor"],
-                        threshold_keep='below',
-                        event_conditions=conditions)
-
-# Epoch the data
-epochs = nk.epochs_create(data=df,
-                          events=events,
-                          sampling_rate=100,
-                          epochs_start=-0.1,
-                          epochs_end=4)
-
-# Extract event related features
-results = nk.bio_analyze(epochs)
-
-# Show subset of results
-results[["Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude"]]
-```
-
-```{r include=TRUE, eval=TRUE, echo = FALSE, fig.width=10, fig.height=6, fig.cap="Subset of the dataset showing one event (in orange) and the other physiological signals."}
-py$data %>%
-  standardize() %>%
-  mutate(Time = 1:n() / 100) %>%
-  slice(900:1900) %>%
-  pivot_longer(1:4) %>%
-  mutate(name = fct_relevel(name, c("ECG", "RSP", "EDA", "Photosensor"))) %>%
-  ggplot(aes(x=Time, y=value, color=name, size=name)) +
-  geom_line() +
-  theme_modern() +
-  scale_color_manual(values=c("ECG"="red", "EDA"="#9C27B0", "RSP"="#2196F3", "Photosensor"="#FF9800")) +
-  scale_size_manual(values=c("ECG"=0.66, "EDA"=2, "RSP"=2, "Photosensor"=2)) +
-  theme(axis.title.y = element_blank(),
-        axis.text.y = element_blank(),
-        legend.title = element_blank(),
-        legend.position = "top") +
-  ylab("Time (s)") +
-  guides(size = guide_legend(override.aes = list(size = 2)))
-```
-```{r table1word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="markdown", digits = 3, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", row.names = FALSE)
-```
-```{r table1pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-In this example, after loading the package and the example dataset, each physiological signal is processed using `bio_process()`. Stimulus onsets in the photosensor are detected separately with `events_find()`. Once we have the preprocessed signals and the location of events, we can slice the data into segments corresponding to a time window (ranging from -0.1 to 4 seconds) around each stimulus with `epochs_create()`. Finally, relevant features are computed for each epoch (i.e., each stimulus) by passing them to `bio_analyze()`.
-
-The features include for example the changes in rate of ECG and RSP signals (e.g. maximum, minimum and mean rate after stimulus onset, and the time at which they occur), and the peak characteristics of the EDA signal (e.g., occurrence of skin conductance response (SCR), and if SCR is present, its corresponding peak amplitude, time of peak, rise and recovery time). In addition, respiration and cardiac cycle phases are extracted (i.e., the respiration phase - inspiration/expiration - and cardiac phase - systole/diastole - occurring at the onset of event).
-
-This example shows the straightforward process of extracting features of physiological responses. This pipeline can easily scale up to group-level analysis by aggregating the average of features across participants. In addition to streamlining data analyses, *NeuroKit2* aims to provide researchers an extensive suite of signal features, allowing for precise interpretations in terms of relationship between physiological activity and neurocognitive processes. In this example (see **Table 1**), exposure to negative stimuli, as compared to neutral stimuli, is related to stronger cardiac deceleration, higher skin conductance response, and accelerated breathing rate (note that this descriptive interpretation is given solely for illustrative purposes).
-
-
-
-## Resting-state Features
-
-The second dataset corresponds to 5 minutes of physiological activity of a human participant at rest (eyes-closed in a seated position), under no specific set of instructions. It contains three channels (ECG, PPG and RSP) sampled at a frequency of 100Hz.
-
-```{python intervalrelated, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_resting_5min_100hz")
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          sampling_rate=100)
-
-# Extract features
-results = nk.bio_analyze(df)
-
-# Show subset of results
-results[["ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean"]]
-```
-
-```{r table2word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="markdown", digits = 3, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state", row.names = FALSE)
-```
-```{r table2pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("ECG_Rate_Mean", "ECG_HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-
-In this example, the steps of the analysis are identical to the previous example, including loading the package, the dataset and processing the data. The difference is that there is no epoching, as we want to compute features related to the whole dataset. Thus, we can directly pass the dataframe to `bio_analyze()`, which will detect that these are not epochs, and compute the appropriate features accordingly. These include for instance the average heart and breathing rate, as well as indices of heart rate variability (HRV) and respiratory sinus arrhythmia (RSA).
-
-
-This example illustrates a second type of physiological analysis, that we refer to as interval-related (as opposed to event-related). Interval-related analyses compute features of signal variability and activation patterns over a longer-term period of time (typically minutes). *NeuroKit2* allows for the fast creation of a standardized and reproducible pipeline to describe this kind of physiological activity, which can be beneficial for a wide variety of applications.
-
-
-# Discussion
-
-*NeuroKit2* is a neurophysiological signal processing software accessible to people with all levels of programming experience and background. Its development is focused on creating an intuitive user-experience, as well as building a collaborative community. It is also a pragmatic answer to the broader need for transparent and reproducible methods in neurophysiology. Its modular structure and organization not only facilitates the use of existing and validated processing pipelines, but also creates a fertile ground for experimentation and innovation.
-
-We expect the package's future evolution to be driven by the communities' needs and the advances in related fields. Possible directions include extending the support for other types of bodily signals (e.g., electrogastrography - EGG, electrooculography - EOG) and achieving performance gains for large datasets by using efficient algorithms. Further validation of the available processing pipelines could be made through the (re)analysis of public databases. In line with this objective, the support of standardized data structure formats (e.g. WFDB, BIDS, ...) could be extended.
-
-In conclusion, we believe that *NeuroKit2* provides useful tools for anyone who is interested in analyzing physiological data from research-grade hardware as well as wearable "smart health devices". By increasing the autonomy of researchers and practitioners, and by shortening the delay between data collection and results acquisition, *NeuroKit2* could be useful beyond academic research in neuroscience and psychology, including applications such as biofeedback, personal physiological monitoring and exercise science. Finally, we hope that *NeuroKit2* encourages users to become part of a supportive open-science community with diverse areas of expertise rather than relying on closed-source and proprietary software, thus shaping the future of neurophysiology and its related fields.
-
-# Conflict of Interest
-
-The authors declare that the research was conducted in the absence of commercial or financial relationships that could constitute a conflict of interest.
-
-# Acknowledgements
-
-We would like to thank Prof. C. F. Xavier for inspiration, all the contributors (https://neurokit2.readthedocs.io/en/latest/authors.html), and the users for their support. Francois Lespinasse would like to thank the Courtois Foundation for its support through the Courtois-NeuroMod project (https://cneuromod.ca)
-
-
-
-\newpage
-
-# References
-```{r create_r-references}
-r_refs(file = "bibliography.bib")
-```
-
-\begingroup
-\setlength{\parindent}{-0.5in}
-\setlength{\leftskip}{0.5in}
-
-<div id = "refs"></div>
-\endgroup
diff --git a/paper/manuscript_v2_files/figure-docx/unnamed-chunk-1-1.pdf b/paper/manuscript_v2_files/figure-docx/unnamed-chunk-1-1.pdf
deleted file mode 100644
index 7bbef646bc..0000000000
Binary files a/paper/manuscript_v2_files/figure-docx/unnamed-chunk-1-1.pdf and /dev/null differ
diff --git a/paper/manuscript_v2_files/figure-docx/unnamed-chunk-1-1.png b/paper/manuscript_v2_files/figure-docx/unnamed-chunk-1-1.png
deleted file mode 100644
index a544c293ad..0000000000
Binary files a/paper/manuscript_v2_files/figure-docx/unnamed-chunk-1-1.png and /dev/null differ
diff --git a/paper/manuscript_v2_files/figure-latex/unnamed-chunk-1-1.pdf b/paper/manuscript_v2_files/figure-latex/unnamed-chunk-1-1.pdf
deleted file mode 100644
index 4dd454f605..0000000000
Binary files a/paper/manuscript_v2_files/figure-latex/unnamed-chunk-1-1.pdf and /dev/null differ
diff --git a/paper/manuscript_v2_files/figure-latex/unnamed-chunk-1-1.png b/paper/manuscript_v2_files/figure-latex/unnamed-chunk-1-1.png
deleted file mode 100644
index a544c293ad..0000000000
Binary files a/paper/manuscript_v2_files/figure-latex/unnamed-chunk-1-1.png and /dev/null differ
diff --git a/paper/manuscript_v3.Rmd b/paper/manuscript_v3.Rmd
deleted file mode 100644
index d89e5c6bff..0000000000
--- a/paper/manuscript_v3.Rmd
+++ /dev/null
@@ -1,340 +0,0 @@
----
-title: '**NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing**'
-shorttitle        : "NeuroKit2"
-author:
-  - name          : "Dominique Makowski"
-    affiliation   : " 1,*"
-    corresponding : no    # Define only one corresponding author
-    address       : "HSS 04-18, 48 Nanyang Avenue, Singapore"
-    email         : "dmakowski@ntu.edu.sg"
-  - name          : "Tam Pham"
-    affiliation   : " 1"
-  - name          : "Zen J. Lau"
-    affiliation   : " 1"
-  - name          : "Jan C. Brammer"
-    affiliation   : " 2"
-  - name          : "François Lespinasse"
-    affiliation   : " 3, 4"
-  - name          : "Hung Pham"
-    affiliation   : " 5"
-  - name          : "Christopher Schölzel"
-    affiliation   : " 6"
-  - name          : "S.H. Annabel Chen"
-    affiliation   : " 1, 7, 8"
-affiliation:
-  - id            : "1"
-    institution   : "School of Social Sciences, Nanyang Technological University, Singapore"
-  - id            : "2"
-    institution   : "Behavioural Science Institute, Radboud University, Netherlands"
-  - id            : "3"
-    institution   : "Département de psychologie, Université de Montréal, Canada"
-  - id            : "4"
-    institution   : "Centre de Recherche de l'Institut Universitaire Geriatrique de Montréal"
-  - id            : "5"
-    institution   : "Eureka Robotics, Singapore"
-  - id            : "6"
-    institution   : "Life Science Informatics, THM University of Applied Sciences, Germany"
-  - id            : "7"
-    institution   : "Centre for Research and Development in Learning, Nanyang Technological University, Singapore"
-  - id            : "8"
-    institution   : "Lee Kong Chian School of Medicine, Nanyang Technological University, Singapore"
-authornote: |
-  \* Correspondence concerning this article should be addressed to Dominique Makowski (HSS 04-18, 48 Nanyang Avenue, Singapore; dmakowski@ntu.edu.sg).
-abstract: |
-  NeuroKit2 is an open-source, community-driven, and user-friendly Python package dedicated to neurophysiological signal processing with an initial focus on bodily signals (e.g., ECG, EDA, EMG, EOG, PPG etc.). Its design philosophy is centred on user-experience and accessibility to both novice and advanced users. The package provides a consistent set of high-level functions that enable data processing in a few lines of code using validated pipelines, which we illustrate in two examples covering the most typical scenarios, such as an event-related paradigm and an interval-related analysis. The package also includes tools dedicated to specific processing steps such as rate extraction and filtering methods, offering a trade-off between efficiency and fine-tuned control to the user. Rather than focusing on specific signals, NeuroKit2 was developed to provide a comprehensive means for a simultaneous processing of a wide range of signals. Its goal is to improve transparency and reproducibility in neurophysiological research, as well as foster exploration and innovation.
-keywords          : "Neurophysiology, Biosignals, Python, ECG, EDA, EMG"
-wordcount         : "2513"
-bibliography      : ["bibliography.bib"]
-floatsintext      : yes
-figsintext        : yes
-figurelist        : no
-tablelist         : no
-footnotelist      : no
-linenumbers       : yes
-mask              : no
-draft             : no
-documentclass     : "apa6"
-classoption       : "man"
-output:
-  papaja::apa6_pdf:
-    keep_tex: FALSE
-    latex_engine: xelatex
-  papaja::apa6_word:
-    keep_tex: FALSE
-header-includes:
-   - \usepackage[labelfont=bf, font={color=gray,small}]{caption}
-   - \usepackage{float}
-   - \usepackage[document]{ragged2e}
-editor_options:
-  chunk_output_type: console
----
-
-\justify
-
-```{r r_setup, include = FALSE, warning=FALSE, message=FALSE}
-library("papaja")
-library("kableExtra")
-options(knitr.kable.NA = 'None')
-
-library(tidyverse)
-library(easystats)
-
-# Setup python - you need to change the path to your python distribution
-library(reticulate)
-reticulate::use_python("D:/Downloads/WPy64-3810/python-3.8.1.amd64/")
-matplotlib <- import("matplotlib")
-matplotlib$use("Agg", force = TRUE)
-```
-
-
-
-<!-- Research gap 1 -->
-Neurophysiological measurements increasingly gain popularity in the study of cognition and behavior.
-These measurements include electroencephalography (EEG), electrocardiography (ECG), electromyography (EMG) and electrodermal activity (EDA).
-Their popularity is driven by theoretical motivations [e.g., the growth of embodied or affective neuroscience; @Kiverstein2015] as well as practical reasons.
-The latter include low costs (especially compared with other imaging techniques, such as MRI or MEG), ease of use (e.g., portability, setup speed), and the increasing availability of recording devices [e.g., wearables; @yuehong2016internet].
-Moreover, the extraction of meaningful information from neurophysiological signals is facilitated by current advances in signal processing algorithms [@clifton2012machine; @roy2019deep].
-Unfortunately, these algorithms are mostly inaccessible to researchers without experience in programming and signal processing.
-Moreover, many software tools for neurophysiological analyses are limited to one type of signal (for instance, focused on ECG).
-This makes it inconvenient for researchers who might have to learn and concurrently rely on different software to process multimodal data.
-
-<!-- Research gap 2 -->
-Another important issue existing in psychology and neuroscience has been coined as the "reproducibility crisis" [@topalidou2015long; @open2015estimating; @milkowski2018replicability; @maizey2019barriers], and has lead to a profound questioning and reassessment from different actors involved (researchers, publishers, fund agencies, ...).
-One of the main identified contributing factor is the actual opacity of data processing, where analysis pipelines are not described in enough details to ensure a full and exact reproduction.
-One of the suggested response to that issue has been to provide, alongside the study, the analysis script, which in turns opens new challenges.
-Indeed, these scripts must be shareable (not always feasible with closed-source and proprietary software or programming languages), accessible (enticing documented and well-organized scripts) and reproducible (which is inherently difficult for many software relying on a graphical user interface - GUI - in which the manual point-and-click sequence is hard to automate).
-
-<!-- Response to gap -->
-*NeuroKit2* addresses these challenges by offering a free, user-friendly, and comprehensive solution for neurophysiological data processing, with an initial focus on bodily signals (including ECG, PPG, RSP, EDA, EMG, EOG) and generic functions that could also support other signal processing such as EEG (for which more specific support is in development).
-It is an open-source Python package, developed by a multi-disciplinary team that actively invites new collaborators.
-It aims at being accessible, well-documented, well-tested, cutting-edge, flexible and efficient, allowing users to select from a wide range of validated analysis pipelines as well as creating their own.
-Historically, *NeuroKit2* is the re-forged successor *NeuroKit1* [@neurokit1], taking on its most successful features and design choices, and re-implementing them in a professional and well-thought way.
-
-<!-- Accessibility and documentation -->
-The package is implemented in Python 3 [@python3], which means that *NeuroKit2's* users benefit from an large amount of learning resources and a vibrant community. The package depends on relatively few, well established and robust packages from the Python data analysis ecosystem [@scipy] such as *NumPy*, *pandas*, *SciPy*, *scikit-learn* and *MatplotLib* (with an additional system of optional dependencies), making *NeuroKit2* itself a viable dependency in other software.
-
-*NeuroKit2's* source code is available under the permissive MIT license on GitHub (*https://github.com/neuropsychology/NeuroKit*). Its documentation (*https://neurokit2.readthedocs.io/*) is automatically built and rendered from the code and includes guides for installation and contribution, a description of the package's functions, as well as several "hands-on" examples and tutorials (e.g., how to extract and visualize individual heartbeats, how to analyze event-related data etc.). Importantly, users can add new examples by simply uploading a Python notebook [@kluyver2016jupyter] to the GitHub repository. The notebook will automatically be displayed on the website, ensuring easily accessible and evolving documentation. Moreover, users can try out the example notebooks directly in their browser via a cloud-based *Binder* environment [@Jupyter2018]. Finally, the issue tracker on GitHub offers a convenient and public forum that allows newcomers and potential collaborators to report bugs, get help and gain insight into the development of the package.
-
-
-<!-- Reliability and Evolution -->
-*NeuroKit2* aims at being reliable and trustworthy, including peer-reviewed processing pipelines and functions tested against established software such as *BioSPPy* [@biosppy], *hrv* [*under review*](https://github.com/openjournals/joss-reviews/issues/1867), *PySiology* [@PySiology], *HeartPy* [@HeartPy], *systole* [@Systole] or *nolds* [@nolds]. The repository leverages a comprehensive test suite and continuous integration to ensure stability and prevent errors. Thanks to its collaborative and open development, *NeuroKit2* can remain cutting-edge and continuously evolve, adapt, and integrate new methods as they are emerging.
-
-
-<!-- Powerful and flexible: API -->
-Finally, we believe that the design philosophy of *NeuroKit2* contributes to an efficient (i.e., allowing to achieve a lot with few functions)  yet flexible (i.e., enabling fine control and precision over what is done) user interface (API). We will illustrate these claims with two examples of common use-cases (the analysis of event-related and resting state data), and will conclude by discussing how *NeuroKit2* contributes to neurophysiological research by raising the standards for validity, reproducibility and accessibility.
-
-
-# Design Philosophy
-
-As stated above, *NeuroKit2* aims at being accessible to beginners and, at the same time, offering a maximal level of control to experienced users. This is achieved by allowing beginning users to implement complex processing and analyses pipelines with very few functions, while still enabling fine-tuned control and precision over arguments and parameters to more experienced users. In concrete terms, this trade-off is allowed by a API structure organized in three three layers of abstraction.
-
-
-## Low-level: Base Utilities for Signal Processing
-
-The basic building blocks are functions for general signal processing, i.e., filtering, resampling, interpolation, peak detection, etc. These functions are signal-agnostic, and include a lot of parameters (e.g., one can change the filtering method, frequencies, and order, by overwriting the default arguments). Most of these functions are based on established algorithms implemented in *scipy* [@scipy]. Examples of such functions include `signal_filter()`, `signal_interpolate()`, `signal_resample()`, `signal_detrend()`, and `signal_findpeaks()`.
-
-
-## Mid-level: Neurophysiological Processing Steps
-
-The base utilities are used by mid-level functions specific to the different physiological modalities (i.e., ECG, RSP, EDA, EMG, PPG). These functions carry out modality-specific signal processing steps, such as cleaning, peak detection, phase classification or rate computation. Critically, for each type of signal, the same function names are called (in the form `signaltype_functiongoal()`) to achieve equivalent goals, e.g., `*_clean()`, `*_findpeaks()`, `*_process()`, `*_plot()`, making the implementation intuitive and consistent across different modalities.
-
-For example, the `rsp_clean()` function uses `signal_filter()` and `signal_detrend()`, with different sets of default parameters that can be switched with a "method" argument (corresponding to different published or established pipelines). For instance, setting `method="khodadad2018"` will use the cleaning workflow described in @khodadad2018optimized. However, if a user wants to build their own custom cleaning pipeline, they can use the cleaning function as a template, and tweak the parameters to their desires in the low-level signal processing operations.
-
-
-## High-level Wrappers for Processing and Analysis
-
-The mid-level functions are assembled in high-level "master" functions, that are convenient entry points for new users. For instance, the `ecg_process()` function internally chains the mid-level functions `ecg_clean()`, `ecg_findpeaks()`, `ecg_rate()`. A specific processing pipeline can be selected with the `method` argument, that is then propagated throughout the internal functions. Easily switching between processing pipelines allows for the comparison of different methods, and streamlines critical but time-consuming steps in reproducible research, such as the validation of data preparation and quality control [@Quintana2016]. Finally, the package includes convenience meta-functions (e.g., `bio_process`) that enable the combined processing of multiple types of signals at once (e.g., `bio_process(ecg=ecg_signal, eda=eda_signal)`).
-
-Performing an entire set of operations with sensible default parameters in one function can be rewarding, especially for beginners, allowing them to perform cutting-edge processing or replication of research steps without requiring much programming expertise. Moreover, it contributes to the demystification of the usage of "pure" programming tools (as opposed to GUI-based software such as *SPSS*, *Kubios*, or *Acqknowledge*), providing a welcoming framework to further explore the complexities of physiological data processing. Importantly, more advanced users can easily build custom analysis pipelines by using the mid-level functions, allowing for a finer control over the processing parameters. We believe that this implementation is a well-calibrated trade-off between flexibility and user-friendliness.
-
-
-
-# Examples
-
-In this section, we present two examples that illustrate the most common use-cases. The first example is an event-related paradigm, in which the interest lies in short-term physiological changes related to specific events (see **Figure 1** and **Table 1**). The second example shows how to extract the characteristics of physiological activity during a longer period of time (not necessarily tied to a specific and sudden event). The example datasets are made available with the package and can be downloaded using the `data()` function.
-
-
-```{r include=TRUE, eval=TRUE, echo = FALSE, out.width="100%", fig.cap="Illustration of the difference between event-related analysis, focusing on activity changes in short windows (the orange rectangles), and interval-related analysis, pertaining to features of large areas, or the whole signal (e.g., the green rectangle)."}
-knitr::include_graphics("figures/features.png")
-```
-
-```{r table3pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# knitr::include_graphics("figures/features.png")
-table <- data.frame("A" = c("ECG Rate Changes (Min, Mean, Max, Time of Min,  Max, Trend)",
-                            "RSP Rate Changes (Min, Mean, Max, Time of Min, Max)",
-                            "RSP Amplitude Measures (Min, Mean, Max)",
-                            "ECG and RSP Phase (Inspiration/Expiration, Systole/Diastole, Completion)",
-                            "SCR peak and its characteristics (amplitude, rise time, recovery time)"),
-                    
-                    "B" = c("ECG Rate Characteristics (Mean, Amplitude)",
-                            "Heart Rate Variability (HRV) indices",
-                            "Respiratory Rate Variability (RRV) indices",
-                            "Respiratory Sinus Arrhythmia (RSA) indices",
-                            "Number of SCR Peaks and mean amplitude"))
-
-colnames(table) <- c("Event-related Features", "Interval-related Features")
-
-# For PDFs
-knitr::kable(table, format="latex", digits = 2, booktabs = TRUE, caption = "Examples of features computed in different domains.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"), font_size=9) %>% 
-  kableExtra::column_spec(1:2, width = "8cm")
-```
-
-
-
-## Event-related Paradigm
-
-This example dataset contains ECG, RSP and EDA signals of one participant who was presented with four emotional images [from the NAPS database; @marchewka2014nencki], in a typical (albeit highly shortened) experimental psychology paradigm.
-
-Signals are 2.5 minutes long and are recorded at a frequency of 100Hz [note that the sampling rate is low for storage purposes and should be higher in actual recordings, see @Quintana2016]. It has 4 channels including three physiological signals, and one corresponding to the marking of events with a photosensor (which signal decreases when a stimulus appeared on the screen).
-
-
-
-```{python eventrelated_data, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_eventrelated_100hz")
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          eda=data["EDA"],
-                          sampling_rate=100)
-
-# Find events
-conditions = ["Negative", "Neutral", "Neutral", "Negative"]
-events = nk.events_find(event_channel=data["Photosensor"],
-                        threshold_keep='below',
-                        event_conditions=conditions)
-
-# Epoch the data
-epochs = nk.epochs_create(data=df,
-                          events=events,
-                          sampling_rate=100,
-                          epochs_start=-0.1,
-                          epochs_end=4)
-
-# Extract event related features
-results = nk.bio_analyze(epochs)
-
-# Show subset of results
-results[["Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude"]]
-```
-
-```{r include=TRUE, eval=FALSE, echo = FALSE, fig.width=10, fig.height=6, fig.cap="Subset of the dataset showing one event (in orange) and the other physiological signals."}
-py$data %>%
-  standardize() %>%
-  mutate(Time = 1:n() / 100) %>%
-  slice(900:1900) %>%
-  pivot_longer(1:4) %>%
-  mutate(name = fct_relevel(name, c("ECG", "RSP", "EDA", "Photosensor"))) %>%
-  ggplot(aes(x=Time, y=value, color=name, size=name)) +
-  geom_line() +
-  theme_modern() +
-  scale_color_manual(values=c("ECG"="red", "EDA"="#9C27B0", "RSP"="#2196F3", "Photosensor"="#FF9800")) +
-  scale_size_manual(values=c("ECG"=0.66, "EDA"=2, "RSP"=2, "Photosensor"=2)) +
-  theme(axis.title.y = element_blank(),
-        axis.text.y = element_blank(),
-        legend.title = element_blank(),
-        legend.position = "top") +
-  ylab("Time (s)") +
-  guides(size = guide_legend(override.aes = list(size = 2)))
-```
-```{r table1word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="markdown", digits = 3, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", row.names = FALSE)
-```
-```{r table1pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-
-
-In this example, after loading the package and the example dataset, each physiological signal is processed using `bio_process()`. Stimulus onsets in the photosensor are detected separately with `events_find()`. Once we have the preprocessed signals and the location of events, we can slice the data into segments corresponding to a time window (ranging from -0.1 to 4 seconds) around each stimulus with `epochs_create()`. Finally, relevant features are computed for each epoch (i.e., each stimulus) by passing them to `bio_analyze()`.
-
-The features include for example the changes in rate of ECG and RSP signals (e.g. maximum, minimum and mean rate after stimulus onset, and the time at which they occur), and the peak characteristics of the EDA signal (e.g., occurrence of skin conductance response (SCR), and if SCR is present, its corresponding peak amplitude, time of peak, rise and recovery time). In addition, respiration and cardiac cycle phases are extracted (i.e., the respiration phase - inspiration/expiration - and cardiac phase - systole/diastole - occurring at the onset of event).
-
-This example shows the straightforward process of extracting features of physiological responses. This pipeline can easily scale up to group-level analysis by aggregating the average of features across participants. In addition to streamlining data analyses, *NeuroKit2* aims to provide researchers an extensive suite of signal features, allowing for precise interpretations in terms of relationship between physiological activity and neurocognitive processes. In this example (see **Table 2**), exposure to negative stimuli, as compared to neutral stimuli, is related to stronger cardiac deceleration, higher skin conductance response, and accelerated breathing rate (note that this descriptive interpretation is given solely for illustrative purposes).
-
-
-
-## Resting-state Features
-
-The second dataset corresponds to 5 minutes of physiological activity of a human participant at rest (eyes-closed in a seated position), under no specific set of instructions. It contains three channels (ECG, PPG and RSP) sampled at a frequency of 100Hz.
-
-```{python intervalrelated, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_resting_5min_100hz")
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          sampling_rate=100)
-
-# Extract features
-results = nk.bio_analyze(df)
-
-# Show subset of results
-results[["ECG_Rate_Mean", "HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean"]]
-```
-
-```{r table2word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("ECG_Rate_Mean", "HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="markdown", digits = 3, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state", row.names = FALSE)
-```
-```{r table2pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("ECG_Rate_Mean", "HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-
-In this example, the steps of the analysis are identical to the previous example, including loading the package, the dataset and processing the data. The difference is that there is no epoching, as we want to compute features related to the whole dataset (see **Table 3**). Thus, we can directly pass the dataframe to `bio_analyze()`, which will detect that these are not epochs, and compute the appropriate features accordingly. These include for instance the average heart and breathing rate, as well as indices of heart rate variability (HRV) and respiratory sinus arrhythmia (RSA).
-
-
-This example illustrates a second type of physiological analysis, that we refer to as interval-related (as opposed to event-related). Interval-related analyses compute features of signal variability and activation patterns over a longer-term period of time (typically minutes). *NeuroKit2* allows for the fast creation of a standardized and reproducible pipeline to describe this kind of physiological activity, which can be beneficial for a wide variety of applications.
-
-
-
-# Discussion
-
-
-
-*NeuroKit2* is a neurophysiological signal processing software accessible to people with all levels of programming experience and background. Its development is focused on creating an intuitive user-experience, as well as building a collaborative community. It is also a pragmatic answer to the broader need for transparent and reproducible methods in neurophysiology. Its modular structure and organization not only facilitates the use of existing and validated processing pipelines, but also creates a fertile ground for experimentation and innovation.
-
-We expect the package's future evolution to be driven by the communities' needs and the advances in related fields. For instance, although *NeuroKit2* already implements a lot of useful functions for EEG processing (such as entropy and fractal dimensions quantification), its support could be further improved [for example with high-level functions built on top of utilities provided by the leading EEG Python software, namely *MNE*; @gramfort2013meg]. Possible other future directions include extending the support for other types of bodily signals (e.g., electrogastrography - EGG, electrooculography - EOG) and achieving performance gains for large datasets by using efficient algorithms. Further validation of the available processing pipelines could be made through the (re)analysis of public databases. In line with this objective, the support of standardized data structure formats (e.g. WFDB, BIDS, ...) could be extended.
-
-In conclusion, we believe that *NeuroKit2* provides useful tools for anyone who is interested in analyzing physiological data from research-grade hardware as well as wearable "smart health devices". By increasing the autonomy of researchers and practitioners, and by shortening the delay between data collection and results acquisition, *NeuroKit2* could be useful beyond academic research in neuroscience and psychology, including applications such as biofeedback, personal physiological monitoring and exercise science. Finally, we hope that *NeuroKit2* encourages users to become part of a supportive open-science community with diverse areas of expertise rather than relying on closed-source and proprietary software, thus shaping the future of neurophysiology and its related fields.
-
-# Conflict of Interest
-
-The authors declare that the research was conducted in the absence of commercial or financial relationships that could constitute a conflict of interest.
-
-# Acknowledgements
-
-We would like to thank Prof. C. F. Xavier for inspiration, all the contributors (https://neurokit2.readthedocs.io/en/latest/authors.html), and the users for their support. Additionally, François Lespinasse would like to thank the Courtois Foundation for its support through the Courtois-NeuroMod project (https://cneuromod.ca)
-
-
-
-\newpage
-
-# References
-```{r create_r-references}
-r_refs(file = "bibliography.bib")
-```
-
-\begingroup
-\setlength{\parindent}{-0.5in}
-\setlength{\leftskip}{0.5in}
-
-<div id = "refs"></div>
-\endgroup
diff --git a/paper/manuscript_v3_files/figure-latex/unnamed-chunk-1-1.pdf b/paper/manuscript_v3_files/figure-latex/unnamed-chunk-1-1.pdf
deleted file mode 100644
index 88990071a7..0000000000
Binary files a/paper/manuscript_v3_files/figure-latex/unnamed-chunk-1-1.pdf and /dev/null differ
diff --git a/paper/manuscript_v3_files/figure-latex/unnamed-chunk-1-1.png b/paper/manuscript_v3_files/figure-latex/unnamed-chunk-1-1.png
deleted file mode 100644
index a544c293ad..0000000000
Binary files a/paper/manuscript_v3_files/figure-latex/unnamed-chunk-1-1.png and /dev/null differ
diff --git a/paper/manuscript_v4.Rmd b/paper/manuscript_v4.Rmd
deleted file mode 100644
index f4420ee3ce..0000000000
--- a/paper/manuscript_v4.Rmd
+++ /dev/null
@@ -1,351 +0,0 @@
----
-title: '**NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing**'
-shorttitle        : "NeuroKit2"
-author:
-  - name          : "Dominique Makowski"
-    affiliation   : " 1,*"
-    corresponding : no    # Define only one corresponding author
-    address       : "HSS 04-18, 48 Nanyang Avenue, Singapore"
-    email         : "dmakowski@ntu.edu.sg"
-  - name          : "Tam Pham"
-    affiliation   : " 1"
-  - name          : "Zen J. Lau"
-    affiliation   : " 1"
-  - name          : "Jan C. Brammer"
-    affiliation   : " 2"
-  - name          : "François Lespinasse"
-    affiliation   : " 3, 4"
-  - name          : "Hung Pham"
-    affiliation   : " 5"
-  - name          : "Christopher Schölzel"
-    affiliation   : " 6"
-  - name          : "S.H. Annabel Chen"
-    affiliation   : " 1, 7, 8"
-affiliation:
-  - id            : "1"
-    institution   : "School of Social Sciences, Nanyang Technological University, Singapore"
-  - id            : "2"
-    institution   : "Behavioural Science Institute, Radboud University, Netherlands"
-  - id            : "3"
-    institution   : "Département de psychologie, Université de Montréal, Canada"
-  - id            : "4"
-    institution   : "Centre de Recherche de l'Institut Universitaire Geriatrique de Montréal"
-  - id            : "5"
-    institution   : "Eureka Robotics, Singapore"
-  - id            : "6"
-    institution   : "Life Science Informatics, THM University of Applied Sciences, Germany"
-  - id            : "7"
-    institution   : "Centre for Research and Development in Learning, Nanyang Technological University, Singapore"
-  - id            : "8"
-    institution   : "Lee Kong Chian School of Medicine, Nanyang Technological University, Singapore"
-authornote: |
-abstract: |
-  NeuroKit2 is an open-source, community-driven, and user-centered Python package for neurophysiological signal processing. It provides a comprehensive suite of processing routines for a variety of bodily signals (e.g., ECG, PPG, EDA, EMG, RSP). These processing routines include high-level functions that enable data processing in a few lines of code using validated pipelines, which we illustrate in two examples covering the most typical scenarios, such as an event-related paradigm and an interval-related analysis. The package also includes tools for specific processing steps such as rate extraction and filtering methods, offering a trade-off between high-level convenience and fine-tuned control. Its goal is to improve transparency and reproducibility in neurophysiological research, as well as foster exploration and innovation. Its design philosophy is centred on user-experience and accessibility to both novice and advanced users.
-keywords          : "Neurophysiology, Biosignals, Python, ECG, EDA, EMG"
-wordcount         : "3477"
-bibliography      : ["bibliography.bib"]
-floatsintext      : yes
-figsintext        : yes
-figurelist        : no
-tablelist         : no
-footnotelist      : no
-linenumbers       : yes
-mask              : no
-draft             : no
-documentclass     : "apa6"
-classoption       : "man"
-output:
-  papaja::apa6_pdf:
-    keep_tex: TRUE
-    latex_engine: xelatex
-  papaja::apa6_word:
-    keep_tex: FALSE
-header-includes:
-   - \usepackage[labelfont=bf, font={color=gray,small}]{caption}
-   - \usepackage{float}
-   - \usepackage[document]{ragged2e}
-editor_options:
-  chunk_output_type: console
----
-
-\justify
-
-```{r r_setup, include = FALSE, warning=FALSE, message=FALSE}
-library("papaja")
-library("kableExtra")
-options(knitr.kable.NA = 'None')
-
-library(tidyverse)
-library(easystats)
-
-# Setup python - you need to change the path to your python distribution
-library(reticulate)
-# reticulate::use_python("C:/Users/Pham Thanh Tam/Desktop/WPy-3710b/python-3.7.1.amd64/")
-# reticulate::use_python("D:/Downloads/WPy64-3902/python-3.9.0.amd64/")
-reticulate::use_python("C:/Users/Dom/Desktop/WPy64-3860/python-3.8.6.amd64/")
-matplotlib <- import("matplotlib")
-matplotlib$use("Agg", force = TRUE)
-```
-
-
-
-<!-- Research gap 1 -->
-Neurophysiological measurements increasingly gain popularity in the study of cognition and behavior.
-These measurements include electroencephalography (EEG), electrocardiography (ECG), electromyography (EMG) and electrodermal activity (EDA).
-Their popularity is driven by theoretical motivations [e.g., the growth of embodied or affective neuroscience; @Kiverstein2015] as well as practical reasons.
-The latter include low costs (especially compared with other imaging techniques, such as MRI or MEG), ease of use (e.g., portability, setup speed), and the increasing availability of recording devices [e.g., wearables; @yuehong2016internet].
-Moreover, the extraction of meaningful information from neurophysiological signals is facilitated by current advances in signal processing algorithms [@clifton2012machine; @roy2019deep].
-Unfortunately, these algorithms are often not distributed in a usable way (i.e., in the form of packaged code) which makes them inaccessible to researchers who do not have the time or experience to implement them. Moreover, many software tools for neurophysiological analyses are limited to a single type of signal (for instance ECG).
-This makes it inconvenient for researchers who might have to concurrently rely on a number of software packages to process and analyze multimodal data.
-
-
-<!-- Research gap 2 -->
-Additionally, psychology and neuroscience face a "reproducibility crisis" [@topalidou2015long; @open2015estimating; @milkowski2018replicability; @maizey2019barriers] which has lead to a profound reassessment of research practices (by researchers, publishers, funding agencies, etc.).
-The opacity of data processing, such as ill-specified, or inaccessible analysis pipelines, plays a major role in the crisis.
-This issue could in part be alleviated by making analyses code an integral part of scientific publications, rather than treating a paper as the sole and most important part of the research  project. However, distributing the analysis script alongside the paper poses new challenges:
-Scripts must be shareable (not always feasible with closed-source and proprietary software or programming languages), accessible (well-documented and organized scripts) and reproducible (which is difficult for software relying on graphical user interfaces - GUI - in which the manual point-and-click sequence can be hard to automate).
-
-<!-- Response to gap -->
-*NeuroKit2*, addresses these challenges by offering a free, user-centered, and comprehensive solution for neurophysiological data processing, with an initial focus on bodily signals including ECG (electrocardiography is used to measure cardiac activity), PPG (photoplethysmogram is an optical measurement of blood flow), RSP (respiration measures), EDA (electrodermal activity measuring the electrical conductance of the skin), EMG (electromyography measuring muscular activity) and EOG (electrooculography measuring eye movements). It also provides modality-independent functions that can be used for other modalities such as EEG (electroencephalography measuring electrical activity of the brain), for which more specific support is in development.
-
-The open-source Python package is developed by a multi-disciplinary team that actively invites new collaborators. The target audience of *NeuroKit2* includes both experienced and novice programmers. Although being a programming-based tool, users not familiar with Python or other languages can start using the software (and improve their programming skills along the way) by following our step-by-step examples. Moreover, we also include a thorough tutorial on Python installation, as well as a "10 minutes introduction to Python" in the documentation. While many of the existing software caters to a single signal modality (e.g., *KUBIOS*\copyright [@tarvainen2014kubios], *HeartPy* [@HeartPy] and *pyHRV* [@gomes2019pyhrv] for ECG, *cvxEDA* [@greco2015cvxeda], *Ledalab* [@benedek2010continuous], and *SCRalyze* [@bach2014head] for EDA), *NeuroKit2* provides support for various signals and allows its users to process signals from multiple physiological modalities with a uniform application programming interface (API). It aims at being accessible, well-documented, well-tested, cutting-edge, flexible and efficient. The library allows users to select from a wide range of validated analysis pipelines and to create custom pipelines tailored to specific analyses requirements.
-Historically, *NeuroKit2* is the re-forged successor of *NeuroKit1* [@neurokit1], taking over its most successful features and design choices, and re-implementing them in a way that adheres to current best practices in open source software development.
-
-
-<!--Intro to Functionality-->
-*NeuroKit2* offers a breadth of functionalities which includes, but is not limited to, signal simulation; data management (e.g., downloading existing datasets, reading and formatting files into a dataframe); event extraction from signals; epoch extraction, signal processing (e.g., filtering, resampling, rate computation using different published algorithms detailed in the package's documentation); spectral analyses; complexity and entropy analyses; and convenient statistical methods (e.g., K-means clustering, ICA or PCA). A variety of plotting functions allow for quick and expressive visualization of the signal processing and the resulting features.
-
-
-<!-- Accessibility and documentation -->
-The package is implemented in Python 3 [@python3], which means that *NeuroKit2's* users benefit from an large number of learning resources and a vibrant community. The package depends on relatively few, well established and robust packages from the numeric Python ecosystem such as *NumPy* [@harris2020array], *pandas* [@pandas], *SciPy* [@scipy], *scikit-learn* [@scikit-learn] and *MatplotLib* [@matplotlib] (with an additional system of optional dependencies), making *NeuroKit2* a viable dependency for other packages.
-
-*NeuroKit2's* source code is available under the MIT license on GitHub (*https://github.com/neuropsychology/NeuroKit*). Its documentation (*https://neurokit2.readthedocs.io/*) is automatically built and rendered from the code and includes guides for installation and contribution, a description of the package's functions, as well as several "hands-on" examples and tutorials (e.g., how to extract and visualize individual heartbeats, how to analyze event-related data etc.). Importantly, users can add new examples by simply submitting a Jupyter notebook [@kluyver2016jupyter] to the GitHub repository. The notebook will automatically be displayed on the website, ensuring easily accessible and evolving documentation. Moreover, users can try out the example notebooks directly in their browser via a cloud-based *Binder* environment [@Jupyter2018]. Finally, the issue tracker on GitHub offers a convenient and public forum that allows users to report bugs, get help and gain insight into the development of the package. Our active collaborators range from academics, professionals and practitioners in the life sciences and engineering fields (See the “authors” section on the package’s documentation). Based on community feedback that we received (social networks, GitHub issues), *NeuroKit2* has attracted users of different profiles, ranging from those who are new to signal processing and programming to more experienced users.
-
-<!-- Reliability and Evolution -->
-*NeuroKit2* aims at being reliable and trustworthy, including implementations of processing pipelines that have been described in peer-reviewed publications. Details and references regarding those pipelines are available in the package's documentation. Many pipelines have been tested against established software such as *BioSPPy* [@biosppy], *hrv* [@HRV], *PySiology* [@PySiology], *HeartPy* [@HeartPy], *systole* [@Systole] or *nolds* [@nolds]. Additionally, the repository leverages a comprehensive test suite (using *pytest*) and continuous integration (using Travis-CI and GitHub actions) to ensure software stability and quality. The test coverage and build status can transparently be tracked via the GitHub repository. Thanks to its collaborative and open development, *NeuroKit2* can remain cutting-edge and continuously evolve, adapt, and integrate new methods as they are emerging. 
-
-
-<!-- Powerful and flexible: API -->
-Finally, we believe that the design philosophy of *NeuroKit2* contributes to an efficient (i.e., allowing to achieve a lot with few functions) yet flexible (i.e., enabling fine control and precision over what is done) UI. We will illustrate these claims with two examples of common use-cases (the interval-related analysis on resting state data and the event-related analysis), and will conclude by discussing how *NeuroKit2* contributes to neurophysiological research by raising the standards for validity, reproducibility and accessibility.
-
-
-# Design Philosophy
-
-*NeuroKit2* aims at being accessible to beginners and, at the same time, offering a maximal level of control to experienced users. This is achieved by allowing beginning users to implement complex processing pipelines with a few functions, while still providing experienced users with fine-tuned control over arguments and parameters. In concrete terms, this trade-off is enabled by an API structure organized in three layers.
-
-
-## Low-level: Base Utilities for Signal Processing
-
-The basic building blocks are functions for general signal processing, i.e., filtering, resampling, interpolation, peak detection, etc. These functions are modality-independent, and include several parameters (e.g., one can change the filtering method, frequencies, and order, by overwriting the default arguments). Most of these functions are based on established algorithms implemented in *scipy* [@scipy]. Examples of such functions include `signal_filter()`, `signal_interpolate()`, `signal_resample()`, `signal_detrend()`, and `signal_findpeaks()`.
-
-
-## Mid-level: Neurophysiological Processing Steps
-
-The base utilities are used by mid-level functions specific to the different physiological modalities (i.e., ECG, RSP, EDA, EMG, PPG). These functions carry out modality-specific signal processing steps, such as cleaning, peak detection, phase classification or rate computation. Critically, for each type of signal, uniform function names are used (in the form `signaltype_functiongoal()`) to achieve equivalent goals, e.g., `*_clean()`, `*_findpeaks()`, `*_process()`, `*_plot()`, making the implementation intuitive and consistent across different modalities.
-
-For example, the `rsp_clean()` function uses `signal_filter()` and `signal_detrend()`, with different sets of default parameters that can be switched with a "method" argument (corresponding to different published or established pipelines). For instance, setting `method="khodadad2018"` will use the cleaning workflow described in @khodadad2018optimized. However, if a user wants to build their own custom cleaning pipeline, they can use the cleaning function as a template, and tweak the parameters to their desires in the low-level signal processing operations.
-
-
-## High-level Wrappers for Processing and Analysis
-
-```{r include=TRUE, eval=TRUE, echo = FALSE, out.width="100%", fig.cap="Illustration of the NeuroKit2 package architecture, in the case of ECG signal processing."}
-knitr::include_graphics("figures/nk_architecture.pdf")
-```
-
-The mid-level functions are assembled in high-level wrappers, that are convenient entry points for new users. For instance, the `ecg_process()` function internally chains the mid-level functions `ecg_clean()`, `ecg_peaks()`, `ecg_quality()`, `ecg_delineate()`, and `ecg_phase()`, as shown in **Figure 1**. A specific processing pipeline can be selected with the `method` argument that is then propagated throughout the internal functions. Easily switching between processing pipelines allows for the comparison of different methods, and streamlines critical but time-consuming steps in reproducible research, such as the validation of data preparation and quality control [@Quintana2016]. Finally, the package includes convenience-functions (e.g., `bio_process`) that enable the combined processing of multiple types of signals at once (e.g., `bio_process(ecg=ecg_signal, eda=eda_signal)`).
-
-Performing an entire set of operations with sensible default parameters in one function can be rewarding, especially for beginners, allowing them to perform cutting-edge processing or replication of research steps without requiring much programming expertise. Moreover, it contributes to the demystification of the usage of programming tools (as opposed to GUI-based software such as *SPSS*, *Kubios*, or *Acqknowledge*), providing a welcoming framework to further explore physiological data processing. Importantly, more advanced users can build custom analysis pipelines by using the low- and mid-level functions, allowing for finer control over the processing parameters. We believe that this implementation is a well-calibrated trade-off between flexibility and user-friendliness.
-
-
-# Installing NeuroKit2
-
-*NeuroKit2* is available on PyPI, a repository of software for the Python programming language. and can be installed using pip (via '*pip install neurokit2*' command). Detailed instructions on how to install Python are also available in the *installation* section of the package's documentation.
-
-
-# Examples
-
-In this section, we present two examples that illustrate the most common use-cases. Both examples can be accessed in an interactive format (without any prior installation) via a *[Binder environment](https://mybinder.org/v2/gh/neuropsychology/NeuroKit/master?urlpath=lab%2Ftree%2Fdocs%2Fexamples)*.The first example illustrates an interval-related paradigm where characteristics of physiological activity during a certain time interval (not necessarily tied to a specific and sudden event) are extracted. The second example presents an event-related paradigm, in which the interest lies in shorter-term physiological changes related to specific events (see **Figure 1** and **Table 1**). The example datasets are available with the package and can be downloaded using the `data()` function. This utility reads comma separated values files (*.csv*) with the Pandas function *pd.read_csv()*, where each column is a different biosignal. Each row is a sample that correspond to signals' value at a given point in time. All examples use the 0.0.41 version release of *NeuroKit2*.
-
-
-```{r include=TRUE, eval=TRUE, echo = FALSE, out.width="100%", fig.cap="Plot window displaying a period of raw electrocardiogram (ECG in red), respiration (RSP in blue) and electrodermal activity (EDA in purple) data. The green highlighted section, spanning from 0 to 20s, represents the periodic region of interest during interval-related analysis. The 3 event markers are indicated by dotted lines, and the orange highlighted sections spanning 0.1s before the onset of each event and ending 4s after the event, represent periodic regions of interest during event-related analysis. The link for generating the figure can be found on NeuroKit2’s GitHub repository (https://github.com/neuropsychology/NeuroKit/blob/master/paper/make_figures.Rmd)"}
-knitr::include_graphics("figures/features.png")
-```
-
-```{r table3pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# knitr::include_graphics("figures/features.png")
-table <- data.frame("A" = c("ECG Rate Characteristics (Mean, Amplitude)",
-                            "Heart Rate Variability (HRV) indices",
-                            "Respiratory Rate Variability (RRV) indices",
-                            "Respiratory Sinus Arrhythmia (RSA) indices",
-                            "Number of SCR Peaks and mean amplitude"),
-                    "B" = c("ECG Rate Changes (Min, Mean, Max, Time of Min,  Max, Trend)",
-                            "RSP Rate Changes (Min, Mean, Max, Time of Min, Max)",
-                            "RSP Amplitude Measures (Min, Mean, Max)",
-                            "ECG and RSP Phase (Inspiration/Expiration, Systole/Diastole, Completion)",
-                            "SCR peak and its characteristics (amplitude, rise time, recovery time)"))
-
-colnames(table) <- c("Interval-related Features", "Event-related Features")
-
-# For PDFs
-knitr::kable(table, format="latex", digits = 2, booktabs = TRUE, caption = "Examples of features computed in different domains.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"), font_size=9) %>%
-  kableExtra::column_spec(1:2, width = "8cm")
-```
-
-
-## Interval-related Paradigm
-
-The first dataset corresponds to 5 minutes of physiological activity of a human participant at rest (eyes-closed in a seated position), with no specific instructions. It contains three channels (ECG, PPG and RSP) sampled at a frequency of 100Hz.
-
-```{python intervalrelated, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_resting_5min_100hz")
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          sampling_rate=100)
-
-# Extract features
-results = nk.bio_analyze(df, sampling_rate=100)
-
-# Show subset of results
-results[["ECG_Rate_Mean", "HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean"]]
-```
-
-```{r table2word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("ECG_Rate_Mean", "HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="markdown", digits = 3, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state", row.names = FALSE)
-```
-```{r table2pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("ECG_Rate_Mean", "HRV_RMSSD", "RSP_Rate_Mean", "RSA_P2T_Mean")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-
-Here, the aim was to illustrate a type of physiological analysis that we refer to as interval-related (or resting-state paradigm, as opposed to an event-related paradigm). After loading the package and the example dataset, each physiological signal is processed using `bio_process()`.
-As we want to compute features related to the entire dataset (see **Table 2**), we can directly pass the whole dataframe to `bio_analyze()`, and compute the interval-related features. Users can choose a specific time interval from their dataset.
-
-Interval-related analyses compute features of signal variability and activation patterns over a given period of time, including average heart and breathing rate, as well as indices of heart rate variability (HRV) and respiratory sinus arrhythmia (RSA). *NeuroKit2* allows for the fast creation of standardized and reproducible pipelines to describe this kind of physiological activity.
-
-
-## Event-related Paradigm
-
-This example dataset contains ECG, RSP and EDA signals of one participant who was presented with four emotional images [from the NAPS database; @marchewka2014nencki] in a typical (albeit shortened) experimental psychology paradigm.
-
-The signals are 2.5 minutes (150 seconds) long and are recorded at a frequency of 100Hz [note that the sampling rate is lower than usually required, see @Quintana2016, in order to be able to include the example data in the *NeuroKit2* distribution]. It has 4 channels including three physiological signals, and one corresponding to events marked with a photosensor (signal strength decreases when a stimulus appears on the screen).
-
-
-
-```{python eventrelated_data, include=TRUE, results="hide", eval=TRUE, echo = TRUE}
-# Load the package
-import neurokit2 as nk
-
-# Download the example dataset
-data = nk.data("bio_eventrelated_100hz")
-
-# Process the data
-df, info = nk.bio_process(ecg=data["ECG"],
-                          rsp=data["RSP"],
-                          eda=data["EDA"],
-                          sampling_rate=100)
-
-# Find events
-conditions = ["Negative", "Neutral", "Neutral", "Negative"]
-events = nk.events_find(event_channel=data["Photosensor"],
-                        threshold_keep='below',
-                        event_conditions=conditions)
-
-# Epoch the data
-epochs = nk.epochs_create(data=df,
-                          events=events,
-                          sampling_rate=100,
-                          epochs_start=-0.1,
-                          epochs_end=4)
-
-# Extract event related features
-results = nk.bio_analyze(epochs, sampling_rate=100)
-
-# Show subset of results
-results[["Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude"]]
-```
-
-```{r include=TRUE, eval=FALSE, echo = FALSE, fig.width=10, fig.height=6, fig.cap="Subset of the dataset showing one event (in orange) and the other physiological signals."}
-py$data %>%
-  standardize() %>%
-  mutate(Time = 1:n() / 100) %>%
-  slice(900:1900) %>%
-  pivot_longer(1:4) %>%
-  mutate(name = fct_relevel(name, c("ECG", "RSP", "EDA", "Photosensor"))) %>%
-  ggplot(aes(x=Time, y=value, color=name, size=name)) +
-  geom_line() +
-  theme_modern() +
-  scale_color_manual(values=c("ECG"="red", "EDA"="#9C27B0", "RSP"="#2196F3", "Photosensor"="#FF9800")) +
-  scale_size_manual(values=c("ECG"=0.66, "EDA"=2, "RSP"=2, "Photosensor"=2)) +
-  theme(axis.title.y = element_blank(),
-        axis.text.y = element_blank(),
-        legend.title = element_blank(),
-        legend.position = "top") +
-  ylab("Time (s)") +
-  guides(size = guide_legend(override.aes = list(size = 2)))
-```
-```{r table1word, eval=FALSE, message=FALSE, warning=FALSE, echo=FALSE}
-# For word
-knitr::kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="markdown", digits = 3, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", row.names = FALSE)
-```
-```{r table1pdf, eval=TRUE, message=FALSE, warning=FALSE, echo=FALSE, out.width = "\\textwidth", fig.pos = "!ht", results = "asis"}
-# For PDFs
-kable(py$results[c("Condition", "ECG_Rate_Mean", "RSP_Rate_Mean", "EDA_Peak_Amplitude")], format="latex", digits = 2, booktabs = TRUE, caption = "Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.", linesep="") %>%
-  kableExtra::kable_styling(latex_options = c("hold_position"))
-```
-
-
-In this example, the steps of the analysis are identical to the previous example, including loading the package, the dataset and processing the data. The difference is that stimulus onsets in the photosensor are detected separately with `events_find()`. Once we have the preprocessed signals and the location of events, we use `epochs_create()` to slice the data into segments corresponding to a time window (ranging from -0.1 to 4 seconds) around each stimulus. Finally, relevant features are computed for each epoch (i.e., each stimulus) by passing them to `bio_analyze()`.
-
-Notably, the features include the changes in rate of ECG and RSP signals (e.g. maximum, minimum and mean rate after stimulus onset, and the time at which they occur), and the peak characteristics of the EDA signal (e.g., occurrence of skin conductance response (SCR), and if SCR is present, its corresponding peak amplitude, time of peak, rise and recovery time). In addition, respiration and cardiac cycle phases are extracted (i.e., the respiration phase - inspiration/expiration - and cardiac phase - systole/diastole - occurring at the onset of event).
-
-We hope that these examples demonstrate how straightforward the process of extracting features of physiological responses can be with *NeuroKit2*. This pipeline can easily scale up to group-level analyses by aggregating the average of features across participants. In addition to streamlining data analyses, *NeuroKit2* aims to allow researchers to extract an extensive suite of features that can be linked to neurocognitive processes. In this example (see **Table 3**), exposure to negative stimuli, as compared to neutral stimuli, is related to stronger cardiac deceleration, higher skin conductance response, and accelerated breathing rate (note that this descriptive interpretation is given solely for illustrative purposes).
-
-
-
-
-# Discussion
-
-*NeuroKit2* is a neurophysiological signal processing library accessible to people across different levels of programming experience and backgrounds. For users who are novice programmers or are new to neurophysiology, the package presents an ideal opportunity for exploration and learning. The experienced programmer is encouraged to choose and validate the preprocessing and analysis pipelines most appropriate for their data. Suggestions for improvements or additions to the library are welcome and openly discussed in the community. Overall, the development of *NeuroKit2* is focused on creating an intuitive user-experience, as well as building a collaborative community. Its modular structure and organization not only facilitate the use of existing and validated processing pipelines, but also create a fertile ground for experimentation and innovation.
-
-The library is also a pragmatic answer to the broader need for transparent and reproducible methods in neurophysiology. The impact of our package on reproducibility in research is two-fold: firstly, while black-box software can be easy and convenient to use, users do not have access to the source code, making processing results subject to unknown idiosyncrasies of the underlying implementation of processing routines. This makes it difficult to identify the source of potential discrepancies in results obtained with other software and can lead to irreproducible findings. In contrast, *NeuroKit2* documents each step of the implementation along with the analysis method, allowing users to pin-point the analysis steps where differences might arise. While maintaining a focus on overall user-experience, the open-source nature of *NeuroKit2* encourages independent researchers to cross-validate research findings. Secondly, not only does *NeuroKit2* implement several methods for analysis, it also allows for the comparison of different algorithms. For instance, using a suite of open-source databases, different algorithms for ECG R-peak detection have been compared for their robustness (number of errors encountered), efficiency (computation time) and accuracy (absolute distance from true R-peak location), documented in the "Studies" section of the package's documentation. As *NeuroKit2* continues to work on benchmarking, we hope to support users in making more informed decisions regarding which method is most suited for their specific requirements.
-
-*NeuroKit2* also prioritizes a high standard of quality control during code development. This is done through automated testing using continuous integration, as well as striving for code simplicity and readability. The API is thoroughly documented, including working examples. We ensure that the documentation evolves alongside the code by including it in our continuous integration. While *NeuroKit2* currently has a fairly comprehensive documentation, more examples and tutorials will be added as the package grows and expands. Additionally, we provide thorough guidelines for new contributors who wish to contribute code or documentation. 
-
-We expect the package's future evolution to be driven by the communities' needs and the advances in related fields. For instance, although *NeuroKit2* already implements a lot of useful functions for EEG processing (such as entropy and fractal dimensions quantification), its support could be further improved [for example with high-level functions built on top of utilities provided by the leading EEG Python software, namely *MNE*; @gramfort2013meg]. Additionally, in the future we strive to support other types of bodily signals (e.g., electrogastrography - EGG, electrooculography - EOG) and plan to optimize computational efficiency on large datasets. We also plan to further validate the available processing pipelines using public databases. In line with this objective, the support of standardized data structure formats (e.g. WFDB, BIDS, ...) could be extended.
-
-In conclusion, we believe that *NeuroKit2* provides useful tools for anyone who is interested in analyzing physiological data collected with research-grade hardware or wearable "smart health devices". By increasing the autonomy of researchers and practitioners, and by shortening the delay between data collection and results acquisition, *NeuroKit2* could be useful beyond academic research in neuroscience and psychology, including applications such as personal physiological monitoring and exercise science. Finally, we hope that *NeuroKit2* encourages users to become part of a supportive open-science community with diverse areas of expertise rather than relying on closed-source and proprietary software, thus shaping the future of neurophysiology and its related fields.
-
-# Conflict of Interest
-
-The authors declare that the research was conducted in the absence of commercial or financial relationships that could constitute a conflict of interest.
-
-# Acknowledgements
-
-We would like to thank Prof. C. F. Xavier for inspiration, all the current and future contributors (https://neurokit2.readthedocs.io/en/latest/authors.html), and the users for their support. Additionally, François Lespinasse would like to thank the Courtois Foundation for its support through the Courtois-NeuroMod project (https://cneuromod.ca)
-
-
-
-\newpage
-
-# References
-```{r create_r-references}
-r_refs(file = "bibliography.bib")
-```
-
-\begingroup
-\setlength{\parindent}{-0.5in}
-\setlength{\leftskip}{0.5in}
-
-<div id = "refs"></div>
-\endgroup
diff --git a/paper/manuscript_v4.pdf b/paper/manuscript_v4.pdf
deleted file mode 100644
index b394d7661a..0000000000
Binary files a/paper/manuscript_v4.pdf and /dev/null differ
diff --git a/paper/manuscript_v4.tex b/paper/manuscript_v4.tex
deleted file mode 100644
index 3d668b6a7d..0000000000
--- a/paper/manuscript_v4.tex
+++ /dev/null
@@ -1,529 +0,0 @@
-% Options for packages loaded elsewhere
-\PassOptionsToPackage{unicode=true}{hyperref}
-\PassOptionsToPackage{hyphens}{url}
-%
-\documentclass[
-  english,
-  man,floatsintext]{apa6}
-\usepackage{lmodern}
-\usepackage{amssymb,amsmath}
-\usepackage{ifxetex,ifluatex}
-\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
-  \usepackage[T1]{fontenc}
-  \usepackage[utf8]{inputenc}
-  \usepackage{textcomp} % provides euro and other symbols
-\else % if luatex or xelatex
-  \usepackage{unicode-math}
-  \defaultfontfeatures{Scale=MatchLowercase}
-  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
-\fi
-% Use upquote if available, for straight quotes in verbatim environments
-\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
-\IfFileExists{microtype.sty}{% use microtype if available
-  \usepackage[]{microtype}
-  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
-}{}
-\makeatletter
-\@ifundefined{KOMAClassName}{% if non-KOMA class
-  \IfFileExists{parskip.sty}{%
-    \usepackage{parskip}
-  }{% else
-    \setlength{\parindent}{0pt}
-    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
-}{% if KOMA class
-  \KOMAoptions{parskip=half}}
-\makeatother
-\usepackage{xcolor}
-\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
-\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
-\hypersetup{
-  pdftitle={NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing},
-  pdfauthor={Dominique Makowski1,*, Tam Pham1, Zen J. Lau1, Jan C. Brammer2, François Lespinasse3, 4, Hung Pham5, Christopher Schölzel6, \& S.H. Annabel Chen1, 7, 8},
-  pdfkeywords={Neurophysiology, Biosignals, Python, ECG, EDA, EMG},
-  hidelinks,
-}
-\urlstyle{same} % disable monospaced font for URLs
-\usepackage{color}
-\usepackage{fancyvrb}
-\newcommand{\VerbBar}{|}
-\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
-\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
-% Add ',fontsize=\small' for more characters per line
-\usepackage{framed}
-\definecolor{shadecolor}{RGB}{248,248,248}
-\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
-\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
-\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
-\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}}
-\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
-\newcommand{\BuiltInTok}[1]{#1}
-\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
-\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
-\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
-\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
-\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
-\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
-\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
-\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
-\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
-\newcommand{\ExtensionTok}[1]{#1}
-\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
-\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
-\newcommand{\ImportTok}[1]{#1}
-\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
-\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
-\newcommand{\NormalTok}[1]{#1}
-\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
-\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
-\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
-\newcommand{\RegionMarkerTok}[1]{#1}
-\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
-\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
-\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
-\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
-\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
-\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
-\usepackage{graphicx,grffile}
-\makeatletter
-\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
-\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
-\makeatother
-% Scale images if necessary, so that they will not overflow the page
-% margins by default, and it is still possible to overwrite the defaults
-% using explicit options in \includegraphics[width, height, ...]{}
-\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
-\setlength{\emergencystretch}{3em} % prevent overfull lines
-\providecommand{\tightlist}{%
-  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
-\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
-
-% Set default figure placement to htbp
-\makeatletter
-\def\fps@figure{htbp}
-\makeatother
-
-% Manuscript styling
-\usepackage{upgreek}
-\captionsetup{font=singlespacing,justification=justified}
-
-% Table formatting
-\usepackage{longtable}
-\usepackage{lscape}
-% \usepackage[counterclockwise]{rotating}   % Landscape page setup for large tables
-\usepackage{multirow}		% Table styling
-\usepackage{tabularx}		% Control Column width
-\usepackage[flushleft]{threeparttable}	% Allows for three part tables with a specified notes section
-\usepackage{threeparttablex}            % Lets threeparttable work with longtable
-
-% Create new environments so endfloat can handle them
-% \newenvironment{ltable}
-%   {\begin{landscape}\begin{center}\begin{threeparttable}}
-%   {\end{threeparttable}\end{center}\end{landscape}}
-\newenvironment{lltable}{\begin{landscape}\begin{center}\begin{ThreePartTable}}{\end{ThreePartTable}\end{center}\end{landscape}}
-
-% Enables adjusting longtable caption width to table width
-% Solution found at http://golatex.de/longtable-mit-caption-so-breit-wie-die-tabelle-t15767.html
-\makeatletter
-\newcommand\LastLTentrywidth{1em}
-\newlength\longtablewidth
-\setlength{\longtablewidth}{1in}
-\newcommand{\getlongtablewidth}{\begingroup \ifcsname LT@\roman{LT@tables}\endcsname \global\longtablewidth=0pt \renewcommand{\LT@entry}[2]{\global\advance\longtablewidth by ##2\relax\gdef\LastLTentrywidth{##2}}\@nameuse{LT@\roman{LT@tables}} \fi \endgroup}
-
-% \setlength{\parindent}{0.5in}
-% \setlength{\parskip}{0pt plus 0pt minus 0pt}
-
-% Overwrite redefinition of paragraph and subparagraph by the default LaTeX template
-% See https://github.com/crsh/papaja/issues/292
-\makeatletter
-\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\parindent}%
-  {0\baselineskip \@plus 0.2ex \@minus 0.2ex}%
-  {-1em}%
-  {\normalfont\normalsize\bfseries\itshape\typesectitle}}
-
-\renewcommand{\subparagraph}[1]{\@startsection{subparagraph}{5}{1em}%
-  {0\baselineskip \@plus 0.2ex \@minus 0.2ex}%
-  {-\z@\relax}%
-  {\normalfont\normalsize\itshape\hspace{\parindent}{#1}\textit{\addperi}}{\relax}}
-\makeatother
-
-% \usepackage{etoolbox}
-\makeatletter
-\patchcmd{\HyOrg@maketitle}
-  {\section{\normalfont\normalsize\abstractname}}
-  {\section*{\normalfont\normalsize\abstractname}}
-  {}{\typeout{Failed to patch abstract.}}
-\patchcmd{\HyOrg@maketitle}
-  {\section{\protect\normalfont{\@title}}}
-  {\section*{\protect\normalfont{\@title}}}
-  {}{\typeout{Failed to patch title.}}
-\makeatother
-\shorttitle{NeuroKit2}
-\keywords{Neurophysiology, Biosignals, Python, ECG, EDA, EMG\newline\indent Word count: 3477}
-\usepackage{lineno}
-
-\linenumbers
-\usepackage{csquotes}
-\usepackage[labelfont=bf, font={color=gray,small}]{caption}
-\usepackage{float}
-\usepackage[document]{ragged2e}
-\ifxetex
-  % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
-  \usepackage{polyglossia}
-  \setmainlanguage[]{english}
-\else
-  \usepackage[shorthands=off,main=english]{babel}
-\fi
-
-\title{\textbf{NeuroKit2: A Python Toolbox for Neurophysiological Signal Processing}}
-\author{Dominique Makowski\textsuperscript{1,*}, Tam Pham\textsuperscript{1}, Zen J. Lau\textsuperscript{1}, Jan C. Brammer\textsuperscript{2}, François Lespinasse\textsuperscript{3, 4}, Hung Pham\textsuperscript{5}, Christopher Schölzel\textsuperscript{6}, \& S.H. Annabel Chen\textsuperscript{1, 7, 8}}
-\date{}
-
-
-\authornote{
-
-Correspondence concerning this article should be addressed to Dominique Makowski, HSS 04-18, 48 Nanyang Avenue, Singapore. E-mail: \href{mailto:dmakowski@ntu.edu.sg}{\nolinkurl{dmakowski@ntu.edu.sg}}
-
-}
-
-\affiliation{\vspace{0.5cm}\textsuperscript{1} School of Social Sciences, Nanyang Technological University, Singapore\\\textsuperscript{2} Behavioural Science Institute, Radboud University, Netherlands\\\textsuperscript{3} Département de psychologie, Université de Montréal, Canada\\\textsuperscript{4} Centre de Recherche de l'Institut Universitaire Geriatrique de Montréal\\\textsuperscript{5} Eureka Robotics, Singapore\\\textsuperscript{6} Life Science Informatics, THM University of Applied Sciences, Germany\\\textsuperscript{7} Centre for Research and Development in Learning, Nanyang Technological University, Singapore\\\textsuperscript{8} Lee Kong Chian School of Medicine, Nanyang Technological University, Singapore}
-
-\abstract{
-NeuroKit2 is an open-source, community-driven, and user-centered Python package for neurophysiological signal processing. It provides a comprehensive suite of processing routines for a variety of bodily signals (e.g., ECG, PPG, EDA, EMG, RSP). These processing routines include high-level functions that enable data processing in a few lines of code using validated pipelines, which we illustrate in two examples covering the most typical scenarios, such as an event-related paradigm and an interval-related analysis. The package also includes tools for specific processing steps such as rate extraction and filtering methods, offering a trade-off between high-level convenience and fine-tuned control. Its goal is to improve transparency and reproducibility in neurophysiological research, as well as foster exploration and innovation. Its design philosophy is centred on user-experience and accessibility to both novice and advanced users.
-}
-
-
-
-\begin{document}
-\maketitle
-
-\justify
-
-Neurophysiological measurements increasingly gain popularity in the study of cognition and behavior.
-These measurements include electroencephalography (EEG), electrocardiography (ECG), electromyography (EMG) and electrodermal activity (EDA).
-Their popularity is driven by theoretical motivations (e.g., the growth of embodied or affective neuroscience; Kiverstein \& Miller, 2015) as well as practical reasons.
-The latter include low costs (especially compared with other imaging techniques, such as MRI or MEG), ease of use (e.g., portability, setup speed), and the increasing availability of recording devices (e.g., wearables; Yuehong, Zeng, Chen, \& Fan, 2016).
-Moreover, the extraction of meaningful information from neurophysiological signals is facilitated by current advances in signal processing algorithms (Clifton, Gibbons, Davies, \& Tarassenko, 2012; Roy et al., 2019).
-Unfortunately, these algorithms are often not distributed in a usable way (i.e., in the form of packaged code) which makes them inaccessible to researchers who do not have the time or experience to implement them. Moreover, many software tools for neurophysiological analyses are limited to a single type of signal (for instance ECG).
-This makes it inconvenient for researchers who might have to concurrently rely on a number of software packages to process and analyze multimodal data.
-
-Additionally, psychology and neuroscience face a \enquote{reproducibility crisis} (Maizey \& Tzavella, 2019; Miłkowski, Hensel, \& Hohol, 2018; Nosek, Cohoon, Kidwell, \& Spies, 2015; Topalidou, Leblois, Boraud, \& Rougier, 2015) which has lead to a profound reassessment of research practices (by researchers, publishers, funding agencies, etc.).
-The opacity of data processing, such as ill-specified, or inaccessible analysis pipelines, plays a major role in the crisis.
-This issue could in part be alleviated by making analyses code an integral part of scientific publications, rather than treating a paper as the sole and most important part of the research project. However, distributing the analysis script alongside the paper poses new challenges:
-Scripts must be shareable (not always feasible with closed-source and proprietary software or programming languages), accessible (well-documented and organized scripts) and reproducible (which is difficult for software relying on graphical user interfaces - GUI - in which the manual point-and-click sequence can be hard to automate).
-
-\emph{NeuroKit2}, addresses these challenges by offering a free, user-centered, and comprehensive solution for neurophysiological data processing, with an initial focus on bodily signals including ECG (electrocardiography is used to measure cardiac activity), PPG (photoplethysmogram is an optical measurement of blood flow), RSP (respiration measures), EDA (electrodermal activity measuring the electrical conductance of the skin), EMG (electromyography measuring muscular activity) and EOG (electrooculography measuring eye movements). It also provides modality-independent functions that can be used for other modalities such as EEG (electroencephalography measuring electrical activity of the brain), for which more specific support is in development.
-
-The open-source Python package is developed by a multi-disciplinary team that actively invites new collaborators. The target audience of \emph{NeuroKit2} includes both experienced and novice programmers. Although being a programming-based tool, users not familiar with Python or other languages can start using the software (and improve their programming skills along the way) by following our step-by-step examples. Moreover, we also include a thorough tutorial on Python installation, as well as a \enquote{10 minutes introduction to Python} in the documentation. While many of the existing software caters to a single signal modality (e.g., \emph{KUBIOS}\copyright (Tarvainen, Niskanen, Lipponen, Ranta-Aho, \& Karjalainen, 2014), \emph{HeartPy} (Gent, Farah, Nes, \& Arem, 2019) and \emph{pyHRV} (Gomes, Margaritoff, \& Silva, 2019) for ECG, \emph{cvxEDA} (Greco, Valenza, Lanata, Scilingo, \& Citi, 2015), \emph{Ledalab} (Benedek \& Kaernbach, 2010), and \emph{SCRalyze} (Bach, 2014) for EDA), \emph{NeuroKit2} provides support for various signals and allows its users to process signals from multiple physiological modalities with a uniform application programming interface (API). It aims at being accessible, well-documented, well-tested, cutting-edge, flexible and efficient. The library allows users to select from a wide range of validated analysis pipelines and to create custom pipelines tailored to specific analyses requirements.
-Historically, \emph{NeuroKit2} is the re-forged successor of \emph{NeuroKit1} (Makowski, 2020), taking over its most successful features and design choices, and re-implementing them in a way that adheres to current best practices in open source software development.
-
-\emph{NeuroKit2} offers a breadth of functionalities which includes, but is not limited to, signal simulation; data management (e.g., downloading existing datasets, reading and formatting files into a dataframe); event extraction from signals; epoch extraction, signal processing (e.g., filtering, resampling, rate computation using different published algorithms detailed in the package's documentation); spectral analyses; complexity and entropy analyses; and convenient statistical methods (e.g., K-means clustering, ICA or PCA). A variety of plotting functions allow for quick and expressive visualization of the signal processing and the resulting features.
-
-The package is implemented in Python 3 (Van Rossum \& Drake, 2009), which means that \emph{NeuroKit2's} users benefit from an large number of learning resources and a vibrant community. The package depends on relatively few, well established and robust packages from the numeric Python ecosystem such as \emph{NumPy} (Harris et al., 2020), \emph{pandas} (McKinney \& others, 2010), \emph{SciPy} (Virtanen et al., 2020), \emph{scikit-learn} (Pedregosa et al., 2011) and \emph{MatplotLib} (Hunter, 2007) (with an additional system of optional dependencies), making \emph{NeuroKit2} a viable dependency for other packages.
-
-\emph{NeuroKit2's} source code is available under the MIT license on GitHub (\emph{\url{https://github.com/neuropsychology/NeuroKit}}). Its documentation (\emph{\url{https://neurokit2.readthedocs.io/}}) is automatically built and rendered from the code and includes guides for installation and contribution, a description of the package's functions, as well as several \enquote{hands-on} examples and tutorials (e.g., how to extract and visualize individual heartbeats, how to analyze event-related data etc.). Importantly, users can add new examples by simply submitting a Jupyter notebook (Kluyver et al., 2016) to the GitHub repository. The notebook will automatically be displayed on the website, ensuring easily accessible and evolving documentation. Moreover, users can try out the example notebooks directly in their browser via a cloud-based \emph{Binder} environment (Jupyter et al., 2018). Finally, the issue tracker on GitHub offers a convenient and public forum that allows users to report bugs, get help and gain insight into the development of the package. Our active collaborators range from academics, professionals and practitioners in the life sciences and engineering fields (See the \enquote{authors} section on the package's documentation). Based on community feedback that we received (social networks, GitHub issues), \emph{NeuroKit2} has attracted users of different profiles, ranging from those who are new to signal processing and programming to more experienced users.
-
-\emph{NeuroKit2} aims at being reliable and trustworthy, including implementations of processing pipelines that have been described in peer-reviewed publications. Details and references regarding those pipelines are available in the package's documentation. Many pipelines have been tested against established software such as \emph{BioSPPy} (Carreiras et al., 2015), \emph{hrv} (Bartels \& Pecanha, 2020), \emph{PySiology} (Gabrieli, Azhari, \& Esposito, 2019), \emph{HeartPy} (Gent et al., 2019), \emph{systole} (Legrand \& Allen, 2020) or \emph{nolds} (Schölzel, 2019). Additionally, the repository leverages a comprehensive test suite (using \emph{pytest}) and continuous integration (using Travis-CI and GitHub actions) to ensure software stability and quality. The test coverage and build status can transparently be tracked via the GitHub repository. Thanks to its collaborative and open development, \emph{NeuroKit2} can remain cutting-edge and continuously evolve, adapt, and integrate new methods as they are emerging.
-
-Finally, we believe that the design philosophy of \emph{NeuroKit2} contributes to an efficient (i.e., allowing to achieve a lot with few functions) yet flexible (i.e., enabling fine control and precision over what is done) UI. We will illustrate these claims with two examples of common use-cases (the interval-related analysis on resting state data and the event-related analysis), and will conclude by discussing how \emph{NeuroKit2} contributes to neurophysiological research by raising the standards for validity, reproducibility and accessibility.
-
-\hypertarget{design-philosophy}{%
-\section{Design Philosophy}\label{design-philosophy}}
-
-\emph{NeuroKit2} aims at being accessible to beginners and, at the same time, offering a maximal level of control to experienced users. This is achieved by allowing beginning users to implement complex processing pipelines with a few functions, while still providing experienced users with fine-tuned control over arguments and parameters. In concrete terms, this trade-off is enabled by an API structure organized in three layers.
-
-\hypertarget{low-level-base-utilities-for-signal-processing}{%
-\subsection{Low-level: Base Utilities for Signal Processing}\label{low-level-base-utilities-for-signal-processing}}
-
-The basic building blocks are functions for general signal processing, i.e., filtering, resampling, interpolation, peak detection, etc. These functions are modality-independent, and include several parameters (e.g., one can change the filtering method, frequencies, and order, by overwriting the default arguments). Most of these functions are based on established algorithms implemented in \emph{scipy} (Virtanen et al., 2020). Examples of such functions include \texttt{signal\_filter()}, \texttt{signal\_interpolate()}, \texttt{signal\_resample()}, \texttt{signal\_detrend()}, and \texttt{signal\_findpeaks()}.
-
-\hypertarget{mid-level-neurophysiological-processing-steps}{%
-\subsection{Mid-level: Neurophysiological Processing Steps}\label{mid-level-neurophysiological-processing-steps}}
-
-The base utilities are used by mid-level functions specific to the different physiological modalities (i.e., ECG, RSP, EDA, EMG, PPG). These functions carry out modality-specific signal processing steps, such as cleaning, peak detection, phase classification or rate computation. Critically, for each type of signal, uniform function names are used (in the form \texttt{signaltype\_functiongoal()}) to achieve equivalent goals, e.g., \texttt{*\_clean()}, \texttt{*\_findpeaks()}, \texttt{*\_process()}, \texttt{*\_plot()}, making the implementation intuitive and consistent across different modalities.
-
-For example, the \texttt{rsp\_clean()} function uses \texttt{signal\_filter()} and \texttt{signal\_detrend()}, with different sets of default parameters that can be switched with a \enquote{method} argument (corresponding to different published or established pipelines). For instance, setting \texttt{method="khodadad2018"} will use the cleaning workflow described in Khodadad et al. (2018). However, if a user wants to build their own custom cleaning pipeline, they can use the cleaning function as a template, and tweak the parameters to their desires in the low-level signal processing operations.
-
-\hypertarget{high-level-wrappers-for-processing-and-analysis}{%
-\subsection{High-level Wrappers for Processing and Analysis}\label{high-level-wrappers-for-processing-and-analysis}}
-
-\begin{figure}
-\includegraphics[width=1\linewidth]{figures/nk_architecture} \caption{Illustration of the NeuroKit2 package architecture, in the case of ECG signal processing.}\label{fig:unnamed-chunk-1}
-\end{figure}
-
-The mid-level functions are assembled in high-level wrappers, that are convenient entry points for new users. For instance, the \texttt{ecg\_process()} function internally chains the mid-level functions \texttt{ecg\_clean()}, \texttt{ecg\_peaks()}, \texttt{ecg\_quality()}, \texttt{ecg\_delineate()}, and \texttt{ecg\_phase()}, as shown in \textbf{Figure 1}. A specific processing pipeline can be selected with the \texttt{method} argument that is then propagated throughout the internal functions. Easily switching between processing pipelines allows for the comparison of different methods, and streamlines critical but time-consuming steps in reproducible research, such as the validation of data preparation and quality control (Quintana, Alvares, \& Heathers, 2016). Finally, the package includes convenience-functions (e.g., \texttt{bio\_process}) that enable the combined processing of multiple types of signals at once (e.g., \texttt{bio\_process(ecg=ecg\_signal,\ eda=eda\_signal)}).
-
-Performing an entire set of operations with sensible default parameters in one function can be rewarding, especially for beginners, allowing them to perform cutting-edge processing or replication of research steps without requiring much programming expertise. Moreover, it contributes to the demystification of the usage of programming tools (as opposed to GUI-based software such as \emph{SPSS}, \emph{Kubios}, or \emph{Acqknowledge}), providing a welcoming framework to further explore physiological data processing. Importantly, more advanced users can build custom analysis pipelines by using the low- and mid-level functions, allowing for finer control over the processing parameters. We believe that this implementation is a well-calibrated trade-off between flexibility and user-friendliness.
-
-\hypertarget{installing-neurokit2}{%
-\section{Installing NeuroKit2}\label{installing-neurokit2}}
-
-\emph{NeuroKit2} is available on PyPI, a repository of software for the Python programming language. and can be installed using pip (via \enquote{\emph{pip install neurokit2}} command). Detailed instructions on how to install Python are also available in the \emph{installation} section of the package's documentation.
-
-\hypertarget{examples}{%
-\section{Examples}\label{examples}}
-
-In this section, we present two examples that illustrate the most common use-cases. Both examples can be accessed in an interactive format (without any prior installation) via a \emph{\href{https://mybinder.org/v2/gh/neuropsychology/NeuroKit/master?urlpath=lab\%2Ftree\%2Fdocs\%2Fexamples}{Binder environment}}.The first example illustrates an interval-related paradigm where characteristics of physiological activity during a certain time interval (not necessarily tied to a specific and sudden event) are extracted. The second example presents an event-related paradigm, in which the interest lies in shorter-term physiological changes related to specific events (see \textbf{Figure 1} and \textbf{Table 1}). The example datasets are available with the package and can be downloaded using the \texttt{data()} function. This utility reads comma separated values files (\emph{.csv}) with the Pandas function \emph{pd.read\_csv()}, where each column is a different biosignal. Each row is a sample that correspond to signals' value at a given point in time. All examples use the 0.0.41 version release of \emph{NeuroKit2}.
-
-\textbackslash begin\{figure\}
-\includegraphics[width=1\linewidth]{figures/features} \textbackslash caption\{Plot window displaying a period of raw electrocardiogram (ECG in red), respiration (RSP in blue) and electrodermal activity (EDA in purple) data. The green highlighted section, spanning from 0 to 20s, represents the periodic region of interest during interval-related analysis. The 3 event markers are indicated by dotted lines, and the orange highlighted sections spanning 0.1s before the onset of each event and ending 4s after the event, represent periodic regions of interest during event-related analysis. The link for generating the figure can be found on NeuroKit2's GitHub repository (\url{https://github.com/neuropsychology/NeuroKit/blob/master/paper/make_figures.Rmd})\}\label{fig:unnamed-chunk-2}
-\textbackslash end\{figure\}
-
-\begin{table}[!h]
-
-\caption{\label{tab:table3pdf}Examples of features computed in different domains.}
-\centering
-\fontsize{9}{11}\selectfont
-\begin{tabular}[t]{>{\raggedright\arraybackslash}p{8cm}>{\raggedright\arraybackslash}p{8cm}}
-\toprule
-Interval-related Features & Event-related Features\\
-\midrule
-ECG Rate Characteristics (Mean, Amplitude) & ECG Rate Changes (Min, Mean, Max, Time of Min,  Max, Trend)\\
-Heart Rate Variability (HRV) indices & RSP Rate Changes (Min, Mean, Max, Time of Min, Max)\\
-Respiratory Rate Variability (RRV) indices & RSP Amplitude Measures (Min, Mean, Max)\\
-Respiratory Sinus Arrhythmia (RSA) indices & ECG and RSP Phase (Inspiration/Expiration, Systole/Diastole, Completion)\\
-Number of SCR Peaks and mean amplitude & SCR peak and its characteristics (amplitude, rise time, recovery time)\\
-\bottomrule
-\end{tabular}
-\end{table}
-
-\hypertarget{interval-related-paradigm}{%
-\subsection{Interval-related Paradigm}\label{interval-related-paradigm}}
-
-The first dataset corresponds to 5 minutes of physiological activity of a human participant at rest (eyes-closed in a seated position), with no specific instructions. It contains three channels (ECG, PPG and RSP) sampled at a frequency of 100Hz.
-
-\begin{Shaded}
-\begin{Highlighting}[]
-\CommentTok{# Load the package}
-\ImportTok{import}\NormalTok{ neurokit2 }\ImportTok{as}\NormalTok{ nk}
-
-\CommentTok{# Download the example dataset}
-\NormalTok{data }\OperatorTok{=}\NormalTok{ nk.data(}\StringTok{"bio_resting_5min_100hz"}\NormalTok{)}
-
-\CommentTok{# Process the data}
-\NormalTok{df, info }\OperatorTok{=}\NormalTok{ nk.bio_process(ecg}\OperatorTok{=}\NormalTok{data[}\StringTok{"ECG"}\NormalTok{],}
-\NormalTok{                          rsp}\OperatorTok{=}\NormalTok{data[}\StringTok{"RSP"}\NormalTok{],}
-\NormalTok{                          sampling_rate}\OperatorTok{=}\DecValTok{100}\NormalTok{)}
-
-\CommentTok{# Extract features}
-\NormalTok{results }\OperatorTok{=}\NormalTok{ nk.bio_analyze(df, sampling_rate}\OperatorTok{=}\DecValTok{100}\NormalTok{)}
-
-\CommentTok{# Show subset of results}
-\NormalTok{results[[}\StringTok{"ECG_Rate_Mean"}\NormalTok{, }\StringTok{"HRV_RMSSD"}\NormalTok{, }\StringTok{"RSP_Rate_Mean"}\NormalTok{, }\StringTok{"RSA_P2T_Mean"}\NormalTok{]]}
-\end{Highlighting}
-\end{Shaded}
-
-\begin{table}[!h]
-
-\caption{\label{tab:table2pdf}Subset of properties characterizing the physiological activity over a period of 5 minutes of resting-state.}
-\centering
-\begin{tabular}[t]{rrrr}
-\toprule
-ECG\_Rate\_Mean & HRV\_RMSSD & RSP\_Rate\_Mean & RSA\_P2T\_Mean\\
-\midrule
-86.39 & 38.84 & 15.74 & 0.07\\
-\bottomrule
-\end{tabular}
-\end{table}
-
-Here, the aim was to illustrate a type of physiological analysis that we refer to as interval-related (or resting-state paradigm, as opposed to an event-related paradigm). After loading the package and the example dataset, each physiological signal is processed using \texttt{bio\_process()}.
-As we want to compute features related to the entire dataset (see \textbf{Table 2}), we can directly pass the whole dataframe to \texttt{bio\_analyze()}, and compute the interval-related features. Users can choose a specific time interval from their dataset.
-
-Interval-related analyses compute features of signal variability and activation patterns over a given period of time, including average heart and breathing rate, as well as indices of heart rate variability (HRV) and respiratory sinus arrhythmia (RSA). \emph{NeuroKit2} allows for the fast creation of standardized and reproducible pipelines to describe this kind of physiological activity.
-
-\hypertarget{event-related-paradigm}{%
-\subsection{Event-related Paradigm}\label{event-related-paradigm}}
-
-This example dataset contains ECG, RSP and EDA signals of one participant who was presented with four emotional images (from the NAPS database; Marchewka, Żurawski, Jednoróg, \& Grabowska, 2014) in a typical (albeit shortened) experimental psychology paradigm.
-
-The signals are 2.5 minutes (150 seconds) long and are recorded at a frequency of 100Hz (note that the sampling rate is lower than usually required, see Quintana et al., 2016, in order to be able to include the example data in the \emph{NeuroKit2} distribution). It has 4 channels including three physiological signals, and one corresponding to events marked with a photosensor (signal strength decreases when a stimulus appears on the screen).
-
-\begin{Shaded}
-\begin{Highlighting}[]
-\CommentTok{# Load the package}
-\ImportTok{import}\NormalTok{ neurokit2 }\ImportTok{as}\NormalTok{ nk}
-
-\CommentTok{# Download the example dataset}
-\NormalTok{data }\OperatorTok{=}\NormalTok{ nk.data(}\StringTok{"bio_eventrelated_100hz"}\NormalTok{)}
-
-\CommentTok{# Process the data}
-\NormalTok{df, info }\OperatorTok{=}\NormalTok{ nk.bio_process(ecg}\OperatorTok{=}\NormalTok{data[}\StringTok{"ECG"}\NormalTok{],}
-\NormalTok{                          rsp}\OperatorTok{=}\NormalTok{data[}\StringTok{"RSP"}\NormalTok{],}
-\NormalTok{                          eda}\OperatorTok{=}\NormalTok{data[}\StringTok{"EDA"}\NormalTok{],}
-\NormalTok{                          sampling_rate}\OperatorTok{=}\DecValTok{100}\NormalTok{)}
-
-\CommentTok{# Find events}
-\NormalTok{conditions }\OperatorTok{=}\NormalTok{ [}\StringTok{"Negative"}\NormalTok{, }\StringTok{"Neutral"}\NormalTok{, }\StringTok{"Neutral"}\NormalTok{, }\StringTok{"Negative"}\NormalTok{]}
-\NormalTok{events }\OperatorTok{=}\NormalTok{ nk.events_find(event_channel}\OperatorTok{=}\NormalTok{data[}\StringTok{"Photosensor"}\NormalTok{],}
-\NormalTok{                        threshold_keep}\OperatorTok{=}\StringTok{'below'}\NormalTok{,}
-\NormalTok{                        event_conditions}\OperatorTok{=}\NormalTok{conditions)}
-
-\CommentTok{# Epoch the data}
-\NormalTok{epochs }\OperatorTok{=}\NormalTok{ nk.epochs_create(data}\OperatorTok{=}\NormalTok{df,}
-\NormalTok{                          events}\OperatorTok{=}\NormalTok{events,}
-\NormalTok{                          sampling_rate}\OperatorTok{=}\DecValTok{100}\NormalTok{,}
-\NormalTok{                          epochs_start}\OperatorTok{=-}\FloatTok{0.1}\NormalTok{,}
-\NormalTok{                          epochs_end}\OperatorTok{=}\DecValTok{4}\NormalTok{)}
-
-\CommentTok{# Extract event related features}
-\NormalTok{results }\OperatorTok{=}\NormalTok{ nk.bio_analyze(epochs, sampling_rate}\OperatorTok{=}\DecValTok{100}\NormalTok{)}
-
-\CommentTok{# Show subset of results}
-\NormalTok{results[[}\StringTok{"Condition"}\NormalTok{, }\StringTok{"ECG_Rate_Mean"}\NormalTok{, }\StringTok{"RSP_Rate_Mean"}\NormalTok{, }\StringTok{"EDA_Peak_Amplitude"}\NormalTok{]]}
-\end{Highlighting}
-\end{Shaded}
-
-\begin{table}[!h]
-
-\caption{\label{tab:table1pdf}Subset of the ouput related to event-related analysis characterizing the pattern of physiological changes related to specific stimuli.}
-\centering
-\begin{tabular}[t]{lrrr}
-\toprule
-Condition & ECG\_Rate\_Mean & RSP\_Rate\_Mean & EDA\_Peak\_Amplitude\\
-\midrule
-Negative & -2.01 & -0.15 & 0.93\\
-Neutral & -3.13 & 1.40 & 0.41\\
-Neutral & 1.34 & -0.34 & 0.02\\
-Negative & -3.55 & 1.97 & 1.06\\
-\bottomrule
-\end{tabular}
-\end{table}
-
-In this example, the steps of the analysis are identical to the previous example, including loading the package, the dataset and processing the data. The difference is that stimulus onsets in the photosensor are detected separately with \texttt{events\_find()}. Once we have the preprocessed signals and the location of events, we use \texttt{epochs\_create()} to slice the data into segments corresponding to a time window (ranging from -0.1 to 4 seconds) around each stimulus. Finally, relevant features are computed for each epoch (i.e., each stimulus) by passing them to \texttt{bio\_analyze()}.
-
-Notably, the features include the changes in rate of ECG and RSP signals (e.g.~maximum, minimum and mean rate after stimulus onset, and the time at which they occur), and the peak characteristics of the EDA signal (e.g., occurrence of skin conductance response (SCR), and if SCR is present, its corresponding peak amplitude, time of peak, rise and recovery time). In addition, respiration and cardiac cycle phases are extracted (i.e., the respiration phase - inspiration/expiration - and cardiac phase - systole/diastole - occurring at the onset of event).
-
-We hope that these examples demonstrate how straightforward the process of extracting features of physiological responses can be with \emph{NeuroKit2}. This pipeline can easily scale up to group-level analyses by aggregating the average of features across participants. In addition to streamlining data analyses, \emph{NeuroKit2} aims to allow researchers to extract an extensive suite of features that can be linked to neurocognitive processes. In this example (see \textbf{Table 3}), exposure to negative stimuli, as compared to neutral stimuli, is related to stronger cardiac deceleration, higher skin conductance response, and accelerated breathing rate (note that this descriptive interpretation is given solely for illustrative purposes).
-
-\hypertarget{discussion}{%
-\section{Discussion}\label{discussion}}
-
-\emph{NeuroKit2} is a neurophysiological signal processing library accessible to people across different levels of programming experience and backgrounds. For users who are novice programmers or are new to neurophysiology, the package presents an ideal opportunity for exploration and learning. The experienced programmer is encouraged to choose and validate the preprocessing and analysis pipelines most appropriate for their data. Suggestions for improvements or additions to the library are welcome and openly discussed in the community. Overall, the development of \emph{NeuroKit2} is focused on creating an intuitive user-experience, as well as building a collaborative community. Its modular structure and organization not only facilitate the use of existing and validated processing pipelines, but also create a fertile ground for experimentation and innovation.
-
-The library is also a pragmatic answer to the broader need for transparent and reproducible methods in neurophysiology. The impact of our package on reproducibility in research is two-fold: firstly, while black-box software can be easy and convenient to use, users do not have access to the source code, making processing results subject to unknown idiosyncrasies of the underlying implementation of processing routines. This makes it difficult to identify the source of potential discrepancies in results obtained with other software and can lead to irreproducible findings. In contrast, \emph{NeuroKit2} documents each step of the implementation along with the analysis method, allowing users to pin-point the analysis steps where differences might arise. While maintaining a focus on overall user-experience, the open-source nature of \emph{NeuroKit2} encourages independent researchers to cross-validate research findings. Secondly, not only does \emph{NeuroKit2} implement several methods for analysis, it also allows for the comparison of different algorithms. For instance, using a suite of open-source databases, different algorithms for ECG R-peak detection have been compared for their robustness (number of errors encountered), efficiency (computation time) and accuracy (absolute distance from true R-peak location), documented in the \enquote{Studies} section of the package's documentation. As \emph{NeuroKit2} continues to work on benchmarking, we hope to support users in making more informed decisions regarding which method is most suited for their specific requirements.
-
-\emph{NeuroKit2} also prioritizes a high standard of quality control during code development. This is done through automated testing using continuous integration, as well as striving for code simplicity and readability. The API is thoroughly documented, including working examples. We ensure that the documentation evolves alongside the code by including it in our continuous integration. While \emph{NeuroKit2} currently has a fairly comprehensive documentation, more examples and tutorials will be added as the package grows and expands. Additionally, we provide thorough guidelines for new contributors who wish to contribute code or documentation.
-
-We expect the package's future evolution to be driven by the communities' needs and the advances in related fields. For instance, although \emph{NeuroKit2} already implements a lot of useful functions for EEG processing (such as entropy and fractal dimensions quantification), its support could be further improved (for example with high-level functions built on top of utilities provided by the leading EEG Python software, namely \emph{MNE}; Gramfort et al., 2013). Additionally, in the future we strive to support other types of bodily signals (e.g., electrogastrography - EGG, electrooculography - EOG) and plan to optimize computational efficiency on large datasets. We also plan to further validate the available processing pipelines using public databases. In line with this objective, the support of standardized data structure formats (e.g.~WFDB, BIDS, \ldots) could be extended.
-
-In conclusion, we believe that \emph{NeuroKit2} provides useful tools for anyone who is interested in analyzing physiological data collected with research-grade hardware or wearable \enquote{smart health devices}. By increasing the autonomy of researchers and practitioners, and by shortening the delay between data collection and results acquisition, \emph{NeuroKit2} could be useful beyond academic research in neuroscience and psychology, including applications such as personal physiological monitoring and exercise science. Finally, we hope that \emph{NeuroKit2} encourages users to become part of a supportive open-science community with diverse areas of expertise rather than relying on closed-source and proprietary software, thus shaping the future of neurophysiology and its related fields.
-
-\hypertarget{conflict-of-interest}{%
-\section{Conflict of Interest}\label{conflict-of-interest}}
-
-The authors declare that the research was conducted in the absence of commercial or financial relationships that could constitute a conflict of interest.
-
-\hypertarget{acknowledgements}{%
-\section{Acknowledgements}\label{acknowledgements}}
-
-We would like to thank Prof.~C. F. Xavier for inspiration, all the current and future contributors (\url{https://neurokit2.readthedocs.io/en/latest/authors.html}), and the users for their support. Additionally, François Lespinasse would like to thank the Courtois Foundation for its support through the Courtois-NeuroMod project (\url{https://cneuromod.ca})
-
-\newpage
-
-\hypertarget{references}{%
-\section{References}\label{references}}
-
-\begingroup
-\setlength{\parindent}{-0.5in}
-\setlength{\leftskip}{0.5in}
-
-\hypertarget{refs}{}
-\leavevmode\hypertarget{ref-bach2014head}{}%
-Bach, D. R. (2014). A head-to-head comparison of scralyze and ledalab, two model-based methods for skin conductance analysis. \emph{Biological Psychology}, \emph{103}, 63--68.
-
-\leavevmode\hypertarget{ref-HRV}{}%
-Bartels, R., \& Pecanha, T. (2020). HRV: A pythonic package for heart rate variability analysis. \emph{Journal of Open Source Software}, \emph{5}(51), 1867. \url{https://doi.org/10.21105/joss.01867}
-
-\leavevmode\hypertarget{ref-benedek2010continuous}{}%
-Benedek, M., \& Kaernbach, C. (2010). A continuous measure of phasic electrodermal activity. \emph{Journal of Neuroscience Methods}, \emph{190}(1), 80--91.
-
-\leavevmode\hypertarget{ref-biosppy}{}%
-Carreiras, C., Alves, A. P., Lourenço, A., Canento, F., Silva, H., Fred, A., \& others. (2015). \emph{BioSPPy: Biosignal processing in Python}. Retrieved from \url{https://github.com/PIA-Group/BioSPPy/}
-
-\leavevmode\hypertarget{ref-clifton2012machine}{}%
-Clifton, D. A., Gibbons, J., Davies, J., \& Tarassenko, L. (2012). Machine learning and software engineering in health informatics. \emph{2012 first international workshop on realizing ai synergies in software engineering (raise)}, 37--41. IEEE.
-
-\leavevmode\hypertarget{ref-PySiology}{}%
-Gabrieli, G., Azhari, A., \& Esposito, G. (2019). PySiology: A python package for physiological feature extraction. In \emph{Neural approaches to dynamics of signal exchanges} (pp. 395--402). Springer Singapore. \url{https://doi.org/10.1007/978-981-13-8950-4_35}
-
-\leavevmode\hypertarget{ref-HeartPy}{}%
-Gent, P. van, Farah, H., Nes, N. van, \& Arem, B. van. (2019). HeartPy: A novel heart rate algorithm for the analysis of noisy signals. \emph{Transportation Research Part F: Traffic Psychology and Behaviour}, \emph{66}, 368--378. \url{https://doi.org/10.1016/j.trf.2019.09.015}
-
-\leavevmode\hypertarget{ref-gomes2019pyhrv}{}%
-Gomes, P., Margaritoff, P., \& Silva, H. (2019). PyHRV: Development and evaluation of an open-source python toolbox for heart rate variability (hrv). \emph{Proc. Int'l conf. On electrical, electronic and computing engineering (icetran)}, 822--828.
-
-\leavevmode\hypertarget{ref-gramfort2013meg}{}%
-Gramfort, A., Luessi, M., Larson, E., Engemann, D. A., Strohmeier, D., Brodbeck, C., \ldots{} others. (2013). MEG and eeg data analysis with mne-python. \emph{Frontiers in Neuroscience}, \emph{7}, 267.
-
-\leavevmode\hypertarget{ref-greco2015cvxeda}{}%
-Greco, A., Valenza, G., Lanata, A., Scilingo, E. P., \& Citi, L. (2015). CvxEDA: A convex optimization approach to electrodermal activity processing. \emph{IEEE Transactions on Biomedical Engineering}, \emph{63}(4), 797--804.
-
-\leavevmode\hypertarget{ref-harris2020array}{}%
-Harris, C. R., Millman, K. J., Walt, S. J. van der, Gommers, R., Virtanen, P., Cournapeau, D., \ldots{} others. (2020). Array programming with numpy. \emph{Nature}, \emph{585}(7825), 357--362.
-
-\leavevmode\hypertarget{ref-matplotlib}{}%
-Hunter, J. D. (2007). Matplotlib: A 2D graphics environment. \emph{Computing in Science \& Engineering}, \emph{9}(3), 90--95.
-
-\leavevmode\hypertarget{ref-Jupyter2018}{}%
-Jupyter, Bussonnier, Forde, Freeman, Granger, Head, \ldots{} Willing. (2018). Binder 2.0 - Reproducible, interactive, sharable environments for science at scale. In Fatih Akici, David Lippa, Dillon Niederhut, \& M. Pacer (Eds.), \emph{Proceedings of the 17th Python in Science Conference} (pp. 113--120). \url{https://doi.org/\%2010.25080/Majora-4af1f417-011\%20}
-
-\leavevmode\hypertarget{ref-khodadad2018optimized}{}%
-Khodadad, D., Nordebo, S., Mueller, B., Waldmann, A., Yerworth, R., Becher, T., \ldots{} others. (2018). Optimized breath detection algorithm in electrical impedance tomography. \emph{Physiological Measurement}, \emph{39}(9), 094001.
-
-\leavevmode\hypertarget{ref-Kiverstein2015}{}%
-Kiverstein, J., \& Miller, M. (2015). The embodied brain: Towards a radical embodied cognitive neuroscience. \emph{Frontiers in Human Neuroscience}, \emph{9}, 237.
-
-\leavevmode\hypertarget{ref-kluyver2016jupyter}{}%
-Kluyver, T., Ragan-Kelley, B., Pérez, F., Granger, B. E., Bussonnier, M., Frederic, J., \ldots{} others. (2016). Jupyter notebooks-a publishing format for reproducible computational workflows. \emph{ELPUB}, 87--90.
-
-\leavevmode\hypertarget{ref-Systole}{}%
-Legrand, N., \& Allen, M. (2020). \emph{Systole: A python toolbox for preprocessing, analyzing, and synchronizing cardiac data}. Retrieved from \url{https://github.com/embodied-computation-group/systole}
-
-\leavevmode\hypertarget{ref-maizey2019barriers}{}%
-Maizey, L., \& Tzavella, L. (2019). Barriers and solutions for early career researchers in tackling the reproducibility crisis in cognitive neuroscience. \emph{Cortex}, \emph{113}, 357--359.
-
-\leavevmode\hypertarget{ref-neurokit1}{}%
-Makowski, D. (2020). Neurokit: A python toolbox for statistics and neurophysiological signal processing (eeg, eda, ecg, emg...). Retrieved from \url{https://github.com/neuropsychology/NeuroKit.py}
-
-\leavevmode\hypertarget{ref-marchewka2014nencki}{}%
-Marchewka, A., Żurawski, Ł., Jednoróg, K., \& Grabowska, A. (2014). The nencki affective picture system (naps): Introduction to a novel, standardized, wide-range, high-quality, realistic picture database. \emph{Behavior Research Methods}, \emph{46}(2), 596--610.
-
-\leavevmode\hypertarget{ref-pandas}{}%
-McKinney, W., \& others. (2010). Data structures for statistical computing in python. \emph{Proceedings of the 9th python in science conference}, \emph{445}, 51--56. Austin, TX.
-
-\leavevmode\hypertarget{ref-milkowski2018replicability}{}%
-Miłkowski, M., Hensel, W. M., \& Hohol, M. (2018). Replicability or reproducibility? On the replication crisis in computational neuroscience and sharing only relevant detail. \emph{Journal of Computational Neuroscience}, \emph{45}(3), 163--172.
-
-\leavevmode\hypertarget{ref-open2015estimating}{}%
-Nosek, B. A., Cohoon, J., Kidwell, M., \& Spies, J. R. (2015). Estimating the reproducibility of psychological science. \emph{Science}, \emph{349}(6251), aac4716.
-
-\leavevmode\hypertarget{ref-scikit-learn}{}%
-Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., \ldots{} Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. \emph{Journal of Machine Learning Research}, \emph{12}, 2825--2830.
-
-\leavevmode\hypertarget{ref-Quintana2016}{}%
-Quintana, D., Alvares, G. A., \& Heathers, J. (2016). Guidelines for reporting articles on psychiatry and heart rate variability (graph): Recommendations to advance research communication. \emph{Translational Psychiatry}, \emph{6}(5), e803--e803.
-
-\leavevmode\hypertarget{ref-roy2019deep}{}%
-Roy, Y., Banville, H., Albuquerque, I., Gramfort, A., Falk, T. H., \& Faubert, J. (2019). Deep learning-based electroencephalography analysis: A systematic review. \emph{Journal of Neural Engineering}, \emph{16}(5), 051001.
-
-\leavevmode\hypertarget{ref-nolds}{}%
-Schölzel, C. (2019). \emph{Nonlinear measures for dynamical systems}. Zenodo. \url{https://doi.org/10.5281/zenodo.3814723}
-
-\leavevmode\hypertarget{ref-tarvainen2014kubios}{}%
-Tarvainen, M. P., Niskanen, J.-P., Lipponen, J. A., Ranta-Aho, P. O., \& Karjalainen, P. A. (2014). Kubios hrv--heart rate variability analysis software. \emph{Computer Methods and Programs in Biomedicine}, \emph{113}(1), 210--220.
-
-\leavevmode\hypertarget{ref-topalidou2015long}{}%
-Topalidou, M., Leblois, A., Boraud, T., \& Rougier, N. P. (2015). A long journey into reproducible computational neuroscience. \emph{Frontiers in Computational Neuroscience}, \emph{9}, 30.
-
-\leavevmode\hypertarget{ref-python3}{}%
-Van Rossum, G., \& Drake, F. L. (2009). \emph{Python 3 reference manual}. Scotts Valley, CA: CreateSpace.
-
-\leavevmode\hypertarget{ref-scipy}{}%
-Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., \ldots{} Contributors, S. 1. 0. (2020). SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. \emph{Nature Methods}, \emph{17}, 261--272. \url{https://doi.org/https://doi.org/10.1038/s41592-019-0686-2}
-
-\leavevmode\hypertarget{ref-yuehong2016internet}{}%
-Yuehong, Y., Zeng, Y., Chen, X., \& Fan, Y. (2016). The internet of things in healthcare: An overview. \emph{Journal of Industrial Information Integration}, \emph{1}, 3--13.
-
-\endgroup
-
-
-\end{document}


Test patch:
diff --git a/tests/tests_hrv.py b/tests/tests_hrv.py
index e6355e0f7c..4737ad64a9 100644
--- a/tests/tests_hrv.py
+++ b/tests/tests_hrv.py
@@ -7,8 +7,8 @@
 
 
 def test_hrv_time():
-    ecg_slow = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=70, random_state=42)
-    ecg_fast = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=110, random_state=42)
+    ecg_slow = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=60, random_state=42)
+    ecg_fast = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=150, random_state=42)
 
     _, peaks_slow = nk.ecg_process(ecg_slow, sampling_rate=1000)
     _, peaks_fast = nk.ecg_process(ecg_fast, sampling_rate=1000)
@@ -27,7 +27,7 @@ def test_hrv_time():
     assert np.all(hrv_fast["HRV_pNN50"] == hrv_slow["HRV_pNN50"])
     assert np.all(hrv_fast["HRV_pNN20"] < hrv_slow["HRV_pNN20"])
     assert np.all(hrv_fast["HRV_TINN"] < hrv_slow["HRV_TINN"])
-    assert np.all(hrv_fast["HRV_HTI"] > hrv_slow["HRV_HTI"])
+    assert np.all(hrv_fast["HRV_HTI"] != hrv_slow["HRV_HTI"])
 
 
 def test_hrv_frequency():