AllenInstitute / ipfx

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

Sweeps that fail qc are incorrectly recorded in LIMS with the state "auto passed" #507

Open wbwakeman opened 3 years ago

wbwakeman commented 3 years ago

There may be two issues here:

  1. Sweeps that do not meet the QC criteria are marked as "auto passed"
  2. Even though there are sweeps that passed, the cell is failed: "failed_qc": true with fail tags: ("No sweep states available", "No current clamps sweeps passed QC")

An example is the Ephys QC output.json file for ephys_roi_result 1086809673 (path below) shows the cell failing ephys qc ("failed_qc": true) with fail tags: ["No sweep states available", "No current clamps sweeps passed QC"], but most of the sweeps are in LIMS and they are all “auto passed”.

The output.json for the previous step NWB_Stimulus_summary (path below) shows that many of the sweeps had a “leak_pa” > +/- 100 pA, except the three ramp sweeps (stimulus_code: ‘X7Ramp’, sweep_nums: 158, 159, and 160) that had a leak_pA of -99.3 pA, which I believe should pass qc, and I can’t see anything reason for them to fail.

/allen/programs/celltypes/production/mousecelltypes/prod3052/Ephys_Roi_Result_1086809673/202103081337_EPHYS_QC_V3_QUEUE_1086809673_output.json 
/allen/programs/celltypes/production/mousecelltypes/prod3052/Ephys_Roi_Result_1086809673/202102261241_EPHYS_NWB_STIMULUS_SUMMARY_V3_QUEUE_1086809673_output.json

(Based on Ephys QC Criteria v1.1)

wbwakeman commented 3 years ago

Ephys QC Criteria v1.1

pre_noise_rms_mv_max            0.07
post_noise_rms_mv_max           0.07
slow_noise_rms_mv_max           0.5
vm_delta_mv_max                 1
seal_gohm_min                   1
blowout_mv_min                -10
blowout_mv_max                 10
electrode_0_pa_min       -200
electrode_0_pa_max        200
access_resistance_mohm_min  1
access_resistance_mohm_max     20
input_vs_access_resistance_min  0.15
leak_pa_max               100
leak_pa_min              -100
sgratiy commented 3 years ago

For the experiment above, the ramps failed because those sweeps were tagged: "Stimulus contains NaN values". This tag was introduced recently in PR #503 as part of handling the Nan stimulus amplitude. I think this tag is not needed for handling the underlying issue #498 and removing it should allow ramp sweeps to pass. Let's check with @MatthewAitken who added the tag.