# GWASAdapter

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 `gwas` plugin. [View source](https://github.com/GMOD/jbrowse-components/blob/main/plugins/gwas/src/GWASAdapter/configSchema.ts).

Reads GWAS results from a bgzip-compressed, tabix-indexed BED-like file. The
adapter is a `BedTabixAdapter` whose `scoreColumn` defaults to
`neg_log_pvalue`, so a file loads with a Manhattan plot score and no further
config.

## Example usage

```js
{
  type: 'GWASTrack',
  trackId: 'my_track',
  name: 'My track',
  assemblyNames: ['hg38'],
  adapter: {
    type: 'GWASAdapter',
    uri: 'https://example.com/summary_stats.txt.gz',
  },
}
```

JBrowse infers `GWASAdapter` and `GWASTrack` from `summary_stats.txt.gz`, and `name` defaults to the file name. In a config declaring one assembly, `assemblyNames` comes from there too — see [the shortest track](https://jbrowse.org/jb2/docs/config_guides/tracks#the-shortest-track).

```js
{
  trackId: 'my_track',
  uri: 'https://example.com/summary_stats.txt.gz',
  assemblyNames: ['hg38'],
}
```

Reading a raw p-value column instead, transformed to -log10(p) at load:

```js
{
  type: 'GWASTrack',
  trackId: 'my_track',
  name: 'My track',
  assemblyNames: ['hg38'],
  adapter: {
    type: 'GWASAdapter',
    uri: 'https://example.com/summary_stats.txt.gz',
    scoreColumn: 'pval',
    scoreTransform: 'negLog10',
  },
}
```

## Related links

- **Track:** [GWASTrack](../gwastrack)
- **Display:** [LinearManhattanDisplay](../linearmanhattandisplay)
- **Base config:** [BedTabixAdapter](../bedtabixadapter)

## Config slots

Adapter slots go inside the track's `adapter`: `"adapter": { "type": "GWASAdapter", ... }`. It also accepts the [shorthand](https://jbrowse.org/jb2/docs/config_guides/file_types#the-uri-shorthand) keys `uri`, `baseUri`, `csi` in place of writing a location slot out. 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 |
| --- | --- |
| **scoreColumn**<br>[`string`](https://jbrowse.org/jb2/docs/config_guides/slot_types#string) = <code>'neg_log_pvalue'</code> | BED column to read as the Manhattan plot score |
| **scoreTransform**<br>[`string`](https://jbrowse.org/jb2/docs/config_guides/slot_types#string) = <code>'none'</code> | transform applied to `scoreColumn` to produce the Manhattan -log10(p) value: `none` (column is already -log10, e.g. Pan-UKBB neglog10_pval_*), `negLog10` (column is a raw p-value), `negLog10FromLn` (column is a natural-log p-value, e.g. Pan-UKBB Hail `ln P`), or a `jexl:...` expression of `score` for anything else (e.g. `jexl:-log10(score)`) — arbitrary but slower than the native modes, so opt-in only<br>_callback args:_ `score` |
| **ldAdapter**<br>[`maybeFrozen`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | optional PLINK .ld sub-adapter (PlinkLDAdapter / PlinkLDTabixAdapter) supplying each SNP's r² to an index SNP, which a fetch joins as the `r2` and `ld_role` fields while the Manhattan display's plot names one, and a column of the file under either name is then dropped; leave it unset to disable |
| <span class="slot-group">Inherited from [BedTabixAdapter](../bedtabixadapter) | <span class="slot-group-count">5 slots |
| **bedGzLocation**<br>[`fileLocation`](https://jbrowse.org/jb2/docs/config_guides/slot_types#filelocation) = <code>{ uri: '/path/to/my.bed.gz', locationType: 'UriLocation' }</code> | location of the bgzip-compressed BED, sorted by position. Must be bgzip rather than plain gzip, which tabix cannot index. |
| **index**<br>[TabixIndex](../tabixindex) | The tabix index location and its kind. The `uri` shorthand derives both, so a config using it states neither. |
| **columnNames**<br>[`stringArray`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringarray) = <code>[]</code> | List of column names. A column named like a standard BED column is parsed as that column's type (chromStart numeric, blockSizes a numeric list); any other column is text |
| **autoSql**<br>[`string`](https://jbrowse.org/jb2/docs/config_guides/slot_types#string) = <code>''</code> | The autoSql definition for the data fields in the file |
| **disableGeneHeuristic**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Disable the heuristic that auto-detects BED12 features as gene/transcript structures. Useful for files that have BED12-like structure but are not genes (e.g. tandem duplications) |

