raphael-group/magi-stat-server

Name: magi-stat-server

Owner: raphael-group

Description: A JSON-based statistics server in Tornado for supplying enrichments to MAGI

Created: 2015-03-30 20:20:33.0

Updated: 2015-05-04 20:14:10.0

Pushed: 2015-05-04 20:14:26.0

Homepage: null

Size: 156

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

This branch of MAGI is meant to serve enrichment queries. These queries are statistics that are requested by the user among different categories, such as gender, survival or mutation status.

Input data format

Enrichment queries can either be served as AJAX requests to a server or as locally on the command line. In either case a query is formed as a JSON body with the fields “X” and “Y”, which should be two lists of equal length and the same type, representing the category membership of a sample. Examples of proper JSON bodies can be found as .in files with the tests folder.

If no category membership exists for a sample (e.g. the mutation status of a sample is unknown), then the string “null” can replace the value and the sample will be treated as missing data in the calculation.

Available test types

Tests currently exists for two categories (and their labeled type):

The labeled type is given in the “request” field in the JSON body, which must be one of the labeled types. If no request field is given, then the request is assumed to be “contingency”.

Output format

The output contains the following fields:

Examples for running:

To run the server:

python statserver.py –port=19999

To test the server:

python runTests.py –port=19999

To submit a JSON file to the server:

python submit.py –port=19999

To run a file locally (no server required):

python stat-local.py –inputdata=$(cat tests/example.in)

To test the local interface:

python -m unittest stat-local


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.