Newer
Older
# Halfpipe
ATAC-Seq Pipeline implemented as a webinterface.
## Setup
Halfpipe requires Python3 and uses the webframework [Django](https://www.djangoproject.com/start/).
Make sure you have the following dependencies installed:
- Postgresql
- Redis
To install them on Ubuntu/Debian use:
apt-get install postgresql postgresql-contrib libpq-dev redis-server
```
Installation under MacOS requires homebrew:
```
### Database setup
Create a database superuser with the same username as your current user:
```
To create database for the project use:
### Storage backend setup
File storage is done with a S3-compatible storage API called [minio](https://min.io/).
On MacOS there is a homebrew package available: `m̀inio/stable/minio`. Linux users can download the binary directly with:
```shell
# Download + make exec
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
```
Then minio can be started with:
```shell
./minio server shared
```
### Other dependencies
Python dependencies are managed via pip. It is however advised to install those dependencies into an virtual environment. This can be created with:
```
To activate the environment use:
```
This needs to be done in every shell that should use our newly created environment.
For development purposes we suggest installing the Python dependencies in the `requirements/testing.txt` file:
pip install -r requirements/testing.txt
```
In order to install javascript and css dependencies use:
python manage.py install_dependencies requirements/static.json
```
## Running
Jobs are managed with [Celery](https://docs.celeryproject.org/en/stable/), a distributed Task-Queue for Python. Start a worker with:
celery -A halfpipe worker --task-events
```
To inspect the job queue and status use `celery -A halfpipe events` Keep in mind that the worker needs to be restarted in order to reflect code changes.
The Django Webserver can be started with:
```
Changes on schema require running `python manage.py migrate` to update the database. For more information see [Django's model documentation](https://docs.djangoproject.com/en/3.1/topics/db/models/#using-models).
## Testing and best practices
Halfpipe uses [Pytest](https://docs.pytest.org/en/stable/) to run tests:
```
The Python code style conforms to [Black](https://github.com/psf/black). To format all Python code use:
## Bowtie Indices
Halfpipe does not ship with a index mapping, but includes documentation on how to obtain them.
Follow the instructions in `halfpipe/fixtures/index_mapping.yaml` and install the fixtures with:
```python
python manage.py loaddata halfpipe/fixtures/index_mapping.yaml
```
## Project organisation
TODO (till)
## Troubleshooting
TODO (till)