Skip to main content

CICADA Analysis

Documentation

cicada-analysis runs analyses on NWB files, without the GUI: from a Python script, the command line or YAML files. It is for users who want to analyze their data in batches, on a server, and replay a run exactly. It provides the analysis plugins and the computation library behind them (cicada-tools), and is the engine of the CICADA pipeline (BiorXiv preprint).

CICADA is three installable packages: cicada-nwb (opens NWB files), cicada-analysis (this package) and cicada-gui (desktop application). Full documentation: cicada-analysis.readthedocs.io.

Install

From PyPI:

conda create -n cicada_env python=3.11
conda activate cicada_env
pip install cicada-analysis

Or from GitLab, a given release (tag):

conda create -n cicada_env python=3.11
conda activate cicada_env
pip install "git+https://gitlab.com/cossartlab/cicada_analysis.git@0.5.0"

To upgrade:

From PyPI, the latest release:

conda activate cicada_env
pip install -U cicada-analysis

Or from GitLab, a given release: replace the tag with its version (check available releases on GitLab):

conda activate cicada_env
pip install "git+https://gitlab.com/cossartlab/cicada_analysis.git@<new_version>"

Windows: enable long paths.

Windows limits file paths to 259 characters unless long paths are enabled. Some analyses write files in sub-folders with long names, so with a results folder deep in your tree, saving can fail ("No such file or directory"). CICADA warns at the start of a run when this may happen. To remove the limit, once, as administrator:

reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f

(or Local Group Policy Editor > Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths), then restart. Otherwise, choose a results folder with a short path (e.g. C:\results). macOS and Linux have no such limit.

Quick start

An analysis runs from two YAML files: a sessions file (the NWB files) and a parameters file (the analysis and its parameter values). Each step is a command or a template script. The example uses Display activity, class CicadaDisplayRasterAnalysis.

Step 0. List the NWB files in a sessions YAML (a local folder, or a DANDI address such as dandi://000219@0.260826.1155/sub-180201-180208; -r: sub-folders too):

cicada-config sessions /path/to/nwb_folder -o sessions.yaml -r

Template script: generate_sessions_config_template.py.

Step 1. Generate the parameters file: every parameter with its default value, and the choices found in the sessions:

cicada-config params CicadaDisplayRasterAnalysis -s sessions.yaml -o params.yaml --results-path results

Template script: generate_config_template.py.

Step 2. Edit the parameters in a text editor. Each parameter is one line: its value, then after the # its type, its choices, MANDATORY if it must have a value, and its help. Only the value is read:

data_to_display: auto  # choices:['auto', 'imaging', 'spikes', 'LFPs'] | Data to display
time_slice: true  # type:bool | Plot slice of time
time_slice_end: 600  # type:int | range:0-39490 | Slice end time (seconds) | used when time_slice = True
results_path: results  # type:dir | Directory to save the results

Set the MANDATORY parameters that have no value. results_path is an existing folder (step 1 creates the one it writes) or empty (the results then go to <Downloads folder>/cicada/results).

Step 3. Run:

cicada-run -s sessions.yaml -p params.yaml

Template script: run_from_config_template.py.

Each run writes a results folder with a combined_<ClassName>_<timestamp>.yaml that records the run; replay it with cicada-run --replay combined_<ClassName>_<timestamp>.yaml (see Replaying a previous run).

No data at hand? Nine small demo NWB files are installed with the package, with the configs that make the panels of Figure 3 of the CICADA paper: see the Demo page.

Documentation

Headless workflow, plugin catalogue, writing plugins, cicada-tools and the GUI guide: cicada-analysis.readthedocs.io.

Contributing: install from a clone, upgrade, source tree

Contributing to cicada-analysis only (cicada-nwb installed from PyPI):

git clone https://gitlab.com/cossartlab/cicada_analysis.git /path/to/cicada_analysis
conda create -n cicada_env python=3.11
conda activate cicada_env
pip install -e "/path/to/cicada_analysis[dev]"

Contributing to both cicada-analysis and cicada-nwb (install cicada-nwb first: cicada-analysis then uses your local clone, whose version is within its range):

git clone https://gitlab.com/cossartlab/cicada_nwb.git /path/to/cicada_nwb
git clone https://gitlab.com/cossartlab/cicada_analysis.git /path/to/cicada_analysis
conda create -n cicada_env python=3.11
conda activate cicada_env
pip install -e "/path/to/cicada_nwb[dev]"
pip install -e "/path/to/cicada_analysis[dev]"

To upgrade a clone:

If you only cloned cicada_analysis: pull it, then update cicada-nwb from PyPI.

cd /path/to/cicada_analysis && git pull
conda activate cicada_env
pip install -U cicada-nwb

If you cloned both repos: pull each.

cd /path/to/cicada_nwb && git pull
cd /path/to/cicada_analysis && git pull

What is inside:

cicada_analysis/
├── base/                  # CicadaAnalysis (plugin base class), parameter schema and rules,
│                          # family base classes (events, groups, PSTH)
├── config/                # Headless runner (generate_config, run_from_config) and YAML I/O
├── core_analysis/         # Core plugins (standard NWB data only)
├── cicada_tools/          # Computation and figure library used by the plugins
└── demo/                  # Small demo NWB files (also the plugin test files)

Metadata

Release files for cicada-analysis 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cicada-analysis 0.5.0
File Size Uploaded Provenance Actions
cicada_analysis-0.5.0.tar.gz 73.6 MB Without provenance Details for cicada_analysis-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cicada-analysis 0.5.0
File Interpreter ABI Platform Actions
cicada_analysis-0.5.0-py3-none-any.whl Python 3 none any Details for cicada_analysis-0.5.0-py3-none-any.whl

Total release size: 147.4 MB

Release files / cicada_analysis-0.5.0.tar.gz

Download URL cicada_analysis-0.5.0.tar.gz
Size 73.6 MB
Tags Source
SHA-256 checksum
How to use checksums
084439b846f801b6fb3775866f3cbd173c50203a177718cda6f7ea7aad74a4aa
BLAKE2b-256 checksum
How to use checksums
85716e990ba5791926a118bd02bde79df7764b5bb0ba8341b79d23db6c9c9fa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / cicada_analysis-0.5.0-py3-none-any.whl

Download URL cicada_analysis-0.5.0-py3-none-any.whl
Size 73.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3e1a032ba3a89c7ad3b8e7d20be64eabe21509bc379c6a6581dc1fe4d7e209ba
BLAKE2b-256 checksum
How to use checksums
5c1c534adbf94a9f424b9e6d29e4146edd4223d14b7eaf99454d22cd13feda3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

Security for cicada-analysis 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page