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.

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.

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.0.tar.gz (92.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.0-py3-none-any.whl (124.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xiaoyu_cytoflow-0.1.0.tar.gz
  • Upload date:
  • Size: 92.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.10.13 Darwin/23.6.0

File hashes

Hashes for xiaoyu_cytoflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12dc9ecb0475c9c667cc8cffdf54ab16e499b299c37c51f7774c1543bea8c0a8
MD5 2ba8a1574182dfa78f96fd72cf144f43
BLAKE2b-256 c55233047793cb17843383f5f80914513fa8eff90f213da69058e5a9bff0e1a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xiaoyu_cytoflow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 124.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.10.13 Darwin/23.6.0

File hashes

Hashes for xiaoyu_cytoflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25d70dbda77a3381f64424ba5c6a2f413ff45ec60716678d3a6159847e954f43
MD5 b92d8124ce920c190561811960dc442d
BLAKE2b-256 bcef781f560818f03011d30e51dbc80aa865ec183bcf3021e971c4bdaaa58112

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