Verify electrode resistance of EXTPINBATH sweep before extracting e0
This commit checks the value of the electrode resistance (eR) before extracting
the value of the electrode baseline current (e0) with extract_electrode_0 in
qc_feature_extractor.py. After the sweep containing the in-bath data (EXTPINBATH)
is identified, eR is extracted with measure_input_resistance and then e0 is only
extracted if eR is less than the max allowable electrode resistance (max_eR).
If eR is found to exceed max_eR the e0 is set to None and a new tag is applied,
indicating that eR exceeded max_eR.
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
[ ] Documentation Change
Solution:
This solution first gets the value of the electrode resistance for the EXTPINBATH sweep with
measure_input_resistance in qc_features and then checks that value to ensure that it is below
the maximum allowable electrode resistance as outlined in the Electrophysiology white paper.
The baseline current of the electrode (e0) is extracted only if the electrode resistance is below the
max electrode resistance, and if it exceeds the max electrode resistance then e0 is set to None
and the new tag which indicates that the pipette resistance is out of range is appended to the
tags list.
Changes:
extract_electrode_0 function now calls measure_input_resistance after EXTPINBATH sweep is found
to measure the electrode resistance (eR)
eR is compared to max_eR (max allowable electrode resistance) and e0 is extracted with
measure_electrode_0 only if eR is less than max_eR.
If eR exceeds max_eR then e0 is set to None and new tag is appended to tags list to indicate
that eR exceeded max_eR.
Validation:
This is a pretty simple and straight forward change that does not break anything. This change
is inside of the extract_electrode_0 function which does not have any tests so I have not
included any tests, but if needed I can refactor my changes into their own function for testing,
but these changes really only introduce a call to measure_input_resistance, which is already
tested, and the comparison operator '<' for comparing eR to max_eR.
Overview:
Verify electrode resistance of EXTPINBATH sweep before extracting e0
This commit checks the value of the electrode resistance (eR) before extracting the value of the electrode baseline current (e0) with extract_electrode_0 in qc_feature_extractor.py. After the sweep containing the in-bath data (EXTPINBATH) is identified, eR is extracted with measure_input_resistance and then e0 is only extracted if eR is less than the max allowable electrode resistance (max_eR). If eR is found to exceed max_eR the e0 is set to None and a new tag is applied, indicating that eR exceeded max_eR.
Addresses:
Addresses issue https://github.com/AllenInstitute/ipfx/issues/513#issue-866275415
Type of Fix:
Solution:
This solution first gets the value of the electrode resistance for the EXTPINBATH sweep with measure_input_resistance in qc_features and then checks that value to ensure that it is below the maximum allowable electrode resistance as outlined in the Electrophysiology white paper. The baseline current of the electrode (e0) is extracted only if the electrode resistance is below the max electrode resistance, and if it exceeds the max electrode resistance then e0 is set to None and the new tag which indicates that the pipette resistance is out of range is appended to the tags list.
Changes:
Validation:
This is a pretty simple and straight forward change that does not break anything. This change is inside of the extract_electrode_0 function which does not have any tests so I have not included any tests, but if needed I can refactor my changes into their own function for testing, but these changes really only introduce a call to measure_input_resistance, which is already tested, and the comparison operator '<' for comparing eR to max_eR.
Screenshots:
Unit Tests:
Script to reproduce error and fix:
Configuration details:
Checklist
Notes:
Please let me know unit tests are still needed for such a small change and I can refactor and add those in.