feat: add support for per-cluster centroid dataset in sequence processing#19
feat: add support for per-cluster centroid dataset in sequence processing#19AStaroverov wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for a per-cluster centroid dataset (clonotype-clustering) by adding a new anchor specification with the axis "pl7.app/clustering/centroidId" in the model. It also updates the workflow logic to detect this axis and treat it as "antibody_tcr_legacy_bulk" for sequence pulling. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if axisSpec.name == "pl7.app/clustering/centroidId" { | ||
| return "antibody_tcr_legacy_bulk" | ||
| } |
There was a problem hiding this comment.
Receptor detection fully deferred to sequence-column domains
Unlike pl7.app/vdj/cloneId / clonotypeKey, the centroidId axis domain carries no VDJ keys (pl7.app/vdj/receptor, pl7.app/vdj/chain), so resolveReceptor will always return seen: false from the axis-level check. Receptor is then determined solely by the d["pl7.app/vdj/chain"] lookup on each sequence column inside the for s in vdjCols loop. If the centroid sequence columns happen to omit that domain key — e.g. a bulk-clustering producer that does not propagate chain metadata — receptorSeen stays false, the default "IG" is used silently, and messages.receptorNotDetected() fires at line 323. The comment says "single-cell centroids still carry the chain domain on the sequence columns", so this is likely safe in practice, but a missing chain annotation on the centroid sequence columns would silently produce IG properties for what might be a TCR dataset.
Prompt To Fix With AI
This is a comment left during a code review.
Path: workflow/src/main.tpl.tengo
Line: 59-61
Comment:
**Receptor detection fully deferred to sequence-column domains**
Unlike `pl7.app/vdj/cloneId` / `clonotypeKey`, the `centroidId` axis domain carries no VDJ keys (`pl7.app/vdj/receptor`, `pl7.app/vdj/chain`), so `resolveReceptor` will always return `seen: false` from the axis-level check. Receptor is then determined solely by the `d["pl7.app/vdj/chain"]` lookup on each sequence column inside the `for s in vdjCols` loop. If the centroid sequence columns happen to omit that domain key — e.g. a bulk-clustering producer that does not propagate chain metadata — `receptorSeen` stays false, the default "IG" is used silently, and `messages.receptorNotDetected()` fires at line 323. The comment says "single-cell centroids still carry the chain domain on the sequence columns", so this is likely safe in practice, but a missing chain annotation on the centroid sequence columns would silently produce IG properties for what might be a TCR dataset.
How can I resolve this? If you propose a fix, please make it concise.3973eea to
8d8bc4c
Compare
The clonotype-clustering centroid dataset export is peptide-only, so detectMode now maps the pl7.app/clustering/centroidId axis to peptide mode (was antibody_tcr_legacy_bulk, which filtered by VDJ REQUIRED_FEATURES and crashed building an empty XSV). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile Summary
This PR adds support for per-cluster centroid datasets (produced by clonotype-clustering) as a valid input to the sequence-properties block. Both the model anchor-spec list and the workflow mode-detection function are extended to recognise the two-axis
[sampleId, centroidId]shape and route it through the existingantibody_tcr_legacy_bulkprocessing path.model/src/index.ts: A new entry is appended toinputAnchorSpecsforpl7.app/clustering/centroidId, making the block'sinputOptionsoutput include centroid datasets without changing any other model logic.workflow/src/main.tpl.tengo: A newdetectModebranch mapspl7.app/clustering/centroidId→"antibody_tcr_legacy_bulk", so the Python plan receives the correct mode and the per-chain sequence-column loop runs unchanged. Receptor detection for centroid data relies entirely onpl7.app/vdj/chainannotations present on the sequence columns rather than on the axis domain.Confidence Score: 4/5
Safe to merge; changes are additive and isolated to anchor registration and mode routing.
Both changes are small and additive. The model change only extends the accepted-input list; the workflow change adds one branch to a detection function that has no side effects on existing paths. The one open question is whether centroid sequence columns from bulk-clustering producers always carry pl7.app/vdj/chain in their domain — if they do not, receptor detection silently defaults to IG with a user-visible warning, which could produce incorrect property calculations for TCR centroid datasets.
workflow/src/main.tpl.tengo — the receptor-detection path for centroid data relies entirely on sequence-column domain annotations rather than the axis domain; worth confirming that all centroid-producing blocks emit chain metadata on their sequence columns.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Input Anchor] --> B{detectMode on axis name} B -->|variantKey + peptide domain| C[peptide] B -->|variantKey + vdj domain| D[antibody_tcr_universal] B -->|vdj/cloneId or clonotypeKey| E[antibody_tcr_legacy_bulk] B -->|vdj/scClonotypeKey| F[antibody_tcr_legacy_sc] B -->|clustering/centroidId NEW| E E --> G[Receptor from sequence column domains] F --> G D --> H[Receptor from axis domain] C --> I[Peptide sequence column] G --> J[Python plan: antibody_tcr_legacy_bulk] H --> J I --> J J --> K[propertiesPf output]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat: add support for per-cluster centro..." | Re-trigger Greptile