{"id":20956501,"url":"https://github.com/bluebrain/currentscape","last_synced_at":"2025-10-21T06:06:07.251Z","repository":{"id":174976472,"uuid":"639422992","full_name":"BlueBrain/Currentscape","owner":"BlueBrain","description":"Currentscape is a Python tool enabling scientists to easily plot the currents in electrical neuron models. The code is based on the paper Alonso and Marder, 2019.","archived":false,"fork":false,"pushed_at":"2024-11-05T12:40:43.000Z","size":2216,"stargazers_count":8,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-13T01:03:00.426Z","etag":null,"topics":["analyze","emodel"],"latest_commit_sha":null,"homepage":"https://currentscape.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlueBrain.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-11T12:53:22.000Z","updated_at":"2024-10-30T18:02:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"09dd83e3-017c-458e-857c-ee402e10a59f","html_url":"https://github.com/BlueBrain/Currentscape","commit_stats":null,"previous_names":["bluebrain/currentscape"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FCurrentscape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FCurrentscape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FCurrentscape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2FCurrentscape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueBrain","download_url":"https://codeload.github.com/BlueBrain/Currentscape/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225277088,"owners_count":17448623,"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":["analyze","emodel"],"created_at":"2024-11-19T01:26:20.800Z","updated_at":"2025-10-21T06:06:06.832Z","avatar_url":"https://github.com/BlueBrain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. warning::\n   The Blue Brain Project concluded in December 2024, so development has ceased under the BlueBrain GitHub organization.\n   Future development will take place at: https://github.com/openbraininstitute/Currentscape\n\nCurrentscape\n============\n\n\n+----------------+------------+\n| Latest Release | |pypi|     |\n+----------------+------------+\n| Documentation  | |docs|     |\n+----------------+------------+\n| License        | |license|  |\n+----------------+------------+\n| Build Status \t | |build|    |\n+----------------+------------+\n| Coverage       | |coverage| |\n+----------------+------------+\n| Gitter         | |gitter|   |\n+----------------+------------+\n| Citation       | |zenodo|   |\n+----------------+------------+\n\nIntroduction\n============\n\nCurrentscape is a Python tool enabling scientists to easily plot the currents in electrical neuron models.\nThe code is based on the paper `Alonso and Marder, 2019 \u003chttps://doi.org/10.7554/eLife.42722\u003e`__.\n\nCurrentscape figures plot the percentage of inward and outward ionic membrane currents,\nthe total inward and outward currents, as well as the voltage in function of time.\nIt allows modellers to see which currents play a role at any given time during a simulation, and check in depth the current dynamics.\n\n.. image:: https://raw.githubusercontent.com/BlueBrain/Currentscape/main/doc/source/images/plot.png\n\nCitation\n========\n\nWhen you use this Currentscape software for your research, we ask you to cite the following publications (this includes poster presentations):\n\n.. code-block:: \n\n    @article {alonsomarder2019,\n        article_type = {journal},\n        title = {Visualization of currents in neural models with similar behavior and different conductance densities},\n        author = {Alonso, Leandro M and Marder, Eve},\n        editor = {Westbrook, Gary L and Skinner, Frances K and Lankarany, Milad and Britton, Oliver},\n        volume = 8,\n        year = 2019,\n        month = {jan},\n        pub_date = {2019-01-31},\n        pages = {e42722},\n        citation = {eLife 2019;8:e42722},\n        doi = {10.7554/eLife.42722},\n        url = {https://doi.org/10.7554/eLife.42722},\n        abstract = {Conductance-based models of neural activity produce large amounts of data that can be hard to visualize and interpret. We introduce visualization methods to display the dynamics of the ionic currents and to display the models’ response to perturbations. To visualize the currents’ dynamics, we compute the percent contribution of each current and display them over time using stacked-area plots. The waveform of the membrane potential and the contribution of each current change as the models are perturbed. To represent these changes over a range of the perturbation control parameter, we compute and display the distributions of these waveforms. We illustrate these procedures in six examples of bursting model neurons with similar activity but that differ as much as threefold in their conductance densities. These visualization methods provide heuristic insight into why individual neurons or networks with similar behavior can respond widely differently to perturbations.},\n        keywords = {neuronal oscillators, Na+ channels, Ca++ channels, K+ channels, conductance-based, ionic channels},\n        journal = {eLife},\n        issn = {2050-084X},\n        publisher = {eLife Sciences Publications, Ltd},\n    }\n    \n    @article{currentscape, \n        title={Currentscape}, \n        DOI={10.5281/zenodo.8046373}, \n        abstractNote={Currentscape is a Python tool enabling scientists to easily plot the currents in electrical neuron models. The code is based on the paper Alonso and Marder, 2019. Currentscape figures plot the percentage of inward and outward ionic membrane currents, the total inward and outward currents, as well as the voltage in function of time. It allows modellers to see which currents play a role at any given time during a simulation, and check in depth the current dynamics.}, \n        publisher={Zenodo}, \n        author={Jaquier, Aurélien and Tuncel, Anil and Van Geit, Werner and Alonso, Leandro M and Marder, Eve}, \n        year={2023}, \n        month={Jun} \n    }\n\nSupport\n=======\n\nWe are providing support on `Gitter \u003chttps://gitter.im/BlueBrain/Currentscape\u003e`_. We suggest you create tickets on the `Github issue tracker \u003chttps://github.com/BlueBrain/Currentscape/issues\u003e`_ in case you encounter problems while using the software or if you have some suggestions.\n\nMain dependencies\n=================\n\n- `Python 3.8+ \u003chttps://www.python.org/downloads/release/python-380/\u003e`_\n- `Numpy \u003chttps://numpy.org/\u003e`_ (automatically installed by pip)\n- `Palettable \u003chttps://github.com/jiffyclub/palettable\u003e`_ (automatically installed by pip)\n\nInstallation\n============\n\nCurrentscape can be pip installed with the following command:\n\n.. code-block:: python\n\n    pip install currentscape\n\nIf you want to be able to run the Currentscape examples, you will need to also install the example dependencies:\n\n.. code-block:: python\n\n    pip install currentscape[example]\n\nQuick Start\n===========\n\nBelow is an example of a ball and stick model in NEURON with simple Hodgkin-Huxley mechanisms, to which a step stimulus is applied.\n\nThe voltage and ionic currents are recorded and fed to Currentscape, along with a configuration dictionary containing the current names to be displayed in the legend.\n\nTo run the code you will first have to install NEURON package:\n\n.. code-block:: python\n\n    pip install neuron\n\nWhen you then execute the following python code, a window should open with the currentscape plot:\n\n.. code-block:: python\n\n    import numpy as np\n    from neuron import h\n    from neuron.units import ms, mV\n    import currentscape\n\n\n    def main():\n        current_names = [\"Potassium\", \"Sodium\", \"Leak\"]\n\n        voltage, potassium, sodium, leak = run_sim()\n\n        config = {\n            \"output\": {\n                \"savefig\": True,\n                \"dir\": \".\",\n                \"fname\": \"quickstart_plot\",\n                \"extension\": \"png\",\n                \"dpi\": 300,\n                \"transparent\": False\n            },\n            \"current\": {\"names\": current_names},\n            \"voltage\": {\"ylim\": [-90, 50]},\n            \"legendtextsize\": 5,\n            \"adjust\": {\n                \"left\": 0.15,\n                \"right\": 0.8,\n                \"top\": 1.0,\n                \"bottom\": 0.0\n            }\n        }\n\n        fig = currentscape.plot(voltage, [potassium, sodium, leak], config)\n        fig.show()\n\n\n    def run_sim():\n        h.load_file('stdrun.hoc')\n\n        soma = h.Section(name='soma')\n        dend = h.Section(name='dend')\n\n        dend.connect(soma(1))\n\n        soma.L = soma.diam = 12.6157\n        dend.L = 200\n        dend.diam = 1\n\n        for sec in h.allsec():\n            sec.Ra = 100    # Axial resistance in Ohm * cm\n            sec.cm = 1      # Membrane capacitance in micro Farads / cm^2\n\n        # Insert active Hodgkin-Huxley current in the soma\n        soma.insert('hh')\n        for seg in soma:\n            seg.hh.gnabar = 0.12  # Sodium conductance in S/cm2\n            seg.hh.gkbar = 0.036  # Potassium conductance in S/cm2\n            seg.hh.gl = 0.0003    # Leak conductance in S/cm2\n            seg.hh.el = -54.3     # Reversal potential in mV\n\n        # Insert passive current in the dendrite\n        dend.insert('pas')\n        for seg in dend:\n            seg.pas.g = 0.001  # Passive conductance in S/cm2\n            seg.pas.e = -65    # Leak reversal potential mV\n\n        stim = h.IClamp(dend(1))\n        stim.delay = 5\n        stim.dur = 10\n        stim.amp = 0.1\n\n        t_vec = h.Vector()\n        v_vec = h.Vector()\n        ik_vec = h.Vector()\n        ina_vec = h.Vector()\n        il_vec = h.Vector()\n        t_vec.record(h._ref_t)\n        v_vec.record(soma(0.5)._ref_v)\n        ik_vec.record(soma(0.5)._ref_ik)\n        ina_vec.record(soma(0.5)._ref_ina)\n        il_vec.record(soma(0.5)._ref_il_hh)\n\n        h.finitialize(-65 * mV)\n        h.continuerun(25 * ms)\n\n        to_pA = 10 * soma(0.5).area()  # turn mA/cm2 (*um2) into pA\n        voltage = np.asarray(v_vec)\n        potassium = np.asarray(ik_vec) * to_pA\n        sodium = np.asarray(ina_vec) * to_pA\n        leak = np.asarray(il_vec) * to_pA\n\n        return voltage, potassium, sodium, leak\n\n\n    if __name__ == \"__main__\":\n        main()\n\nWhen you run this code in Python, it will generate the following currentscape plot (in a window, and on disk as quickstart_plot.png):\n\n.. image:: https://raw.githubusercontent.com/BlueBrain/Currentscape/main/doc/source/images/quickstart_plot.png\n\nTutorial\n========\n\nA more detailed explanation on how to use Currentscape, as well as other examples can be found on the `tutorial page \u003cTutorial.rst\u003e`_.\n\nAPI Documentation\n=================\n\nThe API documentation can be found on `ReadTheDocs \u003chttps://currentscape.readthedocs.io\u003e`_.\n\nFunding \u0026 Acknowledgements\n==========================\n\nWe wish to thank the authors of `Alonso and Marder, 2019 \u003chttps://doi.org/10.7554/eLife.42722\u003e`__ to let us integrate a part of their `code \u003chttps://datadryad.org/stash/dataset/doi:10.5061/dryad.d0779mb\u003e`_ into this repository.\n\nThe part of the code in this repository developed by the EPFL Blue Brain Project was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology.\n\nCopyright (c) 2023-2024 Blue Brain Project/EPFL\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/currentscape.svg\n               :target: https://pypi.org/project/currentscape/\n               :alt: latest release\n\n.. |docs| image:: https://readthedocs.org/projects/currentscape/badge/?version=latest\n               :target: https://currentscape.readthedocs.io/\n               :alt: latest documentation\n\n.. |license| image:: https://img.shields.io/pypi/l/currentscape.svg\n                  :target: https://github.com/BlueBrain/Currentscape/blob/main/LICENSE.txt\n                  :alt: license\n\n.. |build| image:: https://github.com/BlueBrain/Currentscape/workflows/test.yml/badge.svg?branch=main\n                :target: https://github.com/BlueBrain/Currentscape/actions\n                :alt: actions build status\n\n.. |coverage| image:: https://codecov.io/github/BlueBrain/Currentscape/coverage.svg?branch=main\n                   :target: https://codecov.io/gh/BlueBrain/currentscape\n                   :alt: coverage\n\n.. |gitter| image:: https://badges.gitter.im/Join%20Chat.svg\n                 :target: https://gitter.im/BlueBrain/Currentscape\n                 :alt: Join the chat at https://gitter.im/BlueBrain/Currentscape\n\n.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.8046484.svg\n                :target: https://doi.org/10.5281/zenodo.8046373\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluebrain%2Fcurrentscape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluebrain%2Fcurrentscape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluebrain%2Fcurrentscape/lists"}