1 | [![npm](https://img.shields.io/npm/v/higlass-zarr-datafetchers)](https://www.npmjs.com/package/higlass-zarr-datafetchers)
|
2 | [![npm bundle size](https://img.shields.io/bundlephobia/min/higlass-zarr-datafetchers)](https://unpkg.com/browse/higlass-zarr-datafetchers/)
|
3 |
|
4 | # higlass-zarr-datafetchers
|
5 |
|
6 | This repository contains plugin data fetchers for loading [Zarr](https://zarr.readthedocs.io/en/stable/)-based files in HiGlass.
|
7 | These plugins allow data to be stored in object stores such as S3 (rather than using [higlass-server](https://github.com/higlass/higlass-server)).
|
8 | Plugin data fetchers can be registered using [higlass-register](https://github.com/higlass/higlass-register).
|
9 |
|
10 | ## Installation
|
11 |
|
12 | ```sh
|
13 | yarn add zarr # peer dependency
|
14 | yarn add higlass-register # helpers for plugin registration
|
15 | yarn add higlass-zarr-datafetchers
|
16 | ```
|
17 |
|
18 | ## Register plugin data fetchers
|
19 |
|
20 | ```js
|
21 | import register from "higlass-register";
|
22 | import { ZarrMultivecDataFetcher } from "higlass-zarr-datafetchers";
|
23 |
|
24 | register(
|
25 | { dataFetcher: ZarrMultivecDataFetcher, config: ZarrMultivecDataFetcher.config },
|
26 | { pluginType: "dataFetcher" }
|
27 | );
|
28 | ```
|
29 |
|
30 | ## Use in a HiGlass view config track definition
|
31 |
|
32 | List of data fetchers currently implemented:
|
33 |
|
34 | - `zarr-multivec` (register with `ZarrMultivecDataFetcher`)
|
35 |
|
36 | - Use this data fetcher with a `horizontal-multivec` track to visualize multi-sample genome-wide continuous data.
|
37 |
|
38 | ```js
|
39 | {
|
40 | "type": "horizontal-multivec",
|
41 | "uid": "demo-multivec-track",
|
42 | "data": {
|
43 | "type": "zarr-multivec",
|
44 | "url": "//higlass-serverless.s3.amazonaws.com/multivec/Homo_sapiens__AFF4__all.multires.zarr",
|
45 | },
|
46 | }
|
47 | ```
|
48 |
|
49 | - Alternatively, use this data fetcher with a `horizontal-bar` track to visualize single-sample genome-wide continuous data (one row of a multi-sample file).
|
50 |
|
51 | ```js
|
52 | {
|
53 | "type": "horizontal-bar",
|
54 | "uid": "demo-bar-track",
|
55 | "data": {
|
56 | "type": "zarr-multivec",
|
57 | "url": "//higlass-serverless.s3.amazonaws.com/multivec/Homo_sapiens__AFF4__all.multires.zarr",
|
58 | "row": 0, // specify the index of a row of interest
|
59 | },
|
60 | }
|
61 | ```
|
62 |
|
63 | ## Develop
|
64 |
|
65 | ### Install dependencies
|
66 | ```sh
|
67 | yarn
|
68 | ```
|
69 |
|
70 | ### Run the demo
|
71 |
|
72 | ```sh
|
73 | yarn run start
|
74 | ```
|
75 |
|
76 | ## Build
|
77 |
|
78 | ```sh
|
79 | yarn run build
|
80 | ```
|
81 |
|
82 | ## Conversion resources
|
83 |
|
84 | Coming soon: [higlass-zarr-converters](https://github.com/keller-mark/higlass-zarr-converters)
|
85 |
|
86 | _For the current demo, Zarr files were generated using [this script](https://github.com/hms-dbmi/cistrome-explorer/blob/221fc8c183f0e03f83059a6735f5dbe48217b4d3/pipelines/cistrome-to-multivec/src/manifest_to_zarr.py)_
|