braincell

Build and simulate conductance-based neuron models with Hodgkin-Huxley channels and multicompartment morphology.

1|Updated Jul 23, 2026
One-click install
npx skills add https://github.com/chaobrain/BrainX-skill --skill braincell-chaobrain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: braincell
Source: https://github.com/chaobrain/BrainX-skill/tree/main/brainx-display-cases/creative-experiment-verification/06-seizure-recruitment/run2/.agents/skills/braincell
Command: npx skills add https://github.com/chaobrain/BrainX-skill --skill braincell-chaobrain

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires braincell, brainstate, brainunit, braintools, jax, matplotlib, numpy, and includes references (resource) components.

What problem does it solve? Building biophysically accurate neuron models requires correctly wiring ions, channels, morphology, solvers, and units; this Skill guides coding agents through the BrainCell API so cellular simulations are constructed and validated correctly. ## Core Features & Use Cases - Single-compartment modeling: Create isopotential Hodgkin-Huxley point neurons with SingleCompartment, fixed or dynamic ions, built-in channel libraries, and current-clamp simulation loops. - Multicompartment modeling: Load SWC morphologies or construct branches manually, discretize with CV policies, and attach mechanisms via paint()/place() declarations. - Mechanism selection and authoring: Choose from built-in sodium, potassium, calcium, HCN, and mixed-ion channels, or author custom HH/Markov channels and dynamic ions with validation guidance. - Use Case: A researcher asks an agent to reproduce a spike-frequency adaptation experiment; the Skill routes it to dynamic calcium, MixIons(k, ca), an AHP channel, and a controlled ablation pattern with solver and convergence checks. ## Quick Start Ask the agent to build a Hodgkin-Huxley single-compartment neuron in BrainCell that fires under a 5 uA/cm^2 injected current and plots the voltage trace.

Frequently Asked Questions about braincell

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Hodgkin-Huxley neuron in BrainCell?

Subclass braincell.SingleCompartment, attach SodiumFixed and PotassiumFixed ions with Na_HH1952 and K_HH1952 channels, add an IL leak channel, then call init_state() and step with cell.update(I_ext) inside a brainstate environment context.

How do I simulate a multicompartment neuron from an SWC file?

Load the geometry with braincell.Morphology.from_swc, create a braincell.Cell with a CV policy, paint cable properties and density channels over regions, place clamps and probes at locsets, then call init_state() and cell.run(dt, duration).

What is the difference between SingleCompartment and Cell in BrainCell?

SingleCompartment models one isopotential point neuron where size sets independent neurons, while Cell discretizes a morphology into coupled control volumes for spatial voltage dynamics. Use Cell only when geometry, branching, or location-specific stimulation matters.

Which solver should I use for Hodgkin-Huxley dynamics?

Use exp_euler as the accuracy-oriented default for stiff HH gating, ind_exp_euler for faster large vectorized simulations, and staggered or cn_exp_euler for multicompartment cables. Always pass the solver name explicitly and verify convergence by halving dt.

How do I add calcium-dependent adaptation or an AHP current?

Use a dynamic calcium ion such as CalciumDetailed, then combine it with a potassium ion via braincell.MixIons(k, ca) in that exact order and attach a channel like AHP_De1994 to the mixed owner. The potassium ion supplies the reversal potential while calcium drives concentration dynamics.

When should I author a custom ion or channel instead of using built-ins?

Author a custom mechanism only after confirming no built-in or literature-derived class matches the required kinetics. Use the HH template for independent gates, Markov for coupled state probabilities, and validate formulas, lifecycle, and model-level behavior against a reference.