Skip to main content

peacoqc-rs

PyPI version Python versions CI License: MIT

Python bindings for peacoqc-rs, a Rust implementation of the PeacoQC automated quality-control algorithm for flow cytometry data. Distributed on PyPI as peacoqc-rs; imported in Python as peacoqc.

How it works

A native extension module (built with maturin and PyO3) wraps the Rust peacoqc-rs crate and exposes its QC entry points to Python, bridging event tables through Polars/ pyo3-polars. Type stubs (peacoqc.pyi) ship with the package, so run_qc(...), FcsFile, etc. autocomplete and type-check in editors without extra config.

Prebuilt wheels are published for Linux (x86_64/aarch64), macOS (Intel/Apple Silicon), and Windows (x64), targeting Python 3.9+ via PyO3's stable ABI (abi3) — one wheel per platform covers every supported Python version, so there's no wheel-matrix version lottery to worry about.

Installation

pip install peacoqc-rs

Or with uv:

uv add peacoqc-rs

Quick Start

Point at an .fcs file and get filtered data back in one call:

import peacoqc

result, clean_df = peacoqc.run_qc_on_fcs("sample.fcs")
print(f"Removed {result.percentage_removed:.2f}% of events")

run_qc_on_fcs opens the file, applies compensation/transformation, and runs PeacoQC — the fastest path if you're starting from a raw .fcs file.

Already have a Polars DataFrame? Run QC directly against it:

import polars as pl
import peacoqc

df = pl.read_csv("events.csv")

result = peacoqc.run_qc(
    df,
    channels=["FL1-A", "FL2-A"],
    channel_ranges={"FL1-A": (0.0, 262144.0), "FL2-A": (0.0, 262144.0)},
)
print(f"Removed {result.percentage_removed:.2f}% of events")

# Apply the mask to filter good cells
clean_df = df.filter(pl.Series(result.good_cells))

Need more control over each pipeline stage? Margin removal, doublet removal, and FCS-specific helpers (FcsFile, open_fcs, preprocess, filter_fcs) are all available — see peacoqc.pyi for the full API surface and every function's parameters, or test_poc.py for exercised end-to-end usage.

Checking versions

peacoqc-py's bindings version and the underlying peacoqc-rs algorithm version are tracked independently — a bindings-only release (e.g. fixing a Python-facing error message) doesn't require bumping the algorithm version, and vice versa. Check both when comparing behavior against the peacoqc-rs changelog:

import peacoqc

print(peacoqc.__version__)             # peacoqc-py bindings version
print(peacoqc.__peacoqc_rs_version__)  # peacoqc-rs algorithm version baked into this wheel

Performance

Same algorithmic costs as peacoqc-rs; Python overhead is binding/conversion only. GPU features follow the Rust crate defaults when enabled at build time.

Building from source

For contributors: build from this directory with the usual PyO3/maturin flow.

maturin develop          # build + install into the active venv for local testing
maturin build --release  # build a release wheel into dist/

License

MIT

Related crates

Download files

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

Source Distribution

peacoqc_rs-0.1.1.tar.gz (478.9 kB view details)

Uploaded Source

Built Distributions

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

peacoqc_rs-0.1.1-cp39-abi3-win_amd64.whl (8.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

peacoqc_rs-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

peacoqc_rs-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

peacoqc_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

peacoqc_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file peacoqc_rs-0.1.1.tar.gz.

File metadata

  • Download URL: peacoqc_rs-0.1.1.tar.gz
  • Upload date:
  • Size: 478.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for peacoqc_rs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e2463e3e5f9db6fa1ae5013368ff69297004483788a42d41a38a63fa4bb9f8f2
MD5 f337793f4b181fcee16b6c31e3de3e93
BLAKE2b-256 6868fcaa221645db66313042355a8039b46851de33618feb5be3f8d6954b3844

See more details on using hashes here.

File details

Details for the file peacoqc_rs-0.1.1-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for peacoqc_rs-0.1.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 278447bfa8cf1090f9fe01ffca592f4818a9d184e0b1c73b247022c0d582275a
MD5 271c965e1d68824555be91c5f9d5a0be
BLAKE2b-256 ac7b9a0ddbbdc00d340b6782fd35d3c3cf02d9aa5d3ae5590877942f155b7f06

See more details on using hashes here.

File details

Details for the file peacoqc_rs-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for peacoqc_rs-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 063a3f8285c670fa32dbc7c2c995d90e90a6f165ae23f3d06e72aee1cca5a066
MD5 6e119f437c1dea5805e254678b0391a6
BLAKE2b-256 d62b0e360abb39d9b0d3c898a1f17918136bcf69192146b874d3e8669fde96b0

See more details on using hashes here.

File details

Details for the file peacoqc_rs-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for peacoqc_rs-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4f89a0e65a593c66d49a87b54c98248085f995fe1fffcd99e2dc24c01bc19de4
MD5 151d678679269eb586527b1b939bb40d
BLAKE2b-256 4027a942ab365af768df022ee25e47d9755955b5458e3756a8310a66703a1a3d

See more details on using hashes here.

File details

Details for the file peacoqc_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for peacoqc_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7e9ac8f0c9ee8b68178ac6d088f63ee18b18db93d9795e69284b606f24ef971
MD5 1135f1bfc651c5ad7776e7f9cbeb956e
BLAKE2b-256 1acb17795c15f230fb1067aebb18164c2c666a0020be37fb43a78246417e918a

See more details on using hashes here.

File details

Details for the file peacoqc_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for peacoqc_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f158edfabf12d533f2369b90b4c2838e2e015a56b935ec2a0b8886820a18374e
MD5 13ec4abc6793d079015fb7492ab166cd
BLAKE2b-256 15331478d30fe4dcdf045c9cd3485cbaeffb7fe9df96e99474eafc4e2e3654e3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

6 files

This release

0.1.1 This release

6 files

0.1.0

6 files

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