Skip to main content

REST service for Network Assisted Genomic Analysis (NAGA)

Project description


REST service for Network Assisted Genomic Analysis (NAGA)

For more information please click here to visit our wiki

This service is currently running here:


Additional dependencies to build


It is highly reccommended one use Anaconda for Python environment

git clone
cd naga-gwas-rest
make install

Running service in development mode

NOTE: Example below runs the REST service and not the task runner.

# It is assumed the application has been installed as described above
export FLASK_APP=nbgwas_rest
flask run # --host= can be added to allow all access from interfaces

# Service will be running on http://localhost:5000

# NOTE: To have tasks processed must be started in
# another terminal

Click here for information on launching service via Vagrant VM

Example usage of service

Below is a small script that leverages the nbgwas_rest service to run NAGA on the compressed nagadata/schizophrenia.txt.gz passed into the script on the command line

#!/usr/bin/env python

import sys
import gzip
import time
import requests

# pass the gzipped schizophrenia.txt.gz
networkfile = sys.argv[1]

# set parameters
data_dict = {}

# set snp file
files = {'snp_level_summary':, 'rb')}
url = ''
r =, data=data_dict, files=files,

# If successful the previous POST will return 202
if r.status_code != 202:
    sys.stderr.write('Submission failed with code: ' + str(r.status_code) +
    sys.stderr.write('Message: ' + str(r.text) + '\n')

# If successful Location will be set to a URL that can
# be polled for result
if 'Location' not in r.headers:
    sys.stderr.write('Expected Location in Header, ' +
                     'but its not there: ' + str(r.headers) + '\n')

resulturl = r.headers['Location']
getres = requests.get(resulturl, timeout=30)
json_res = getres.json()
while getres.status_code != 200 or json_res['status'] == 'submitted' or json_res['status'] == 'processing':
   getres = requests.get(resulturl, timeout=30)
   json_res = getres.json()

sys.stdout.write(str(json_res) + '\n')

Assuming the above is saved in a file named and run from base directory of this source tree

./ nagadata/schizophrenia.txt.gz

Example output:

{'result': {'A1BG': 1.818739214334769, 'A1CF': 2.9679830980888413,
'A2M': 3.9294999566765174, 'A2ML1': 1.4379620790934335, 'A3GALT2': 1.9918435374785632,
'A4GALT': 1.8734641163972634, 'A4GNT': 1.335302470858104, 'AAAS': 2.384799543926567,
'AACS': 2.965792987307328, 'AADAC': 1.455957465785784, 'AADACL2': 1.0156608351922358,
'AADACL3': 0.895944981993654, 'AADACL4': 1.2458363441128992, 'AADAT': 2.689141678947707,
'AAED1': 0.12364477699188797, 'AAGAB': 0.14237051805828474, 'AAK1': 5.652340641567231,
'AAMDC': 0.1647736242197245, 'AAMP': 3.2927511707526884, 'AANAT': 5.654764562774087,
'AAR2': 0.9427896961129361,
, 'status': 'done'}


Please report them here



0.7.0 (2019-07-01)

  • Added dm6 in list of valid protein coding region files

0.6.0 (2019-05-06)

  • Added mm10 and rn6 in list of valid protein coding region files

0.5.0 (2019-03-07)

  • Replace infinite heat values returned from NAGA bug issue #24
  • Add naga version used in processing to result json issue #23
  • Rename to naga-gwas-rest issue #22
  • Add input parameters snp_analyzer/get endpoint enhancement issue #20
  • Modify to run in a daemon mode issue #3

0.4.1 (2018-12-20)

  • Replace Association with Analysis in REST service description bug issue #19

0.4.0 (2018-12-19)

  • Enabled DELETE rest endpoint issue #16
  • Fixed problems including numpy and running under apache modwsgi bug issue #15
  • should remove snp level summary file after job runs issue #5

0.1.1 (2018-11-30)

  • First release onto github

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for naga-gwas-rest, version 0.7.0
Filename, size File type Python version Upload date Hashes
Filename, size naga_gwas_rest-0.7.0-py2.py3-none-any.whl (26.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size naga-gwas-rest-0.7.0.tar.gz (32.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page