jaechang-hits/scicraft/flowio-flow-cytometry
Claude Code and agent skill by jaechang-hits/scicraft
- community
Checking that the SKILL.md file is still in the repository.
Parse/write FCS (Flow Cytometry) files v2.0-3.1. Events as NumPy, channel metadata, multi-dataset files, CSV/FCS export. Use FlowKit for gating/compensation.
Install
npx vskill@latest install jaechang-hits/scicraft/flowio-flow-cytometrySKILL.md
FlowIO — Flow Cytometry File Handler
Overview
FlowIO is a lightweight Python library for reading and writing Flow Cytometry Standard (FCS) files. It parses FCS metadata, extracts event data as NumPy arrays, and creates new FCS files. Supports FCS versions 2.0, 3.0, and 3.1. Minimal dependencies — ideal for data pipelines and preprocessing before advanced analysis.
When to Use
- Parsing FCS files to extract event data as NumPy arrays
- Reading channel metadata (names, ranges, types) from FCS files
- Converting flow cytometry data to pandas DataFrames or CSV
- Creating new FCS files from NumPy arrays or processed data
- Handling multi-dataset FCS files (separating combined datasets)
- Batch processing directories of FCS files
- Preprocessing flow cytometry data before downstream analysis
- For compensation, gating, and FlowJo workspace support, use FlowKit instead
- For advanced cytometry visualization (density plots, gating plots), use matplotlib or plotly
Prerequisites
Requires Python 3.9+. No compiled dependencies — installs on any platform.
Quick Start
Core API
1. Reading FCS Files
The FlowData class is the primary interface for reading FCS files.
2. Channel Metadata
Extract channel names, types, and ranges from FCS files.
3. Creating FCS Files
Generate new FCS files from NumPy arrays.
4. Multi-Dataset FCS Files
Handle FCS files containing multiple datasets.
5. Modifying and Re-Exporting
Read, modify, and save FCS data.
Key Concepts
FCS File Structure
FCS files consist of four segments:
| Segment | Content | FlowData attribute | |
|---|---|---|---|
| HEADER | Version, byte offsets | flow.header | |
| TEXT | Key-value metadata ($DATE, $CYT, channel names) | flow.text | |
| DATA | Event data (binary/float) | flow.events (bytes), flow.as_array() | |
| ANALYSIS | Optional processed results | flow.analysis |
Preprocessing (as_array)
When preprocess=True (default), FlowIO applies:
- Gain scaling: Multiply by PnG gain values
- Log transform: Apply PnE exponential transform if present (
value = a × 10^(b × raw)) - Time scaling: Convert time channel to proper units
Use preprocess=False when you need raw values for modification or custom transforms.
Common Workflows
Workflow: Batch FCS Summary
Workflow: FCS to DataFrame with Channel Statistics
Key Parameters
| Parameter | Function | Default | Options | Effect | |
|---|---|---|---|---|---|
preprocess | as_array() | True | True/False | Apply gain/log scaling | |
only_text | FlowData() | False | True/False | Skip DATA segment (metadata only) | |
ignore_offset_discrepancy | FlowData() | False | True/False | Tolerate HEADER/TEXT offset mismatch | |
use_header_offsets | FlowData() | False | True/False | Prefer HEADER over TEXT offsets | |
ignore_offset_error | FlowData() | False | True/False | Skip all offset validation | |
null_channel_list | FlowData() | None | List of names | Exclude channels during parsing | |
nextdata_offset | FlowData() | None | byte offset | Read specific dataset in multi-dataset files | |
opt_channel_names | create_fcs() | None | List of names | Descriptive channel names (PnS) | |
metadata | create_fcs() | None | Dict | Custom TEXT segment key-value pairs |
Best Practices
- Use `only_text=True` for metadata scanning: When processing many files, skip DATA segment parsing for 10-100x speedup.
- Use `preprocess=False` for data modification: Always work with raw values when filtering/modifying events, then re-export. Preprocessing is irreversible.
- Anti-pattern — modifying `flow.events` directly: FlowIO does not support in-place event modification. Extract with
as_array(), modify, thencreate_fcs()to save.
- Preserve metadata on re-export: Pass
flow.textas metadata tocreate_fcs()to retain original acquisition info.
- Check for multi-dataset files: Catch
MultipleDataSetsErrorand useread_multiple_data_sets()— some instruments write multiple acquisitions into one file.
Common Recipes
Recipe: Extract Fluorescence Channels Only
Recipe: File Inspection Report
Recipe: Normalize Events to [0, 1] Range
When to use: Prepare fluorescence channels for machine learning or cross-sample comparison.
Troubleshooting
| Problem | Cause | Solution | |
|---|---|---|---|
DataOffsetDiscrepancyError | HEADER/TEXT offset mismatch | Use ignore_offset_discrepancy=True | |
MultipleDataSetsError | File contains multiple datasets | Use read_multiple_data_sets() instead | |
FCSParsingError | Corrupt or non-standard FCS file | Try ignore_offset_error=True; verify file is valid FCS | |
| Out of memory on large files | Millions of events loaded at once | Use only_text=True for metadata; process in chunks by channel | |
| Unexpected channel count | Null/padding channels in file | Use null_channel_list=["Time", "Null"] to exclude | |
| Modified data has wrong values | Applied preprocessing before modification | Use preprocess=False for raw data when modifying events | |
| Channel names missing (empty PnS) | Instrument didn't set descriptive names | Use pnn_labels (short names) instead; PnS is optional in FCS spec |
Related Skills
- matplotlib-scientific-plotting — create scatter plots, density plots, and histograms from extracted cytometry data
- scikit-learn-machine-learning — clustering and dimensionality reduction on cytometry event data
References
- FlowIO documentation — official GitHub repository and API
- FCS file format specification — ISAC data standards for flow cytometry
- Spidlen et al. (2010) "Data File Standard for Flow Cytometry, Version FCS 3.1" — Cytometry Part A
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cell-biology/flowio-flow-cytometry/SKILL.md
Popularity
- Repository stars
- 20
- Repository forks
- 1
- 7-day trend score
- 15
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jaechang-hits/scicraft/flowio-flow-cytometry)