flowkit
它能做什么
FlowKit 是一个用于分析流式细胞术数据的工具。它可以应用或创建分析规则(称为“门”,即 gates),同时处理多个数据文件,还能复现在另一个程序 FlowJo 中完成的分析。
适用场景
- ✓使用预先设定好的分析规则,分析一组流式细胞术样本。
- ✓创建你自己的分析规则,用来识别样本中的特定细胞群。
- ✓复现之前在 FlowJo 中完成的数据分析。
技能链接
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/flowkit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请用我提供的 GatingML 规则分析这个流式细胞术数据文件。”
每周 5 个新技能,1 分钟读完。
工作原理
FlowKit 会读取你的流式细胞术数据,并应用你定义的规则,或文件中已有的规则。然后它会计算每条规则下有多少细胞符合条件,并给出详细的报告。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
FlowKit
When to use
Use FlowKit to apply or build cytometry gating strategies, analyze batches of FCS samples, or reproduce supported FlowJo workspace analyses. It supports GatingML 2.0 and a subset of FlowJo 10 features. Import success alone does not establish agreement with FlowJo.
The examples and bundled helper target FlowKit 1.3.2 on Python 3.13. Upstream supports additional Python versions; those were not exercised here. The helper and examples were tested on synthetic FCS data, including a public FlowJo 10.7.1 synthetic workspace fixture. They are not biological validation.
Install
Use a separate environment; FlowKit 1.3.2 requires NumPy >2 and pandas <3:
uv venv --python 3.13 .venv-flowkit
uv pip install --python .venv-flowkit/bin/python "flowkit==1.3.2"
.venv-flowkit/bin/python -c "import flowkit; print(flowkit.__version__)"
The scientific package is BSD-3-Clause licensed; this skill is MIT licensed.
Workflow
- Identify the analysis definition. Use
Sessionfor a programmatic or GatingML strategy; useWorkspacefor FlowJo sample-specific gates, compensation, and transforms. Request the actual strategy or controls when biological thresholds have not been supplied. - Inspect samples and channel identities. Match detector/PnN labels to
compensation matrices and gate dimensions; PnS marker names may be empty or
repeated. Verify sample IDs: the default is FCS
$FIL, which can differ from the current filename. Reject ID collisions before loading a batch. - Establish the coordinate system. Determine whether the supplied events are already compensated. Apply compensation before nonlinear transforms; match gate thresholds to the same transformed or untransformed coordinates. See compensation and gating.
- Check the hierarchy. Preserve parent gates and full gate paths, including
root. For a study, review acquisition/time stability, debris exclusion, singlets, viability, and phenotype gates as appropriate to its panel. Use single-stain controls for compensation and suitable negative/FMO controls for positivity; demonstration thresholds are not transferable biology. - Analyze and inspect. Run on all events, then check gate overlays and sample-level QC. A plot's subsample is not the population denominator. Review warnings and compare representative imported results to FlowJo.
- Export counts with denominators and provenance. Keep gate paths, sample IDs, total event counts, input hashes, package versions, and the analysis definition. Keep biological replicates identifiable; events from one specimen are not independent experimental replicates.
Apply an existing strategy
Set FLOWKIT_SKILL_DIR to this skill's installed directory. From the repository
root it is skills/flowkit. Paths below represent the user's local inputs.
FLOWKIT_SKILL_DIR="skills/flowkit"
uv run --no-project --python 3.13 --with "flowkit==1.3.2" \
python "$FLOWKIT_SKILL_DIR/scripts/analyze_gates.py" \
--gatingml gates.xml --fcs sample.fcs --output-dir results-gatingml
For a FlowJo workspace, supply every FCS file in the selected group:
uv run --no-project --python 3.13 --with "flowkit==1.3.2" \
python "$FLOWKIT_SKILL_DIR/scripts/analyze_gates.py" \
--workspace study.wsp --group "Study" \
--fcs sample-a.fcs sample-b.fcs --output-dir results-workspace
The helper writes gate_report.csv and provenance.json to a new directory.
Each row includes sample_event_count, parent_event_count, and a full
population_path; empty-parent percentages are blank and flagged with
relative_percent_defined=False.
It rejects duplicate sample IDs, missing/extra workspace-group samples,
zero-event samples, and strategies without gates. It uses explicit input files,
does not follow paths embedded in the workspace, and runs without
multiprocessing or transformed-event caching. It still loads each sample into
memory; use manageable batches via the Python API for large studies.
--filename-as-id deliberately switches from $FIL to file basenames. Use it
only when those names match the analysis definition. See
workspace analysis for partial-group
analysis, result interpretation, and fluorescence summaries.
Build a strategy in Python
This runnable example uses sample.fcs with FSC-A, FL1-A, and FL2-A.
…
常见问题
流式细胞术中的“门”是什么?
“门”就像你在数据上画出的虚拟分界线,用来区分不同的细胞类型或细胞群。比如,你可以设置一个“门”,只把活细胞或表达某种蛋白的细胞单独筛选出来。
FlowKit 的功能和 FlowJo 完全一样吗?
它可以复现许多 FlowJo 的分析,但并非全部。它只支持 FlowJo 10 的特定功能集合,结果可能会有细微差异。
使用 FlowKit 前需要安装什么吗?
需要。FlowKit 要安装在 Python 编程环境中。相关说明中提到了使用 uv 和 pip 安装的具体命令。
详情
作者的原始描述
Analyzes flow cytometry data with FlowKit, including spillover compensation, logicle and biexponential transforms, hierarchical gating, GatingML strategies, and supported FlowJo 10 workspaces. Use for reproducible gate counts, population percentages, gated fluorescence summaries, or reproducing a FlowJo analysis in Python. For FCS metadata inspection or file-format repair alone, use FlowIO.
热度
- GitHub 星标
- 51k
- 排名
- #3462
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …