Skip to main content

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

Project description

Quickstart

Display ABF Information:

import pyabf
abf=pyabf.ABF("filename.abf")
abf.info()

Access ABF Sweep Data:

import pyabf
abf=pyabf.ABF("filename.abf")
abf.setSweep(7)
print(abf.dataY, abf.units)
print(abf.dataC, abf.unitsCommand)
print(abf.dataX, abf.unitsTime)

Output:

[-47.729 -47.729 -47.76  ..., -42.542 -42.542 -42.572] mV
[ 0.  0.  0. ...,  0.  0.  0.] pA
[ 0.  0.  0. ...,  3.  3.  3.] seconds

Plot all sweeps with matplotlib:

import pyabf
import matplotlib.pyplot as plt

abf=pyabf.ABF("filename.abf")
for sweepNumber in abf.sweepList:
    abf.setSweep(sweepNumber)
    plt.plot(abf.dataX,abf.dataY)

plt.ylabel(abf.unitsLong)
plt.xlabel(abf.unitsTimeLong)
plt.margins(0,.1)
plt.show()

Output:

pyABF Example - plot every sweep of an ABF file

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-0.1.16.tar.gz (20.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pyabf-0.1.16.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyabf-0.1.16.tar.gz
Algorithm Hash digest
SHA256 edb24dfa774cf93842706205caeeb05425ade2f13d1083b0d4f717c62e86c23e
MD5 eea510b8ace5ce99fb3fb36ee750c36a
BLAKE2b-256 3ce701b45d4044ff8f08006a0aa38881d69c92942ced41c4f6d02b77a05bd234

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