跳转到主要内容

一个易于绘制currentscape的模块。

项目描述

Currentscape

最新发布

latest release

文档

latest documentation

许可证

license

构建状态

actions build status

覆盖率

coverage

Gitter

Join the chat at https://gitter.im/BlueBrain/Currentscape

引用

zenodo

简介

Currentscape是一个Python工具,使科学家能够轻松绘制电神经模型中的电流。该代码基于论文Alonso and Marder, 2019

Currentscape图形绘制内向和外向离子膜电流的百分比,总内向和外向电流,以及随时间变化的电压。它允许建模者在模拟的任何给定时间点查看哪些电流起作用,并深入了解电流动力学。

https://raw.githubusercontent.com/BlueBrain/Currentscape/main/doc/source/images/plot.png

引用

当您使用此Currentscape软件进行研究时,我们要求您引用以下出版物(这包括海报展示)

@article {alonsomarder2019,
    article_type = {journal},
    title = {Visualization of currents in neural models with similar behavior and different conductance densities},
    author = {Alonso, Leandro M and Marder, Eve},
    editor = {Westbrook, Gary L and Skinner, Frances K and Lankarany, Milad and Britton, Oliver},
    volume = 8,
    year = 2019,
    month = {jan},
    pub_date = {2019-01-31},
    pages = {e42722},
    citation = {eLife 2019;8:e42722},
    doi = {10.7554/eLife.42722},
    url = {https://doi.org/10.7554/eLife.42722},
    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.},
    keywords = {neuronal oscillators, Na+ channels, Ca++ channels, K+ channels, conductance-based, ionic channels},
    journal = {eLife},
    issn = {2050-084X},
    publisher = {eLife Sciences Publications, Ltd},
}

@article{currentscape,
    title={Currentscape},
    DOI={10.5281/zenodo.8046373},
    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.},
    publisher={Zenodo},
    author={Jaquier, Aurélien and Tuncel, Anil and Van Geit, Werner and Alonso, Leandro M and Marder, Eve},
    year={2023},
    month={Jun}
}

支持

我们正在Gitter上提供支持。Gitter。如果您在使用软件时遇到问题或有任何建议,建议您在Github问题跟踪器上创建工单。

主要依赖项

安装

您可以使用以下命令使用pip安装Currentscape:

pip install currentscape

如果您想运行Currentscape示例,您还需要安装示例依赖项

pip install currentscape[example]

快速入门

以下是在NEURON中实现的球棒模型的示例,其中包含简单的Hodgkin-Huxley机制,并施加了阶跃刺激。

记录电压和离子电流并将其与包含要在图例中显示的电流名称的配置字典一起输入Currentscape。

要运行此代码,您首先必须安装NEURON软件包

pip install neuron

当您执行以下Python代码时,应该会打开一个包含currentscape图的窗口

import numpy as np
from neuron import h
from neuron.units import ms, mV
import currentscape


def main():
    current_names = ["Potassium", "Sodium", "Leak"]

    voltage, potassium, sodium, leak = run_sim()

    config = {
        "output": {
            "savefig": True,
            "dir": ".",
            "fname": "quickstart_plot",
            "extension": "png",
            "dpi": 300,
            "transparent": False
        },
        "current": {"names": current_names},
        "voltage": {"ylim": [-90, 50]},
        "legendtextsize": 5,
        "adjust": {
            "left": 0.15,
            "right": 0.8,
            "top": 1.0,
            "bottom": 0.0
        }
    }

    fig = currentscape.plot(voltage, [potassium, sodium, leak], config)
    fig.show()


def run_sim():
    h.load_file('stdrun.hoc')

    soma = h.Section(name='soma')
    dend = h.Section(name='dend')

    dend.connect(soma(1))

    soma.L = soma.diam = 12.6157
    dend.L = 200
    dend.diam = 1

    for sec in h.allsec():
        sec.Ra = 100    # Axial resistance in Ohm * cm
        sec.cm = 1      # Membrane capacitance in micro Farads / cm^2

    # Insert active Hodgkin-Huxley current in the soma
    soma.insert('hh')
    for seg in soma:
        seg.hh.gnabar = 0.12  # Sodium conductance in S/cm2
        seg.hh.gkbar = 0.036  # Potassium conductance in S/cm2
        seg.hh.gl = 0.0003    # Leak conductance in S/cm2
        seg.hh.el = -54.3     # Reversal potential in mV

    # Insert passive current in the dendrite
    dend.insert('pas')
    for seg in dend:
        seg.pas.g = 0.001  # Passive conductance in S/cm2
        seg.pas.e = -65    # Leak reversal potential mV

    stim = h.IClamp(dend(1))
    stim.delay = 5
    stim.dur = 10
    stim.amp = 0.1

    t_vec = h.Vector()
    v_vec = h.Vector()
    ik_vec = h.Vector()
    ina_vec = h.Vector()
    il_vec = h.Vector()
    t_vec.record(h._ref_t)
    v_vec.record(soma(0.5)._ref_v)
    ik_vec.record(soma(0.5)._ref_ik)
    ina_vec.record(soma(0.5)._ref_ina)
    il_vec.record(soma(0.5)._ref_il_hh)

    h.finitialize(-65 * mV)
    h.continuerun(25 * ms)

    to_pA = 10 * soma(0.5).area()  # turn mA/cm2 (*um2) into pA
    voltage = np.asarray(v_vec)
    potassium = np.asarray(ik_vec) * to_pA
    sodium = np.asarray(ina_vec) * to_pA
    leak = np.asarray(il_vec) * to_pA

    return voltage, potassium, sodium, leak


if __name__ == "__main__":
    main()

当您在Python中运行此代码时,它将生成以下currentscape图(在窗口中,并在磁盘上作为quickstart_plot.png)

https://raw.githubusercontent.com/BlueBrain/Currentscape/main/doc/source/images/quickstart_plot.png

教程

有关如何使用Currentscape的更详细说明以及其他示例,请参阅教程页面

API文档

API文档可以在ReadTheDocs上找到。

资金与致谢

我们感谢Alonso和Marder,2019的作者允许我们将他们代码的部分集成到本存储库中。

本存储库中开发的代码部分由瑞士政府ETH委员会对洛桑联邦理工学院(EPFL)的Blue Brain项目的研究中心资助。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装软件包的更多信息。

源分布

currentscape-1.0.16.tar.gz (343.3 KB 查看散列

上传时间

构建分布

currentscape-1.0.16-py3-none-any.whl (340.0 KB 查看散列

上传于 Python 3

由以下组织支持