Skip to content

Adapt Sequence properties block to dms data#21

Merged
mzueva merged 1 commit into
mainfrom
mzueva/adapt-dms
Jul 1, 2026
Merged

Adapt Sequence properties block to dms data#21
mzueva merged 1 commit into
mainfrom
mzueva/adapt-dms

Conversation

@mzueva

@mzueva mzueva commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds support for synthetic-repertoire-profiler amplicon variant datasets by introducing a new "amplicon" workflow mode that reuses the existing peptide physicochemical computation path, differing only in which sequence column is read and how outputs are labeled ("amplicon-sequence" feature instead of "peptide").

  • WorkflowMode — Union type in model/src/types.ts. Added "amplicon" as a new variant for synthetic-repertoire-profiler datasets; runs the same math as "peptide" but labels output columns with the "amplicon-sequence" feature.
  • detectMode — Function in workflow/src/main.tpl.tengo. Now recognizes pl7.app/repertoire/extractionRunId on a pl7.app/variantKey axis and returns "amplicon", instead of falling through to the "no recognized axis" panic.
  • buildWholeSeqColumns — New parameterised helper in workflow/src/columns.lib.tengo. Extracts the whole-sequence column list (previously inline to peptide mode) into a shared function called by both peptide and amplicon modes with appropriate feature and deltaLabel values.
  • wholeSeqMode — Boolean in workflow/src/main.tpl.tengo. Extended to cover mode == "amplicon" in addition to mode == "peptide", gating the single-sequence fetch path and suppressing chain/region logic.
  • pyMode — Variable in workflow/src/main.tpl.tengo. Bridges the amplicon→peptide translation: for amplicon runs pyMode = "peptide" is sent to the Python engine (which runs the same computation), while the original "amplicon" mode value drives column labeling and colArgs.
  • ampliconSequences — New bundle key in workflow/src/main.tpl.tengo. Collects pl7.app/sequence columns with pl7.app/feature: "amplicon-sequence" and pl7.app/alphabet: "aminoacid" from the input dataset to locate the whole-variant AA sequence.
  • wholeSeqFeature — New TypeScript helper in ui/src/utils/scalarColumns.ts. Maps WorkflowMode to the corresponding pl7.app/feature domain value ("amplicon-sequence" for amplicon, "peptide" for peptide), enabling mode-aware default scatter/histogram axis selection in the UI.

Confidence Score: 4/5

The amplicon mode wiring is correct end-to-end; the only gap is a missing info banner in info.tpl.tengo for short amplicon sequences.

The core amplicon path — detectMode, pyMode translation, column domain labeling, and UI axis selection — is implemented correctly and consistently. The only defect is in info.tpl.tengo: the hasPeptideBelowInstabilityFloor warning fires only on mode == "peptide", so amplicon users whose sequences are shorter than 10 aa will see blank Instability Index cells with no explanation.

workflow/src/info.tpl.tengo — the instability floor guard should cover amplicon mode in addition to peptide mode.

Important Files Changed

Filename Overview
workflow/src/main.tpl.tengo Core change: detectMode now recognises pl7.app/repertoire/extractionRunId for amplicon, ampliconSequences bundle added, wholeSeqMode extended, pyMode translates amplicon→peptide for Python; logic is sound, but coverageTier stays "peptide" for amplicon mode.
workflow/src/columns.lib.tengo buildWholeSeqColumns extracted as a parameterised helper shared by peptide and amplicon; TSV header names stay *_peptide (matching Python output); amplicon columns are correctly labelled with the "amplicon-sequence" feature.
workflow/src/info.tpl.tengo Info template unchanged, but the hasPeptideBelowInstabilityFloor check uses mode == "peptide", so the short-sequence warning is suppressed for amplicon datasets even though they run the same Python path.
model/src/types.ts WorkflowMode union extended with "amplicon"; comment clearly distinguishes it from peptide mode. No type-safety concerns.
ui/src/utils/scalarColumns.ts wholeSeqFeature helper added; defaultScatterAxes and defaultHistogramMetric correctly resolve "amplicon-sequence" domain for amplicon mode. Logic is correct and complete.
block/package.json Added --registry-serve-url to the prepublishOnly script; routine publishing configuration change.
pnpm-lock.yaml Lock file regenerated to match catalog bumps in pnpm-workspace.yaml; no unusual dependency changes observed.
pnpm-workspace.yaml Catalog versions bumped: @platforma-sdk/workflow-tengo 5.24→6.6.5, @platforma-sdk/model 1.77→1.79.20, and several tooling packages; straightforward upgrade.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Input as Input Dataset
    participant DM as detectMode()
    participant Body as wf.body
    participant Python as Python Engine
    participant XSV as xsv.importFile
    participant UI as UI / scalarColumns.ts

    Input->>DM: axisSpec (pl7.app/variantKey)
    alt domain has pl7.app/peptide/extractionRunId
        DM-->>Body: "mode = peptide"
    else domain has pl7.app/repertoire/extractionRunId (NEW)
        DM-->>Body: "mode = amplicon"
    else domain has pl7.app/vdj/clonotypingRunId
        DM-->>Body: "mode = antibody_tcr_universal"
    end

    Body->>Body: "wholeSeqMode = true for peptide or amplicon"
    Body->>Body: "pyMode = peptide (for amplicon) [NEW]"

    Body->>Python: plan.json with pyMode + input.tsv
    Python-->>Body: "properties.tsv headers *_peptide + stats.json"

    Body->>XSV: "buildColumns → feature=amplicon-sequence [NEW]"
    XSV-->>Body: PColumns with amplicon-sequence domain

    Body->>UI: "WorkflowInfo mode=amplicon"
    UI->>UI: wholeSeqFeature(amplicon) → amplicon-sequence [NEW]
    UI-->>UI: defaultScatterAxes on amplicon-sequence domain
Loading
%%{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"}}}%%
sequenceDiagram
    participant Input as Input Dataset
    participant DM as detectMode()
    participant Body as wf.body
    participant Python as Python Engine
    participant XSV as xsv.importFile
    participant UI as UI / scalarColumns.ts

    Input->>DM: axisSpec (pl7.app/variantKey)
    alt domain has pl7.app/peptide/extractionRunId
        DM-->>Body: "mode = peptide"
    else domain has pl7.app/repertoire/extractionRunId (NEW)
        DM-->>Body: "mode = amplicon"
    else domain has pl7.app/vdj/clonotypingRunId
        DM-->>Body: "mode = antibody_tcr_universal"
    end

    Body->>Body: "wholeSeqMode = true for peptide or amplicon"
    Body->>Body: "pyMode = peptide (for amplicon) [NEW]"

    Body->>Python: plan.json with pyMode + input.tsv
    Python-->>Body: "properties.tsv headers *_peptide + stats.json"

    Body->>XSV: "buildColumns → feature=amplicon-sequence [NEW]"
    XSV-->>Body: PColumns with amplicon-sequence domain

    Body->>UI: "WorkflowInfo mode=amplicon"
    UI->>UI: wholeSeqFeature(amplicon) → amplicon-sequence [NEW]
    UI-->>UI: defaultScatterAxes on amplicon-sequence domain
Loading

Reviews (1): Last reviewed commit: "Adapt Sequence properties block to dms d..." | Re-trigger Greptile

Context used:

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for synthetic-repertoire-profiler (amplicon) variant datasets. It adds a new "amplicon" workflow mode that shares the same whole-sequence physicochemical computation path as the existing "peptide" mode, but uses the "amplicon-sequence" feature for output labeling. The UI has been updated to support amplicon-aware default scatter and histogram axes, and the workflow now correctly maps the amplicon mode to the peptide computation path in the Python engine. No review comments were provided, so there is no feedback to address.

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.

@mzueva mzueva added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit 94a7068 Jul 1, 2026
14 checks passed
@mzueva mzueva deleted the mzueva/adapt-dms branch July 1, 2026 16:53
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