Skip to content

Commit

Permalink
Merge pull request #21 from yardenmezi/docs-update
Browse files Browse the repository at this point in the history
Docs update
  • Loading branch information
yardenmezi authored Dec 31, 2024
2 parents a2dc5da + 61b4d5e commit 4e8b123
Show file tree
Hide file tree
Showing 25 changed files with 346 additions and 173 deletions.
3 changes: 3 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{{ name | escape | underline}}

.. currentmodule:: {{ module }}
.. tip::
|{{ name }}|


.. autoclass:: {{ objname }}
:members:
Expand Down
6 changes: 5 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ API Reference
.. toctree::
:maxdepth: 2

base
pipeline

.. toctree::
:hidden:

base
4 changes: 4 additions & 0 deletions docs/base/sleepeegpy.base.BaseEventPipe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

.. currentmodule:: sleepeegpy.base

.. tip::
|BaseEventPipe|


.. autoclass:: BaseEventPipe
:members:
:show-inheritance:
Expand Down
4 changes: 4 additions & 0 deletions docs/base/sleepeegpy.base.BaseHypnoPipe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

.. currentmodule:: sleepeegpy.base

.. tip::
|BaseHypnoPipe|


.. autoclass:: BaseHypnoPipe
:members:
:show-inheritance:
Expand Down
4 changes: 4 additions & 0 deletions docs/base/sleepeegpy.base.BasePipe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

.. currentmodule:: sleepeegpy.base

.. tip::
|BasePipe|


.. autoclass:: BasePipe
:members:
:show-inheritance:
Expand Down
4 changes: 4 additions & 0 deletions docs/base/sleepeegpy.base.SpectrumPlots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

.. currentmodule:: sleepeegpy.base

.. tip::
|SpectrumPlots|


.. autoclass:: SpectrumPlots
:members:
:show-inheritance:
Expand Down
29 changes: 26 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import inspect
import shutil
from pathlib import Path

sys.path.insert(0, os.path.abspath('./notebooks'))
sys.path.append(os.path.abspath(".."))

project = "sleepeegpy"
Expand All @@ -29,7 +29,31 @@
"sphinx.ext.linkcode",
"sphinx.ext.autosummary",
"myst_nb",
"nbsphinx",
]
html_logo = "sleepEEGpy.png"

rst_epilog = """
.. |AbstractClass| replace:: 🚨 **Abstract Class** -
This class is **abstract** and cannot be used directly.
Subclass it and implement the required methods.
.. |ExamplePipe| replace:: 💡 **Usage Examples** -
See the notebook for usage examples and code snippets:
.. |CleaningPipe| replace:: |ExamplePipe| :doc:`/notebooks/1_cleaning`
.. |ICAPipe| replace:: |ExamplePipe| :doc:`/notebooks/2_ica`
.. |SpectralPipe| replace:: |ExamplePipe| :doc:`/notebooks/4_spectral`
.. |GrandSpectralPipe| replace:: |ExamplePipe| :doc:`/notebooks/5_grand spectral`
.. |SpindlesPipe| replace:: |ExamplePipe| :doc:`/notebooks/6_spindles`
.. |SlowWavesPipe| replace:: |ExamplePipe| :doc:`/notebooks/7_slow_waves`
.. |RapidEyeMovementsPipe| replace:: |ExamplePipe| :doc:`/notebooks/8_rems`
.. |BasePipe| replace:: |AbstractClass|
.. |BaseEventPipe| replace:: |AbstractClass|
.. |BaseHypnoPipe| replace:: |AbstractClass|
.. |SpectrumPlots| replace:: |AbstractClass|
"""

nb_execution_mode = "off"
# autosummary_generate = False
Expand All @@ -42,8 +66,7 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "furo"
html_static_path = ["_static"]
html_theme = 'sphinx_rtd_theme'

intersphinx_mapping = {
"mne": ("https://mne.tools/stable/", None),
Expand Down
86 changes: 79 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,90 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to sleepeegpy's documentation!
================================================
sleepeegpy
==========

**sleepeegpy** is a high-level package built on top of several powerful libraries, including:

- `MNE-python <https://mne.tools/stable/index.html>`_ for electrophysiological data analysis
- `yasa <https://raphaelvallat.com/yasa/build/html/index.html>`_ for sleep staging and analysis
- `PyPREP <https://pyprep.readthedocs.io/en/latest/>`_ for preprocessing EEG data
- `specparam (fooof) <https://fooof-tools.github.io/fooof/>`_ for spectral analysis and parameter estimation

This package is designed to streamline the preprocessing, analysis, and visualization of sleep EEG data.

Additionally, the repository includes a Jupyter notebook demonstrating how to use this package, along with a ready-made workflow for common use cases.

.. image:: https://github.com/user-attachments/assets/f26c2023-44fc-48d7-ba72-d0de89a5dcee
:alt: sleepeegpy workflow

API Reference
===============
.. toctree::
:maxdepth: 1

notebooks
api

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Installation
============

Prerequisites
-----
Before installing, ensure that you have a compatible version of Python installed:

- **Python Version**: `Python <https://www.python.org/downloads/>`_ version >3.9 and <3.12.

Steps
-----
Follow these steps to install and set up **sleepeegpy**:

1. **Create a Python Virtual Environment**:
First, create a Python virtual environment. For more information, refer to:

- `venv <https://docs.python.org/3/tutorial/venv.html>`
- `virtualenv <https://virtualenv.pypa.io/en/latest/user_guide.html>`
- `conda <https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`

2. **Activate the Environment**

3. **Install sleepeegpy**:
Run the following command to install **sleepeegpy**:

.. code-block:: bash
pip install sleepeegpy
Usage Example
=============

The included notebooks are a great way to get started with **sleepeegpy**. They provide examples and instructions for using the package in common workflows.

Steps to Use the Notebooks
------------------
1. **Download the Notebooks**:
Download the zip folder of this repository by clicking `Download <https://github.com/NirLab-TAU/sleepeegpy/archive/refs/heads/main.zip>`_. You will only need the notebooks folder.

2. **Run Jupyter**:
Navigate to the "Pipeline Notebooks" folder and start Jupyter:

.. code-block:: bash
jupyter notebook
3. **Open the Complete Pipeline Notebook**:
Open the `complete_pipeline` notebook using Jupyter Notebook within the activated environment and follow the instructions provided in the notebook.

RAM Requirements
================

For high-density EEG recordings (256 channels) downsampled to 250 Hz, you will need at least 64 GB of RAM for tasks such as data cleaning, spectral analysis, and event detection.

Citation
========

To cite **sleepeegpy** in your research, please use the following references:

1. Belonosov, G., Falach, R., Schmidig, J.F., Aderka, M., Zhelezniakov, V., Shani-Hershkovich, R., Bar, E., Nir, Y. "SleepEEGpy: A Python-based software package to organize preprocessing, analysis, and visualization of sleep EEG data." bioRxiv (2023). doi: `https://doi.org/10.1101/2023.12.17.572046 <https://doi.org/10.1101/2023.12.17.572046>`_

2. Belonosov, G., Falach, R., Schmidig, F., Aderka, M., Zhelezniakov, V., Shani-Hershkovich, R., Bar, E., & Nir, Y. (2024). SleepEEGpy: A Python-based package for preprocessing, analysis, and visualization of sleep EEG data [Dataset]. Zenodo. `https://doi.org/10.5281/ZENODO.13903088 <https://doi.org/10.5281/ZENODO.13903088>`_

Loading

0 comments on commit 4e8b123

Please sign in to comment.