First, thanks for the great toolbox 🙏. I think I may have found a small logic issue in the amplitude/SNR gating for MUA vs GOOD units.
In quality_matrices.py, the MUA mask adds the raw amplitude and SNR checks only if all units have non-NaN rawAmplitude:
quality_matrices.py
if param["extractRaw"] and np.all(~np.isnan(quality_metrics['rawAmplitude'])):
mua_mask |= np.isnan(unit_type) & (
(quality_metrics["rawAmplitude"] < param["minAmplitude"]) |
(quality_metrics["signalToNoiseRatio"] < param["minSNR"])
)
Because this uses np.all(...), if any one unit has rawAmplitude == NaN, the whole block is skipped for every unit. In my dataset, I had one NaN rawAmplitude, and the amplitude rule wasn’t applied at all, so I ended up with 15 units labeled GOOD even though their rawAmplitude was below my minAmplitude = 20.
Could you please confirm if this is the intended behavior, or if the condition was meant to allow per-unit checks even when some amplitudes are missing?
Thank you for checking this!
System information
Recording probes: [ Neuropixels 2.0 4 -shank]
Recording software: [SpikeGLX]
OS: [Windows]
Python