Updates to feature vector and QC analysis from exc_mMET branch - #592
Open
gouwens wants to merge 21 commits into
Open
Updates to feature vector and QC analysis from exc_mMET branch#592gouwens wants to merge 21 commits into
gouwens wants to merge 21 commits into
Conversation
… calculation; add transient removal functionality
Replace builtin max()/min() over the stimulus array with np.max/np.min. The builtins iterated element-by-element in Python (~65x slower on a full-length trace); np.max/np.min use the C path on ndarrays while still accepting list inputs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
find_time_index used np.argmin(abs(t - t_0)), an O(n) scan allocating two full-length arrays on every call. Since t is monotonic (already asserted), np.searchsorted finds the closest sample in O(log n) with identical results (30-500x faster per call depending on trace length). calculate_dvdt redesigned the 4-pole Bessel filter via signal.bessel on every call, though the coefficients depend only on order and normalized cutoff, which are fixed across a cell's sweeps. Memoize the design. Feature-vector output verified bit-for-bit identical on a real specimen; time_series_utils / spike / subthreshold test outcomes unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The feature-vector, subthreshold, and QC code was refactored (stim-timing API, curve-fit QC, strict find_time_index) but the tests were not updated. - test_feature_vector: port to stim_timing_dict/list + duration, add sweep_number and clipped columns; update inst_freq initial-rate assertion to match the spike-time-only estimate - test_subthresh_features: rebuild input_resistance data with a baseline period and settling step (deflection is now baseline-relative) - test_qc_features: rewrite measure_seal / input-resistance tests around the averaged-pulse + curve-fit path (get_r_from_stable_pulse_response_fit) - run_feature_vector_extraction / run_feature_collection: port the old runners to the new API (sweep_qc_record, per-sweep stim timing, identify_suprathreshold_spike_info two-value return) - regenerate feature-vector and MIES pipeline expected outputs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is trying to bring in changes from the long-ago diverged exc_mMET branch of IPFX into the current master branch. Rather than merging directly from that branch, I have manually ported the key features into this new branch here and made some additional modifications.
The major changes involve:
run_feature_vector_extraction_flex.py)I've also (using Claude Code) updated the test suite to reflect these changes.