# UCSCTrackHubConnection

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

Adds the tracks a UCSC track hub's `hub.txt` declares for each matching
assembly to the session.

## Example usage

An entry in the config's `connections`. The hub's `hub.txt` is read on
connect and every track it declares for a matching assembly is added to the
session — nothing is written into your config, so the hub stays the source of
truth. `assemblyNames` limits which of the hub's genomes are used.

```js
{
  type: 'UCSCTrackHubConnection',
  connectionId: 'ucsc_hub_example',
  name: 'My track hub',
  assemblyNames: ['hg38'],
  hubTxtLocation: { uri: 'https://example.com/hub.txt' },
}
```

## Related links

- **State model:** [runtime API](../../models/ucsctrackhubconnection)
- **Base config:** [BaseConnection](../baseconnection)

## Config slots

Connection slots are top-level fields of the connection's entry in `connections`. 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 |
| --- | --- |
| **hubTxtLocation**<br>[`fileLocation`](https://jbrowse.org/jb2/docs/config_guides/slot_types#filelocation) = <code>{ uri: 'https://mysite.com/path/to/hub.txt', locationType: 'UriLocation', }</code> | location of the hub file (usually called hub.txt) |
| **assemblyNames**<br>[`stringArray`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringarray) = <code>[]</code> | optional list of genomes to import from this track hub, if empty all genomes will be imported |
| <span class="slot-group">Inherited from [BaseConnection](../baseconnection) | <span class="slot-group-count">1 slot |
| **name**<br>[`string`](https://jbrowse.org/jb2/docs/config_guides/slot_types#string) = <code>'nameOfConnection'</code> | a unique name for this connection |

