Skip to main content

Self-contained flow cytometry analysis helpers with a slim vendored Cytoflow runtime.

Project description

xiaoyu-cytoflow

xiaoyu-cytoflow is a self-contained flow-cytometry analysis package for 96-well plate FCS workflows. It packages Xiaoyu's analysis helpers together with the small Cytoflow runtime subset they need, so users do not have to install the unmaintained upstream cytoflow package separately.

The package focuses on the workflow exposed by xiaoyu_CF: importing plate FCS files, attaching sample and concentration metadata, removing outliers, gating cell populations and doublets, plotting channel distributions, subsetting by well/row/column, and exporting 96-well median signal tables.

The installable API is the xiaoyu_CF package plus the vendored runtime packages cytoflow and fcsparser. analysis.py is kept as a small example script in the repository; it is not packaged as an importable module.

Why This Exists

The original analysis code depended on a locally patched Cytoflow install that was difficult to recreate on modern Python. This repository vendors the working pieces of that local runtime and updates them for Python 3.12, making the analysis easier to share, test, and publish.

The vendored Cytoflow subset is intentionally small. It keeps the pieces used by the current workflow:

  • FCS import and experiment storage
  • range, polygon, and density gates
  • autofluorescence and linear bleedthrough correction
  • histogram, scatter, and density views
  • linear and log scales

The compiled Cytoflow logicle extension was removed, so this package is pure Python.

Installation

The recommended development setup uses mamba:

mamba env create -f environment.yml
mamba activate xiaoyu-cytoflow

The environment installs this repository in editable mode, so local changes are immediately visible.

In an existing Python 3.12 environment, install with:

pip install -e .

After the package is published to PyPI, users will be able to install it with:

pip install xiaoyu-cytoflow

Quick Start

import matplotlib.pyplot as plt
import xiaoyu_CF as flow

expr = flow.xiaoyu_Expr("path/to/fcs_directory")
expr.add_conc_condition(1e-5, dilu_dir="down")

without_outliers = flow.gate_outliers(expr.expr)
cell_population = flow.auto_gate_FSC_SSC(without_outliers, if_plot=True)
single_cells = flow.auto_gate_FSC_A_H(cell_population, if_plot=True, keep=0.7)

flow.channel_histogram(flow.subset_by_num(single_cells, "12"), huefacet="conc")
expr.median_96well(single_cells, channel="Alexa 647-A")

plt.show()

Documentation

See PROJECT_GUIDE.md for the full project documentation, including data layout assumptions, API reference, example workflows, testing, packaging, and maintenance notes.

For AI coding assistants and notebook agents, this repository also includes AGENTS.md and llms.txt. These files summarize the import name, common workflow, public helpers, channel assumptions, and removed Cytoflow features in a compact form that agents can discover quickly.

Test Data

The test/ directory may contain local experiment data and scratch analysis files. The included smoke test exercises the packaged workflow against the provided example data:

MPLCONFIGDIR=/tmp/mplconfig python test/package_smoke_test.py

Licensing

This project includes a vendored subset of Cytoflow, which is GPL-licensed. The package is therefore distributed under GPL-compatible terms. See LICENSE.txt and THIRD_PARTY_NOTICES.md.

Project details


Download files

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

Source Distribution

xiaoyu_cytoflow-0.1.2.tar.gz (99.9 kB view details)

Uploaded Source

Built Distribution

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

xiaoyu_cytoflow-0.1.2-py3-none-any.whl (124.9 kB view details)

Uploaded Python 3

File details

Details for the file xiaoyu_cytoflow-0.1.2.tar.gz.

File metadata

  • Download URL: xiaoyu_cytoflow-0.1.2.tar.gz
  • Upload date:
  • Size: 99.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.12.13 Windows/11

File hashes

Hashes for xiaoyu_cytoflow-0.1.2.tar.gz
Algorithm Hash digest
SHA256 da8222d07af33c8c375a09d84ad948c73ae20e386bb4f50a5cba3a13a815fac1
MD5 c6385a3b1221cefc6450a71d1bafb79b
BLAKE2b-256 4fe37f7ab052ec3db45ccab186e8ff97cd49db862d9b712bfe9be3919524320d

See more details on using hashes here.

File details

Details for the file xiaoyu_cytoflow-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: xiaoyu_cytoflow-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 124.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.12.13 Windows/11

File hashes

Hashes for xiaoyu_cytoflow-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 41a21efc1fe3dc003dfacfed2c21876b82264418e516360d73793ffe9122389f
MD5 7d50b74bd11441cd6e657058b7ad1aac
BLAKE2b-256 a398326a8622a5a123155867856bf439090edb5d3595459b6485363944719cc9

See more details on using hashes here.

Supported by

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