Agent skill

Neuropixels Analysis

by aipoch in aipoch/medical-research-skills

End-to-end Neuropixels extracellular electrophysiology analysis (SpikeGLX/Open Ephys/NWB) including preprocessing, motion correction, Kilosort4 spike sorting, QC metrics, and Allen/IBL-style…

MITAuto-check passedData & Analytics

Install Neuropixels Analysis

skills CLI
$ npx skills add aipoch/medical-research-skills --skill neuropixels-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills neuropixels-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'scientific-skills/Data Analysis/neuropixels-analysis' .claude/skills/neuropixels-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
neuropixels-analysis
GitHub stars
2k
Token cost
~2.4k tokens
SKILL.md length
711 words
Files
19 (incl. scripts, references, assets)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

End-to-end Neuropixels extracellular electrophysiology analysis (SpikeGLX/Open Ephys/NWB) including preprocessing, motion correction, Kilosort4 spike sorting, QC metrics, and Allen/IBL-style…

  • Works in 7 steps: Data I/O and supported formats → Preprocessing chain (typical) → Motion estimation and correction → …
  • Processing Neuropixels recordings
  • SKILL.md covers When to Use, Key Features, Dependencies and Example Usage, plus 1 more section
  • Runs Python scripts from its folder; calls python

What it does

Neuropixels Analysis is an agent skill from aipoch/medical-research-skills. End-to-end Neuropixels extracellular electrophysiology analysis (SpikeGLX/Open Ephys/NWB) including preprocessing, motion correction, Kilosort4 spike sorting, QC metrics, and Allen/IBL-style curation; use when processing Neuropixels recordings or when users mention Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, drift/motion correction, or unit curation.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 21 other files, including scripts, reference files and assets (for example `assets/analysis_template.py`, `neuropixels-analysis_audit_result_v1.json` and `references/AI_CURATION.md`).

It sits in Data & Analytics. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Processing Neuropixels recordings
  • Users mention Neuropixels
  • Quality metrics
  • Drift/motion correction

Example prompts

  • “/neuropixels-analysis”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Data I/O and supported formats
  2. Preprocessing chain (typical)
  3. Motion estimation and correction
  4. Spike sorting
  5. Post-processing and quality metrics
  6. Curation logic (Allen/IBL-style)
  7. AI-assisted visual analysis (optional)

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 5 files in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Neuropixels Analysis loads about 2.4k tokens when it runs, and up to ~26k if it reads all its reference files. Until then it costs about 98 tokens; SKILL.md has 711 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~98
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~26k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 711 words, ~2,428 tokens.

Download SKILL.mdSave it as .claude/skills/neuropixels-analysis/SKILL.md (or your agent's skills folder). This skill also uses 18 other files; get the full folder from GitHub.
name
neuropixels-analysis
description
End-to-end Neuropixels extracellular electrophysiology analysis (SpikeGLX/Open Ephys/NWB) including preprocessing, motion correction, Kilosort4 spike sorting, QC metrics, and Allen/IBL-style curation; use when processing Neuropixels recordings or when users mention Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, drift/motion correction, or unit curation.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

When to Use

Use this skill in any of the following situations:

  1. You need to load and standardize Neuropixels recordings from SpikeGLX (.ap.bin/.lf.bin/.meta), Open Ephys (.continuous/.oebin), or NWB (.nwb) into a consistent analysis pipeline.
  2. You are preparing raw extracellular data for spike sorting, including high-pass filtering, phase shift correction (NP1.0), bad channel detection/removal, and common average referencing (CAR).
  3. You suspect probe drift or tissue motion and need to estimate and correct motion before sorting (especially when drift is > ~10 µm).
  4. You want to run spike sorting (Kilosort4 recommended; CPU alternatives supported) and then compute post-processing products (waveforms, templates, amplitudes, correlograms, unit locations).
  5. You need quality control and curation using Allen/IBL-style thresholds, plus optional AI-assisted visual review for borderline units, and exports to Phy/NWB.

Key Features

  • Multi-format ingestion: SpikeGLX, Open Ephys, and NWB readers via SpikeInterface.
  • Neuropixels-aware preprocessing:
    • High-pass filtering for spike band
    • Phase shift correction for Neuropixels 1.0
    • Bad channel detection and removal
    • Median CAR / referencing
  • Motion/drift workflow:
    • Motion estimation presets (e.g., “Kilosort-like”)
    • Optional rigid/non-rigid correction presets
    • Drift visualization outputs
  • Spike sorting orchestration:
    • Kilosort4 (GPU) recommended
    • CPU alternatives (e.g., SpykingCircus2, Mountainsort5, Tridesclous2)
  • Post-processing and QC:
    • SortingAnalyzer-based computation of waveforms, templates, amplitudes, correlograms, unit locations, and quality metrics
  • Curation:
    • Allen/IBL-style automated labeling
    • Optional AI-assisted visual analysis for uncertain units
  • Reporting and export:
    • HTML report generation
    • Export to Phy and NWB
    • Save metrics tables (CSV)

Reference guides (if present in the repository) can be used for deeper explanations:

  • reference/standard_workflow.md
  • reference/api_reference.md
  • reference/plotting_guide.md
  • reference/PREPROCESSING.md, reference/MOTION_CORRECTION.md, reference/SPIKE_SORTING.md
  • reference/QUALITY_METRICS.md, reference/AUTOMATED_CURATION.md, reference/AI_CURATION.md

Dependencies

Python dependencies (typical versions known to work; adjust to your environment):

  • python >= 3.9
  • spikeinterface[full] >= 0.99
  • probeinterface >= 0.2
  • neo >= 0.13
  • Spike sorters (optional, depending on what you run):
    • kilosort >= 4.0 (Kilosort4; GPU required)
    • spykingcircus >= 1.1 (SpykingCircus2; CPU)
    • mountainsort5 >= 0.5 (CPU)
  • Optional (AI-assisted curation):
    • anthropic >= 0.20
  • Optional (IBL tooling):
    • ibllib >= 2.0
    • ibl-neuropixel >= 1.0

Example Usage

The following example is designed to be a complete, runnable script (assuming dependencies and a valid dataset path). It loads SpikeGLX data, preprocesses, estimates/corrects motion, runs Kilosort4, computes metrics, curates units, generates a report, and exports to Phy and NWB.

python
import spikeinterface.full as si
import neuropixels_analysis as npa

def main():
    # Parallelization / chunking settings used by SpikeInterface functions
    job_kwargs = dict(n_jobs=-1, chunk_duration="1s", progress_bar=True)

    # 1) Load data (SpikeGLX example)
    # For Open Ephys: si.read_openephys("/path/to/Record_Node_101/")
    # For NWB:        si.read_nwb("/path/to/file.nwb")
    recording = si.read_spikeglx("/path/to/spikeglx_folder", stream_id="imec0.ap")

    # Optional: slice first 60 seconds for a quick test
    fs = recording.get_sampling_frequency()
    recording = recording.frame_slice(0, int(60 * fs))

    # 2) Preprocess (recommended chain; wrapper may include the same steps)
    # Note: phase_shift is mandatory for Neuropixels 1.0 and not needed for 2.0.
    rec = npa.preprocess(recording)

    # 3) Estimate drift/motion and correct if needed
    motion_info = npa.estimate_motion(rec, preset="kilosort_like", **job_kwargs)
    npa.plot_drift(rec, motion_info, output="drift_map.png")

    # Example threshold: correct if max drift exceeds 10 µm
    if float(motion_info["motion"].max()) > 10.0:
        rec = npa.correct_motion(rec, preset="nonrigid_accurate", **job_kwargs)

    # 4) Spike sorting (Kilosort4 recommended; requires GPU)
    sorting = si.run_sorter("kilosort4", rec, folder="ks4_output", **job_kwargs)

    # 5) Post-processing + metrics
    analyzer = si.create_sorting_analyzer(sorting, rec, sparse=True)

    analyzer.compute("random_spikes", max_spikes_per_unit=500, **job_kwargs)
    analyzer.compute("waveforms", ms_before=1.0, ms_after=2.0, **job_kwargs)
    analyzer.compute("templates", operators=["average", "std"], **job_kwargs)
    analyzer.compute("spike_amplitudes", **job_kwargs)
    analyzer.compute("correlograms", window_ms=50.0, bin_ms=1.0, **job_kwargs)
    analyzer.compute("unit_locations", method="monopolar_triangulation", **job_kwargs)
    analyzer.compute("quality_metrics", **job_kwargs)

    metrics = analyzer.get_extension("quality_metrics").get_data()
    metrics.to_csv("quality_metrics.csv")

    # 6) Automated curation (Allen/IBL-style)
    labels = npa.curate(metrics, method="allen")  # e.g., "allen", "ibl", "strict"

    # 7) Report
    results = {"sorting": sorting, "metrics": metrics, "labels": labels, "analyzer": analyzer}
    npa.generate_analysis_report(results, "output_report/")
    npa.print_analysis_summary(results)

    # 8) Export
    si.export_to_phy(
        analyzer,
        output_folder="phy_export/",
        compute_pc_features=True,
        compute_amplitudes=True,
    )

    from spikeinterface.exporters import export_to_nwb
    export_to_nwb(rec, sorting, "output.nwb")

if __name__ == "__main__":
    main()

Implementation Details

1) Data I/O and supported formats
  • SpikeGLX: si.read_spikeglx(path, stream_id="imec0.ap")
  • Open Ephys: si.read_openephys(path)
  • NWB: si.read_nwb(path)

Neuropixels probe types commonly encountered:

  • Neuropixels 1.0: requires phase shift correction to align channels.
  • Neuropixels 2.0: denser geometries; phase shift correction typically not required.
2) Preprocessing chain (typical)

A standard spike-band preprocessing sequence is:

  1. High-pass filter (commonly 300–400 Hz) to isolate spikes.
  2. Phase shift correction (si.phase_shift) for NP1.0.
  3. Bad channel detection (si.detect_bad_channels) and removal.
  4. Common reference (often median CAR) to reduce shared noise.

Key parameters:

  • freq_min (high-pass cutoff): typical 300–400 Hz
  • bad channel detection sensitivity (implementation-dependent; often exposed as thresholds/presets)
Show full SKILL.md (265 more words)Show less
3) Motion estimation and correction
  • Motion/drift can strongly degrade sorting quality; a practical rule is to inspect drift before sorting.
  • Presets:
    • preset="kilosort_like": faster estimation aligned with common sorter assumptions
    • preset="nonrigid_accurate": more robust correction for severe drift

Operational threshold often used in practice:

  • If estimated drift exceeds ~10 µm, apply correction before sorting.
4) Spike sorting
  • Kilosort4 is recommended for Neuropixels due to speed and quality, but requires a GPU.
  • CPU alternatives can be used when GPU is unavailable (at the cost of runtime and sometimes quality).

Sorter parameters to tune (Kilosort4 examples):

  • batch_size: samples per batch (often ~30000 by default)
  • nblocks: number of drift blocks (increase for long recordings)
  • Th_learned: detection threshold (lower → more spikes, potentially more false positives)
5) Post-processing and quality metrics

Using SortingAnalyzer, the pipeline typically computes:

  • waveforms (window: ms_before, ms_after)
  • templates (average/std)
  • spike amplitudes
  • correlograms (e.g., window_ms=50, bin_ms=1)
  • unit locations (e.g., monopolar_triangulation)
  • quality metrics (e.g., SNR, ISI violations, presence ratio, amplitude cutoff)

Common QC thresholds (dataset-dependent; document your choices):

  • snr_threshold: often 3–5
  • isi_violations_ratio: often 0.01–0.5
  • presence_ratio: often 0.5–0.95
6) Curation logic (Allen/IBL-style)

A conservative “good unit” selection often combines:

  • high presence ratio (stable across recording)
  • low ISI violations (refractory period respected)
  • low amplitude cutoff (less truncation / missed spikes)

Example rule (illustrative):

  • presence_ratio > 0.9
  • isi_violations_ratio < 0.5
  • amplitude_cutoff < 0.1
7) AI-assisted visual analysis (optional)

For borderline units (e.g., moderate SNR), AI-assisted review can be used to interpret:

  • waveform shape consistency
  • refractory period evidence in autocorrelograms
  • amplitude stability and drift effects
  • multi-unit contamination indicators

If your repository provides npa.analyze_unit_visually(...), it can be integrated with an API client (e.g., anthropic) to generate structured curation suggestions.

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 18 other files (scripts, references, assets) in scientific-skills/Data Analysis/neuropixels-analysis of aipoch/medical-research-skills.

  • SKILL.md
  • assets/analysis_template.py
  • neuropixels-analysis_audit_result_v1.json
  • references/AI_CURATION.md
  • references/ANALYSIS.md
  • references/AUTOMATED_CURATION.md
  • references/MOTION_CORRECTION.md
  • references/PREPROCESSING.md
  • references/QUALITY_METRICS.md
  • references/SPIKE_SORTING.md
  • references/api_reference.md
  • references/plotting_guide.md
  • references/standard_workflow.md
  • scripts/compute_metrics.py
  • scripts/explore_recording.py
  • scripts/export_to_phy.py
  • scripts/neuropixels_pipeline.py
  • scripts/preprocess_recording.py
  • … and 1 more

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Neuropixels Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Neuropixels Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Neuropixels Analysis this skillaipoch/medical-research-skills2k—~2.4kAutomated safety check: PassMIT
Exploratory Data Analysisspacering-net/codeg3.8k15 repos~3.6kAutomated safety check: PassMIT
MatplotlibzLanqing/codex-claude-academic-skills4.6k18 repos~2.9kAutomated safety check: PassMIT
Scikit LearnzLanqing/codex-claude-academic-skills4.6k17 repos~3.9kAutomated safety check: PassBSD-3-Clause
Chart Visualizationbytedance/deer-flow83k2 repos~840Automated safety check: PassMIT
TimesFM Forecastinggoogle-research/timesfm34k—~4.7kAutomated safety check: PassApache-2.0

Similar skills

  • Exploratory Data Analysis

    spacering-net/codeg

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    3.8k GitHub starsUsed in 15 repos~3.6k tokens
    Data & AnalyticsAuto-check passed
  • Matplotlib

    zLanqing/codex-claude-academic-skills

    Low-level plotting library for full customization. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 18 repos~2.9k tokens
    Data & AnalyticsAuto-check passed
  • Scikit Learn

    zLanqing/codex-claude-academic-skills

    Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 17 repos~3.9k tokens
    Data & AnalyticsAuto-check passed
  • Chart Visualization

    bytedance/deer-flow

    Picks a suitable chart type from 26 options for your data, maps the data to that chart's parameters and generates a chart image through a JavaScript script.

    83k GitHub starsUsed in 2 repos~840 tokens
    Data & AnalyticsAuto-check passed
  • TimesFM Forecasting

    google-research/timesfm

    Forecasts any univariate time series zero-shot with Google's TimesFM model, returning point forecasts and calibrated prediction intervals without training.

    34k GitHub stars~4.7k tokensUpdated 8 days ago
    Data & AnalyticsAuto-check passed
  • Sandbox Bench

    vercel/next.js

    Official

    Benchmark React or Next.js changes on Vercel Sandbox VMs with paired A/B statistics: react PR/commit vs base, or Next.js PR/commit vs base, measured end-to-end through the bench/render-pipeline app…

    143k GitHub stars~4.1k tokensUpdated today
    Data & AnalyticsAuto-check passed

More from aipoch/medical-research-skills

All 567 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 21 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 21 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 21 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 21 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 21 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 21 days ago
    Auto-check passed

Questions about Neuropixels Analysis

What does Neuropixels Analysis do?

End-to-end Neuropixels extracellular electrophysiology analysis (SpikeGLX/Open Ephys/NWB) including preprocessing, motion correction, Kilosort4 spike sorting, QC metrics, and Allen/IBL-style…. Neuropixels Analysis is an agent skill from aipoch/medical-research-skills. End-to-end Neuropixels extracellular electrophysiology analysis (SpikeGLX/Open Ephys/NWB) including preprocessing, motion correction, Kilosort4 spike sorting, QC metrics, and Allen/IBL-style curation; use when processing Neuropixels recordings or when users mention Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, drift/motion correction, or unit curation.

When should I use Neuropixels Analysis?

Neuropixels Analysis fits situations like: processing Neuropixels recordings; users mention Neuropixels; quality metrics; drift/motion correction.

How do I install Neuropixels Analysis in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill neuropixels-analysis -a claude-code`. Or copy the skill folder (scientific-skills/Data Analysis/neuropixels-analysis in aipoch/medical-research-skills) into .claude/skills/neuropixels-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Neuropixels Analysis in Codex?

Run `npx skills add aipoch/medical-research-skills --skill neuropixels-analysis -a codex`. Or copy the skill folder (scientific-skills/Data Analysis/neuropixels-analysis in aipoch/medical-research-skills) into .agents/skills/neuropixels-analysis in your project. Codex loads it when a task matches its description.

Can I use Neuropixels Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill neuropixels-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/neuropixels-analysis, .gemini/skills/neuropixels-analysis, .github/skills/neuropixels-analysis and .opencode/skills/neuropixels-analysis in your project.

What does Neuropixels Analysis need to run?

Going by SKILL.md and its folder, Neuropixels Analysis needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Neuropixels Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Neuropixels Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Neuropixels Analysis use?

Neuropixels Analysis is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Neuropixels Analysis use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 24k tokens, read only when the agent opens those files.

What are the alternatives to Neuropixels Analysis?

Skills that share tags, products or a category with Neuropixels Analysis: Exploratory Data Analysis (spacering-net/codeg, 3.8k stars), Matplotlib (zLanqing/codex-claude-academic-skills, 4.6k stars), Scikit Learn (zLanqing/codex-claude-academic-skills, 4.6k stars) and Chart Visualization (bytedance/deer-flow, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Neuropixels Analysis?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.