Skip to main content

plsdo

DOI

Partial Least Squares (PLS) covariance analysis with permutation testing, bootstrap reliability, and publication-ready visualisation — from the command line.

(Pronounced: "please do")

plsdo was built out of necessity for project-specific neuroscience and neuroimaging pipelines, then generalised to handle flexible, diverse datasets beyond its origins. It implements two PLS variants used in neuroimaging and cognitive neuroscience research:

  • Correlational PLS — finds latent variables that maximise covariance between two continuous data matrices (e.g. brain measures and behaviour scores).
  • Discriminatory PLS — finds latent variables that maximise covariance between a continuous data matrix and a dummy-coded group matrix (i.e. group differences).

Statistical validity is built in: every analysis runs a permutation test on singular values and bootstraps loading stability. Only latent variables that pass both tests appear in the output.

Early alpha. The API and output format may change before the first stable release. Feedback and bug reports are very welcome — please open an issue.


Installation

Requires Python ≥ 3.10.

uv pip install plsdo

For discriminatory PLS with cross-validation (requires scikit-learn):

uv pip install "plsdo[cv]"

For development:

git clone https://github.com/braincentrekcl/plsdo.git
cd plsdo
uv venv .venv && source .venv/bin/activate
uv pip install -e ".[dev]"

Quick start

Correlational PLS

plsdo run --method c \
  --x brain_measures.csv \
  --y behaviour_scores.csv \
  --demographics participants.csv \
  --group-col treatment \
  --subject-id participant_id \
  --output results/

Discriminatory PLS

plsdo run --method d \
  --y mri_features.csv \
  --demographics participants.csv \
  --group-col drug_group \
  --subject-id participant_id \
  --output results/

Cross-validation (discriminatory only)

Requires plsdo[cv] — see Installation above.

plsdo cross-validate \
  --y mri_features.csv \
  --demographics participants.csv \
  --group-col drug_group \
  --subject-id participant_id \
  --output cv_results/

Output

Each run writes to the output directory:

results/
  figures/     cross-correlation heatmap, permutation test, loading bar plots, score plots
  data/        singular values, p-values, loadings, bootstrap ratios, subject scores (CSV)
  log.txt      parameters and version stamp

Documentation

Page Contents
Usage guide Full CLI options, multiple grouping variables, all flags
Input format How to structure X, Y, demographics, and metadata files
Interpreting output What each plot and CSV means
Statistical methods Design matrix encoding, p-value correction, LV filtering, bootstrap alignment
Missing data Why plsdo does not impute, and what to do instead

Contributing

Issues and pull requests are welcome. Please open an issue before starting significant work.

Contact: eilidh [dot] macnicol [at] kcl [dot] ac [dot] uk


Citation

If you use plsdo in your research, please cite it. GitHub will show a "Cite this repository" prompt from the CITATION.cff file, or you can use the BibTeX entry in docs/references.bib.

Licence

BSD 3-Clause. See LICENSE.

Metadata

Release files for plsdo 0.1.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 plsdo 0.1.1
File Size Uploaded Provenance Actions
plsdo-0.1.1.tar.gz 46.5 kB With provenance Details for plsdo-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 73.2 kB

Release files / plsdo-0.1.1.tar.gz

Download URL plsdo-0.1.1.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c6e47cbcc600bafbc8cf3a814845d7c93f0bc643403ee4fd0ac18b296a00bf0d
BLAKE2b-256 checksum
How to use checksums
ea728c3d039cda98a4880b75ef85cbec0f9300eb42eeecdab3f8e09d80c0067b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

Release files / plsdo-0.1.1-py3-none-any.whl

Download URL plsdo-0.1.1-py3-none-any.whl
Size 26.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2f69b80157a5daac135b9c3f0f96badbdf4727339dce1eec1cea1ebde96c2d8
BLAKE2b-256 checksum
How to use checksums
fc3fe06e238f0c8fade321b509519bbb0a799f695e5f6f93d4731484a9f09710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

Security for plsdo 0.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for plsdo-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

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