cibrrig.archiving.backup
This module provides functionality to backup raw electrophysiological data to a specified folder. The backup is a “Frozen copy” that should be identical to the data acquired on the day of recording.
Much of the functionality of the Archiver class is deprecated but retained for legacy support.
Key features: - Handles electrophysiological (ephys), video, audio, and metadata files. - Compresses electrophysiological files using SpikeGLX, optionally removing the raw data after compression. - Supports GUI-based file selection using PyQt5 for the backup process. - Supports running the backup without a GUI through the command line. - Copies the session data to a new target location based on the recording date. - Marks the backup with a timestamp indicating when it was archived.
Attributes
Classes
Handles the backup of electrophysiological and related session data for a given subject. |
|
GUI to ask the user for the destination (Subjects path), source (run_path), and subject_ID (spikeglx run name). |
Functions
|
Entry point for the backup process. |
|
Run the backup process with a GUI. |
|
Run the backup process without a GUI, using command line arguments. |
Module Contents
- class cibrrig.archiving.backup.Archiver(keep_raw)[source]
Handles the backup of electrophysiological and related session data for a given subject.
- ephys_files_remote
Remote electrophysiological files to back up.
- Type:
list
- subjects_path
Path where the subjects’ data is stored remotely.
- Type:
Path
- run_path
Path to the local session data.
- Type:
Path
- today_path
Path to the backup directory based on the record date.
- Type:
Path
- compress_ephys_files_local()[source]
Compress local electrophysiological files before copying to archive.
- get_record_date()[source]
Get the recording date from the metadata of local electrophysiological files.
- class cibrrig.archiving.backup.RecordingInfoUI(archiver, title)[source]
Bases:
PyQt5.QtWidgets.QWidgetGUI to ask the user for the destination (Subjects path), source (run_path), and subject_ID (spikeglx run name).
- cibrrig.archiving.backup.main(local_run_path, remote_subjects_path, keep_raw, no_local_compression)[source]
Entry point for the backup process.
If no arguments are provided, the GUI will open. If both local_run_path and remote_subjects_path are provided, the process will run without the GUI.
- Parameters:
local_run_path (str) – Path to the local recording session.
remote_subjects_path (str) – Path to the remote storage location.
keep_raw (bool) – Flag to indicate whether raw data should be kept after compression.
no_local_compression (bool) – If True, use legacy remote compression behavior.
- cibrrig.archiving.backup.archive(keep_raw)[source]
Run the backup process with a GUI.
- Parameters:
keep_raw (bool) – Whether to keep raw data after compression.
- cibrrig.archiving.backup.no_gui(local_run_path, remote_subjects_path, compress_locally=True)[source]
Run the backup process without a GUI, using command line arguments.
- Parameters:
local_run_path (str) – Path to the local recording session.
remote_subjects_path (str) – Path to the remote storage location.
compress_locally (bool) – If True, compress files locally before copying. Defaults to True.