---
title: "Pairwise Alignment"
method: POST
path: "/pairwise_alignment"
tags: ["Alignment & variants"]
---

# Pairwise Alignment

`POST /pairwise_alignment`

## Request

- Base URL: `https://seqbench.com/api/v1`
- URL: `https://seqbench.com/api/v1/pairwise_alignment`
- Auth: none required

Global (Needleman-Wunsch), local (Smith-Waterman) or semi-global/fitting pairwise alignment of two sequences, with match/mismatch scoring and affine gap costs (Gotoh).

## Request body

- object
  - `seqA` string, required: First sequence (raw or FASTA; nucleotide or protein).
  - `seqB` string, required: Second sequence (raw or FASTA; nucleotide or protein).
  - `mode` 'global' | 'local' | 'semiglobal': "global" penalizes end gaps in both sequences; "local" returns the best-scoring subalignment; "semiglobal" is a fitting alignment — seqB is consumed end to end while seqA's terminal overhangs are free and are not emitted, so a partial read placed on a longer reference is not smeared across it.
  - `match` number: Match score.
  - `mismatch` number: Mismatch penalty.
  - `gap` number: Affine gap EXTEND penalty, charged per gap position (including the first).
  - `gapOpen` number: Extra one-off penalty charged on top of gap for a gap's first position. Defaults to 1.5 * gap, so a k-base gap costs gap * (k + 1.5) and one contiguous k-base indel is cheaper than k scattered 1-base gaps. Pass 0 for a purely linear penalty.

## Response `200`

Tool ran successfully.

- SuccessResponse: Standard success envelope returned by every single-tool call.
  - `ok` unknown, required
  - `tool` string, required: The tool slug that ran.
  - `result` object, required: Tool-specific output object. Its shape depends on the tool — call `GET /{tool}` or see the docs for each tool's fields.
  - `gate` GateResult
    - `pass` boolean, required: True if and only if every hard check passed.
    - `checks` GateCheck[], required
      - `id` string, required
      - `label` string, required
      - `severity` 'hard' | 'soft', required
      - `pass` boolean, required
      - `message` string, required
      - `value` number
      - `threshold` string
    - `notChecked` string[], required: Honest list of what this gate does NOT verify.
  - `provenance` Provenance, required
    - `apiVersion` string, required
    - `tool` union, required: Tool slug, or an array of slugs (one per step) for a workflow.
      - string
      - string[]
    - `generatedAt` string, date-time, required: ISO 8601 timestamp of when the result was generated.

## Other responses

- `400`: Invalid argument or the tool could not run.
- `404`: Unknown tool.
- `429`: Rate limited (metered tools only). Body carries code `rate_limited` and retryable `true`; honor the Retry-After header.
- `503`: A metered tool is momentarily at capacity. The identical request should succeed after Retry-After; body carries code `upstream_unavailable`.

---

[API](https://skmtc.dev/seqbench/apis/seqbench-api.md) · [All operations](https://skmtc.dev/seqbench/apis/seqbench-api/llms.txt) · [OpenAPI document](https://skmtc.dev/seqbench/apis/seqbench-api/revisions/132575216865?raw)
