This document describes the new compressed archive functionality implemented in the cibrrig pipeline.
The pipeline now supports compressing electrophysiological data locally before archiving, allowing processing directly from compressed .cbin files. This reduces network transfer times and storage requirements while maintaining full functionality.
- Copy uncompressed data to archive
- Compress data on archive server
- Process locally from uncompressed files
- Move processed data to working directory
- Compress data locally (.bin → .cbin)
- Copy compressed archive to backup location
- Process pipeline from compressed .cbin files
- Move processed data to working directory
# Use new compressed workflow (default)
npx_run_all_no_gui /path/to/data /path/to/working /path/to/archive
# Use legacy remote compression
npx_run_all_no_gui /path/to/data /path/to/working /path/to/archive --no_local_compression# Use new local compression (default)
backup /path/to/local/data /path/to/archive
# Use legacy remote compression
backup /path/to/local/data /path/to/archive --no_local_compressionfrom cibrrig.main_pipeline import run
from cibrrig.archiving.backup import no_gui
# New compressed workflow (default)
run(
local_path,
working_path,
archive_path,
remove_opto_artifact=False,
run_ephysQC=True,
compress_locally=True # Default
)
# Legacy workflow
run(
local_path,
working_path,
archive_path,
remove_opto_artifact=False,
run_ephysQC=True,
compress_locally=False
)
# Backup with local compression
no_gui(local_path, archive_path, compress_locally=True)- Faster backups: Compressed files transfer faster over network
- Reduced storage: Archive requires less disk space
- Same performance: spikeinterface processes .cbin files as efficiently as .bin files
- Backward compatible: Legacy workflow still available
- File formats: Supports both
.binand.cbinfiles throughout pipeline - Mixed environments: Can process sessions with mix of compressed/uncompressed files
- Existing scripts: Work unchanged (new behavior is default but transparent)
- Tools: Compatible with spikeinterface, ibl-neuropixels, and all preprocessing tools
-
backup.py
compress_ephys_files_local()- Compress files before archivingfull_archive_with_local_compression()- New workflowno_gui(compress_locally=True)- API parameter
-
main_pipeline.py
run(compress_locally=True)- API parameter- Updated CLI with
--no_local_compressionflag - Modified workflow order
-
File pattern compatibility
alf_utils.py- Searches*nidq.binand*nidq.cbinephys_data_to_alf.py- Processes*ap.binand*ap.cbinsynchronize_sorting_to_aux.py- Handles both file types
- New installations: Use compressed workflow by default
- Existing scripts: Work unchanged, get new behavior automatically
- Legacy mode: Available via
--no_local_compressionflags
Run the test suite to verify functionality:
python -m pytest tests/test_compressed_archive.py -vTests cover:
- New method functionality
- Parameter propagation
- Backward compatibility
- File type support
No migration required! The new functionality is:
- Default enabled: New behavior is the default
- Transparent: Existing code works unchanged
- Optional: Legacy behavior available via flags
- Gradual: Can migrate systems individually
Solution: Ensure spikeglx version supports .cbin files (most recent versions do)
Solution: Use --no_local_compression flag
Solution: Pipeline handles mixed environments automatically
This implementation maintains full backward compatibility while providing the requested compressed archive functionality from issue #22.