cibrrig.archiving.ephys_data_to_alf
This module reformats raw electrophysiological data to match the ALF standards used by the International Brain Laboratory (IBL). It is intended for organizing data generated by SpikeGLX. The script renames and moves files in place, so ensure that the raw data has been backed up before running the script.
Key Features: - Renames probe folders and moves video and electrophysiological data to standardized locations. - Ensures that wiring maps are correctly applied to the electrophysiological data. - Handles the renaming of multiple gates and sessions for a given run path. - Allows optional skipping of backup checks before renaming files.
Attributes
Classes
Represents a recording run consisting of multiple gates. |
Functions
|
|
|
Renames probe folders under 'raw_ephys_data' to ALF standards (e.g., 'probe00', 'probe01'). |
|
|
|
|
|
Moves and renames video files to the 'raw_video_data' directory following ALF standards. |
|
Checks if the session has been backed up by verifying the existence of a backup flag file. |
|
Removes the backup flag file from the session directory since it is not us. |
|
Retrieves the recording date from the metadata of the electrophysiological data. |
|
Extracts the gate number from the gate folder name. |
|
Ensures that the appropriate wiring map is applied to the session. If a wiring map is missing, |
|
Moves .nidq files to the 'raw_ephys_data' directory. |
|
Renames and organizes a session by: |
|
Runs the renaming and reorganization process for a given run. |
|
Command-line interface to run the renaming and reorganization process. |
Module Contents
- cibrrig.archiving.ephys_data_to_alf.rename_probe_folders(session_path)[source]
Renames probe folders under ‘raw_ephys_data’ to ALF standards (e.g., ‘probe00’, ‘probe01’).
- Parameters:
session_path (Path) – The path to the session directory.
- Returns:
List of renamed probe paths.
- Return type:
list
- cibrrig.archiving.ephys_data_to_alf.rename_nested_probes(session_path, raw_ephys_folder, ap_bin_files)[source]
- cibrrig.archiving.ephys_data_to_alf.rename_flat_probe(session_path, raw_ephys_folder, ap_bin_files)[source]
- cibrrig.archiving.ephys_data_to_alf.rename_and_move_video(session_path)[source]
Moves and renames video files to the ‘raw_video_data’ directory following ALF standards.
- Parameters:
session_path (Path) – The path to the session directory.
- cibrrig.archiving.ephys_data_to_alf.check_backup_flag(session_path)[source]
Checks if the session has been backed up by verifying the existence of a backup flag file.
- Parameters:
session_path (Path) – The path to the session directory.
- Raises:
AssertionError – If the backup flag file does not exist.
- cibrrig.archiving.ephys_data_to_alf.remove_backup_flag(session_path)[source]
Removes the backup flag file from the session directory since it is not us.
- Parameters:
session_path (Path) – The path to the session directory.
- cibrrig.archiving.ephys_data_to_alf.get_record_date(gate)[source]
Retrieves the recording date from the metadata of the electrophysiological data.
- Parameters:
gate (Path) – The path to the gate directory.
- Returns:
The recording date in YYYY-MM-DD format.
- Return type:
str
- cibrrig.archiving.ephys_data_to_alf.get_gate_number(gate)[source]
Extracts the gate number from the gate folder name.
- Parameters:
gate (Path) – The path to the gate directory.
- Returns:
The gate number.
- Return type:
int
- cibrrig.archiving.ephys_data_to_alf.check_wiring(session_path)[source]
Ensures that the appropriate wiring map is applied to the session. If a wiring map is missing, it uses the default map.
- Parameters:
session_path (Path) – The path to the session directory.
- cibrrig.archiving.ephys_data_to_alf.move_ni_files(session_path)[source]
Moves .nidq files to the ‘raw_ephys_data’ directory.
- Parameters:
session_path (Path) – The path to the session directory.
- cibrrig.archiving.ephys_data_to_alf.rename_session(session_path)[source]
Renames and organizes a session by: - Renaming probe folders. - Moving .nidq files. - Checking and applying wiring maps. - Renaming and moving electrophysiological and video data. - Removing the backup flag.
- Parameters:
session_path (Path) – The path to the session directory.
- class cibrrig.archiving.ephys_data_to_alf.Run(run_path)[source]
Represents a recording run consisting of multiple gates.
- gates
List of gate directories within the run.
- Type:
list
- get_gates()[source]
Finds all gate directories in the run directory and stores them in sorted order.