Skip to content

Flatten Sequence

The "flattenSequence" transform flattens strings such as FASTA sequences into data objecsts with position and character fields.

Parameters

as

Type: array

Name of the fields where the zero-based index number and flattened sequence letter are written to.

Default: ["pos", "sequence"]

field

Type: string (field name)

The field to flatten.

Default: "sequence"

Example

Given the following data:

identifier sequence
X AC
Y ACTG

... and parameters:

{
  "type": "flattenSequence",
  "field": "sequence",
  "as": ["base", "pos"]
}

The sequences are flattened into:

identifier sequence base pos
X AC A 0
X AC C 1
Y ACTG A 0
Y ACTG C 1
Y ACTG T 2
Y ACTG G 3