README.md 2.4 KB

P-unit data in nixio format for the paper 'Beat encoding at mistuned octaves within single electrosensory neurons'

Summary

We provide electrophysiological datasets of primary sensory afferents (P-Units) of the Apteronotus leptorhynchus (Barayeu et al., 2023). The datasets contain intracellular recordings sampled at 40 kHz. It also includes the timing of stimulus-related events recorded along with the electrophysiological data. The datasets also provide the metadata structured in a nixio format. The datasets address contain information and can be analysed with the questions in mind: How are beats at high difference frequencies encoded in the electrosensory system in primary sensory afferents?

Repository structure

The repository contains the P-unit data sets. They are provided in the nixio format (.nix).

Example code to load the data of a cell:

  • import the nixo package

    import nixio as nix
    from matplotlib import pyplot as plt
    import numpy as np
    
  • load cell, (works if you are in the cell folder)

    file = nix.File.open('2019-05-07-aq-invivo-1.nix', nix.FileMode.ReadOnly)
    b = file.blocks[0]
    
  • choice of a beat multi_tag

    mt_nr = 1
    mt = b.multi_tags[mt_nr]
    
  • load the array of interes: hier the EOD of the fish and the spike times

    EOD = b.data_arrays['LocalEOD-1']
    spikes_all = b.data_arrays['Spikes-1']
    voltage = b.data_arrays['V-1']
    
  • slice the whole dataarray at with the bignning and the extend of the multitag

    eod = EOD.get_slice([mt.positions[:][mt_nr]], [mt.extents[:][mt_nr]], nix.DataSliceMode.Data)[:]
    spikes = spikes_all.get_slice([mt.positions[:][mt_nr]], [mt.extents[:][mt_nr]], nix.DataSliceMode.Data)[:] - mt.positions[:][mt_nr]
    volt = voltage.get_slice([mt.positions[:][mt_nr]], [mt.extents[:][mt_nr]], nix.DataSliceMode.Data)[:]
    
  • get the sampling

    sampling = len(EOD.get_slice([0], [0.1], nix.DataSliceMode.Data)[:]) * 10
    
  • get the time array

    time_array = np.arange(0, mt.extents[:][mt_nr], 1 / sampling)
    
  • example plot of a beat and the P-unit response

    fig, ax = plt.subplots(2, 1, sharex = True)
    ax[0].set_ylabel('mV')
    ax[0].plot(time_array, eod)
    ax[1].plot(time_array, volt)
    ax[1].set_ylabel('mV')
    ax[1].set_xlabel('Time [s]')
    ax[1].set_xlim(0,0.1)
    ax[1].scatter(spikes, np.ones(len(spikes))*np.max(volt))
    plt.show()
    

See https://nixio.readthedocs.io/en/latest/getting_started.html#tutorials for more documentation examples.