This is a system for storing, serving and tracking BLAST and PSI_BLAST PSSM files.
- dnf install postgresql-contrib (for hstore extension)
- pip install -r requirements/base.txt
- Add blast_cache db to postgres CREATE DATABASE blast_cache_db;
- Enable hstore extension \c blast_cache_db CREATE EXTENSION hstore;
- Create test template for the test db CREATE DATABASE hstemplate; \c hstemplate CREATE EXTENSION hstore; update pg_database set datistemplate=true where datname='hstemplate';
- Add blast_cache_user to postgres CREATE USER blast_cache_user WITH PASSWORD ''; ALTER USER blast_cache_user CREATEDB;
- Run migrations
- Add 'manage.py createsuperuser'
- GET Requests
- blast_cache/list/ : List every single entry in the db
- blast_cache/list/[MD5] : list all unexpired entries in the db with this MD5
- blast_cache/entry/[MD5]?[param...]=[value]... : retrieve unexpired single unique record given MD5 and uniquely specifying params
- blast_cache/entry/[MD5]?[param...]=[value]&block=true... : retrieve unexpired single unique record given MD5 and uniquely specifying params and if not present create a record and set it to blocked
- POST Requests
- blast_cache/entry : required fields include
When posting PSSM string data it needs to be escaped properly so that it does not get read as json on submission (see line 98 of run_blast.py), .replace('"', '\"').replace('\n', '\n'). This also means that these escape sequences must be removed when data is retrieved
- name: A short easy to remember identifier for the cache entry
- md5: The md5 hash of the protein sequence for the cache entry
- file_type: An integer reflecting the file type; 1: PSSM, 2: CHK
- blast_hit_count: An integer listing the number of blast hits
- runtime: An integer listing the blast runtime in seconds
- data: A dict containing the file_data (required)
python manage.py test --settings=blast_cache.settings.dev
python manage.py runserver --settings=blast_cache.settings.dev