Repository navigation
fix(flow-cytometry-referee): run_qc entry point, exit status, pinned packages, range-limit check - #1
Open
faranm-stack wants to merge 3 commits into
Conversation
…xit status - Add flow_qc_utils.run_qc(fcs_path, output_dir), which loads one FCS file and writes the JSON report, channel-summary CSV, and dashboard. The agent now calls only this function. A fresh Studio run failed because the generated script called build_qc_report() without the events argument. - Capture Python's exit status in the flow-qc launcher before tail runs, so a failed script no longer exits 0 (same pattern as cp2k). - Add tests for run_qc, a file without events, and launcher exit codes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pin the six direct dependencies to the versions the fix was tested with (CI and Discovery Studio). load_fcs depends on FlowIO's channel API, so an unpinned rebuild could break file loading. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- The declared-range fraction compared values with $PnR, but $PnR counts the possible values, so instruments record their maximum as $PnR - 1. On public FlowIO sample files the tool reported 0 for channels with hundreds of events at the maximum (for example, 782 SSC-H events at 1023 in 3FITC_4PE_004.fcs). Count values at or above $PnR - 1 instead, and add a regression test. - Sample dashboard events evenly across the whole acquisition instead of plotting only the first 20,000, and add a test. - Document that values are raw and that multi-data-set files and files with HEADER/TEXT DATA offset discrepancies are rejected with an error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the two integration issues from the microsoft#162 review and a range-check bug found while testing real instrument files. The agent now calls a single
flow_qc_utils.run_qc(fcs_path, output_dir)function, and theflow-qclauncher exits with Python's status. The declared-range check now counts events at the instrument maximum ($PnR - 1).Type of change
agents/<name>/)starter-kits/<name>/)docs/schemas/**).github/**)Related issue / tracking
Refs microsoft#162
Schema impact
breaking-changelabel and link the rollout plan belowValidation checklist
README.md, schemas) is updated to match the change..auto-registry/**(it is generated post-merge)..DS_Store,.env,*.swp,.idea/,.vs/, etc.).Reviewer notes (optional)
Changes (3 commits)
eee9b32: newrun_qcloads one FCS file and writes<stem>_qc_report.json,<stem>_channel_summary.csvand<stem>_dashboard.png. A file with no events raises a clearValueError.agent.yamlshows the exact call, andtool.yamlkeeps Python's exit status (_EXIT=$?/exit $_EXIT, as incp2k).582001d: pins the six Python packages in the Dockerfile to the versions tested here (FlowIO 1.4.0, Matplotlib 3.11.2, NumPy 2.5.4, pandas 3.1.0, scikit-learn 1.9.1, SciPy 1.18.1).a713475: the declared-range fraction compared values with$PnR, but$PnRcounts the possible values, so instruments record their maximum as$PnR - 1. It now counts values at or above$PnR - 1. The dashboard samples events evenly across the whole run instead of plotting only the first 20,000. The README documents raw values and the file types the tool rejects.Validation (fork CI run on
a713475)tool.yaml(exit 0 instead of 1 and 3).run_qcsnippet writes the JSON, CSV and PNG for a 100-event synthetic FCS (FITC-A median 50.5). The script the agent generated in Studio on Oct 7 now exits 1 with itsTypeError. A zero-event FCS exits 1 with "contains no events".a713475, the range fraction was 0 for every channel; for example, 782 SSC-H events sit at 1023 in3FITC_4PE_004.fcs, and 247 SSC-A events sit at the maximum inG11.fcs. It now matches the count at$PnR - 1on every channel.python .github/scripts/validate_pr.pyon allagents/flow-cytometry-refereefiles: passed.a713475image, with the same prompt and file as the failed Oct 7 run, called onlyrun_qc. It reported 100 events and FITC-A median 50.5, and shared the outputs. A deliberately failing script shows as a failed run (exit code 1);tool.yamlhas not changed since that test.Not covered
present_validand acquisition-rate CV questions from the review are unchanged; those decisions are yours.