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 used in xiaoyu_CF.py: 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 xiaoyu_CF 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.1.tar.gz (100.8 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.1-py3-none-any.whl (125.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xiaoyu_cytoflow-0.1.1.tar.gz
  • Upload date:
  • Size: 100.8 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.1.tar.gz
Algorithm Hash digest
SHA256 ceba44f0cfef9acfb50f2608b19bded11f25697ee7648d5f5b478185b9a3bfcd
MD5 ecbefc26de74873f4ba88c18c3968b4a
BLAKE2b-256 e4019549c9f155c1d28fcaa14d2b117ef65d24a0204b8cd0dd234a3422bca628

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xiaoyu_cytoflow-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 125.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab3583d65e43dd57c31853dc4dde0a06cf8f6d2175ad53f8b3649e1c66942b58
MD5 924604d8d6edf1fe1c71cb887b9d147e
BLAKE2b-256 edaf2637c8a5a9e6fc198a0e30c1d2ea56d6dfa78c4b080de99f0a3c6ed97dce

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