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()

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

Uploaded Source

Built Distributions

efel-5.7.8-cp312-cp312-win_amd64.whl (222.3 kB view details)

Uploaded CPython 3.12 Windows x86-64

efel-5.7.8-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.8-cp312-cp312-macosx_10_9_x86_64.whl (275.1 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

efel-5.7.8-cp311-cp311-win_amd64.whl (222.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

efel-5.7.8-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.8-cp311-cp311-macosx_10_9_x86_64.whl (274.9 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

efel-5.7.8-cp310-cp310-win_amd64.whl (222.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

efel-5.7.8-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.8-cp310-cp310-macosx_10_9_x86_64.whl (274.9 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

efel-5.7.8-cp39-cp39-win_amd64.whl (222.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

efel-5.7.8-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.8-cp39-cp39-macosx_10_9_x86_64.whl (274.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: efel-5.7.8.tar.gz
  • Upload date:
  • Size: 108.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for efel-5.7.8.tar.gz
Algorithm Hash digest
SHA256 ac41d687a17ff637f907d81d86d5adc4ed8461300fbfd95b98e231b317b2ccb4
MD5 9e198b7d559095d7d2872cbb1e9b0745
BLAKE2b-256 c668a02fa50292006f48abd05d77146315771add09f59b6424ab00b9dfa6f82d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: efel-5.7.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 222.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for efel-5.7.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6e50450a195e11bbd91f1f0c0a0b5c2d1c1d7cce61b4fe768f03f2c429b7132a
MD5 8f3c4535b79506580a9f36b8b2cf22d6
BLAKE2b-256 ecda2f5b17f0b9030a77bcb957aa3797ccc2f4ae8776a9490019955ff0ba8f6a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for efel-5.7.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee7b85b41e57a9ac9e96c06d3aab375d510e040bf4accc710833eb84d60aa94c
MD5 9f6bd36f0907c773dd1b2555eb6e2670
BLAKE2b-256 2b21dc9ff73ce43b2d870d671b0c09d401c2db9982ef359f5f599867b5bb493f

See more details on using hashes here.

Provenance

File details

Details for the file efel-5.7.8-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for efel-5.7.8-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 704fb66b1bc598fa0f61d6017a800055048c0b0e81d66ddd1a6114c00469743d
MD5 794dce723a5c10c00bfd8daa9a9af247
BLAKE2b-256 338399833eb2a40da03491dd51fccc79056de75933e8a85dfbe695a0c65b58c0

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: efel-5.7.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 222.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for efel-5.7.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 65cde7cb180e6e3e27fe916f8983d68373f6d97abd8eff4de85758af918e3693
MD5 df90a2f4405e048315c6c422e3f226dc
BLAKE2b-256 2f581a1026b8e18483f6ba2536bf363a09336a6841a1477f0b6a424427d2ad7f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for efel-5.7.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98cc9cafb8ae96bb4f5ff544d44f171ea9ca5c1d485d3eac4444e754fc86e4c6
MD5 b5dc79d9c919deac0d34eee27d181249
BLAKE2b-256 68bcd387d1f572933a4d51a75dce8c847ad39f17224de7c8981ca3f77e77d370

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for efel-5.7.8-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2fdda0571608807ae059f62198d4172476e51f81ee58a635056d987fe8fd571a
MD5 cbad37a08c23f79e6887b800e0928c2d
BLAKE2b-256 944ff2dead85b29632f70bff0df257b5c23a8cc7c15a2dc0dd2e20f71f1e274d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: efel-5.7.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 222.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for efel-5.7.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4d53d681210400fd7b1b9549c222235a10e5b563bb38899d55f0f3868e76a9ff
MD5 57033eab785e1bb03a2bbfded495f502
BLAKE2b-256 58a5d8cbd6166fede12e4460d547cbe1045c81d053299b1fc82165b3a9e60d22

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for efel-5.7.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 369f8d1a623d0bed9fb04f898134cca91cbca4be0f963f134d6b48601bff8c99
MD5 aae1bd7037f4a2453390b95ac6142a94
BLAKE2b-256 f0e193df3679dc616630cc6c285f25489784626f5d56bae098ee720691999600

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for efel-5.7.8-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 919709d1fed7e46f93d8696c84a7e73b17020bdd2ff95bf6d06fe5e3469e391e
MD5 8582dfa89244de346cab5e777153e3f8
BLAKE2b-256 b96725a115fea39c73fc50f97d409f0d6183bb00990b73563d052cbdf06f54a4

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: efel-5.7.8-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 222.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for efel-5.7.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 aa7054e624405bd6461490e8921b5846b9c0de299064a955b88752ee303c8929
MD5 c3aa057ffe1718f6b21409e405307b95
BLAKE2b-256 231c83642f7052e7410cd41eeb5066eca800c1c1d5bc7257199c39660bbbc718

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for efel-5.7.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b3c5f9fb094b6a32b53c048e9f84a01b53958a3d32dec9f6cd8a4da7f974181
MD5 5d69295619e01bc2a75e13ac23e44949
BLAKE2b-256 9ddded07bddeb85cc4efe67ca762325da2bbd866b5748d577c8ec1a72433481b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for efel-5.7.8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 041b7a55b0a15871c7fd4c3004db2633a237edd29067b80faa8ff9cafeab570a
MD5 777c2f172200589aaa7869c1a33ff6c3
BLAKE2b-256 f4eeea5d63256faf2be4667c44578cae8dc09663d30116bc64d1bc4e29cbcbde

See more details on using hashes here.

Provenance

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