{"id":25594408,"url":"https://github.com/chaobrain/braincell","last_synced_at":"2026-03-11T18:06:27.358Z","repository":{"id":247330435,"uuid":"825447742","full_name":"chaobrain/braincell","owner":"chaobrain","description":"Biologically Detailed Brain Cell Modeling in JAX","archived":false,"fork":false,"pushed_at":"2025-02-16T06:21:12.000Z","size":1527,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T06:26:54.340Z","etag":null,"topics":["dendrite","dendrites","multi-compartment-modeling"],"latest_commit_sha":null,"homepage":"https://braincell.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaobrain.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-07T19:54:39.000Z","updated_at":"2025-02-16T06:21:16.000Z","dependencies_parsed_at":"2024-08-26T16:21:51.627Z","dependency_job_id":"2dc02ae8-a2d7-41f2-a108-56f852deb1c7","html_url":"https://github.com/chaobrain/braincell","commit_stats":null,"previous_names":["chaoming0625/dendritex","chaobrain/dendritex"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbraincell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbraincell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbraincell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbraincell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaobrain","download_url":"https://codeload.github.com/chaobrain/braincell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240002137,"owners_count":19732164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dendrite","dendrites","multi-compartment-modeling"],"created_at":"2025-02-21T11:00:33.914Z","updated_at":"2026-01-19T06:04:42.374Z","avatar_url":"https://github.com/chaobrain.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["New Libraries"],"readme":"\n\n# Biologically Detailed Brain Cell Modeling in JAX\n\n\u003cp align=\"center\"\u003e\n  \t\u003cimg alt=\"Header image of BrainCell.\" src=\"https://raw.githubusercontent.com/chaobrain/braincell/main/docs/_static/braincell.png\" width=50%\u003e\n\u003c/p\u003e \n\n\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://pypi.org/project/braincell/\"\u003e\u003cimg alt=\"Supported Python Version\" src=\"https://img.shields.io/pypi/pyversions/braincell\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/chaobrain/braincell/blob/main/LICENSE\"\u003e\u003cimg alt=\"LICENSE\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"\u003e\u003c/a\u003e\n    \u003ca href='https://braincell.readthedocs.io/?badge=latest'\u003e\n        \u003cimg src='https://readthedocs.org/projects/braincell/badge/?version=latest' alt='Documentation Status' /\u003e\n    \u003c/a\u003e  \t\n    \u003ca href=\"https://badge.fury.io/py/braincell\"\u003e\u003cimg alt=\"PyPI version\" src=\"https://badge.fury.io/py/braincell.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/chaobrain/braincell/actions/workflows/CI.yml\"\u003e\u003cimg alt=\"Continuous Integration\" src=\"https://github.com/chaobrain/braincell/actions/workflows/CI.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://doi.org/10.5281/zenodo.14969987\"\u003e\u003cimg src=\"https://zenodo.org/badge/825447742.svg\" alt=\"DOI\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n\n[braincell](https://github.com/chaobrain/braincell) provides a unified interface for modeling single-compartment and multi-compartment Hodgkin-Huxley-styled neuron models. \nIt is built on top of [JAX](https://github.com/jax-ml/jax) and [brainstate](https://github.com/chaobrain/brainstate), offering a highly parallelized and efficient simulation \nof biophysically detailed brain cell models.\n\n\n\n\n\n\n## Quick start\n\n\nHere is an example to model the **single-compartment** thalamus neuron model by using the interface of `braincell.SingleCompartment`:\n\n```python\nimport braincell\nimport brainstate\nimport braintools\nimport brainunit as u\n\nclass HTC(braincell.SingleCompartment):\n    def __init__(self, size, solver: str = 'ind_exp_euler'):\n        super().__init__(size, V_initializer=braintools.init.Constant(-65. * u.mV), V_th=20. * u.mV, solver=solver)\n\n        self.na = braincell.ion.SodiumFixed(size, E=50. * u.mV)\n        self.na.add(INa=braincell.channel.INa_Ba2002(size, V_sh=-30 * u.mV))\n\n        self.k = braincell.ion.PotassiumFixed(size, E=-90. * u.mV)\n        self.k.add(IKL=braincell.channel.IK_Leak(size, g_max=0.01 * (u.mS / u.cm ** 2)))\n        self.k.add(IDR=braincell.channel.IKDR_Ba2002(size, V_sh=-30. * u.mV, phi=0.25))\n\n        self.ca = braincell.ion.CalciumDetailed(size, C_rest=5e-5 * u.mM, tau=10. * u.ms, d=0.5 * u.um)\n        self.ca.add(ICaL=braincell.channel.ICaL_IS2008(size, g_max=0.5 * (u.mS / u.cm ** 2)))\n        self.ca.add(ICaN=braincell.channel.ICaN_IS2008(size, g_max=0.5 * (u.mS / u.cm ** 2)))\n        self.ca.add(ICaT=braincell.channel.ICaT_HM1992(size, g_max=2.1 * (u.mS / u.cm ** 2)))\n        self.ca.add(ICaHT=braincell.channel.ICaHT_HM1992(size, g_max=3.0 * (u.mS / u.cm ** 2)))\n\n        self.kca = braincell.MixIons(self.k, self.ca)\n        self.kca.add(IAHP=braincell.channel.IAHP_De1994(size, g_max=0.3 * (u.mS / u.cm ** 2)))\n\n        self.Ih = braincell.channel.Ih_HM1992(size, g_max=0.01 * (u.mS / u.cm ** 2), E=-43 * u.mV)\n        self.IL = braincell.channel.IL(size, g_max=0.0075 * (u.mS / u.cm ** 2), E=-70 * u.mV)\n\n```\n\n\nHere is an example to model the **multi-compartment** neuron model by using the interface of `braincell.MultiCompartment`:\n\n\n```python\nimport braincell\nimport brainstate\nimport brainunit as u\n\n\nclass HTC(braincell.MultiCompartment):\n    def __init__(self, size, solver: str = 'staggered'):\n        morphology = braincell.Morphology.from_swc(...)\n        super().__init__(size, \n                         morphology=morphology,   # the only difference from SingleCompartment\n                         V_initializer=brainstate.init.Constant(-65. * u.mV), \n                         V_th=20. * u.mV, \n                         solver=solver)\n        \n        self.na = braincell.ion.SodiumFixed(size, E=50. * u.mV)\n        self.na.add(INa=braincell.channel.INa_Ba2002(size, V_sh=-30 * u.mV))\n\n        self.k = braincell.ion.PotassiumFixed(size, E=-90. * u.mV)\n        self.k.add(IDR=braincell.channel.IKDR_Ba2002(size, V_sh=-30. * u.mV, phi=0.25))\n\n```\n\n\n\n## Installation\n\nYou can install ``braincell`` via pip:\n\n```bash\npip install braincell --upgrade\n```\n\n\nAlternatively, you can install `BrainX`, which bundles `braincell` with other compatible packages for a comprehensive brain modeling ecosystem:\n\n```bash\npip install BrainX -U\n```\n\n\n## Documentation\n\nThe official documentation is hosted on Read the Docs: [https://braincell.readthedocs.io](https://braincell.readthedocs.io)\n\n\n\n## See also the ecosystem\n\nBrainCell is one part of our brain modeling ecosystem: https://brainmodeling.readthedocs.io/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaobrain%2Fbraincell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaobrain%2Fbraincell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaobrain%2Fbraincell/lists"}