Skip to content

nigeLab_defaults

Max_KUMC_Desktop edited this page Aug 6, 2020 · 2 revisions

+defaults

Functions for customizing +nigeLab based on your workflow

Table of +defaults Functions

Animal.m AutoClustering.m Block.m doActions.m
Event.m Experiment.m Filt.m LFP.m
nigelColors.m Notifications.m Plot.m Probe.m
Queue.m SD.m Shortcuts.m Sort.m
Sync.m Tank.m TDT.m Tempdir.m
Video.m

+defaults Summaries

Has a few fields for initializing nigeLab.Animal that are primarily used in the constructor or during the nigeLab.Tank/addAnimal() method.

  • Click here for a list of all parameters and more-detailed explanations.

This contains the parameters controlling nigeLab.Block/doAutoClustering() method for aggregating spikes detected on the same channel into "clusters" based on the similarity of the filtered extracellular waveform in short (~1-2 ms) epochs around the detected spike peak. Because different parameters are associated with different methods for automated clustering, there is a "special" +AutoClustering package as well. It currently (2020-01-02) contains parameters for two clustering methods (which are selected by pars.MethodName in ~/+defaults/AutoClustering.m):

  • 'KMEANS': Typically this runs more-quickly. Generates pars.MaxNClus (currently, 9) clusters using k-means.
    • Click here for a list of parameters and more-detailed explanations.
  • 'SPC': Can take substantially longer depending on parameters. Has many parameters.
    • Click here for a list of parameters and more-detailed explanations.

This is where most of the necessary parameter defaults are set (they relate to Block objects, which are the main class used to link data in nigeLab). Importantly, both Fields and FieldType are configured here, as well as File Types. FileNames and FolderNames must contain the same number of elements as the previous variables; they are used in setting up the Block disk file hierarchy. The TAG variable is a struct that configures how naming conventions are parsed elsewhere, but probably shouldn't be changed.

  • Click here for a list of all parameters and more-detailed explanations.

This is used by the nigeLab.Block/checkActionIsValid() method to return "dependencies" for doActions. Each parameter (field) is the name of some doMethod. Each field contains a struct with the following fields:

  • 'required' : cell array of fields that must evaluate to 'true' from nigeLab.Block/updateParams() method. Otherwise, that doMethod will throw an error when called.
  • 'enabled' : true or false. If false, will be greyed out in the nigelDash context-menu that appears when right-clicking a Block to run a doMethod.
  • Click here for a list of all parameters and more-detailed explanations.

This is where parameters are configured for members of the Events FieldType.

  • Click here for details about how to configure the relevant variables.
  • Click here for a list of all parameters and more-detailed explanations.

This is where parameters that are ubiquitous to your experimental workflow (such as relating to the default acquisition system in use at your lab, which may be less-likely to change than other parameters). It also contains the parameter pars.File, which by default points to 'Experiment.txt' (also located in ~/+defaults/). This file provides a "default" template for initializing experimental metadata that can be entered with nigeLab.libs.NotesUI via the nigeLab.Block/takeNotes() method. To create other default files, just make a text file in the same location (see: parsing Notes metadata), and then change pars.File to the name of that file instead. In this way, you can have several different "default notes" templates (they do not even have to be in ~/+defaults/, but if you do not put them there make sure you specify the full filename to the template instead of just the name of the file).

  • Click here for a list of all parameters and more-detailed explanations.

This is where the unit band-pass filter parameters are set and where the filter is created according to the sample rate used by your acquisition system. By default, the created filter is an elliptical IIR band-pass filter with the pass band for the design set between 300 Hz to 3000 Hz, stop-band attenuation set to 70 dB, and pass-band ripple set to 0.1 dB.

  • Click here for a list of all parameters and more-detailed explanations.

LFP.m

The only settings here relate to the cascaded anti-aliasing low-pass filters that are applied during the decimation of local field potential (LFP) signals (since in that case, we are only interested in signals that are substantially less than 1,000 Hz, but most signals are acquired at 20 or 30 kHz). As such, the only two parameters to change are:

  • pars.DecimateCascadeM = [5 3 2]
    • Each element corresponds to a decimation factor. For 3-elements, the signal will be decimated 3 times (in this case: first by a factor of 5, then by a factor of 3, then by a factor of 2, yielding a 30-times decimated signal).
  • pars.DecimateCascadeN = [3 5 5]
    • Each element matches the corresponding element from pars.DecimateCascadeM and indicates the Chebyshev low-pass filter order to use for anti-aliasing.
    • If you are having trouble with pass-band ripple in the LFP, you can add more cascaded elements to reduce the filter order here during decimation (but I think this is unlikely to need changes).

nigelColors.m

Please do not change the colors! Nigel would be sad! In all seriousness, this is just where different colors are defined so that the color scheme for different UI elements is "standardized." So instead of arbitrarily defining a shade of green for one UI and then using a slightly different one elsewhere, it is better to just to use this function for reference (for example, if you want green):

col = nigeLab.defaults.nigelColors('g');
fig = figure('Color',col); % Uses standard "green"

To see a list of all color shortcuts, enter:

nigeLab.defaults.nigelColors('help');

Parameters for notifying the end-user via the Command Window or "progress" interfaces are located here. There are also some parameters, such as pars.DBLoc and pars.DBFile that are for troubleshooting and debugging on the Remote if needed. It should be unlikely that there is much need to change parameters in this file frequently.

  • Click here for a list of all parameters and more-detailed explanations.

This contains parameters for use with various kinds of graphical plot methods. It may be removed in the future and replaced with something more specific, depending on how development of those methods goes.

  • Click here for a list of all parameters and more-detailed explanations.

There are not very many parameters to change here, but one that may change depending on your local machine configuration is pars.ElectrodesFolder, which is the folder containing probe configuration files used for all recordings. The general strategy is that the probe meta-data (e.g. the ProbeID) is associated with each recording in some way (this can be done using the nigeLab.libs.NotesUI in nigeLab.Block/takeNotes(), for example). The ProbeID then allows you to associate a probe configuration file with a specific nigeLab.Block. A default Probes.xlsx file is provided in ~/+defaults/ to show what a probe configuration file might look like. This file is also used as the default in initializing new probe configuration files when the metadata parsing cannot find a probe matching the ProbeID associated with your nigeLab.Block.

For more information, click here to read about setting up probe configuration files and how this information is associated with your data.

  • Click here for a list of all parameters and more-detailed explanations.

This is really only important if you are taking advantage of the Matlab Parallel Processing and Distributed Computing toolboxes. If you would like to run everything serially, just change pars.UseParallel to false and pars.UseRemote to false. We use nigeLab to run some of the more memory-intensive methods (doRawExtraction and doAutoClustering being the chief use-cases) on the University of Kansas Medical Center Isilon computing cluster. If you have access to the Isilon and would like to use nigeLab, then pars.UNCPath.RecDir and pars.UNCPath.SaveLoc must be configured here to reflect your internal mapping to the Isilon drives. You also may have a different naming convention for the Matlab Job Server(s) that run the remote job queue; in that case, you will need to change pars.ClusterList to reflect the job server names.

  • Click here for a list of all parameters and more-detailed explanations.

Spike-detection parameter defaults are set here. With no re-configuration, the default spike detection uses a threshold-based peak-finding strategy on the smoothed nonlinear energy operator (SNEO). The current auto-clustering strategy uses the wavelet-based super-paramagnetic clustering algorithm developed by the Quiroga Lab, but has not been configured in our code to return optimal cluster groupings. Other options can be set according to comments next to each field of the pars struct in nigeLab.defaults.SD.

"Shortcuts" for making indexing expressions more compact are enumerated here. Please don't change these settings, as modifications can cause terrible problems with the overloaded nigeLab.Block/subsref() and nigeLab.Block/subsasgn() methods. In general, these allow more compact expressions, such as:

blockObj = nigeLab.Block(); % Make Block
blockObj.doRawExtraction(); % Extract raw data
% Get samples 17 to 250 of channel-3:
data = blockObj.Channels(3).Raw.data(17:250); 
% This also works:
data = blockObj.raw(3,17:250); % convenient
  • If you still would like to make changes to Shortcuts.m, click **here.

This function contains defaults associated with nigeLab.Sort(), the modular spike-sorting interface. It is most-likely that you would only want to change the following parameters to make it more convenient for your local machine:

  • pars.InFileDefDir: this can be changed to your preferred "default Block location"

  • pars.TagOpts: you may have other qualitative tags you prefer to associate with your clusters. Add or change those as elements of this cell array.

  • Click here for a list of all parameters and more-detailed explanations.

(WIP: This may contain more parameters when the nigeLab.Block/alignVideoLED() is implemented. For now it only has pars.DeBounce (debounce time in milliseconds), and pars.ID which I am pretty sure is deprecated)

Like ~/+defaults/Animal.m, this function does not contain too many parameters. You may find it useful to modify pars.DefaultSaveLoc and pars.DefaultTankLoc to reflect your local machine's paths.

  • Click here for a list of all parameters and more-detailed explanations.

Because some TDT circuits have different stream naming conventions, this file was created to allow more flexibility in parsing experimental data acquired using the TDT system specifically.

  • Click here for a list of all parameters and more-detailed explanations.

Tempdir.m

This is more of a utility than anything; basically it just makes sure that the folder temp exists at the same level as ~/+defaults/ (in case an algorithm that creates files in that location is run on a new repository, for example).

Defaults for parsing VidStreams (Videos FieldType) are set in this file. At a high-level, it is important that the dynamic variables (and associated data) parsed from your video file naming convention match up to those parsed from your Block naming convention, or nigeLab will not be able to associate the correct video files to your electrophysiological recordings. Click here for details about how to configure the relevant variables.

  • Click here for a list of all parameters and more-detailed explanations.
Clone this wiki locally