Stage 01 - Data Entry¶
This stage handles the loading and representation of the input dataset and metadata into the standard format for the pipeline.
Input¶
A dataset containing neural activity signals simultaneously recorded from channels (electrodes/pixels) laying on a grid. This includes data from various signal modalities from various measurement techniques or simulations. See required data capabilities and metadata below.
Furthermore it requires a (custom) loading script to load the dataset and bring it into the required representation. See guide to create loading script from a template below.
Output¶
The input data and metadata represented in the Neo format. Concretely, a neo.Block and Segment object containing an AnalogSignal object containing all signal channels (additional AnalogSignal objects are ignored) with at least
array_annotations:
x_coordsandy_coordsspecifying the integer position on the channel grid;annotations:
spatial_scalespecifying the distance between electrodes/pixels asquantities.Quantityobject.
Any additional metadata and neo objects in the neo.Block passed along through the pipeline and may complement the final pipeline output.
should pass check_input.py
Required Data Capabilities¶
What kind of data can go into the pipeline?
It needs to exhibit propagating wave-like activity, for example, in the form of spatially organized transitions between Up and Down states (slow waves) or spatially phase-shifted field potential oscillations.
Channels (electrodes/pixels) must be regularly spaced on a rectangular grid, which can include empty sites.
Required Metadata¶
- Minimum metadata (required, for a correct processing of the data)
Sampling rate of the signals (set as attribute of
AnalogSignal)Distance between channels (
quantities.Quantityobject set as annotationspatial_scaleinAnalogSignal)Relative spatial location of channels (
intarrays as array_annotationsx_coordsandy_coordsinAnalogSignal)
- Recommended metadata (desired, for a correct interpretation of the results)
Identifier/source of the dataset
Units of AnalogSignal
Anatomical orientation of the recorded region
Absolute cortical positioning of the electrodes
Type and dosage (or estimated level) of anesthetic
Species and general animal information
Information on artifacts and erroneous signals
Any additional protocols or events (e.g. stimulation) influencing the signals
Entering Datasets Into Cobrawap¶
Datasets can be very different. Therefore, it usually requires a custom loading script to access the data and bring it into a standard representation that can be used by the pipeline. Having the data and metadata already in a standard format (e.g., Neo) as used within the pipeline) makes this step easier. Similar datasets which, for example, come from the same experiment may be able to use the same loading script.
- Put the dataset somewhere accessible.
It should be accessible from where the pipeline is intended to run (i.e. local machine, compute cluster, …)
- Create the corresponding config file.
Rename the
config_template.yamlinstage01_data_entry/configs/toconfig_<data-name>.yaml. This can be either within thecobrawap/pipelinefolder or your<configs_dir>/specified insettings.py.Set the path to the dataset for
DATA_SETSas<data-name>: '/path/to/data/'.Set the name of the loading script for
CURATION_SCRIPT(will be created in the next step).Set the additional metadata for the config parameter as required (can be revisited when writing the loading script)
- Create the corresponding loading script.
Copy the
enter_data_template.pyincobrawap/pipeline/stage01_data_entry/scripts/and 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.
- Edit the loading script.
Write a loading routine for your data type. Also, check whether there is a neo IO function to load the data directly into the neo structure.
Follow along the template to create a neo structure with a
neo.Block,Segment, andAnalogSignalcontaining all signal channels. You may use the utility functionsmerge_analogsignals()when each channel is loaded as as separateAnalogSignal, or the functionimagesequence_to_analogsignal()when loading imaging data as anImageSequenceobject.As outlined in the template add the required metadata (and extra metadata) as
annotationsandarray_annotationsto theAnalogSignalobject. When some metadata is not loaded with the data object, it can be specified in the config file (inANNOTATIONS,ARRAY_ANNOTATIONS, as well asKWARGS) to be available in the loading script and added manually to theAnalogSignalobject.
- Test and debug the loading script.
Follow the instructions in the pipeline README to execute the pipeline or only stage 1.
After the execution of the
enter_datablock, the created data object is automatically checked whether it adheres to the pipeline’s requirements via thecheck_inputblock.Even when there is no error in the execution, inspect the results for correctness in
<output_path>/stage01_data_entry/.
Blocks¶
Utility Blocks (fixed)¶
Check whether the input data representation adheres to the stage's requirements. |
|
Loads a dataset and brings it into the required data representation (using Neo). |
|
Plots excerpts of the input data with its corresponding metadata. |