用于读取Axon二进制格式(ABF)文件的Python库
pyabf的Python项目详细描述
pyabf:纯python abf文件读取器
pyabf以axon二进制格式(abf)为电生理文件提供了一个python接口。 Pyabf支持Python2.7和Python3.6+,并且不使用晦涩的库 (只有标准库加上numpy和matplotlib)。Pyabf支持读取 abf1和abf2文件,并可以写入abf1文件。
快速启动
安装或升级pyabf:
pip install --upgrade pyabf
访问ABF扫描数据:
importpyabfabf=pyabf.ABF("demo.abf")abf.setSweep(3)print(abf.sweepY)# sweep data (ADC)print(abf.sweepC)# sweep command (DAC)print(abf.sweepX)# sweep times (seconds)
使用matplotlib绘制扫描:
importmatplotlib.pyplotaspltimportpyabfabf=pyabf.ABF("17o05028_ic_steps.abf")abf.setSweep(14)plt.plot(abf.sweepX,abf.sweepY)plt.show()
喜欢matplotlib:
importmatplotlib.pyplotaspltimportpyabfabf=pyabf.ABF("sample.abf")plt.figure(figsize=(8,5))forsweepNumberinrange(abf.sweepCount)[::5]:abf.setSweep(sweepNumber)plt.plot(abf.sweepX,abf.sweepY,alpha=.5,label="sweep %d"%(sweepNumber))plt.legend()plt.ylabel(abf.sweepLabelY)plt.xlabel(abf.sweepLabelX)plt.title("pyABF and Matplotlib are a great pair!")plt.show()
引用pyabf
如果Pyabf模块有助于您的研究,请考虑按名称引用此项目,以便它也能使其他人受益:
“Computational analysis of electrophysiological recordings was performed with custom software written for this project using Python 3.6 and the pyABF module.”
功能请求/不支持的ABF文件
如果有不受支持的abf文件(或读取错误) 通过这个软件,很可能是因为我们没有运行一个用例 到现在为止,让我们知道!我们只能开发和测试 这个软件是针对我们可以访问的abf文件的,所以如果你 有兴趣让您的abf文件支持发送主要作者 一封电子邮件(以及你试图分析的abf文件),我们将 调查一下。如果找到解决方案,pyabf包将 更新以使每个人都能从更改中受益。 我们只能为我们能接触到的ABF开发(和测试)。 所以我们非常感谢你的贡献!