Wiki source code of Slow Wave Analysis Pipeline

Version 15.2 by epastorelli on 2020/01/20 14:08

Hide last authors
robing 1.1 1 (% class="jumbotron" %)
2 (((
3 (% class="container" %)
4 (((
robing 9.1 5 = (% style="color:inherit" %)Slow Wave Analysis Pipeline(%%) =
robing 1.1 6
robing 9.1 7 = (% style="color:inherit; font-size:24px" %)Integrating multiscale data in a reproducible and adaptable pipeline(%%) =
robing 1.1 8 )))
9 )))
10
11 (% class="row" %)
12 (((
13 (% class="col-xs-12 col-sm-8" %)
14 (((
15 = What can I find here? =
16
robing 10.1 17 ...
robing 1.1 18
19 = Who has access? =
20
21 Describe the audience of this collab.
robing 6.1 22
robing 10.1 23 == Executing the pipeline ==
robing 6.1 24
robing 10.1 25 [[image:pipeline_flowchart.png]]
robing 6.1 26
robing 10.1 27 === in the collab (beta) ===
robing 8.1 28
robing 10.1 29 * **Edit the config files**
30 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]).
31 ** stage01_data_entry: [README.md](), [config.yaml]()
32 ** stage02_preprocessing: [README.md](), [config.yaml]()
33 ** stage03_trigger_detection: [README.md](), [config.yaml]()
34 ** stage04_wavefront_detection: [README.md](), [config.yaml]()
35 ** stage05_wave_characterization: [README.md](), [config.yaml]()
36
pierstanpaolucci 15.1 37 * **Start a Jupyter Hub instance (copy the URL below in a separate browser page)**
robing 13.1 38 [[jupyterhub-preview.apps-dev.hbp.eu>>jupyterhub-preview.apps-dev.hbp.eu]]
robing 10.1 39
40 * **Follow the notebook**
robing 14.1 41 In the jupyter hub, navigate to `drive/Shared with groups/Slow Wave Analysis Pipeline/pipeline/showcase_notebooks/run_snakemake_in_collab.ipynb`.
robing 10.1 42 Follow the notebook to install the required packages into your Python kernel, set the output path, and execute the pipeline with snakemake.
43 * **Coming soon**
44 ** Use of KnowledgeGraph API
45 ** Provenance Tracking
46 ** HPC support
47
48 === locally ===
49
50 * **Get the code**
51 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]()).
52
53 * **Build the Python environment**
54 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]()).
epastorelli 15.2 55 `conda env create ~-~-file /envs/wavescalephant_env.yml`.
robing 10.1 56
57 * **Edit the settings**
58 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`.
59
60 * **Edit the config files**
61 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`.
62
63 * **Enter a dataset**
64 see `pipeline/stage01_data_entry/README.md`
65
66 * **Run the pipeline (-stages)**
67 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.
68 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`.
69
70 == Accessing and using the results ==
71
72 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]()).
73 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.
74 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.
75
76 == References ==
77
78
79 == Acknowledgments ==
80
81 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
82 under the Specific Grant Agreement No. 785907 (Human Brain Project SGA2).
robing 1.1 83 )))
84
85
86 (% class="col-xs-12 col-sm-4" %)
87 (((
88 {{box title="**Contents**"}}
89 {{toc/}}
90 {{/box}}
91
92
93 )))
94 )))