rec_to_nwb.processing.builder.raw_to_nwb_builder
¶
Module Contents¶
Classes¶
|
Unpack data from raw folder specified by arguments, and write those data into NWB file format |
-
path
¶
-
logger
¶
-
_DEFAULT_LFP_EXPORT_ARGS
= ['-highpass', '0', '-lowpass', '400', '-interp', '0', '-userefs', '0', '-outputrate', '1500']¶
-
_DEFAULT_MDA_EXPORT_ARGS
= ['-usespikefilters', '0', '-interp', '0', '-userefs', '0']¶
-
_DEFAULT_ANALOG_EXPORT_ARGS
= []¶
-
_DEFAULT_DIO_EXPORT_ARGS
= []¶
-
_DEFAULT_SPIKE_EXPORT_ARGS
= []¶
-
_DEFAULT_TIME_EXPORT_ARGS
= []¶
-
_DEFAULT_TRODES_REC_EXPORT_ARGS
= []¶
-
class
RawToNWBBuilder
(data_path: str, animal_name: str, dates: list, nwb_metadata: MetadataManager, output_path: str = '', video_path: str = '', extract_analog: bool = True, extract_spikes: bool = False, extract_lfps: bool = False, extract_dio: bool = True, extract_mda: bool = True, overwrite: bool = True, lfp_export_args: tuple = _DEFAULT_LFP_EXPORT_ARGS, mda_export_args: tuple = _DEFAULT_MDA_EXPORT_ARGS, analog_export_args: tuple = _DEFAULT_ANALOG_EXPORT_ARGS, dio_export_args: tuple = _DEFAULT_DIO_EXPORT_ARGS, time_export_args: tuple = _DEFAULT_TIME_EXPORT_ARGS, spikes_export_args: tuple = _DEFAULT_SPIKE_EXPORT_ARGS, parallel_instances: int = 4, trodes_rec_export_args: tuple = _DEFAULT_TRODES_REC_EXPORT_ARGS)¶ Unpack data from raw folder specified by arguments, and write those data into NWB file format
- Parameters
data_path (string) – path to directory containing all experiments data
animal_name (string) – directory name which represents animal subject of experiment
dates (list of strings) – dates of experiments on above animal
nwb_metadata (MetadataManager) – object containig metadata about experiment
output_path (string) – path and name specifying where .nwb file gonna be written
video_path (string) – path to directory with video files associated to nwb file
extract_analog (boolean) – flag if analog data should be extracted and processed from raw data
extract_spikes (boolean) – flag if spikes data should be extracted and processed from raw data
extract_lfps (boolean) – flag if lfps data should be extracted and processed from raw data
extract_dio (boolean) – flag if dio data should be extracted and processed from raw data
extract_mda (boolean) – flag if mda data should be extracted and processed from raw data
overwrite (boolean) – flag if current extracted data in preprocessed folder content should be overwritten
lfp_export_args (tuple of strings) – parameters to launch lfp extraction from spikegadgets
mda_export_args (tuple of strings) – parameters to launch mda extraction from spikegadgets
dio_export_args (tuple of strings) – parameters to launch dio extraction from spikegadgets
analog_export_args (tuple of strings) – parameters to launch analog extraction from spikegadgets
spikes_export_args (tuple of strings) – parameters to launch spikes extraction from spikegadgets
time_export_args (tuple of strings) – parameters to launch time extraction from spikegadgets
trodes_rec_export_args (tuple of strings) – parameters to launch analog extraction from spikegadgets
parallel_instances (int) – number of parallel processes used during processing data
-
build_nwb
()¶
-
append_to_nwb
()¶
-
cleanup
()¶
-
__is_rec_config_valid
(self)¶ Check if XML is valid with XSD file
-
__get_header_path
(self)¶
-
build_nwb
(self, process_mda_valid_time=True, process_mda_invalid_time=True, process_pos_valid_time=True, process_pos_invalid_time=True)¶ Builds nwb file for experiments from given dates.
- Parameters
process_mda_valid_time (boolean) – True if the mda valid times should be build and append to nwb. Need the mda data inside the nwb. (default True)
process_mda_invalid_time (boolean) – True if the mda invalid times should be build and append to nwb. Need the mda data inside the nwb. (default True)
process_pos_valid_time (boolean) – True if the pos valid times should be build and append to nwb. Need the pos data inside the nwb. (default True)
process_pos_invalid_time (boolean) – True if the pos invalid times should be build and append to nwb. Need the pos data inside the nwb. (default True)
-
__preprocess_data
(self)¶ process data with rec_to_binaries library
-
static
append_to_nwb
(nwb_builder, process_mda_valid_time, process_mda_invalid_time, process_pos_valid_time, process_pos_invalid_time)¶ Append to NWBFile that was build using NWBFileBuilder passed in parameter.
- Parameters
nwb_builder (NWBFileBuilder) – Builder that created NWBFile you want to append to
process_mda_valid_time (boolean) – If true, build and inject into NWB mda valid times
process_mda_invalid_time (boolean) – If true, build and inject into NWB mda invalid times
process_pos_valid_time (boolean) – If true, build and inject into NWB pos valid times
process_pos_invalid_time (boolean) – If true, build and inject into NWB pos invalid times
-
cleanup
(self)¶ Remove all temporary files structure from preprocessing folder