Skip to main content

Implementations of the ZETA family of statistical tests.

Project description

zetapy

Repository containing ZETA functions and dependencies. For an example of how to use the code, check example.py.

Now available as pip package! Simply "pip install zetapy".

  • This Python repository and the pip package are maintained by Guido Meijer and Alexander Heimel.
  • The original code is written in MATLAB by Jorrit Montijn .
  • A Julia port, developed by Pierre Le Merre, is available here: ZetaJu

Our pre-print describing data-stitching, the time-series ZETA-test, and the two-sample tests is available online.

The article describing the original ZETA-test has been published in eLife.

The ZETA-test for spiking data has been extensively tested on real and artificial data, and has been peer-reviewed. The time-series ZETA-test and two-sample ZETA-tests are also thoroughly tested and are described in our pre-print, which we will submit for peer-review soon. We are confident all ZETA-tests, including the two-sample tests, are reliable and statistically sound, but if you find any bugs, do let us know on the Issues page!

This repository contains five main functions:

  • zetatest: Calculates the Zenith of Event-based Time-locked Anomalies (ZETA) for spike times of a single neuron. Outputs a p-value.
  • zetatstest: Calculates the time-series version of ZETA, for data such as calcium imaging or EEG recordings.
  • zetatest2: Same as (1), but for testing whether two neurons respond differently to the same stimulus; or whether one neuron responds differently to two sets of stimuli.
  • zetatstest2: Same as (2), but for testing differences between two time-series data arrays.
  • ifr: Calculates the instantaneous firing rate (IFR) without running the ZETA-test. Use this as you would a PSTH function.

Rationale for ZETA

Neurophysiological studies depend on a reliable quantification of whether and when a neuron responds to stimulation, be it sensory, optogenetically or otherwise. However, current statistical analysis methods to determine a neuron’s responsiveness require arbitrary parameter choices, such as a binning size. This choice can change the results of the analysis, which invites bad statistical practice and reduces the replicability of analyses. Moreover, many methods, such as bin-wise t-tests, only detect classically mean-rate modulated cells. Especially with advent of techniques that yield increasingly large numbers of cells, such as Neuropixels recordings or two-photon calcium imaging, it is important to use tests for cell-inclusion that require no manual curation. Here, we present a new family of statistical tests for responses in point-event and time-series data for one- and two-sample comparisons: the family of ZETA-tests. As shown in our papers, they outperform approaches such as optimally-binned ANOVAs, t-tests and model-based approaches, in the sense that it includes more cells in real neurophysiological data at a similar false-positive rate.

Latency

For computing the latency of a response, we recommend to use the LatenZy test (https://github.com/Herseninstituut/latenZy), based on the zeta-test.

zeta_image

Project details


Download files

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

Source Distribution

zetapy-4.0.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zetapy-4.0-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

File details

Details for the file zetapy-4.0.tar.gz.

File metadata

  • Download URL: zetapy-4.0.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for zetapy-4.0.tar.gz
Algorithm Hash digest
SHA256 cb791b6c891f2971513ad22a373b3d17f2efc79bda49ca2151bb6358e1181432
MD5 2349082034593aa8efffd72a204b548d
BLAKE2b-256 fd9d6ab2a4756db63af4a2fa83e519da6a100d928b9eb71c59d764768f9ab174

See more details on using hashes here.

File details

Details for the file zetapy-4.0-py3-none-any.whl.

File metadata

  • Download URL: zetapy-4.0-py3-none-any.whl
  • Upload date:
  • Size: 44.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for zetapy-4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24ac318fe7cba3e0e038db1d1179655a47e872d14ac40509615570e4fd6680c8
MD5 df5aaa182219cb9e2ef596ab514bf79a
BLAKE2b-256 df777a4bcd6d8a0b76244ecba51753075d62cd266f9ceaaccf5bf3463462fbb9

See more details on using hashes here.

Supported by

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