Skip to content

max-seqs parameter#57

Merged
mzueva merged 2 commits into
mainfrom
mzueva/max-seqs-fix
Jul 13, 2026
Merged

max-seqs parameter#57
mzueva merged 2 commits into
mainfrom
mzueva/max-seqs-fix

Conversation

@mzueva

@mzueva mzueva commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Allow to configure mmseqs2 --max-seqs parameter to improve recall res…ults

Greptile Summary

This PR introduces a configurable --max-seqs parameter for MMseqs2 to improve recall when many highly similar clonotypes exist. The value is exposed in the UI as both a numeric field and a "Find all matching clonotypes" checkbox (which stores 0 as a sentinel that the workflow converts to 1,000,000,000).

  • BlockData / BlockArgs: maxSeqs?: number added to BlockData (optional, for existing-data compat) and maxSeqs: number added to BlockArgs (required, always has a concrete value by the time args are projected). The args() projection pins it to 10000 in exact-match mode and applies a ?? 10000 fallback otherwise.
  • Workflow propagation: main.tpl.tengo passes args.maxSeqs to analysis.tpl.tengo, which forwards it to both MMseqs2 chunk invocations in run-alignment.tpl.tengo; the run-alignment template handles the <= 0 sentinel by substituting 1,000,000,000.
  • Dependency upgrades: Multiple @platforma-sdk and @milaboratories packages are bumped to recent patch/minor versions, and build:dev-remote convenience script is added to package.json.

Confidence Score: 4/5

The max-seqs plumbing is correct end-to-end and the 0-sentinel for no-limit is handled consistently in the workflow; the only roughness is a missing upper bound on the manual number field in the UI.

The feature is well-scoped: the new field is optional in BlockData (backward-compatible with existing saved data), always resolved to a concrete number before reaching the workflow, and the ≤ 0 sentinel is reliably converted to 1 billion inside run-alignment. Both MMseqs2 chunk invocations receive the same value. The one gap is the PlNumberField having no max-value constraint, meaning a user typing a very large number manually bypasses the intended Find all matching clonotypes checkbox path, though it produces no incorrect computation.

ui/src/pages/MainPage.vue — the PlNumberField for maxSeqs lacks a max-value, making the numeric input and the no-limit checkbox partially redundant for large values.

Important Files Changed

Filename Overview
model/src/types.ts Adds maxSeqs?: number to BlockData (optional for backward compat) and maxSeqs: number to BlockArgs (required, always resolved before workflow)
model/src/index.ts Initializes maxSeqs to 10000 in both init() and upgradeLegacy(); args() projection pins to 10000 in exact-match mode and applies ?? 10000 fallback otherwise — backward-compatible
ui/src/pages/MainPage.vue Adds maxSeqsNoLimit computed (0 sentinel) and PlNumberField for direct value entry; no max-value constraint on the number field, allowing arbitrarily large manual values
workflow/src/run-alignment.tpl.tengo Reads maxSeqs from args (undefined → 10000, ≤ 0 → 1_000_000_000) and passes it to MMseqs2's --max-seqs flag; sentinel handling is correct
workflow/src/analysis.tpl.tengo Correctly threads maxSeqs through to both MMseqs2 chunk invocations; no changes to exact-match path (as expected, maxSeqs is irrelevant there)
workflow/src/main.tpl.tengo Passes maxSeqs: args.maxSeqs to the analysis template; straightforward plumbing, no issues
package.json Adds build:dev-remote convenience script with PL_DOCKER_BUILD and PL_DOCKER_AUTOPUSH flags; unrelated to the max-seqs feature
pnpm-lock.yaml Routine SDK and helper package version bumps; adds @aws-sdk/client-ecr-public pulled in by new Docker-push tooling
.changeset/young-heads-yawn.md Patch-level changeset entry for all four packages, matching the scope of the change

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant UI as MainPage.vue
    participant Model as model/index.ts
    participant Main as main.tpl.tengo
    participant Analysis as analysis.tpl.tengo
    participant RunAlign as run-alignment.tpl.tengo
    participant MMseqs2

    UI->>UI: maxSeqsNoLimit checkbox (stores 0 for no-limit)
    UI->>Model: "data.maxSeqs (0 | number | undefined)"
    Model->>Model: args() projection exact? 10000 : (maxSeqs ?? 10000)
    Model->>Main: BlockArgs.maxSeqs (number)
    Main->>Analysis: maxSeqs: args.maxSeqs
    Analysis->>RunAlign: maxSeqs (chunk 1)
    Analysis->>RunAlign: maxSeqs (chunk 2)
    RunAlign->>RunAlign: "if maxSeqs <= 0 → 1_000_000_000"
    RunAlign->>MMseqs2: --max-seqs value
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 UI as MainPage.vue
    participant Model as model/index.ts
    participant Main as main.tpl.tengo
    participant Analysis as analysis.tpl.tengo
    participant RunAlign as run-alignment.tpl.tengo
    participant MMseqs2

    UI->>UI: maxSeqsNoLimit checkbox (stores 0 for no-limit)
    UI->>Model: "data.maxSeqs (0 | number | undefined)"
    Model->>Model: args() projection exact? 10000 : (maxSeqs ?? 10000)
    Model->>Main: BlockArgs.maxSeqs (number)
    Main->>Analysis: maxSeqs: args.maxSeqs
    Analysis->>RunAlign: maxSeqs (chunk 1)
    Analysis->>RunAlign: maxSeqs (chunk 2)
    RunAlign->>RunAlign: "if maxSeqs <= 0 → 1_000_000_000"
    RunAlign->>MMseqs2: --max-seqs value
Loading

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
ui/src/pages/MainPage.vue:489-495
Missing upper bound on the `maxSeqs` number field. Without a `:max-value`, a user can type any positive integer directly (e.g. `999999999`), which silently duplicates the intent of the "Find all matching clonotypes" checkbox and bypasses its UX affordance. Adding a reasonable ceiling (e.g. `300000`) keeps the two controls semantically distinct and avoids accidental over-allocation.

```suggestion
        <PlNumberField
          v-if="matchingApproach === 'alignment' && !maxSeqsNoLimit"
          v-model="app.model.data.maxSeqs"
          label="Max clonotypes examined per sequence"
          :min-value="1"
          :max-value="300000"
          :step="1000"
        >
```

Reviews (1): Last reviewed commit: "Allow to configure mmseqs2 --max-seqs pa..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

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 the ability to configure the mmseqs2 --max-seqs parameter, allowing users to control the maximum number of similar clonotypes examined per sequence or remove the limit entirely to improve recall. It updates the data model, UI (adding a checkbox and number field), and Tengo workflow templates to propagate and apply this parameter. Additionally, several SDK and internal dependencies are updated. A review comment points out that maxSeqs is hardcoded to 10000 when initializing the block data model from existing arguments, which ignores any previously saved value.

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.

Comment thread model/src/index.ts Outdated
Comment thread ui/src/pages/MainPage.vue
@mzueva
mzueva merged commit 134f7bf into main Jul 13, 2026
11 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