# AlignmentsSort

Auto-generated from the config schema in the source — see the [config guide](https://jbrowse.org/jb2/docs/config_guide) for concepts. Provided by the `alignments` plugin. [View source](https://github.com/GMOD/jbrowse-components/blob/main/plugins/alignments/src/LinearAlignmentsDisplay/alignmentsSortConfigSchema.ts).

## Example usage

```js
{ type: 'LinearAlignmentsDisplay', sort: 'spliced' }
```

```js
{
  type: 'LinearAlignmentsDisplay',
  sort: { type: 'tag', tag: 'HP', pos: 1999, refName: 'ctgA' },
}
```

The alignments displays' `sort` setting: the pileup's row order. A
whole-window order is a string — `"position"` (by start, the default),
`"length"` (widest first), `"spliced"` (reads whose CIGAR carries a skip
first), `"split"` (reads aligned in pieces first) or `"svSignal"` (split
reads and reads carrying a deletion of 50 bp or more first, the evidence for
a structural variant). A column sort ranks the reads over one base, `pos`
(0-based) on `refName`, by `strand`, `basePair`, `mapq` (highest first),
`pairOrientation` (the abnormal orientations over LR), `tag` (naming `tag`),
or the `insertion`, `softclip` or `hardclip` there, or up to `within` bases
either side; the reads not over it lay out by position. On another
chromosome a column sort orders by position.

## Related links

- **Extended by:** [LGVSyntenySort](../lgvsyntenysort)

## Config slots

Slot types (`fileLocation`, `frozen`, ...) are explained in the [config slot types reference](https://jbrowse.org/jb2/docs/config_guides/slot_types). Slots a base configuration contributes are listed here too, so this table is the whole surface.

| Slot | Description |
| --- | --- |
| **type**<br>[`stringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenum) = <code>'position'</code> | position, length, spliced, split or svSignal order the whole window; strand, basePair, mapq, pairOrientation, tag, insertion, softclip or hardclip rank the reads over the column at pos |
| **pos**<br>[`maybeNumber`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | a column sort's 0-based position |
| **refName**<br>[`maybeString`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | a column sort's reference sequence |
| **tag**<br>[`maybeString`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | the SAM tag a tag sort ranks by |
| **within**<br>[`maybeNumber`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | how many bases either side of pos an insertion, softclip or hardclip sort still ranks a mark |

