AllenInstitute / AllenSDK

code for reading and processing Allen Institute for Brain Science data
https://allensdk.readthedocs.io/en/latest/
Other
333 stars 149 forks source link

EphySweepfeatureExtractor time step #2210

Open ClaudMor opened 2 years ago

ClaudMor commented 2 years ago

Hello,

Due to some unexpected behaviour, I would like to ask whether the t argument in

class allensdk.ephys.ephys_extractor.EphysSweepFeatureExtractor(t=None, v=None, i=None, start=None, end=None, filter=10.0, dv_cutoff=20.0, max_interval=0.005, min_height=2.0, min_peak=-30.0, thresh_frac=0.05, baseline_interval=0.1, baseline_detect_thresh=0.3, id=None)[source]

docs

is required to be a time vector of constant time step.

The unexpected behaviour, which would not be easy to reproduce in an MWE since it involves a using AllenSDK through PyCall in Julia, consists in the following. I have a DifferentialEquations.jl model representing a single-compartment HH neuron, that given a set of parameter values it outputs a membrane potential time series as a solution. The model has the same structure as this one. Keeping the parameters set constant but varying the time stepping at which the solution is saved between constant stepping and solver-determined stepping (which does not respect constant time-stepping), the features extracted from the corresponding two solutions (using the EphysSweepFeatureExtractor) vary a lot. I noticed that the features are correctly extracted if constant time stepping is imposed, and not correctly otherwise, hence this issue.

Thanks for your attention.

ClaudMor commented 2 years ago

Hello,

I figured out that by looking at the source code linked in the documentation, specifically at the calculate_dvdt function, one may conclude that a constant time stepping is needed.