# ReadFilter

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

## Example usage

```js
{ type: 'LinearAlignmentsDisplay', filter: { flagExclude: 1540, properPairs: 'exclude', split: 'only' } }
```

```js
{ type: 'LinearAlignmentsDisplay', filter: { tagFilters: [{ tag: 'HP', value: '1' }] } }
```

_See the **Config slots** section below for all available configuration fields._

Every read filter of the alignments display in one object, its `filter`
slot: the SAM flag masks, a read name, the tag filters a read has to pass
every one of, and the four read categories, each `only`, `exclude` or
unset for unfiltered. The default excludes unmapped, QC-failed and duplicate
reads (flag 1540).

## 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 |
| --- | --- |
| **flagInclude**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>defaultFilterFlags.flagInclude</code> | a read passes only with every one of these SAM flag bits set, samtools -f |
| **flagExclude**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>defaultFilterFlags.flagExclude</code> | a read passes only with none of these SAM flag bits set, samtools -F; 1540 drops unmapped, QC-failed and duplicate reads |
| **readName**<br>[`maybeString`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | the one read name shown; unset shows every read |
| **tagFilters**<br>[TagFilter](../tagfilter) | The tags a read has to carry, every one of them: a `{ tag, value }` each, the value `*` or unset passing any read with the tag. |
| **spliced**<br>[`maybeStringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) (only, exclude) | `only`, `exclude`, or unset for unfiltered: reads whose CIGAR carries a reference skip. |
| **properPairs**<br>[`maybeStringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) (only, exclude) | `only`, `exclude`, or unset for unfiltered: pairs the aligner flagged proper, in normal orientation. |
| **singletons**<br>[`maybeStringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) (only, exclude) | `only`, `exclude`, or unset for unfiltered: reads whose mate and supplementary segments are all outside the window. |
| **split**<br>[`maybeStringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) (only, exclude) | `only`, `exclude`, or unset for unfiltered: reads with a supplementary segment, a chimeric alignment. |

