neurochat.nc_config module

This module implements Configuration Class for NeuroChaT software.

@author: Md Nurul Islam; islammn at tcd dot ie

class neurochat.nc_config.Configuration(filename=[])[source]

Bases: object

The Configuration object is the placeholder for all NeuroChaT settings.

The object consists of specification of data and analysis along with the parameters for each analysis type.

It also facilitates saving these setting to a .ncfg file and retriving them from the .ncfg file. The .ncfg file is a YAML-formatted file.

filename

Full file name of the configuration storage (.ncfg)

Type:str
format

Recording system or format of the data file

Type:str
analysis_mode

Mode of analysis in NeuroChaT. Options are ‘Single Unit’, ‘Single Session’ and ‘Listed Units’

Type:str
mode_id

Numeric ID of modes in NeuroChaT Respectively 0, 1, and 2 for the three modes

Type:int
graphic_format

File format for output graphics. Options are ‘PDF’ or ‘Postscript’

Type:str
unit_no

Unit number to be analyzed. Used in ‘Single Unit’ mode

Type:int
spatial_file

Full file of the spatial dataset

Type:str
spike_file

Full file of the spike dataset

Type:str
lfp_file

Full file of the lfp dataset

Type:str
nwb_file

Full file of the NWB format dataset

Type:str
excel_dir

Full file of the Excel list of unit. Used only in ‘Listed Units’ mode

Type:str
analyses

Dictionary of analysis methods as key and their selection as boolean values

Type:dict
parameters

(key: value) pairs of parameter names and their values

Type:dict
special_analysis

A dict indicating a menu analysis method.

Type:dict
get_all_modes()[source]

Return the analysis modes in NeuroChaT.

Parameters:None
Returns:dict – Modes and their IDs
get_analysis(name=None)[source]

Return the selection of an analysis.

If name is ‘all’, selection values for all the analyses are returned.

Parameters:name (str) – Name of the analysis. Enter ‘all’ for returning values for all the analyses
Returns:bool – True if selected, False if not.
get_analysis_list()[source]

Return a list of analyses.

Parameters:None
Returns:list – List of analysis names.
get_analysis_mode()[source]

Return the mode of analysis and mode ID.

Parameters:None
Returns:(str, int) – Analysis mode set, ID of analysis mode
get_cell_type()[source]

Return the type of cell set to analyse.

Parameters:None
Returns:str – Cell type set for analyses
get_config_dir()[source]

Return the directory of configuration file.

Parameters:None
Returns:str – Name of the configuration file
get_config_file()[source]

Return the name of the configuration file.

Parameters:None
Returns:str – Name of configuration file
get_data_dir()[source]

Return the data directory.

Parameters:None
Returns:str – Data directory
get_data_format()[source]

Return the data format or recording system.

Parameters:None
Returns:str – Data format or recording system
get_excel_file()[source]

Return the filename of the Excel list.

Parameters:None
Returns:str – Filename of the Excel list
get_graphic_format()[source]

Return output graphics file format.

Parameters:None
Returns:str – Export format of output graphics
get_lfp_file()[source]

Return the filename of the lfp data.

Parameters:None
Returns:str – Filename of the lfp data
get_nwb_file()[source]

Return the filename of the HDF5 data.

Parameters:None
Returns:str – Filename of the HDF5 data
get_param_list()[source]

Return the list of all parameters.

Parameters:None
Returns:list – List of parameter names
get_params(name=None)[source]

Get the value of parameter.

If a list of parameter names are provided, then a list of values are returned.

Parameters:name (str or list of str) – Name of the parameter(s)
Returns:params – Parameter value(s)
get_params_by_analysis(analysis=None)[source]

Return the parameters and their values for a given analysis.

Parameters:analysis (str) – Name of the analysis
Returns:params (dict) – Dictionary of parameters and their values
get_spatial_file()[source]

Return the filename of the spatial data.

Parameters:None
Returns:str – Filename of the spatial data
get_special_analysis()[source]

Get the special analysis dictionary.

Parameters:None
Returns:dict – Dictionary of special analyses.
get_spike_file()[source]

Return the filename of the spike data.

Parameters:None
Returns:str – Filename of spike data
get_unit_no()[source]

Return the unit number that is already set.

Parameters:None
Returns:str – Unit number
load_config(filename=None)[source]

Import the configuration data from a .ncfg file.

Parameters:filename (str) – Name of the configuration file
Returns:None
save_config(filename=None)[source]

Export the configuration data to .ncfg file.

Parameters:filename (str) – Name of the configuration file
Returns:None
set_analysis(name=None, value=None)[source]

Set the selection of an analysis.

Parameters:
  • name (str) – Name of the analysis
  • value (bool) – Boolean value to indicate analysis selection
Returns:

None

set_analysis_mode(analysis_mode=None)[source]

Set the mode of analysis.

Parameters:analysis_mode (str) – Mode of the analysis
Returns:None
set_cell_type(cell_type=None)[source]

Set the type of cell to analyse.

Parameters:cell_type (str) – Cell type of interest
Returns:None
set_config_dir(directory=None)[source]

Set the directory of configuration file.

Parameters:directory (str) – Directory of configuration file
Returns:None
set_config_file(filename)[source]

Set the name of the configuration file.

Parameters:directory (str) – Name of configuration file
Returns:None
set_data_dir(directory=None)[source]

Set the data directory.

Parameters:directory (str) – Data directory
Returns:None
set_data_format(file_format=None)[source]

Set the format of the data or recording system.

Parameters:file_format (str) – Format of the data or recording system
Returns:None
set_excel_file(excel_file=None)[source]

Set filename of the Excel list.

Parameters:excel_file (str) – Filename of the Excel list
Returns:None
set_graphic_format(graphic_format=None)[source]

Set output graphics file format.

Parameters:graphic_format (str) – Format of output graphic export. Options are ‘PDF’ or ‘Postscript’.
Returns:None
set_lfp_file(lfp_file=None)[source]

Set filename of the lfp data.

Parameters:lfp_file (str) – Filename of the lfp data
Returns:None
set_nwb_file(nwb_file=None)[source]

Set filename of the HDF5 data.

Parameters:nwb_file (str) – Filename of the HDF5 data
Returns:None
set_param(name=None, value=None)[source]

Set the value of a parameter.

Parameters:
  • name (str) – Name of the parameter
  • value (any) – Value of the parameter
Returns:

None

set_spatial_file(spatial_file=None)[source]

Set filename of the spatial data.

Parameters:spatial_file (str) – Filename of the spatial data
Returns:None
set_special_analysis(in_dict={})[source]

Set special analysis to the input dictionary.

Parameters:in_dict (dict) – Dictionary to set special analysis to.
Returns:None
set_spike_file(spike_file=None)[source]

Set filename of the spike data.

Parameters:spike_file (str) – Filename of the spike data
Returns:None
set_unit_no(unit_no=None)[source]

Set the unit no to analyse in ‘Single Unit’ analysis.

Parameters:unit_no (int) – Unit number the user is intending to analyse
Returns:None