AllenInstitute / ipfx

computes intrinsic cell features from intracellular electrophysiology data
https://ipfx.readthedocs.io/en/latest/
Other
26 stars 36 forks source link

Changing target_sampling_rate in run_feature_vector_extraction skews the output DvDT #308

Open smestern opened 4 years ago

smestern commented 4 years ago

Hello,

This may or may not be intended. When you change the 'target_sampling_rate' for the 'data_for_specimen_id' function in 'run_feature_vector_extraction.py' script, you get a skewed first_ap_Dv in the resulting file. Specifically this occurs when changing it from 50khz to 10khz.

As an example I ran the extraction with the following cell ids: 565871768 469801138 605889373 485909730 323865917 583836069

And here is the resulting first_ap_Dv for 50hz: 50hz and for 10hz: 10hz

gouwens commented 4 years ago

The code that calculates the first_ap_dv is just taking the difference of adjacent points of the voltage trace, so essentially the units are mV per (length of time bin). So changing the sampling rate does change the magnitude of those values (and the time axis is different as well).

It's a reasonable idea to standardize the units (e.g. to always return V/s). You'd still see differences when you change the sampling rate, but if you plotted them each on their appropriate time base, they'd match up (unlike now). Thanks for bringing the point up.