# LinearAlignmentsDisplay

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/configSchema.ts).

## Example usage

Minimal BAM track — no display override needed for defaults. See the
[alignments track guide](https://jbrowse.org/jb2/docs/config_guides/alignments_track) for all
adapter and display options:

```js
{
  type: 'AlignmentsTrack',
  trackId: 'ngs_reads',
  name: 'NGS reads',
  assemblyNames: ['hg38'],
  adapter: { type: 'BamAdapter', uri: 'https://example.com/sample.bam' },
}
```

CRAM colored by CpG methylation (modBAM MM/ML tags). The `displayDefaults`
object shorthand applies settings without spelling out the display `type` or
`displayId` — equivalent to `displays: [{ type: 'LinearAlignmentsDisplay',
displayId: '...', color: ... }]`. See
[configuring displays](https://jbrowse.org/jb2/docs/config_guides/tracks#configuring-displays):

```js
{
  type: 'AlignmentsTrack',
  trackId: 'methylation',
  name: 'Methylation',
  assemblyNames: ['hg38'],
  adapter: { type: 'CramAdapter', uri: 'https://example.com/sample.cram' },
  displayDefaults: {
    baseColor: { field: 'modifications' },
    modifications: { unmodified: 'all' },
  },
}
```

Long reads — taller track, soft-clipping shown, split/chimeric reads
connected by arcs, each segment colored by its strand against its
molecule's:

```js
{
  type: 'AlignmentsTrack',
  trackId: 'long_reads',
  name: 'Long reads',
  assemblyNames: ['hg38'],
  adapter: { type: 'BamAdapter', uri: 'https://example.com/longreads.bam' },
  displayDefaults: {
    height: 400,
    showSoftClipping: true,
    unit: 'chain',
    color: { field: 'pairOrientation' },
    readConnections: 'arc',
  },
}
```

Draws the reads of an `AlignmentsTrack` as a pileup under a coverage
histogram.

## Related links

- **Adapter:** [BamAdapter](../bamadapter)
- **Adapter:** [CramAdapter](../cramadapter)
- **Adapter:** [HtsgetBamAdapter](../htsgetbamadapter)
- **Adapter:** [SamAdapter](../samadapter)
- **Extended by:** [LGVSyntenyDisplay](../lgvsyntenydisplay)
- **State model:** [runtime API](../../models/linearalignmentsdisplay)
- **Base config:** [BaseLinearDisplay](../baselineardisplay)

## Config slots

These slots go on a display entry: `"displays": [{ "type": "LinearAlignmentsDisplay", ... }]`, or in the track's [`displayDefaults`](https://jbrowse.org/jb2/docs/config_guides/tracks#configuring-displays) when this is its default display. 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 |
| --- | --- |
| **featureHeight**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>7</code> | Height of each feature (read) in pixels. Defaults to 7 |
| **readConnectionsLineWidth**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>1</code> | Line width for read-connection arcs/lines in pixels |
| **showSashimiLabels**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Draw the supporting-read count on each sashimi arc |
| **showNonCanonicalJunctions**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw sashimi arcs whose splice-site motif is none of GT-AG, GC-AG or AT-AC. Off, the motif is read off the reference under each junction, so it needs a sequence adapter, and a junction whose motif could not be read stays |
| **maxHeight**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>6000</code> | Maximum pixel height of the pileup layout; reads beyond this are not stacked (coverage still reflects true depth)<br>_advanced_ |
| **height**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>250</code> | Starting height in pixels for the coverage band and pileup together; heightMode decides what a pileup deeper than this does |
| **color**<br>[AlignmentsColor](../alignmentscolor) | The read fill: `"steelblue"` paints every read, `{ field: "strand" }` a read dimension's own vocabulary and `{ field: "tags.HP" }` a SAM tag. |
| **baseColor**<br>[AlignmentsBaseColor](../alignmentsbasecolor) | The per-base layer drawn over the reads, whatever fills them: `{ field: "modifications" }`, `"bisulfite"`, `"baseQuality"` or `"base"`. |
| **modifications**<br>[AlignmentsModifications](../alignmentsmodifications) | Settings for the `modifications` and `bisulfite` color fields: `threshold` (percent, default 10), `unmodified`, `cytosineContext` and `shownModifications`. |
| **filter**<br>[ReadFilter](../readfilter) | Every read filter, in one object: the flag masks, a read name, tag filters, and the four read categories.<br><br>default filter flags is exclude 1540 read unmapped (0x4) read fails platform/vendor quality checks (0x200) read is PCR or optical duplicate (0x400)<br><br>A read category takes `"only"` or `"exclude"`, and is absent when it isn't filtering — `{ "svSignal": "only" }` for the split reads, the SV-size indels and the discordant pairs. `svSignal`, `singletons`, `split` and `spliced`. |
| **facet**<br>[SectionFacet](../sectionfacet) | In-track stacked grouping, one labelled section per value: a read dimension (`strand`, `firstOfPairStrand`, `pairOrientation`, `pairing`, `split`, `spliced`, `mapq`, `mateRefName`, `mateAssembly`), a tag (`tags.HP`), or any other field. `{ field: "tags.HP", domain: ["2", "1"] }` stacks the listed values first. |
| **collapseGroupRows**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Only consulted while `facet` is in effect. Collapsing trades the per-group stack for one lane per group, with overlap depth carried by the tint shading instead of by row count — the compact reading for a track with many groups (an all-vs-all synteny track's mate genomes). A group expanded from its label chip opts back out and draws a true stack. |
| **scales**<br>[ValueScale](../valuescale) | The coverage band's value scale — the one thing on this display drawn against an axis, the pileup having no value and the arcs their own `arcBandYScale`. `symlogConstant` starts at 1 rather than the wiggle family's 0, which makes symlog exactly `log(depth+1)`: the knee sits at one read, the smallest depth there is. `domainQuantile` stays at 1, the deepest base in view; the Coverage axis panel's Clip extreme outliers writes 0.99, which stops the axis at twice the 99th percentile of the covered bins' peaks, and misses a collapsed-repeat pile-up once it covers more than 1% of the view. |
| **fadeLowQualityMismatches**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Fade mismatch bases by their per-base Phred quality. Defaults to off |
| **fadeLowFrequencyMismatches**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Fade the sub-pixel mismatches, insertions and clip bars in the pileup that fall below the depth-dependent frequency threshold; off draws them all at full opacity. Does not affect the coverage band (see runCoveragePipeline)<br>_advanced_ |
| **showLegend**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Show the color-scheme legend overlay. Defaults to off |
| **sort**<br>[AlignmentsSort](../alignmentssort) | The pileup's row order: a whole-window order (`position`, `length`, `spliced`, `split`) or a column sort at one base (`{ type: "strand", pos, refName }`). |
| **showOutline**<br>[`maybeBoolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | null = auto: outline is drawn only under `unit: 'chain'`. Set true/false to force it on or off regardless of mode.<br>_advanced_ |
| **unit**<br>[`stringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenum) (read, chain) = <code>'read'</code> | The unit one row draws: a read, or a chain of a read, its mate and its split segments (the "View as pairs" menu row) |
| **showBezierConnections**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Draw paired-read connection curves over the pileup |
| **showCoverage**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw the coverage histogram band |
| **showPileup**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw the stacked-read pileup band |
| **coverageHeight**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>45</code> | Height of the coverage band in pixels |
| **coverageSnpMinFrequency**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>0</code> | Hide a coverage-band allele segment whose share of that position's depth is below this fraction, so the band stops painting a sliver for every sequencing error at high depth. 0 (the default) colors every mismatch. Distinct from `fadeLowFrequencyMismatches`, the pileup's fade of sub-pixel marks against a depth-dependent threshold; this is a flat allele-fraction floor on the band, and the grey depth bar still shows through where a segment is hidden<br>_advanced_ |
| **showMismatches**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw how reads differ from the reference: per-base mismatches, insertion markers and deletion bars. Not the intron centerlines — a spliced read is drawn as separate exon blocks, so the line joining them says they are one read rather than several, and it draws either way (PILEUP_MARKS) |
| **showInterbaseIndicators**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw interbase insertion/clip count bars and indicator triangles |
| **showInterchrom**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw inter-chromosomal read-connection arcs |
| **showOrdinaryPairs**<br>[`maybeBoolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | Draw the ordinary pairs alongside the abnormal ones: concordant pairs as arcs, pairs of modal insert size in the read cloud. Unset, the arcs draw them as context and the cloud leaves them out |
| **minInterchromSupport**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>2</code> | Hide inter-chromosomal connections supported by fewer than this many reads clustered at the same breakpoint |
| **showLongRange**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw long-range read-connection arcs |
| **arcColor**<br>[AlignmentsArcColor](../alignmentsarccolor) | The field the read-connection arcs and the read cloud are colored by: `"pairOrientation"` paints them by pair orientation whatever the reads show, and `""` takes the reads' `color` field where an arc paints it. |
| **readConnections**<br>[`stringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenum) (off, arc, cloud) = <code>'off'</code> | Read-connection rendering mode (mate pairs + split reads) |
| **readConnectionsDown**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw read connections below the coverage band. Defaults to on |
| **showSashimiArcs**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>true</code> | Draw sashimi (splice-junction) arcs |
| **sashimiArcsMode**<br>[`stringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenum) (up, down, auto) = <code>'up'</code> | Sashimi junction-arc placement |
| **minSashimiScore**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>2</code> | Hide sashimi arcs with fewer than this many supporting reads |
| **sashimiArcsHeight**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>40</code> | Height of the sashimi-arc band in pixels |
| **readConnectionsHeight**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>35</code> | Height of the read-connection band in pixels |
| **showSoftClipping**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Draw soft-clipped read portions. Defaults to off |
| **heightMode**<br>[`stringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenum) (fixed, grow, fit) = <code>'fixed'</code> | Track-sizing strategy — how the track responds when there are more reads than fit (shared vocabulary with the canvas feature display, exposed in the "Track sizing" menu). `fixed` (the default) keeps `featureHeight` and scrolls; `grow` expands the track to show every read at the configured height; `fit` squeezes reads so every uncollapsed group fills the display without scrolling. Orthogonal to the per-read size set by `featureHeight` |
| **growMaxHeight**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>800</code> | Ceiling in pixels for the "autogrow track height" sizing mode; a pileup deeper than this grows to the ceiling and scrolls the rest. Does not apply to the fixed or fit modes, and does not limit how much is laid out (see maxHeight)<br>_advanced_ |
| <span class="slot-group">Inherited from [BaseLinearDisplay](../baselineardisplay) | <span class="slot-group-count">2 slots |
| **fetchSizeLimit**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>1_000_000</code> | maximum data to attempt to download for a given track, used if adapter doesn't specify one<br>_advanced_ |
| **forceLoad**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Declarative equivalent of the "Force load" button on the "too much data" banner: when true the display always renders, however large the region or dense the features. Off by default (the gate guards against huge downloads). Set it on a view no one can interact with — an embedded / notebook view, or a screenshot — where the region is known and you want it drawn without a click.<br>_advanced_ |

## Retired keys

An older config may still write these. Each loads without an error, and `jbrowse validate` reports it as stale.

| Key | On load |
| --- | --- |
| `maxFeatureScreenDensity` | ignored |
| `maxDisplayedBpPerPx` | ignored |
| `mouseover` | ignored |
| `jexlFilters` | ignored |
| `colorBy` | moved into a current slot |
| `drawInter` | moved into a current slot |
| `drawLongRange` | moved into a current slot |
| `filterBy` | moved into a current slot |
| `pileupDisplay` | moved into a current slot |
| `snpCoverageDisplay` | moved into a current slot |
| `defaultRendering` | ignored |
| `renderers` | moved into a current slot |
| `colorScheme` | ignored |
| `scaleType` | moved into a current slot |
| `autoscale` | moved into a current slot |
| `minScore` | moved into a current slot |
| `maxScore` | moved into a current slot |
| `numStdDev` | ignored |
| `inverted` | ignored |
| `multiTicks` | ignored |
| `jitter` | ignored |
| `lineWidth` | moved into a current slot |
| `hideSmallIndels` | ignored |
| `hideMismatches` | moved into a current slot |
| `mismatchAlpha` | moved into a current slot |
| `hideLargeIndels` | ignored |
| `minSubfeatureWidth` | ignored |
| `flipStrandLongReadChains` | ignored |

