Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Hypline

Python License: MIT CI CD

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

[!NOTE] hypline transcribe decodes audio through FFmpeg, which must be installed separately and on your PATH. Other commands do not need it.

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.

License

Released under the MIT License.

Download files

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

Source Distribution

hypline-0.3.0a3.tar.gz (550.3 kB view details)

Uploaded Source

Built Distribution

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

hypline-0.3.0a3-py3-none-any.whl (116.3 kB view details)

Uploaded Python 3

File details

Details for the file hypline-0.3.0a3.tar.gz.

File metadata

  • Download URL: hypline-0.3.0a3.tar.gz
  • Upload date:
  • Size: 550.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for hypline-0.3.0a3.tar.gz
Algorithm Hash digest
SHA256 561e6da9d0676df084e2051bf1ca32e399f890f0ae20670ef107b0d2e5ab86b1
MD5 539cd207b8600ae1689a50cc1e0e86f8
BLAKE2b-256 c21484ce391e941d9c49fe67606891419e72ead7ed22bf05a860e13d8e0252dd

See more details on using hashes here.

File details

Details for the file hypline-0.3.0a3-py3-none-any.whl.

File metadata

  • Download URL: hypline-0.3.0a3-py3-none-any.whl
  • Upload date:
  • Size: 116.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for hypline-0.3.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 1b25d3e08197d3e1d1ed352900ef824be288d984815b0d220e73cf274e4a94b9
MD5 044cf0ab2cb1d8d2b99d49909b17c296
BLAKE2b-256 83ca5456008060e09c8ad02a824b7c19b57ce0441fe209b6172639753ed58cbe

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0a3 This release

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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