-
Notifications
You must be signed in to change notification settings - Fork 33
Description
The ABF interface incorrectly assumes that each Neo channel, which corresponds to an ADC signal channel, represents a separate physical electrode. This assumption is made in get_number_of_electrodes(). For the Khaliq lab conversion this does not hold, and I don't think it holds in general. A monitor signal of the protocol is also propagated to the acquisition system:
Where the IN0 channel with mV represents the voltage response and the IN1 channel with pA represents the current monitor signal of the same electrode. The current implementation of the ABF interface counts these as two separate electrodes.
Looking at the format, I don't think there is a bulletproof automatic method to determine electrode count from ABF files alone. I think the right thing to do is to provide a way for the user to pass this specification, either as metadata or as conversion options (I need to think more about it and come with a proposal) and error out if this is not provided, as making up electrodes is a serious provenance violation.
We could though improve the heuristic by counting active DAC channels (those with defined epoch protocols in dictEpochInfoPerDAC, see neo/rawio/axonrawio.py where this structure is populated from the ABF file's EpochPerDACSection) as each electrode requires its own stimulus generator. For files where this information is unavailable (ABF version 1) or ambiguous (e.g., multiple DACs active but unclear ADC-to-electrode mapping), the electrode count could be inferred by grouping ADC channels with complementary units (mV/pA pairs in current clamp, or pA/mV pairs in voltage clamp) under the assumption that each pair monitors a single electrode. Not sure if this is worth the added complexity and the possibility of a provenance error though.