Skip to content

Latest commit

 

History

History
124 lines (81 loc) · 3.66 KB

README.md

File metadata and controls

124 lines (81 loc) · 3.66 KB

HiGlass Server

The HiGlass Server supports HiGlass and HiPiler by providing APIs for accessing and uploading tiles generated by Clodius.

demo api DOI

Note: that the HiGlass Server itself only provides an API, and does not serve any HTML.

Installation

Prerequirements:

  • Python v3

Docker

The easiest way to run HiGlass with HiGlass Server is with Docker. More information is available at higlass-docker or check out the Dockerfile.

Manually

To install HiGlass Server manually follow the steps below. Note we strongly recommend to create a virtual environment using Virtualenvwrapper for example. Skip step 2 if you don't work with virtual environments.

git clone https://github.com/higlass/higlass-server && cd higlass-server
mkvirtualenv -a $(pwd) -p $(which python3) higlass-server && workon higlass-server
pip install --upgrade -r ./requirements.txt
pip install --upgrade -r ./requirements-secondary.txt
python manage.py runserver

Uploading Files

Although there is an API endpoint for uploading files, but it is more direct to use a manage.py script:

COOLER=dixon2012-h1hesc-hindiii-allreps-filtered.1000kb.multires.cool
HITILE=wgEncodeCaltechRnaSeqHuvecR1x75dTh1014IlnaPlusSignalRep2.hitile

wget -P data/ https://s3.amazonaws.com/pkerp/public/$COOLER
wget -P data/ https://s3.amazonaws.com/pkerp/public/$HITILE

python manage.py ingest_tileset --filename data/$COOLER --filetype cooler --datatype matrix --uid cooler-demo
python manage.py ingest_tileset --filename data/$HITILE --filetype hitile --datatype vector --uid hitile-demo

We can now use the API to get information about a tileset, or to get the tile data itself:

curl http://localhost:8000/api/v1/tileset_info/?d=hitile-demo
curl http://localhost:8000/api/v1/tiles/?d=hitile-demo.0.0.0

Preparing files for ingest

Genomics data needs to be aggregated across a range of scales before it can be used with HiGlass.

Cooler files

TODO: Is this still accurate?

Cooler files store Hi-C data. They need to be decorated with aggregated data at multiple resolutions in order to work with higlass-server. This is easily accomplished by simply installing the cooler python package and running the recursive_agg_onefile.py script. For now this has to come from a clone of the official cooler repository, but this will hopefully be merged into the main branch shortly.


git clone -b develop https://github.com/pkerpedjiev/cooler.git
cd cooler
python setup.py install

recursive_agg_onefile.py file.cooler --out output.cooler

BigWig files

BigWig files can be aggregated with the Clodius.

TODO: Any other types?


Development

Start the server:

python manage.py runserver localhost:8001
// or
npm start

Test the server:

./test.sh
// or
npm test

Bump version of server:

bumpversion patch

Update source code:

./update.sh

Troubleshooting

pybbi installation fails on macOS: Check out nvictus/pybbi#2

License

The code in this repository is provided under the MIT License.