running a local fork of higlass-server

overview

The goal is to set up a Django management command and API route (with authentication support) for deleting HiGlass tilesets. We will do the work on a t2.micro EC2 instance running Ubuntu 18.04 (ami-0f65671a86f061fcd).

nodejs

Install nodenpm, and npx from Nodejs:

cd ~ 
NODEJS_VERSION=16.13.0
wget -qO- https://nodejs.org/dist/v${NODEJS_VERSION}/node-v11.1.0-linux-x64.tar.xz > node-v${NODEJS_VERSION}-linux-x64.tar.xz 
tar xvf node-v${NODEJS_VERSION}-linux-x64.tar.xz
cd node-v${NODEJS_VERSION}-linux-x64/bin 
sudo ln -s ${PWD}/node /usr/bin/node 
sudo ln -s ${PWD}/npm /usr/bin/npm 
sudo ln -s ${PWD}/npx /usr/bin/npx

anaconda

cd ~
ANACONDA_VERSION=5.3.1
wget https://repo.anaconda.com/archive/Anaconda3-${ANACONDA_VERSION}-Linux-x86_64.sh
chmod +x Anaconda3-${ANACONDA_VERSION}-Linux-x86_64.sh
./Anaconda3-${ANACONDA_VERSION}-Linux-x86_64.sh

github

Clone and fork higlass-server:

git clone https://github.com/alexpreynolds/higlass-server
cd ~/higlass-server
git remote add upstream https://github.com/higlass/higlass-server.git
git checkout develop
git pull remote develop
git checkout -b delete-tileset develop

environment

Install GCC kit and related dependencies:

sudo apt install build-essential
sudo apt install libglib2.0-dev
sudo apt install libbz2-dev
sudo apt install liblzma-dev
sudo apt install libhdf5-serial-dev
sudo apt install libcurl4-gnutls-dev
sudo apt install libpng-dev
sudo apt install libssl-dev
gcc --version

Other packages may be needed.

python

cd ~/higlass-server
source activate higlass-server
pip install --upgrade -r ./requirements.txt
pip install --upgrade -r ./requirements-secondary.txt

higlass-server

Initialize database and start server:

python manage.py makemigrations
python manage.py migrate
python manage.py runserver localhost:8000

test API

wget -qO- http://localhost:8000/api/v1/tilesets
# {"count":0,"next":null,"previous":null,"results":[]}
wget -qO- http://localhost:8000/api/v1/tileset_info/?d=1234
# {"1234": {"error": "No such tileset with uid: 1234"}}

test ingestion and listing

wget -O- --user * --password * https://resources.altius.org/~areynolds/LN43287.75_20.normalized.GRCh38_no_alts.bw.tileset > /tmp/LN43287.75_20.normalized.GRCh38_no_alts.bw.tileset
python manage.py ingest_tileset --filetype hitile --datatype vector --filename /tmp/LN43287.75_20.normalized.GRCh38_no_alts.bw.tileset
# uid: AIVpsJYwSemD8FVPBv6vrw
python manage.py list_tilesets
# tileset: Tileset [name: LN43287.75_20.normalized.GRCh38_no_alts.bw.tileset] [ft: hitile] [uuid: AIVpsJYwSemD8FVPBv6vrw]

set up superuser

python manage.py createsuperuser

pull request

https://github.com/higlass/higlass-server/pull/79