This repo was started to analyze loom experiments, but it eventually came to be useful for several projects. After iterating through many exploratory analysis for different datasets, this repo became bloated. I've cleaned it up by splitting off certain projects/analyses into new repositories (eg, callback-breaths; see below) and branches; what should be left here (at least in main branch) should be fairly bare-bones preprocessing code that can be used as templates for processing data.
- Some repositories which have diverged:
See INSTALL.md for installation instructions (to be done once).
See STARTUP.md for startup instructions (how to open jupyter notebooks and run
.ipynbfiles).
make_df.ipynb: given a list of supported.matfiles, creates a stimulus-aligned dataframe. Saves as a.picklefor loading into other python code and/or as multiple.csvfiles for external compatibility.callbacks.ipynb: Given pickled dfs frommake_df.ipynb, generates some useful plots and summary statistics.
Warning
Not all callbacks.ipynb plots are currently supported for evsonganaly .not.mat files due to file_info issue.
- Label calls in Evsonganaly
- Run
make_df.ipynbdirectly on output.not.matfiles.
- Label calls in DeepSqueak
- Check
callback_summaries.mfor summary information on contents.
- Check
prep_for_export.m- Transforms deepSqueak output into a python-importable .mat
make_df.ipynb
kde.ipynb: a first go at spline fitting
TODO: .mat file writeups
TODO: update data structure documentation
Each row represents one stimulus and subsequent calls.
Fields:
trial_start_s: start time of this stimulus in audio filetrial_end_s: end of trial; start time of following stimulus in audio filecalls_in_range: indices of calls in deepsqueak data that have any segment overlapping with (trial_start_s, trial_end_s); range exclusive to prevent inclusion of subsequent stimuluscall_times_stim_aligned: onset and offset time for all calls_in_range, aligned to stimulus onsetn_calls: number of calls in this trial with onset after stim onset. not necessarily len(calls_in_range) (eg, a call starts before stimulus)wav_filename: audio file containing these calls.calls_index: index of this stimulus in deepsqueak data
As in stim_trials:
trial_start_strial_end_sstim_duration_scalls_in_range
Stores call types in each
calls_index: index. index of this stimulus in deepsqueak data.- (call type columns): count of non-stimulus call types occurring during each stimulus trial (or nan, if not found in this trial).
- made dynamically, with columns only created when this call type is found in at least one file
Useful information about data source, generated in prep_for_export.m. Note: prep_for_export does some optional path corrections to account for moving between computers.
birdname: identifier for bird; see regex.block: block of experiment (int)day: day of experiment (int)mat_filename: deepsqueak output filenameprocess_date_posix: timestamp of runningprep_for_export.mwav_duration_s: duration of wav file in secondswav_filename: wav file on which deepsqueak was runwav_fs: sample rate of wav file in Hz
Added by utils.deepsqueak.multi_index_from_dict after loading by utils.deepsqueak.call_mat_stim_trial_loader. Useful when concatenating data from multiple audio files.
birdnamedayblockstims_index: # of stimulus in block