Skip to content

Conversation

@seqasim
Copy link
Owner

@seqasim seqasim commented Nov 15, 2025

accidental branch - merge


Note

Add comprehensive type hints and docstrings plus a suite of LFP analysis utilities (preprocessing/baseline, BOSC/eBOSC, connectivity incl. GC/GCMI and amp coupling, FOOOF, synchronization, NLX/IOWA parsing, and permutation/mixed-effects stats).

  • analysis_utils:
    • Add type hints/docstrings and utilities: ROI/channel selection, LFP STA, TFR plotting, fast burst detection, FOOOF per-epoch and parallel wrappers, catch22 features.
  • iowa_utils:
    • Add parsers for connection/electrode tables; channel renaming stub with typing/docstring.
  • lfp_preprocess_utils:
    • Add baseline functions (time-series/TFR, trialwise and permutation), referencing (white matter, bipolar; laplacian stub), channel name matching, bad-electrode/artifact/IED detection, electrode loading, MNE builders (scalp/NLX/EDF), re-referencing, epoching, electrode DF renaming, and TFR compute+baseline pipeline.
  • nlx_utils:
    • Add typed, documented IO helpers for headers, records, NCS/NEV loading, record checks, subject parsing, and NCS merge scaffold.
  • oscillation_utils:
    • Implement surrogate generators; connectivity metrics (phase GCMI, amp-amp, time-resolved and epoch GC); seed-target mapping; BOSC/eBOSC libraries and parallel wrapper; helpers with typing/docs.
  • statistics_utils:
    • Add permutation OLS z-scoring, hierarchical shuffling and surrogate generation, time-resolved single-channel regression, and parallel time-resolved mixed-effects with empirical/z p-values.
  • sync_utils:
    • Add photodiode/TTL timestamp extraction, pulse alignment, robust synchronization, and typed/docs across functions.

Written by Cursor Bugbot for commit 473232a. This will update automatically on new commits. Configure here.

Merge pull request #68 from seqasim/2025-11-15-96o6-91a92
@seqasim seqasim merged commit a264f31 into main Nov 15, 2025
1 of 4 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bug: NameError: Variable from Unquoted String

The condition elif entorhinal in roi: references an undefined variable entorhinal (missing quotes). This should be the string 'entorhinal' to check if the string is in the roi list. This will cause a NameError at runtime when this branch is executed.

LFPAnalysis/analysis_utils.py#L154-L155

roi += ['cingulate gyrus a', 'cingulate gyrus b', 'cingulate gyrus c']
elif entorhinal in roi:

Fix in Cursor Fix in Web


spikes - raw spike times used to compute STA, should be in s
signal - signal for averaging. can be filtered or unfiltered.
bound - bound of the STA in ms, +- this number
def lfp_sta(ev_times: np.ndarray, signal: np.ndarray, sr: float, pre: float, post: float):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Scope Error: Variable Name Mismatch

The variable elec_df is used but the function parameter is named elec_data. This causes a NameError since elec_df is not defined in the function scope. The code should use elec_data instead of elec_df.

Fix in Cursor Fix in Web

spikes - raw spike times used to compute STA, should be in s
signal - signal for averaging. can be filtered or unfiltered.
bound - bound of the STA in ms, +- this number
def lfp_sta(ev_times: np.ndarray, signal: np.ndarray, sr: float, pre: float, post: float):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Naming Error Prevents Code Execution

The variable elec_df is used but the function parameter is named elec_data. This causes a NameError since elec_df is not defined in the function scope. The code should use elec_data instead of elec_df.

Fix in Cursor Fix in Web

seqasim added a commit that referenced this pull request Nov 15, 2025
Merge pull request #70 from seqasim/2025-11-15-96o6-91a92
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

Successfully merging this pull request may close these issues.

2 participants