Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cobrawap/pipeline/stage01_data_entry/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Having the data and metadata already in a standard format (e.g., Neo_) as used w
* Set the additional metadata for the config parameter as required (*can be revisited when writing the loading script*)

3. Create the corresponding loading script.
* Copy the ``enter_data_template.py`` in ``cobrawap/pipeline/stage01_data_entry/scripts/`` and and name it as specified in the just created config file.
* Copy the ``enter_data_template.py`` in ``cobrawap/pipeline/stage01_data_entry/scripts/`` and name it as specified in the just created config file.
* Put the script either in the same folder or in ``<configs_dir>/stage01_data_entry/scripts/`` if defined.

4. Edit the loading script.
Expand Down
40 changes: 20 additions & 20 deletions cobrawap/pipeline/stage01_data_entry/configs/config_template.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Config file for Stage 1 - Data Entry

# Name of stage, must be identical with folder name
STAGE_NAME: 'stage01_data_entry'
STAGE_NAME: "stage01_data_entry"

# The profile name is the key for this parameter configuration. Results are stored in output_path/<PROFILE>/ (output_path is defined in settings.py)
PROFILE: 'dataset_key'
PROFILE: "dataset_key"

# Name of stage output file.
STAGE_OUTPUT: 'data'
STAGE_OUTPUT: "data"

# File format in which all intermediate neo objects are stored
NEO_FORMAT: 'nix'
NEO_FORMAT: "nix"

# If True (default), the output file of a stage is created as symbolic link
# to the last block output. If False, a duplicate is created (e.g. for cloud
Expand All @@ -21,16 +21,16 @@ USE_LINK_AS_STAGE_OUTPUT: True
# To set as key-value pairs
# Name_of_dataset: /path/to/data/files/
DATA_SETS: # Note that only the first entry will be used for the pipeline!
data_name: '/path/to/data/'
data_name: "/path/to/data/"

# Name of script in scripts/ folder, handling the loading and curation
CURATION_SCRIPT: 'curate_dataset_key.py'
CURATION_SCRIPT: "curate_dataset_key.py"

# Distance between electrodes (or pixel size)
SPATIAL_SCALE: 0.05 # mm

# Rate of acquisition of data points
# Can be 'None' if information is provided in the data file
# Can be "None" if information is provided in the data file
SAMPLING_RATE: 25 # Hz

# Time slice in s
Expand All @@ -40,36 +40,36 @@ T_STOP: None

# Orientation of the recorded cortical region
# recommend top: ventral
ORIENTATION_TOP: 'ventral'
# recommended right: 'lateral' for right hemisphere, 'medial' for left hemisphere
ORIENTATION_RIGHT: 'lateral'
ORIENTATION_TOP: "ventral"
# recommended right: "lateral" for right hemisphere, "medial" for left hemisphere
ORIENTATION_RIGHT: "lateral"

TRIAL: None

# Metadata - general information (non-specific to individual channels)
# This must include an entry 'grid_size' with an int tuple
# This must include an entry "grid_size" with an int tuple
# (x-dim, y-dim). The size of this rectangual grid would thus be
# (x-dim*SPATIAL_SCALE, y-dim*SPATIAL_SCALE).
ANNOTATIONS:
experimental_lab: 'Santa Corp, Antarctica'
experimental_lab: "Santa Corp, Antarctica"
grid_size: [2, 2]
anesthetic: 'Isoflurane'
anesthetic: "Isoflurane"
#
# # Metadata - channel-wise information (e.g. coordinates, SNR, ...), can be 'None'
# # Metadata - channel-wise information (e.g. coordinates, SNR, ...), can be "None"
# # Here, the entries must be lists of the same length as the number of channels
ARRAY_ANNOTATIONS:
x_coords: [0, 0, 1, 1]
y_coords: [0, 1, 0, 1]

# Script parameters
# Here, additional parameters can be passed to the script,
# to be used to determine additional annotations or array_annotations. Can be 'None' or empty.
KWARGS: 'None'
# to be used to determine additional annotations or array_annotations. Can be "None" or empty.
KWARGS: "None"

# Plotting parameters
# These parameters are used to create an example plot to get a first view
# on the signals and ensure that the data was loaded and annotated correctly
PLOT_TSTART: 0 # float (in s) or 'None' -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or 'None' -> stopping time of the input signal is used
PLOT_CHANNELS: 'None' # int, or list of int, or 'None' -> randomly chosen channel
PLOT_FORMAT: 'png' # file extension for storing the plot
PLOT_TSTART: 0 # float (in s) or "None" -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or "None" -> stopping time of the input signal is used
PLOT_CHANNELS: "None" # int, or list of int, or "None" -> randomly chosen channel
PLOT_FORMAT: "png" # file extension for storing the plot
30 changes: 15 additions & 15 deletions cobrawap/pipeline/stage02_processing/configs/config_template.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Config file for Stage 2 - Processing

# Name of stage, must be identical with folder name
STAGE_NAME: 'stage02_processing'
STAGE_NAME: "stage02_processing"

# The profile name is the key for this parameter configuration. Results are stored in output_path/<PROFILE>/ (output_path is defined in settings.py)
PROFILE: 'dataset_key'
PROFILE: "dataset_key"

# Name of the output file
STAGE_OUTPUT: "processed_data"

# File format in which all intermediate neo objects are stored
NEO_FORMAT: 'nix'
NEO_FORMAT: "nix"

# If True (default), the output file of a stage is created as symbolic link
# to the last block output. If False, a duplicate is created (e.g. for cloud
# application, where sym-links are not supported).
USE_LINK_AS_STAGE_OUTPUT: True

# Plotting parameters
PLOT_TSTART: 0 # float (in s) or 'None' -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or 'None' -> stopping time of the input signal is used
PLOT_CHANNELS: 'None' # int or None. default 'None' -> randomly selected
PLOT_FORMAT: 'png'
PLOT_TSTART: 0 # float (in s) or "None" -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or "None" -> stopping time of the input signal is used
PLOT_CHANNELS: "None" # int or None. default "None" -> randomly selected
PLOT_FORMAT: "png"

# The block order determines which processing steps (blocks) will be applied
# and in which order. Execution order is from first to last entry.
Expand All @@ -35,9 +35,9 @@ PLOT_FORMAT: 'png'
BLOCK_ORDER: []

# To make sure that the processing blocks are always executed in the correct
# order that results from previous runs don't confound the workflow, all blocks
# order that results from previous runs do not confound the workflow, all blocks
# are rerun upon each execution. To turn this off, e.g., because the block order
# didn't change, set to False (do with care!).
# did not change, set to False (do with care!).
RERUN_MODE: True

# BLOCK - background_subtraction
Expand All @@ -51,8 +51,8 @@ MACRO_PIXEL_DIM: 2
# BLOCK - normalization
#######################
# Normalize the data (divide channels-wise) by either:
# 'mean', 'median', 'max'
NORMALIZE_BY: 'max'
# "mean", "median", "max"
NORMALIZE_BY: "max"

# BLOCK - frequency_filter
##########################
Expand All @@ -62,8 +62,8 @@ HIGHPASS_FREQUENCY: 0 # in Hz
LOWPASS_FREQUENCY: 150 # in Hz
FILTER_ORDER: 2
# filter function used in scipy backend.
# options: filtfilt’, 'lfilter’, ‘sosfiltfilt
FILTER_FUNCTION: 'sosfiltfilt'
# options: "filtfilt", "lfilter", "sosfiltfilt"
FILTER_FUNCTION: "sosfiltfilt"
# Plotting parameters for the power spectrum
PSD_FREQUENCY_RESOLUTION: 5 # in Hz
PSD_OVERLAP: 0.5
Expand All @@ -90,10 +90,10 @@ CROP_TO_SELECTION: True
MUA_HIGHPASS_FREQUENCY: 50 # in Hz
MUA_LOWPASS_FREQUENCY: 1200 # in Hz
# Rate of the logMUA signal. Must be <= the original sampling rate
# in Hz (default: 'None', takes highpass_frequency)
# in Hz (default: "None", takes highpass_frequency)
logMUA_RATE: 70
# Length of time slice (in s) to estimate the local power spectrum
# default 'None', takes minimum number of samples determined
# default "None", takes minimum number of samples determined
# by the lower bound of the frequency band
FFT_SLICE: 0.1
# PSD_OVERLAP: determined by setting in block frequency_filter
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
# Config file for Stage 3 - Trigger Detection

# Name of stage, must be identical with folder name
STAGE_NAME: 'stage03_trigger_detection'
STAGE_NAME: "stage03_trigger_detection"

# The profile name is the key for this parameter configuration. Results are stored in output_path/<PROFILE>/ (output_path is defined in settings.py)
PROFILE: 'dataset_key'
PROFILE: "dataset_key"

# Name of the stage output file
STAGE_OUTPUT: 'trigger_times'
STAGE_OUTPUT: "trigger_times"

# File format in which all intermediate neo objects are stored
NEO_FORMAT: 'nix'
NEO_FORMAT: "nix"

# If True (default), the output file of a stage is created as symbolic link
# to the last block output. If False, a duplicate is created (e.g. for cloud
# application, where sym-links are not supported).
USE_LINK_AS_STAGE_OUTPUT: True

# Plotting parameters
PLOT_TSTART: 0 # float (in s) or 'None' -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or 'None' -> stopping time of the input signal is used
PLOT_CHANNELS: 'None' # int or None. default 'None' -> randomly selected
PLOT_FORMAT: 'png'
PLOT_TSTART: 0 # float (in s) or "None" -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or "None" -> stopping time of the input signal is used
PLOT_CHANNELS: "None" # int or None. default "None" -> randomly selected
PLOT_FORMAT: "png"

# DETECTION BLOCK
#################
# Available Blocks: 'threshold', 'hilbert_phase', 'minima'
DETECTION_BLOCK: 'threshold'
# Available Blocks: "threshold", "hilbert_phase", "minima"
DETECTION_BLOCK: "threshold"

# TRIGGER FILTER
#################
# Available Blocks: 'remove_short_states'
TRIGGER_FILTER: ['remove_short_states']
# Available Blocks: "remove_short_states"
TRIGGER_FILTER: ["remove_short_states"]

# BLOCK - Threshold
###################
# Threshold method: 'fixed', 'fitted'
THRESHOLD_METHOD: 'fixed'
# Threshold method: "fixed", "fitted"
THRESHOLD_METHOD: "fixed"

# Fitting Parameters
# available fit functions: 'HalfGaussian', 'DoubleGaussian'
# available fit functions: "HalfGaussian", "DoubleGaussian"
# FirstGaussian: detects main peak (DOWN), fits Gaussian to left half, set threshold to mean + sigma*SIGMA_FACTOR
# DoubleGaussian: Fits two Gaussians, threshold = central minima, or if no second peak mean1 + sigma1*SIGMA_FACTOR
FIT_FUNCTION: 'DoubleGaussian'
FIT_FUNCTION: "DoubleGaussian"
BIN_NUM: 100
# Factor to multiply with the standard deviation
# to determine threshold
Expand All @@ -66,8 +66,8 @@ MIN_PEAK_DISTANCE: 0.28
# amplitude fraction to set the threshold detecting local maxima
MAXIMA_THRESHOLD_FRACTION: 0.5
# time window to use to set the threshold detecting local maxima (s)
# default value 'None' is meant to set the time window equal to the entire signal length
MAXIMA_THRESHOLD_WINDOW: 'None'
# default value "None" is meant to set the time window equal to the entire signal length
MAXIMA_THRESHOLD_WINDOW: "None"
# minimum time the signal must be increasing after a minima candidate (s)
MINIMA_PERSISTENCE: 0.16

Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# Config file for Stage 4 - Wave Detection

# Name of stage, must be identical with folder name
STAGE_NAME: 'stage04_wave_detection'
STAGE_NAME: "stage04_wave_detection"

# The profile name is the key for this parameter configuration. Results are stored in output_path/<PROFILE>/ (output_path is defined in settings.py)
PROFILE: 'dataset_key'
PROFILE: "dataset_key"

# Name of the output file
STAGE_OUTPUT: "waves"

# File format in which all intermediate neo objects are stored
NEO_FORMAT: 'nix'
NEO_FORMAT: "nix"

# If True (default), the output file of a stage is created as symbolic link
# to the last block output. If False, a duplicate is created (e.g. for cloud
# application, where sym-links are not supported).
USE_LINK_AS_STAGE_OUTPUT: True

# Plotting parameters
PLOT_TSTART: 0 # float (in s) or 'None' -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or 'None' -> stopping time of the input signal is used
PLOT_CHANNELS: 'None' # int or None. default 'None' -> randomly selected
PLOT_FORMAT: 'png'
PLOT_TSTART: 0 # float (in s) or "None" -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or "None" -> stopping time of the input signal is used
PLOT_CHANNELS: "None" # int or None. default "None" -> randomly selected
PLOT_FORMAT: "png"


# DETECTION BLOCK
##################
# Available Blocks: 'trigger_clustering'
DETECTION_BLOCK: 'trigger_clustering'
# Available Blocks: "trigger_clustering"
DETECTION_BLOCK: "trigger_clustering"

# ADDITIONAL PROPERTIES
#######################
# Available Blocks: 'optical_flow', 'critical_points', 'wave_mode_clustering'
# Available Blocks: "optical_flow", "critical_points", "wave_mode_clustering"
# use empty list [] for selecting none
ADDITIONAL_PROPERTIES: ['wave_mode_clustering', 'optical_flow']
ADDITIONAL_PROPERTIES: ["wave_mode_clustering", "optical_flow"]

# Trigger Clustering
######################
# Using sklearn.cluster.DBSCAN
METRIC: 'euclidean'
METRIC: "euclidean"
# eps, maximum distance between points to be neighbours
NEIGHBOUR_DISTANCE: 15
MIN_SAMPLES_PER_WAVE: 30
Expand All @@ -61,7 +61,7 @@ CONVERGENCE_LIMIT: 0.0001
GAUSSIAN_SIGMA: [0,3,3]
# Kernel filter to use to calculate the spatial derivatives.
# simple_3x3, prewitt_3x3, scharr_3x3, sobel_3x3, sobel_5x5, sobel_7x7
DERIVATIVE_FILTER: 'scharr_3x3'
DERIVATIVE_FILTER: "scharr_3x3"

# Critical Point Clustering
###########################
Expand Down Expand Up @@ -94,7 +94,7 @@ BITRATE: 20M
# displayed sampling rate, the data will be stretched or compressed to.
# If None, the inherent sampling rate is used.
FRAME_RATE: None
# 'gray', 'viridis' (sequential), 'coolwarm' (diverging), 'twilight' (cyclic)
COLORMAP: 'twilight'
PLOT_EVENT: 'wavefronts' # name of neo event to plot, default is None
MARKER_COLOR: 'r'
# "gray", "viridis" (sequential), "coolwarm" (diverging), "twilight" (cyclic)
COLORMAP: "twilight"
PLOT_EVENT: "wavefronts" # name of neo event to plot, default is None
MARKER_COLOR: "r"
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# Config file for Stage 5 - Channel-wise Wave Characterization

# Name of stage, must be identical with folder name
STAGE_NAME: 'stage05_channel_wave_characterization'
STAGE_NAME: "stage05_channel_wave_characterization"

# The profile name is the key for this parameter configuration. Results are stored in output_path/<PROFILE>/ (output_path is defined in settings.py)
PROFILE: 'dataset_key'
PROFILE: "dataset_key"

# Name of the output file
STAGE_OUTPUT: 'channel-wise_measures.csv'
STAGE_OUTPUT: "channel-wise_measures.csv"

# If True (default), the output file of a stage is created as symbolic link
# to the last block output. If False, a duplicate is created (e.g. for cloud
# application, where sym-links are not supported).
USE_LINK_AS_STAGE_OUTPUT: True

# Plotting parameters
PLOT_TSTART: 0 # float (in s) or 'None' -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or 'None' -> stopping time of the input signal is used
PLOT_CHANNELS: 'None' # int or None. default 'None' -> randomly selected
PLOT_FORMAT: 'png'
PLOT_TSTART: 0 # float (in s) or "None" -> starting time of the input signal is used
PLOT_TSTOP: 10 # float (in s) or "None" -> stopping time of the input signal is used
PLOT_CHANNELS: "None" # int or None. default "None" -> randomly selected
PLOT_FORMAT: "png"

# Wave event name
# 'wavefronts', 'wavemodes'
EVENT_NAME: 'wavefronts'
# "wavefronts", "wavemodes"
EVENT_NAME: "wavefronts"

# Measures to compute
# 'velocity_local', 'direction_local', 'inter_wave_interval_local', 'annotations'
MEASURES: ['annotations', 'velocity_local', 'direction_local', 'inter_wave_interval_local']
# "velocity_local", "direction_local", "inter_wave_interval_local", "annotations"
MEASURES: ["annotations", "velocity_local", "direction_local", "inter_wave_interval_local"]

# Velocity/Direction Local
################
# simple_3x3, prewitt_3x3, scharr_3x3, sobel_3x3, sobel_5x5, sobel_7x7
KERNEL: 'scharr_3x3'
KERNEL: "scharr_3x3"
INTERPOLATE: True
# smoothing factor for the interpolation (0 = no smoothing)
SMOOTHING: 0
Expand Down
Loading