neurochat.nc_base module

This module implements two classes NAbstract and NBase.

Those are inherited by other data classes for detailed implementation. Methods and attributes that are likely to be common in other data types in NeuroChaT are implemented in the NAbstract and NBase classes.

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

class neurochat.nc_base.NAbstract(**kwargs)[source]

Bases: object

NAbstract includes a number of attributes and methods common in NC.

NAbstract is the abstract class which includes a number of attributes and methods commonly used by most other data types.

get_comments()[source]

Get the comments or notes about the experiment.

Parameters:None
Returns:str
get_data_source()[source]

Get the source of the data.

Parameters:None
Returns:str
get_date()[source]

Get the recording date.

Parameters:None
Returns:str
get_duration()[source]

Get the duration of the experiment.

Parameters:None
Returns:str
get_experimenter()[source]

Get the name of the experimenter.

Parameters:None
Returns:str
get_file_version()[source]

Get the version of the data file.

Parameters:None
Returns:str
get_filename()[source]

Return the filename of the data class.

Parameters:None
Returns:str
get_name()[source]

Get the name of the object.

Parameters:None
Returns:str
get_record_info(record_name=None)[source]

Get the comments or notes about the experiment.

Parameters:None
Returns:dict or str – dict if record_name is None. str if record_name is a key in _record_info.
get_results()[source]

Return the analysis results.

Returns:OrderedDict
get_source_format()[source]

Get the recording system or native data format.

Parameters:None
Returns:str
get_system()[source]

Return the name of the recording system or data format.

Parameters:None
Returns:str
get_time()[source]

Get the time of the experiment.

Parameters:None
Returns:str
get_type()[source]

Return the type of data class.

For example, an instance of Nabstract will return ‘abstract’ as the type of the class.

Parameters:None
Returns:str
load()[source]

Only implemented in subclasses.

reset_results()[source]

Reset the results to an empty OrderedDict.

save_to_hdf5(parent_dir)[source]

Only implemented in subclasses.

set_description(description='')[source]

Set the general description about the data by the user.

Parameters:description (str) –
Returns:None
set_filename(filename=None)[source]

Set the file name of the data object.

Parameters:filename (str) – Name of the data file
Returns:None
set_name(name='')[source]

Set a name for the class instance.

Parameters:name (str) –
Returns:None
set_record_info(new_info={})[source]

Set the recording information.

Parameters:new_info (dict) – The new recording information dictionary. The existing information is updated with this information.
Returns:None
set_system(system=None)[source]

Set the name of the recording system or the format of the data file.

Parameters:system (str) – Recording system or data file format
Returns:None
update_result(new_result={})[source]

Update the results.

Parameters:new_result (dict) – The dictionary to update the current results dict with.
Returns:OrderedDict

See also

get_results()

class neurochat.nc_base.NBase(**kwargs)[source]

Bases: neurochat.nc_base.NAbstract

NBase adds managing multiple spike or LFP datasets to NAbstract.

NBase is derived from NAbstract class. And it implements additional functionalities for managing multiple spike or LFP datasets to NAbstract.

add_node(node, node_type=None, **kwargs)[source]

Add a new dataset, called node, to the spike and LFP dataset arrays.

Parameters:
  • node – Data node to be added
  • node_type (str) – Type of the dataset described in each class attributes
  • **kwargs – Keyword arguments
Returns:

None

change_names(old_names, new_names, node_type='spike')[source]

Change the names of nodes.

old_names should have the same length as that of new_length

Parameters:
  • old_names (list of str) – List of the old names of nodes
  • new_names (list of str) – List of the new names of nodes
  • node_type – Type of the data node
Returns:

None

count_lfp()[source]

Count the number of lfp nodes.

Parameters:None
Returns:int – Total number of lfp nodes
count_spike()[source]

Count the number of spike nodes.

Parameters:None
Returns:int – Total number of spike nodes
del_lfp(lfp)[source]

Delete a node that represents LFP dataset.

Parameters:lfp – LFP node to be deleted by name or the object
Returns:int – Index of the deleted node
del_node(node)[source]

Delete a node that represents spike or LFP dataset.

Parameters:node – Data node to be deleted
Returns:int – Index of deleted node
del_spike(spike)[source]

Delete a node that represents a spike dataset.

Parameters:spike – Spike node to be deleted by name or the object
Returns:i (int) – Index of the deleted node
get_lfp(names=None)[source]

Get the lfp nodes by name.

Parameters:names (list) – List of the names of the lfp nodes to obtain
Returns:list – List of the lfp nodes. Returns all the lfp nodes if names is None
get_lfp_names()[source]

Get the name of all the lfp nodes.

Parameters:None
Returns:list – Names of the LFP nodes
get_node(node_names, node_type='spike')[source]

Get the nodes by name and dataset type.

Parameters:
  • node_names (list) – List of the names of the data nodes to obtain
  • node_type (str) – Type of the data node
Returns:

list – List of the data nodes

get_spike(names=None)[source]

Get the spike nodes by name.

Parameters:names (list) – List of the names of the spike nodes to obtain
Returns:list – List of the spike nodes. Returns all the spike nodes if names is None.
get_spike_names()[source]

Get the names of all the spike nodes.

Parameters:None
Returns:list – Names of the spike nodes
set_lfp_file_names(lfp_names, filenames)[source]

Set the filenames for each LFP data node.

lfp_names must be of equal length to filenames

Parameters:
  • lfp_names (list of str) – Names of the lfp nodes whose filenames are set
  • filenames (list of str) – List of the filenames for each lfp node
Returns:

None

set_lfp_names(names)[source]

Set the names of the lfp nodes. Old names are replaced.

Parameters:names (list of str) – List of new names of the lfp nodes
Returns:None
set_node_file_names(node_names, filenames, node_type='spike')[source]

Set the filenames for each data node.

node_names must be of equal length to filenames

Parameters:
  • node_names (list of str) – Names of the nodes whose filenames are set
  • filenames (list of str) – List of the filenames for each node
  • node_type – Type of the data node
Returns:

None

set_spike_file_names(spike_names, filenames)[source]

Set the filenames for each data node.

spike_names must be of equal length to filenames

Parameters:
  • spike_names (list of str) – Names of the spike nodes whose filenames are set
  • filenames (list of str) – List of the filenames for each spike node
Returns:

None

set_spike_names(names)[source]

Set the names of the spike nodes. Old names are replaced.

Parameters:names (list of str) – List of new names of the spike nodes
Returns:None