Metadata-Version: 2.5
Name: melizalab-tools
Version: 2026.10.14
Summary: Meliza lab scripts and modules for auditory neurophysiology
Project-URL: Homepage, https://github.com/melizalab/melizalab-tools
Author-email: C Daniel Meliza <dan@meliza.org>
Maintainer-email: C Daniel Meliza <dan@meliza.org>
License: BSD 3-Clause License
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: appdirs>=1.4.4
Requires-Dist: arf>=2.7.2
Requires-Dist: ewave>=1.0.10
Requires-Dist: jsonschema>=4.18
Requires-Dist: libtfr>=2.1.9
Requires-Dist: neurobank<0.13,>=0.12
Requires-Dist: pandas>=2.3.1
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: quickspikes>=2.0.8
Requires-Dist: samplerate>=0.2.3
Requires-Dist: scipy>=1.15.3
Requires-Dist: toelis>=2.1.4
Provides-Extra: audio
Requires-Dist: samplerate>=0.2.3; extra == 'audio'
Description-Content-Type: text/x-rst

melizalab-tools
===============

|ProjectStatus|_ |Version|_ |BuildStatus|_ |License|_ |PythonVersions|_

.. |ProjectStatus| image:: https://www.repostatus.org/badges/latest/active.svg
.. _ProjectStatus: https://www.repostatus.org/#active

.. |Version| image:: https://img.shields.io/pypi/v/melizalab-tools.svg
.. _Version: https://pypi.python.org/pypi/melizalab-tools/

.. |BuildStatus| image:: https://github.com/melizalab/melizalab-tools/actions/workflows/python_tests.yml/badge.svg
.. _BuildStatus: https://github.com/melizalab/melizalab-tools/actions/workflows/python_tests.yml

.. |License| image:: https://img.shields.io/pypi/l/melizalab-tools.svg
.. _License: https://opensource.org/license/bsd-3-clause/

.. |PythonVersions| image:: https://img.shields.io/pypi/pyversions/melizalab-tools.svg
.. _PythonVersions: https://pypi.python.org/pypi/melizalab-tools/

A collection of python code and scripts used by the Meliza Lab.

To install: ``pipx install melizalab-tools``

modules
~~~~~~~

-  ``dlab.pprox``: functions for working with
   `pprox <https://meliza.org/spec:2/pprox/>`__ objects, a data format
   for storing multi-trial point process data (e.g. spike times evoked
   by stimulus presentation).
-  ``dlab.neurobank``: some convenient wrappers for interacting with a
   `neurobank <https://github.com/melizalab/neurobank/>`__ repository and archives.
-  ``dlab.signal``:  signal processing functions

console scripts
~~~~~~~~~~~~~~~

-  ``group-kilo-spikes``: sort spike times output from
   `kilosort <https://github.com/MouseLand/Kilosort>`__ and
   `phy2 <https://github.com/cortex-lab/phy/>`__ into pprox files
   (`stimtrial <https://meliza.org/spec:2/stimtrial/>`__ format), optionally
   recording pulses on auxiliary channels such as optogenetic stimulation
   (``--aux``). For recordings without a sync track, ``--audio-sync CHANNEL``
   finds the stimulus onsets on a copy of the audio by cross-correlation
   (``python -m dlab.audio_sync`` does this on its own, for checking a
   recording). If only part of the recording was sorted, ``--sort-start`` and
   ``--sort-stop`` give the part. Where kilosort's output for it starts is
   found by checking it against the recording's neural channels, to the
   sample, and the output is timed from the recording's start. Stimuli
   presented under other names than they were deposited under are mapped with
   ``--alt-stim-names``. The outputs record the sort, the sorter's version
   (read from kilosort 4's log, or given with ``--sorter``), and how many of
   each unit's spikes were dropped and why.
-  ``audit-kilo-spikes``: check the ``group-kilo-spikes`` output for one
   recording against its waveform files, the stimulus messages in the ARF
   file, and each other, and write a JSON report. Changes nothing.
-  ``find-kilo-units``: find the units of recordings in the registry and write
   a control file for running ``audit-kilo-spikes`` in batches.
-  ``collect-kilo-audit``: summarize the ``audit-kilo-spikes`` reports.
-  ``regenerate-pprox``: rebuild missing pprox files from their waveform files.
-  ``get-songs``: extract segments from arf files, rescale, resample, save into
   wave files, and optionally deposit back into neurobank. Usually the first
   step in generating a stimulus set, keeps a nice provenance trail.

See `docs/audit.md
<https://github.com/melizalab/melizalab-tools/blob/master/docs/audit.md>`__
for how to run the audit and what its findings mean.

other stuff
~~~~~~~~~~~

