Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABFFIO.DLL vs pyABF values #78

Closed
swharden opened this issue Jun 9, 2019 · 2 comments
Closed

ABFFIO.DLL vs pyABF values #78

swharden opened this issue Jun 9, 2019 · 2 comments
Assignees

Comments

@swharden
Copy link
Owner

swharden commented Jun 9, 2019

vsABF (which uses the official ABFFIO.DLL to read ABF values) just got far enough along that I was able to test it on all the ABFs in the data folder to compare their first values (for each channel) to those determined by pyABF. Sweep values produced by pyABF perfectly matched those produced by ABFFIO.DLL for every ABF file! ... with the exception of File_axon_3.abf (an ABF1 file). pyABF is reporting values for these two channels as exactly 100x and 400x larger than expected.

FIRSTVALUES = {}
FIRSTVALUES['05210017_vc_abf1'] = ['-136.29149', '11625.36621']
FIRSTVALUES['14o08011_ic_pair'] = ['-65.52124', '-56.12183']
FIRSTVALUES['14o16001_vc_pair_step'] = ['-25.87890', '-31.49414']
FIRSTVALUES['16d05007_vc_tags'] = ['0.85449']
FIRSTVALUES['16d22006_kim_gapfree'] = ['0.01007', '0.13641']
FIRSTVALUES['171116sh_0011'] = ['-125.73241']
FIRSTVALUES['171116sh_0012'] = ['-120.23925']
FIRSTVALUES['171116sh_0013'] = ['-103.51562']
FIRSTVALUES['171116sh_0014'] = ['-109.98534']
FIRSTVALUES['171116sh_0015'] = ['-119.38476']
FIRSTVALUES['171116sh_0016'] = ['-61.43188']
FIRSTVALUES['171116sh_0017'] = ['-61.70654']
FIRSTVALUES['171116sh_0018'] = ['-62.46948']
FIRSTVALUES['171116sh_0019'] = ['-62.43896']
FIRSTVALUES['171116sh_0020'] = ['72.75390']
FIRSTVALUES['171117_HFMixFRET'] = ['-0.43945', '-94.87915', '0.06989', '0.07080']
FIRSTVALUES['17o05024_vc_steps'] = ['-21.36230']
FIRSTVALUES['17o05026_vc_stim'] = ['-16.11328']
FIRSTVALUES['17o05027_ic_ramp'] = ['-48.00415']
FIRSTVALUES['17o05028_ic_steps'] = ['-47.08862']
FIRSTVALUES['180415_aaron_temp'] = ['-0.35187', '25.02339']
FIRSTVALUES['2018_04_13_0016a_original'] = ['-115.96679', '-15.25879']
FIRSTVALUES['2018_04_13_0016b_modified'] = ['-115.96679', '-7.44399']
FIRSTVALUES['model_vc_ramp'] = ['-138.42772']
FIRSTVALUES['model_vc_step'] = ['-140.13670']
FIRSTVALUES['18702001-biphasicTrain'] = ['-10.74219', '-1.03607']
FIRSTVALUES['18702001-cosTrain'] = ['-8.05664', '-1.03638']
FIRSTVALUES['18702001-pulseTrain'] = ['-11.71875', '-1.03607']
FIRSTVALUES['18702001-ramp'] = ['-12.20703', '-1.03638']
FIRSTVALUES['18702001-step'] = ['-10.49805', '-1.03546']
FIRSTVALUES['18702001-triangleTrain'] = ['-9.88769', '-1.03577']
FIRSTVALUES['130618-1-12'] = ['-188.33015']
FIRSTVALUES['18711001'] = ['-66.66565']
FIRSTVALUES['18713001'] = ['-64.27002']
FIRSTVALUES['sine sweep magnitude 20'] = ['0.00000']
FIRSTVALUES['171116sh_0015-ATFwaveform'] = ['-119.38476']
FIRSTVALUES['2018_08_23_0009'] = ['-138.42772']
FIRSTVALUES['18807005'] = ['506.59180']
FIRSTVALUES['18808025'] = ['-14.77051']
FIRSTVALUES['File_axon_2'] = ['-55.28870']
FIRSTVALUES['File_axon_3'] = ['-15.50000', '-22000.00000']
# ABFFIO.DLL TELLS ME File_axon_3 SHOULD BE: ['-0.15500', '-55.00000']
FIRSTVALUES['File_axon_4'] = ['-0.00610']
FIRSTVALUES['File_axon_5'] = ['-71.05103']
FIRSTVALUES['File_axon_6'] = ['-56.47583', '-0.03357']
FIRSTVALUES['File_axon_7'] = ['-1.48067']
FIRSTVALUES['File_axon_1'] = ['2.18811']
FIRSTVALUES['abf1_with_tags'] = ['-34.54589']
FIRSTVALUES['2018_11_16_sh_0006'] = ['-119.14062']
FIRSTVALUES['sample trace_0054'] = ['0.00931']
FIRSTVALUES['f1'] = ['-30.51758', '-4.27246', '3100.58594', '3445.43457']
FIRSTVALUES['171116sh_0020_saved'] = ['72.72339']
FIRSTVALUES['f1_saved'] = ['-30.51758']
FIRSTVALUES['2018_12_09_pCLAMP11_0001'] = ['-3.65051']
FIRSTVALUES['18425108'] = ['0.07935', '-71.35010']
FIRSTVALUES['2018_05_08_0028-IC-VC-pair'] = ['-68.57300', '-153.32030']
FIRSTVALUES['18425108_abf1'] = ['0.07935', '-71.31958']
FIRSTVALUES['pclamp11_4ch'] = ['-0.24017', '-0.08545', '-0.00793', '0.27313']
FIRSTVALUES['pclamp11_4ch_abf1'] = ['-0.23987', '-0.08514', '-0.00763', '0.27313']
FIRSTVALUES['2018_12_15_0000'] = ['-0.16541', '0.26764', '0.04761', '-0.28351']
FIRSTVALUES['vc_drug_memtest'] = ['-7.20215']

@swharden swharden self-assigned this Jun 9, 2019
@swharden
Copy link
Owner Author

swharden commented Jun 9, 2019

After more closely reviewing the header, I suspect that ABF1 files aren't selecting the proper fADCProgrammableGain and fInstrumentScaleFactor . My guess is that pyABF's less-complex ABF1 reader is taking the first two scaling values, but they must be mapped somehow.

https://github.com/swharden/pyABF/blob/master/data/headers/File_axon_3.md

Compare what the header says to what ClampFit says:

Created: Jun 11, 2005, at 14:15:28.552 [01:35:24]
Created by: Clampex 9.2
Acquisition mode: episodic stimulation.
Axon binary file (integer)
206440 samples in this file.
Comment: n/a

Digitizer type:          Demo
Analog input channels:       16
Analog output channels:       2
Digital output channels:      8 (4 during waveform)

ADCRange:                 10.24
DACRange:                 10.24
ADCResolution:            32768
DACResolution:            32768

                             #0       #1       
DAC Calibration factors:        1        1
DAC Calibration offsets:        0        0


ADC channel information:
No.  sADCChannelName  sADCUnits
 5     stim            V      
 7     VmRK           mV      

No.  fInstrumentOffset  fADCDisplayOffset  fSignalOffset
 5         0.0000           2.4395           0.0000
 7         0.0000         -22.2000           0.0000

    fInstrumentScaleFactor             fADCProgrammableGain
No.               fADCDisplayAmplification                   fSignalGain
 5         1.0000           2.3272           1.0000            1.0000
 7         0.0100           4.1423           4.0000            1.0000

Notice those numbers are 5 and 7, and that a scaling factor of 4 could explain the "400x" value.

@swharden
Copy link
Owner Author

This probably only affects ABF1 files and is super low priority. I'll close it for now, and re-open it if this issue arises in the wild.

swharden added a commit that referenced this issue Jun 28, 2021
previously nADCSamplingSeq was not being respected in ABF1 files, affecting offset and gain scaling of integer data when ADCs were not sequential.

This fix fixes some long-running failing tests where first values of some files was different between ABFFIO.DLL and pyabf. #78 Tests pass now.
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

No branches or pull requests

1 participant