Skip to main content

Electrophys Feature Extract Library (eFEL)

Project description

eFEL banner
Latest Release latest release
Documentation latest documentation
License license
Build Status actions build status
Coverage coverage
Gitter
Citation DOI

Introduction

The Electrophys Feature Extraction Library (eFEL) allows neuroscientists to automatically extract features from time series data recorded from neurons (both in vitro and in silico). Examples are the action potential width and amplitude in voltage traces recorded during whole-cell patch clamp experiments. The user of the library provides a set of traces and selects the features to be calculated. The library will then extract the requested features and return the values to the user.

The core of the library is written in C++, and a Python wrapper is included. At the moment we provide a way to automatically compile and install the library as a Python module. Instructions on how to compile the eFEL as a standalone C++ library can be found here.

How to cite

When you use this eFEL software for your research, we ask you to cite it (this includes poster presentations) by referring to the "Cite this repository" button at the top of the repository page to get various citation formats, including APA and BibTeX.

For detailed citation information, please refer to the CITATION.cff file.

Requirements

  • Python 3.9+
  • Pip (installed by default in newer versions of Python)
  • C++ compiler that can be used by pip
  • Numpy (will be installed automatically by pip)
  • The instruction below are written assuming you have access to a command shell on Linux / UNIX / MacOSX / Cygwin

Installation

The easiest way to install eFEL is to use pip

pip install efel

In case you don't have administrator access this command might fail with a permission error. In that case you could install eFEL in your home directory

pip install efel --user

Or you could use a python virtual environment

virtualenv pythonenv
. ./pythonenv/bin/activate
# If you use csh or tcsh, you should use:
# source ./pythonenv/bin/activate.csh
pip install efel

If you want to install straight from the github repository you can use

pip install git+git://github.com/BlueBrain/eFEL

Quick Start

First you need to import the module

import efel

To get a list with all the available feature names

efel.get_feature_names()

Note that the extra-cellular features, the bpap_attenuation feature and the check_ais_initiation feature are not listed above because they have to be used in a special way, as described here for extra-cellular features, here for bpap_attenuation feature and here for check_ais_initiation feature.

To change the spike detection threshold setting (default is -20 mV)

efel.set_setting('Threshold', -30)

For a full list of available settings, please refer to the Setting class

The python function to extract features is get_feature_values(...). Below is a short example on how to use this function. The code and example trace are available here

"""Basic example 1 for eFEL"""

import efel
import numpy

def main():
    """Main"""

    # Use numpy to read the trace data from the txt file
    data = numpy.loadtxt('example_trace1.txt')

    # Time is the first column
    time = data[:, 0]
    # Voltage is the second column
    voltage = data[:, 1]

    # Now we will construct the datastructure that will be passed to eFEL

    # A 'trace' is a dictionary
    trace1 = {}

    # Set the 'T' (=time) key of the trace
    trace1['T'] = time

    # Set the 'V' (=voltage) key of the trace
    trace1['V'] = voltage

    # Set the 'stim_start' (time at which a stimulus starts, in ms)
    # key of the trace
    # Warning: this need to be a list (with one element)
    trace1['stim_start'] = [700]

    # Set the 'stim_end' (time at which a stimulus end) key of the trace
    # Warning: this need to be a list (with one element)
    trace1['stim_end'] = [2700]

    # Multiple traces can be passed to the eFEL at the same time, so the
    # argument should be a list
    traces = [trace1]

    # set the threshold for spike detection to -20 mV
    efel.set_setting('Threshold', -20)

    # Now we pass 'traces' to the efel and ask it to calculate the feature
    # values
    traces_results = efel.get_feature_values(traces,
                                           ['AP_amplitude', 'voltage_base'])

    # The return value is a list of trace_results, every trace_results
    # corresponds to one trace in the 'traces' list above (in same order)
    for trace_results in traces_results:
        # trace_result is a dictionary, with as keys the requested features
        for feature_name, feature_values in trace_results.items():
            print("Feature %s has the following values: %s" %
                (feature_name, ', '.join([str(x) for x in feature_values])))


if __name__ == '__main__':
    main()

The output of this example is

Feature AP_amplitude has the following values: 72.5782441262, 46.3672552618, 41.1546679158, 39.7631750953, 36.1614653031, 37.8489295737
Feature voltage_base has the following values: -75.446665721

This means that the eFEL found 5 action potentials in the voltage trace. The amplitudes of these APs are the result of the 'AP_amplitude' feature. The voltage before the start of the stimulus is measured by 'voltage_base'. Results are in mV.

Full documentation

The full documentation can be found here

Funding

This work has been partially funded by the European Union Seventh Framework Program (FP7/2007­2013) under grant agreement no. 604102 (HBP), the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 720270, 785907 (Human Brain Project SGA1/SGA2) and by the EBRAINS research infrastructure, funded from the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 945539 (Human Brain Project SGA3). This project/research 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.

Copyright (c) 2009-2024 Blue Brain Project/EPFL

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

efel-5.7.12.tar.gz (108.8 kB view details)

Uploaded Source

Built Distributions

efel-5.7.12-cp312-cp312-win_amd64.whl (223.1 kB view details)

Uploaded CPython 3.12 Windows x86-64

efel-5.7.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

efel-5.7.12-cp312-cp312-macosx_10_13_x86_64.whl (274.5 kB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

efel-5.7.12-cp311-cp311-win_amd64.whl (223.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

efel-5.7.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

efel-5.7.12-cp311-cp311-macosx_10_9_x86_64.whl (275.6 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

efel-5.7.12-cp310-cp310-win_amd64.whl (223.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

efel-5.7.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

efel-5.7.12-cp310-cp310-macosx_10_9_x86_64.whl (275.6 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

efel-5.7.12-cp39-cp39-win_amd64.whl (223.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

efel-5.7.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

efel-5.7.12-cp39-cp39-macosx_10_9_x86_64.whl (275.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file efel-5.7.12.tar.gz.

File metadata

  • Download URL: efel-5.7.12.tar.gz
  • Upload date:
  • Size: 108.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for efel-5.7.12.tar.gz
Algorithm Hash digest
SHA256 1321d2bd819ae5a89115493b00600676d471136fd143f5055ec4072fcf55dae2
MD5 1056af6f00525d6661b81d2c10947464
BLAKE2b-256 407a2460f39c050920c04543f89dababc3713035ac11a96e4333dddb66d09ed0

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: efel-5.7.12-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 223.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for efel-5.7.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5fe77f00b5f85fcac94c8d6394f0984549871d1ad6e9d0de5d4b07160e06f300
MD5 6e1c9005e04f2829f28cf16fcc8169c4
BLAKE2b-256 21ecab816f56e8c75a70d109f151ba5224dbe87398846a12f1a51f290d66d36c

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ffe6f886890f3e5f1ef9d16e850627ba34ed83a29846c420c85b164f2b041c6a
MD5 5a7fb33a21b3613165bccd78e351a4b8
BLAKE2b-256 af4473be3dabd09456dddfcb0500bf1a4ade49cb52974617d88110ccb7e694ef

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 bd95a4e319a6b2028f55849e966c6402c5158bbfcef39313bf46b9b3bae8d926
MD5 b8bb255b263ca6da406a4ed2d16aec08
BLAKE2b-256 c55b85cef2217bcc3eb864efb551e6fd2bfd040f6397ff71e7edf63d995442e9

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: efel-5.7.12-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 223.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for efel-5.7.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 494387372ffeecbccec18974b2d180292515ff7857d3a3542a68962826dbfc27
MD5 cea2d1f4ee48ed05376a34db8793b4ea
BLAKE2b-256 cb634c2be0d23c85c585ce50a4bda024d8b98f8f7c7a54e5f965828a307c65ba

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b72f5abb140e066d96966011c76344853a2607bd9c095f95da835fdb04d44984
MD5 9628cd346b8de3108d9fa32ebcdf93f2
BLAKE2b-256 49d118b753ae21aaf1cac8a95adcf8ba8512c1f25f3783d14f454f063d4ae907

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ff620d328e810b1e1b5ea613fab40785b0a8631d297daf01b772b24babb04a11
MD5 cf11b02db774562aa7759e6304634a62
BLAKE2b-256 aa966c41fa5a194b46e049206730affbc25e016ec542cda269a519147ad7af34

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: efel-5.7.12-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 223.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for efel-5.7.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 265be2d15e3f9d9342c1d9aa09c4d2e8d504c4d5269f3852f7f63fbafe42ce71
MD5 38ada036cfd9d8b74b3a7d1d4f74743f
BLAKE2b-256 7099f9b250d44e1ff0ba56b2750e659dd718921ffa1114cd760fbe70bad1f85a

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c63c09c364822627ef5121619ada2b667a1f99374f00cf1501b3d58ce54c0d5e
MD5 2396b8e93f9c18356a921eb515d57367
BLAKE2b-256 e6e21a11a70e8260918471eda06b74551ddb6d4ec76fc75862c5c025c7d645b3

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9dc16d9732d1b7aa98e0b7a187d99e18fa018d62d2d821ff6caf017042480ca3
MD5 f5fbcd8b668b8650226d57d2d5594abd
BLAKE2b-256 f57a0f0bcc1d81cf6943ca7ea880ea6847462f6d0950035df82348fffca101df

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: efel-5.7.12-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 223.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for efel-5.7.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0d689df0470437475d8d28dcf23743b2bbb67aa1bbcc42e0a783ca318279c77a
MD5 b9bf1f2721998b13b9aa5b401059c431
BLAKE2b-256 220ee0eeb1988e3ec0f0d4b3b2bb0ab59c54a0f61c1480bd0eb9d7efdfd8319c

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a4e5f9df5a35dbc63148f7710d9eb5cc7cfdaf21620678665d0d2f259cbec7f
MD5 aa4badcca9fab289e9893561d7a64c73
BLAKE2b-256 19d600ad9ed33054ce0284d187e2300267181ba34822c44f2273ef163efe24da

See more details on using hashes here.

File details

Details for the file efel-5.7.12-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.12-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c61f37dba2d883b9e4ace9e7d937155bd9e5609599c2039da08f6c65e9e451b6
MD5 7a59d796571c501aa38ff764a3f2b597
BLAKE2b-256 dceb693c8bd66818f48962700b121e2d04c89f9c35d8712f75296d215983db6a

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