Note
Click here to download the full example code
This example show how to use the channel indexes in the NeoAll class. In NeoAll, channel indexes are defined for each tetrode and each electrode if the signal directory path is given at init. Otherwise channel indexes are created based on the probe file.
from neoStructures import *
import pandas as pd
import matplotlib.pyplot as plt
from os.path import isdir, join
Import the data and create the NeoAll instance
data_dir = join('pySpikeAnalysis', 'sample_data') if isdir('pySpikeAnalysis') else join('..', '..', 'pySpikeAnalysis', 'sample_data')
spykingcircus_dir = r'SpykingCircus_results'
probe_filename = r'000_AA.prb'
results_filename = r'spykingcircusres'
artefact_csv_filepath = join(data_dir, r'artefact_free_periods.csv')
neoAll = NeoAll(join(data_dir, spykingcircus_dir), results_filename, join(data_dir, probe_filename), save_fig=0)
See information about NeoAll
print(neoAll)
Out:
NeoAll Instance with 54 units. 1 Neo segment per unit. Each segment contains 1 Neo spiketrain
10 channel indexes
Let’s look at the different channel indexes :
print(neoAll.channel_indexes)
Out:
[<neo.core.channelindex.ChannelIndex object at 0x7f5595d02cc0>, <neo.core.channelindex.ChannelIndex object at 0x7f5595d02cf8>, <neo.core.channelindex.ChannelIndex object at 0x7f5595d020f0>, <neo.core.channelindex.ChannelIndex object at 0x7f5595cc4550>, <neo.core.channelindex.ChannelIndex object at 0x7f5595cc47b8>, <neo.core.channelindex.ChannelIndex object at 0x7f5595cc4a58>, <neo.core.channelindex.ChannelIndex object at 0x7f5595cc4c18>, <neo.core.channelindex.ChannelIndex object at 0x7f5595cc4cf8>, <neo.core.channelindex.ChannelIndex object at 0x7f5595cc4d68>, <neo.core.channelindex.ChannelIndex object at 0x7f5595cc4f98>]
We can see that the first groups or ChannelIndex correpond to individual tetrodes and that the last groups We can see that the first groups or ChannelIndex correpond to individual tetrodes and that the last groups correpond to the entire electrode (i.e. group of 2 or 3 tetrodes)
We can use the channel indexes for plotting the firing rate evolution of multiple units in the same figure. Channel indexes define groups of channel. By default, a channel index is defined for each tetrode. Let’s plot the firing rate evolution of all units of the tetrode 2 of electrode cp (ChannelIndex number 4, thus index 3) :
neoAll.plot_spikerate_evolution_group(grp_index=3)
Total running time of the script: ( 0 minutes 3.032 seconds)