Skip to main content

Python library for reading files in Axon Binary Format (ABF)

Project description

pyABF provides a Python interface to files in the Axon Binary Format (ABF)

Quickstart

Access Sweep Data:

import pyabf
abf = pyabf.ABF("demo.abf")
abf.setSweep(3) # sweeps start at 0
print(abf.sweepY) # sweep data (ADC)
print(abf.sweepC) # sweep command (DAC)
print(abf.sweepX) # sweep times (seconds)

Plot a Single Sweep:

import matplotlib.pyplot as plt
import pyabf
abf = pyabf.ABF("17o05028_ic_steps.abf")
abf.setSweep(14)
plt.plot(abf.sweepX, abf.sweepY, lw=.5)
plt.show()
pyABF Example

Create Fancy Plots with Matplotlib:

import matplotlib.pyplot as plt
import pyabf
abf = pyabf.ABF("17o05028_ic_steps.abf")

plt.figure(figsize=(8, 5))
for sweepNumber in range(abf.sweepCount)[::5]:
    abf.setSweep(sweepNumber)
    plt.plot(abf.sweepX,abf.sweepY,alpha=.5,label=f"sweep {sweepNumber+1}")

plt.margins(0, .1)
plt.legend()
plt.ylabel(abf.sweepLabelY)
plt.xlabel(abf.sweepLabelX)
plt.title(abf.abfID)
plt.tight_layout()
plt.show()
pyABF Example

Additional Examples

Full pyabf API documentation, additional code examples, a pyabf cookbook, and low-level information about the ABF file format can be found at the pyABF project homepage: https://github.com/swharden/pyABF

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyabf-2.0.28.tar.gz (35.0 kB view details)

Uploaded Source

File details

Details for the file pyabf-2.0.28.tar.gz.

File metadata

  • Download URL: pyabf-2.0.28.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.14.2 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

File hashes

Hashes for pyabf-2.0.28.tar.gz
Algorithm Hash digest
SHA256 c864f94ff609859a61dcf551b3f0b2891dfa25b2ca94d882c6dfbcc2ea6b0fc1
MD5 93eda0868a5df6ba47fbf38815754cf2
BLAKE2b-256 b15da6b1a5c20d24a4cf3b17ffc936c103a069d127266646befa9a0394d14078

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page