Slow Wave Analysis Pipeline
Integrating multiscale data in a reproducible and adaptable pipeline
What can I find here?
...
Who has access?
Describe the audience of this collab.
Executing the pipeline
in the collab (beta)
- Edit the config files
Each stage has a config file to specify which analysis/processing blocks to execute and which parameters to use. General and specific information about the blocks and parameters can found in the README and config files. The default values are set for an example dataset (ECoG, anesthetized mouse, IDIBAPS [ref]).- stage01_data_entry: [README.md](), [config.yaml]()
- stage02_preprocessing: [README.md](), [config.yaml]()
- stage03_trigger_detection: [README.md](), [config.yaml]()
- stage04_wavefront_detection: [README.md](), [config.yaml]()
- stage05_wave_characterization: [README.md](), [config.yaml]()
- Start a Jupyter Hub instance
copy the URL below in a separate browser page
jupyterhub-preview.apps-dev.hbp.eu
- Follow the notebook
In the jupyter hub, navigate to `drive/Shared with groups/Slow Wave Analysis Pipeline/pipeline/showcase_notebooks/run_snakemake_in_collab.ipynb`.
Follow the notebook to install the required packages into your Python kernel, set the output path, and execute the pipeline with snakemake. - Coming soon
- Use of KnowledgeGraph API
- Provenance Tracking
- HPC support
locally
- Get the code
The source code of the pipeline is available via Github: [INM-6/wavescalephant]('https://github.com/INM-6/wavescalephant') and can be cloned to your machine ([how to use Github]()).
- Build the Python environment
In the wavescalephant repository, there is an environment file (`pipeline/envs/wavescalephant_env.yaml`) specifying the required packages and versions. To build the environment, we recommend using *conda* ([how to get started with conda]()).
`conda env create --file /envs/wavescalephant_env.yml`.
- Edit the settings
The settings file specifies the path to the output folder, where results are saved to. Open the template file `pipeline/settings_template.py`, set the `output_path` to the desired path, and save it as `pipeline/settings.py`.
- Edit the config files
Each stage has a config file to specify which analysis/processing blocks to execute and which parameters to use. Edit the config template files `pipeline/stageXX_<stage_name>/config_template.yaml` according to your dataset and analysis goal, and save them as `pipeline/stageXX_<stage_name>/config.yaml`. A detailed description of the available parameter settings and their meaning is commented in the template files, and a more general description of the working mechanism of each stage can be found in the respective README file `pipeline/stageXX_<stage_name>/README.md`.
- Enter a dataset
see `pipeline/stage01_data_entry/README.md`
- Run the pipeline (-stages)
To run the pipeline with snakemake ([intro to snakemake]()) activate the Python environment `conda activate wavescalephant_env`, make sure you are in the working directory `pipeline/`, and call `snakemake` to run the entire pipeline.
To (re-)execute an individual stage, you can navigate to the corresponding stage folder and call the `snakemake` command there. For running an individual stage, you may need to manually set the path for input file for the stage (i.e. the output file of the previous stage) in the config file `INPUT: /path/to/file`.
Accessing and using the results
All results are stored in the path specified in the `settings.py` file. The folder structure reflects the structuring of the pipeline into stages and blocks. All intermediate results are stored as `.nix` files using the Neo data format ([Neo]()) and can be loaded with `neo.NixIO('/path/to/file.nix').read_block()` ([documentation]()).
Additionally, most blocks produce a figure, and each stage a report file, to give an overview of the execution log, parameters, intermediate results, and to help with debugging.
The final stage (*stage05_wave_characterization*) stores the results as pandas.DataFrames ([pandas]()) in `.csv` files, separately for each measure as well as in a combined dataframe for all measures.
References
Acknowledgments
This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union’s Horizon 2020 Framework Programme for Research and Innovation
under the Specific Grant Agreement No. 785907 (Human Brain Project SGA2).