Skip to content

Sort-Seq Analysis block implementation - #1

Merged
mzueva merged 7 commits into
mainfrom
develop
Aug 13, 2026
Merged

Sort-Seq Analysis block implementation#1
mzueva merged 7 commits into
mainfrom
develop

Conversation

@mzueva

@mzueva mzueva commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Spec

Greptile Summary

The PR implements an end-to-end FACS sort-seq analysis block, including Python scoring, Tengo orchestration, Platforma model contracts, Vue result views, packaging, and CI. Important touched terms:

  • Gate rank mean — the read-weighted mean of a variant’s ranked FACS gates; newly computed per retained condition and emitted as pl7.app/facsBin/gateRankMean.
  • Bin score — gate rank mean relative to the identifiable parent variant; newly emitted as pl7.app/facsBin/binScore, with referenced, cancelled, and absent-parent-output handling.
  • Gate frequency — a variant’s normalized read distribution across collected gates; newly generated for the top-scoring variants and exposed to distribution charts.
  • Gate reads — raw supporting read counts for each variant-and-gate point; newly carried alongside gate frequency to communicate evidence depth.
  • Condition domain — the domain key distinguishing each condition’s output columns; newly used throughout workflow output construction, model lookup, navigation, and plotting.
  • Reference mode — metadata identifying whether bin scores were parent-referenced or emitted in cancelled form; newly propagated through the run manifest and score-column domains.
  • Abundance anchor — the selected upstream per-sample/per-variant raw abundance column that scopes metadata and variant axes; newly selected by annotation and axis-shape predicates.
  • Sort-yield correction — optional reweighting by sample sort fractions; newly supported from settings through workflow export and Python scoring.
  • Read floor — optional minimum total-read threshold determining which variants remain scored; newly validated and applied after gate-depth calculation.

Confidence Score: 4/5

The PR should not merge until gate and condition selections cannot persist empty snapshots while their metadata values are still loading; the stale README status is non-blocking but should also be corrected.

The settings UI exposes selectable metadata before its independent asynchronous value fetch is guaranteed complete, so a valid gate selection can be saved with no values and leave the block unrunnable until manually reselected.

Files Needing Attention: ui/src/components/SettingsDrawer.vue; README.md

Important Files Changed

Filename Overview
software/src/scoring.py Implements and unit-tests gate frequencies, weighted rank means, read-floor filtering, parent-relative scores, and top-variant distributions.
software/src/pipeline.py Coordinates per-condition validation, scoring, output files, and manifest entries with consistent optional-value handling.
workflow/src/main.tpl.tengo Resolves anchored inputs, exports computation tables, invokes the Python package, and publishes run artifacts.
workflow/src/build-columns.tpl.tengo Imports generated score and distribution files into condition-keyed Platforma columns.
model/src/index.ts Defines settings validation, run arguments, selectors, tables, graph frames, output accessors, and condition navigation.
ui/src/components/SettingsDrawer.vue Implements input selection and value snapshots, but can persist an empty snapshot when asynchronous metadata values have not loaded.
ui/src/pages/DistributionPage.vue Binds condition-specific distribution columns to persisted GraphMaker state and handles stale routes.
README.md Documents the implemented analysis but retains a contradictory statement that no computation exists.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Upstream abundance and metadata columns] --> B[Model settings and validation]
  B --> C[Tengo workflow exports reads and variants]
  C --> D[Python validation and scoring]
  D --> E[Score, distribution, and manifest files]
  E --> F[Tengo constructs Platforma columns]
  F --> G[Results table]
  F --> H[Condition distribution charts]
  E --> I[Run statistics]
Loading

Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
ui/src/components/SettingsDrawer.vue:101-111
**Async value snapshot breaks selection**

When a user selects a metadata column before `useWatchFetch` has populated `valuesByRef`, `valuesFor(ref)` returns an empty array and the handlers persist that as the column snapshot. For a gate column, this hides the ordering control and leaves Run disabled with “The gate column has no values to rank” until the user clears or reselects the column after loading completes.

### Issue 2
README.md:7-8
**Scaffold status contradicts implementation**

The README says that no computation is implemented, while this PR adds the scoring software, workflow, model, and UI. This stale status misrepresents the block to developers and users.

```suggestion
Status: **under development** — the initial model, workflow, UI, and scoring computation are implemented.
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "FACS Analysis block implementation" | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Context used:

  • Context used - Terms is a types in codebase. Provide the list of ... (source)

Comment on lines +101 to +111
function setGateColumn(ref: SUniversalPColumnId | undefined) {
app.model.data.gateColumnRef = ref;
app.model.data.gateValues = valuesFor(ref);
// The label too: only the option list knows it, and the block subtitle is derived from
// `data` alone. Same gesture, so no watcher on an output is needed.
app.model.data.gateColumnLabel = app.model.outputs.gateOptions?.find(
(option) => option.value === ref,
)?.label;
// Seed the order with the column's own values. A different gate column has different
// values, so any previous ordering is meaningless.
app.model.data.gateOrder = valuesFor(ref);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Async value snapshot breaks selection

When a user selects a metadata column before useWatchFetch has populated valuesByRef, valuesFor(ref) returns an empty array and the handlers persist that as the column snapshot. For a gate column, this hides the ordering control and leaves Run disabled with “The gate column has no values to rank” until the user clears or reselects the column after loading completes.

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/components/SettingsDrawer.vue
Line: 101-111

Comment:
**Async value snapshot breaks selection**

When a user selects a metadata column before `useWatchFetch` has populated `valuesByRef`, `valuesFor(ref)` returns an empty array and the handlers persist that as the column snapshot. For a gate column, this hides the ordering control and leaves Run disabled with “The gate column has no values to rank” until the user clears or reselects the column after loading completes.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

Comment thread README.md Outdated
@mzueva mzueva changed the title FACS Analysis block implementation Sort-Seq Analysis block implementation Aug 12, 2026
@mzueva
mzueva merged commit 9ab7b08 into main Aug 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant