Skip to main content

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

Release files for zetapy 4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zetapy 4.1
File Size Uploaded
zetapy-4.1.tar.gz 42.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zetapy 4.1
File Interpreter ABI Platform
zetapy-4.1-py3-none-any.whl Python 3 none any Details

Total release size: 87.0 kB

Release files / zetapy-4.1.tar.gz

Download URL zetapy-4.1.tar.gz
Size 42.8 kB
Tags Source
SHA-256 checksum
How to use checksums
30cc715f5edb23c7a64eb6fe41b480a1a392fa19d0e27cc881520de03f0d87aa
BLAKE2b-256 checksum
How to use checksums
98b8df0e0a509d30089d857c99b17f7d6cf5d761b9fd92bf7c2bf6034c8f2513
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Release files / zetapy-4.1-py3-none-any.whl

Download URL zetapy-4.1-py3-none-any.whl
Size 44.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99a38fc1818cbfa5ba1dcc52c37c3b3b5212855eb30165d57f5068c826a5352e
BLAKE2b-256 checksum
How to use checksums
c4819b0d99a0709bb36702742f898500f656e3446da8dc465ab379218fa5ca1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Release history Release notifications | RSS feed

This release

4.1 This release

2 release files

4.0

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2

2 release files

3.1

1 release file

3.0.9

1 release file

3.0.8

1 release file

3.0.7

1 release file

3.0.6

1 release file

3.0.5

1 release file

3.0.4

1 release file

3.0.3

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.7.2

1 release file

2.7.1

1 release file

2.7

1 release file

2.6.2

1 release file

2.6.1

1 release file

2.6.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page