Skip to content

Feature: support epoch shapes and ABF1 in the ABF protocol reconstruction - #1963

Open
h-mayorquin wants to merge 1 commit into
NeuralEnsemble:masterfrom
h-mayorquin:axon_protocol_work
Open

h-mayorquin wants to merge 1 commit into
NeuralEnsemble:masterfrom
h-mayorquin:axon_protocol_work

Conversation

@h-mayorquin

Copy link
Copy Markdown
Contributor

ABF files do not store the command that the amplifier played as samples. They store a protocol: a holding level plus a table of up to ten epochs per output, each with a shape, a level, a duration and how these change from sweep to sweep. read_raw_protocol rebuilds the command from that table, and right now it has these problems:

  • Every epoch is drawn as a step, so ramps and the pulse, triangle, cosine and biphasic trains come out as flat levels.
  • ABF1 files throw an error, although their header carries the same protocol.
  • The "use last epoch level" option is ignored, so a sweep that should start where the previous one ended starts at the holding level.
  • Files with user lists, stimulus files or alternating outputs get a wrong waveform without any message.

This PR draws all six epoch shapes with their train period and width, keeps the level and duration increments, follows the "use last epoch level" option and reads the protocol of ABF1 files from version 1.6 on. Files with user lists, stimulus files, alternating outputs or conditioning trains are not reconstructed yet, and the reader now warns about them. Before the first epoch the output stays at the holding level for 1/64 of the sweep. The old code used that value with a # TODO guess for first holding comment and #1305 asked about it. It is right (the recorded responses start right after it), so it stays. The test files were added to gin in https://gin.g-node.org/NeuralEnsemble/ephy_testing_data/pulls/197.

This should close #1305.

Draw ramps and pulse, triangle, cosine and biphasic trains, start each sweep at the last epoch level when the protocol asks for it, read the protocol of ABF1 files from version 1.6 on, and warn when a file uses user lists, alternating outputs, stimulus-file waveforms or conditioning trains, which are not reconstructed yet.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alternative way to get offset before first "epoch" in axon protocol conversion

1 participant