Skip to main content

Hypline

Python License: MIT CI CD DOI

Hypline is a command-line toolbox for cleaning and analyzing data from hyperscanning studies involving dyadic conversations. Its commands are modular: each does one job — transcribe audio, generate features, denoise fMRIPrep BOLD, fit an encoding model — and runs on its own, all inside one BIDS-style dataset.

An encoding model predicts the brain's BOLD response from features of the speech a participant heard. Hypline prepares both sides of that fit — the stimulus features and the denoised BOLD — then fits and scores the model with encoding. You bring two inputs: the stimulus audio and the fMRIPrep-preprocessed BOLD. Hypline starts from fMRIPrep's outputs; it does not preprocess the BOLD itself.

Hypline implements the encoding-model approach of Zada et al. (2026), Neuron (10.1016/j.neuron.2025.11.004), which used fMRI hyperscanning and language-model features to study the shared neural systems for speech production and comprehension in real-time dyadic conversations.

Installation

pip install hypline

Also installable with uv (uv add hypline) or poetry (poetry add hypline). This installs the hypline command:

hypline --help

The pipeline

Hypline's commands compose into a pipeline. Every command reads from a shared dataset root and writes back into the same tree. Most fall into two independent branches — a stimulus branch and an fMRIPrep branch — that prepare the two sides the encoding branch then joins:

Command Branch Reads Writes
transcribe stimulus stimulus audio word-level transcripts
featuregen phonemic stimulus transcripts phonemic features (+ confounds)
featuregen semantic stimulus transcripts semantic features (+ confounds)
featuregen spectral stimulus stimulus audio spectral features (TR-aligned)
featuregen syntactic stimulus transcripts syntactic features
confoundgen phonemic stimulus phonemic features conf-phonemic confounds
confoundgen semantic stimulus semantic features conf-semantic confounds
denoise fMRIPrep preprocessed BOLD, fMRIPrep confounds denoised BOLD (desc-denoised)
encoding train encoding features, confounds, denoised BOLD fitted models (results/)
encoding analyze encoding fitted models, features, denoised BOLD eval correlations (results/)

featuregen phonemic also generates the matching phonemic confounds by default, so you rarely call confoundgen phonemic directly. And you needn't run every step: any command works on its own once its inputs exist — run transcribe alone for transcripts, or denoise alone to clean fMRIPrep BOLD.

Quick start

Once your files sit where hypline expects (see the dataset layout), you only ever point a command at the dataset root — it finds its own inputs from there, so you never pass file paths. End to end, the whole pipeline is four commands:

# stimulus branch: audio → transcripts → features (+ phonemic confounds, auto)
hypline transcribe data/ --audio-ext .wav
hypline featuregen phonemic data/

# fMRIPrep branch: clean the BOLD with a motion + drift model, read straight
# from fMRIPrep's confounds table
hypline denoise data/ \
  --columns trans_x,trans_y,trans_z,rot_x,rot_y,rot_z,cosine

# encoding branch: fit the model that maps features onto the denoised BOLD
hypline encoding train data/ \
  --data-filters task-conv \
  --features phonemic \
  --desc v1 \
  --fold-by none

After this, data/ holds phonemic features plus desc-denoised BOLD — the two sides the encoding model needs — and a fitted model under results/. Re-run any step with --force to overwrite its outputs; without it, hypline skips work it has already done.

Documentation

Full guides and per-command reference live at the project documentation. New to hypline? Walk through a full run on the example dataset, or read The hypline dataset layout — every command depends on it. To load a fitted model or eval back into Python, see the encoding results API.

Citing Hypline

If you use Hypline in your research, please cite it:

  1. Open Hypline's Zenodo record.
  2. Pick the version you used under Versions (the latest is shown by default).
  3. Copy the citation from Citation, in the format you need (APA, BibTeX, and others).

If you use the encoding model, please also cite Zada et al. (2026).

License

Released under the MIT License.

Metadata

Release files for hypline 0.3.0

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

Source distribution (sdist)

Source distribution for hypline 0.3.0
File Size Uploaded Provenance Actions
hypline-0.3.0.tar.gz 559.6 kB Without provenance Details for hypline-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 677.2 kB

Release files / hypline-0.3.0.tar.gz

Download URL hypline-0.3.0.tar.gz
Size 559.6 kB
Tags Source
SHA-256 checksum
How to use checksums
234e666ec4f5ddd0d315109d03dc1eec881a7ad54aa131299fb9123c0b8cf6c8
BLAKE2b-256 checksum
How to use checksums
7dfa3a456af093bd1549e45429cb726f0540fe67924735c076562cb809b5d118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.15

Release files / hypline-0.3.0-py3-none-any.whl

Download URL hypline-0.3.0-py3-none-any.whl
Size 117.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e429e938cc5b8197abc18653261de11d348ce8c9eb5e5ded78164ada87485d8
BLAKE2b-256 checksum
How to use checksums
69e7ed2c0f54fe13fc21585f647e4cb7a542a8ebdf034e5d7da9c973a9cc093a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.15

Security for hypline 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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