cibrrig.main_pipeline
Takes a spikeglx run and performs: 1) compression and copy backup to archive 2) Renaming to alf 3) Preprocessing 4) Spikesorting
# Gui created in part by chatgpt
Classes
Enum where members are also (and must be) ints |
|
Create a collection of name/value pairs. |
Functions
|
Check if the run path is already in ALF format |
|
Check if data is in the raw spikeglx organization, the archived subject organziation, or alf |
|
Set the status of the session |
|
Get the status of the session |
|
|
|
Main function to run the pipeline |
|
Run the main pipeline |
|
Command line interface for running the main pipeline. |
Module Contents
- class cibrrig.main_pipeline.Status[source]
Bases:
enum.IntEnumEnum where members are also (and must be) ints
- class cibrrig.main_pipeline.DataOrganization(*args, **kwds)[source]
Bases:
enum.EnumCreate a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- cibrrig.main_pipeline.check_is_alf(run_path)[source]
Check if the run path is already in ALF format
- cibrrig.main_pipeline.check_data_organization(in_path)[source]
Check if data is in the raw spikeglx organization, the archived subject organziation, or alf
raw spikeglx organization: /Subjects/<run>/<run_gate>/.nidq.bin /Subjects/<run>/<run_gate>/<run_gate_probe>/.ap.bin …
archived subject organization: /Subjects/<subject>/<date>/<run_gate>/.nidq.bin /Subjects/<subject>/<date>/<run_gate>/<run_gate_probe>/.ap.bin …
alf organization: /Subjects/<subject>/<date>/<session>/alf /Subjects/<subject>/<date>/<session>/raw_ephys_data …
- cibrrig.main_pipeline.main()[source]
Main function to run the pipeline
This function runs the pipeline for a selected run directory. It performs the following steps: 1) Backup and compress the data to the archive 2) Rename the data to ALF format 3) Extract and preprocess the auxiliary data 4) Spikesort the data 5) Move the data to the working directory
- cibrrig.main_pipeline.run(local_run_path: pathlib.Path, remote_working_path: pathlib.Path | None, remote_archive_path: pathlib.Path | None, remove_opto_artifact: bool, run_ephysQC: bool, compress_locally: bool = True)[source]
Run the main pipeline 1) Compress data locally (if compress_locally=True) 2) Backup compressed data to archive 3) Rename to ALF if not already 4) Preprocess each session 5) Spikesort each session 6) Move to working directory 7) Synchronize sorting to aux
- Parameters:
local_run_path (Path) – Path to the local run directory
remote_working_path (Path) – Path to the remote working directory
remote_archive_path (Path) – Path to the remote archive directory
remove_opto_artifact (bool) – Whether to remove opto artifact during preprocessing
run_ephysQC (bool) – Whether to run ephys QC during preprocessing
compress_locally (bool) – Whether to compress data locally before backup. Defaults to True.
- cibrrig.main_pipeline.cli(local_run_path, remote_working_path=None, remote_archive_path=None, remove_opto_artifact=False, run_ephysqc=False, no_local_compression=False)[source]
Command line interface for running the main pipeline.
- Parameters:
local_run_path (str) – Path to the data source run directory. Typically on the local computer (NPX acquisition)
remote_working_path (str) – Path to the remote working directory where uncompressed active data is stored
remote_archive_path (str) – Path to the remote archive directory where compressed freezes are stored
remove_opto_artifact (bool) – Whether to remove opto artifact during preprocessing
run_ephysQC (bool) – Whether to run ephys QC during preprocessing
no_local_compression (bool) – Whether to use legacy remote compression behavior
- Returns:
None