How are the different electrophysiological sweeps for a single cell considered (e.g. taken into account or not), notably for the computation of I/O features?

Hello everyone,

I am interested into computing various electrophysiological features from the Allen Mouse cell type database, like the gain, the adaptation,… from scratch (i.e. from the spike-times and the stimulus trace for each sweep). Before being able to compute them by myself, I would like to better understand how, notably in the context of computing the gain, the multiple sweeps for a given specimen are treated, especially when some of them show no response.
The reason I am asking this, is that when I plot by myself some specimen f-I curve, I see data points which do not appear on the cell data page provided by the Allen Institute (for example specimen 479091820).
Are these sweeps ignored because the frequency is 0Hz or is there a quality assessment for the trace to reject them before?

Similarly, in several cell data, we can observe that for a given stimulus amplitude, several experiments have been done, where the neuron shows different firing frequencies (for example in cell 501839495, at 110pA, 150pA, 190pA). However, when looking at the Allen Institute cell page (attached) we can only see one point at each stimulus amplitude.
So my question in this case is, how are these data taken into account when computing neural gain? Are they all taken into account, or just the highest one, …?

Thank you for any help you can give me,
Best regards,

Julien Ballbé

The electrophysiology experiments in the Cell Types Database use several different (sometimes quite similar) stimulus protocols to evaluate the intrinsic properties of the cells. If you look at the associated XML data for a given experiment, you can see the sweep numbers and the sweep description (e.g., “C1LSFINEST150112”). The f-I curve plots on the website are built just from the C1LSCOARSE type sweeps (which have a larger stimulus amplitudes), so that is why you can find additional sweeps not shown in the plots. In most cases, the C1LSCOARSE sweeps will be earlier in the experiment than others (which you can see by checking their sweep numbers).

In terms of what to use for calculating the f-I curve slope or similar measures, you probably have a few options. You could potentially average the values at the same amplitudes, or (if you’re just interested in a fit), you could include all the points in the fit. Sometimes the f-I curve properties change to some degree over the course of the experiment, though, so you may want to check if the later sweeps are substantially different and only use the earlier ones (when the cell is presumably less affected by the extended recording) in that case.


Thank you for your very detailed response, indeed that explains a lot. Do you know if there is a Python function in the Allen SDK which allows to retrieve the stimulus description from the sweep number? I would like to be able to include only the “C1LSCOARSE” type experiments in my computation of the F-I curve slope, in an automated way.
Thank you again for your help!

Yes, you can get sweep metadata via Allen SDK functions and then filter for the sweeps you are interested in. For example:

from allensdk.core.cell_types_cache import CellTypesCache
ctc = CellTypesCache(manifest_file='path/to/manifest.json') # put the cache wherever you like

specimen_id = 501839495
sweeps = ctc.get_ephys_sweeps(specimen_id)

# sweeps is a list of sweep metadata dictionaries
coarse_sweep_numbers = [s['sweep_number'] for s in sweeps
    if s['stimulus_description'].startswith("C1LSCOARSE")]
1 Like

Thank you for this example! In the meantime I tried to retrieve this myself but your solution is simpler…
Thank you very much for your help!
Best regards