Fix downstream errors with range assembling features (Liabilities, Lead Selection)#87
Conversation
There was a problem hiding this comment.
Code Review
This pull request resolves downstream Sequence Liabilities and Lead Selection errors by exporting the amino acid sequence for range assembling features. In calculate-export-specs.lib.tengo, the anchor feature is aligned for full-span ranges, the nucleotide sequence of the productive feature is marked as the main sequence, and a corresponding amino acid sequence column is exported. Feedback on the changes highlights that the newly added amino acid column is not appended to the aminoAcidSeqColumns and aminoAcidSeqColumnPairs arrays, which will prevent downstream stop codon replacements from being applied to this combined range column.
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.
Range assembling features previously exported the combined assembling-feature sequence only in nucleotide form (the clonotype key), with no aminoacid counterpart and without the main sequence flag. Downstream blocks broke as a result: Sequence Liabilities panicked ("No sequences found to determine the primary feature") because it needs an aminoacid column flagged
isAssemblingFeature, and Lead Selection crashed because itsmainSeqsVdjquery found no column flaggedisMainSequence.This PR brings range assembling features in line with MiXCR Clonotyping:
isAssemblingFeature: trueandisMainSequence: true.Fixes the Sequence Liabilities and Lead Selection errors for range assembling features, with and without germline imputation.
Greptile Summary
This PR fixes downstream breakage (Sequence Liabilities panic, Lead Selection crash) for range assembling features by exporting the combined aminoacid assembling-feature sequence column alongside the existing nucleotide column and flagging both with
isAssemblingFeature: trueandisMainSequence: true. A separate fix ensures theFR1:FR4feature correctly anchors its flags to theVDJRegioncolumn (the name MiXCR uses for that range) rather than the literal string"FR1:FR4", which never appears as an individual feature name in the export loop.aaSeq<feature>column is appended tocolumnsSpecPerClonotypeNoAggregatesalongside the existingnSeqcolumn in theneedsAssemblingFeatureExportblock, with both markedisAssemblingFeature: true/isMainSequence: trueand the corresponding-aaFeatureexport arg added.anchorFeatureis now normalized tooutputProductiveFeature(\"VDJRegion\") whenassemblingFeature == \"FR1:FR4\", so the flags land on the right column in the per-feature loop.@platforma-sdk/workflow-tengo6.3.0 → 6.6.4,@platforma-sdk/model/ test / ui-vue 1.78.4 → 1.79.17, block-tools 2.10.5 → 2.11.2, tengo-builder 4.0.5 → 4.0.9.Confidence Score: 4/5
The change is narrowly scoped to adding an aminoacid column for range assembling features and fixing the FR1:FR4 anchor alignment; the core export pipeline for CDR3 and VDJRegion is untouched.
The new aaSeq column is appended to columnsSpecPerClonotypeNoAggregates but not to aminoAcidSeqColumns, so the stop-codon replacement/filtering pass in mixcr-export.tpl.tengo skips it. In the common case this causes no visible problem, but the gap is real and worth closing.
workflow/src/calculate-export-specs.lib.tengo — the needsAssemblingFeatureExport block where the new aa column is constructed without updating aminoAcidSeqColumns.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[assemblingFeature input] --> B{is CDR3 or VDJRegion?} B -- Yes --> C[Standard path: flags set in feature loop] B -- No --> D{VDJRegion in imputed list?} D -- No / FR1:FR4 --> E[anchorFeature = VDJRegion\nFlags land on VDJRegion in loop] D -- Yes / sub-range --> F[needsAssemblingFeatureExport = true] F --> G[Add nSeq column\nisAssemblingFeature=true\nisMainSequence=true] F --> H[Add aaSeq column NEW\nisAssemblingFeature=true\nisMainSequence=true] F --> I[exportArgs += -nFeature\nexportArgs += -aaFeature NEW] G --> J[columnsSpecPerClonotypeNoAggregates] H --> J J --> K[columnsSpec returned to callers] K --> L[Sequence Liabilities\nfinds aaSeq with isAssemblingFeature] K --> M[Lead Selection\nfinds col with isMainSequence]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[assemblingFeature input] --> B{is CDR3 or VDJRegion?} B -- Yes --> C[Standard path: flags set in feature loop] B -- No --> D{VDJRegion in imputed list?} D -- No / FR1:FR4 --> E[anchorFeature = VDJRegion\nFlags land on VDJRegion in loop] D -- Yes / sub-range --> F[needsAssemblingFeatureExport = true] F --> G[Add nSeq column\nisAssemblingFeature=true\nisMainSequence=true] F --> H[Add aaSeq column NEW\nisAssemblingFeature=true\nisMainSequence=true] F --> I[exportArgs += -nFeature\nexportArgs += -aaFeature NEW] G --> J[columnsSpecPerClonotypeNoAggregates] H --> J J --> K[columnsSpec returned to callers] K --> L[Sequence Liabilities\nfinds aaSeq with isAssemblingFeature] K --> M[Lead Selection\nfinds col with isMainSequence]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "changeset" | Re-trigger Greptile