Skip to content

Instantly share code, notes, and snippets.

@pietromarchesi
Last active March 12, 2018 15:11
Show Gist options
  • Save pietromarchesi/332570058848f6a27795b72c0fb4551e to your computer and use it in GitHub Desktop.
Save pietromarchesi/332570058848f6a27795b72c0fb4551e to your computer and use it in GitHub Desktop.
neoconversion

Packaging data following the Neo model

General considerations

  • A block corresponds to a recording session. Consequently, a full dataset will be composed of several blocks. A block should have annotations regarding the animal and all the dummy codes used in the different fields (e.g. if different trial types have specific numeric labels)
  • Segments are used for trials. They should contain annotations regarding trial-specific variables, and event/epoch objects.
  • Since this is a multi-area recording, channel indices correspond to a single area/bundle, and tetrode and channel information are ralegated to the annotations.

Detailed procedure

  1. Construct a block corresponding to a single recording session. It contains annotations of the dummy codes used to trial parameters etc.

  2. For every recording area, generate a ChannelIndex

    • The ChannelIndexes for every recording area are appended to block.channel_indexes.
  3. For every recorded neuron, generate a unit object with all the relevant annotations.

    • Append unit to the corresponding ChannelIndex.units
    • Set unit.channel_index to the corresponding ChannelIndex.
  4. For every behavioral trial, generate a Segment object, with the relevant annotations (trial outcome, trial type, etc.) and an Event object.

    • Append the Event to Segment.events
    • Append the segment to block.segments
  5. For every unit unit_n, generate the spike train corresponding to a segment segment_m, and construct a SpikeTrain object.

    • Append the SpikeTrain so segment.spiketrains.
    • Append the SpikeTrain to unit.spiketrains.
    • Set SpikeTrain.unit=unit_n.
    • Set SpikeTrain.segment=segment_m.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment