Code Monkey home page Code Monkey logo

fast_km's Introduction

fast_km

AppVeyor Badge

API

/skim/api/jobs/

POST:

Post a SKiM job to the job queue. Must be in json format. Returns the job ID. Parameters: A dictionaries with the keys:

  • "a_terms": list of strings
  • "b_terms": list of strings
  • "c_terms": list of strings
  • "top_n": integer
  • "ab_fet_threshold": float
  • "censor_year" (optional): integer
  • "return_pmids" (optional): boolean

Example:

import requests
post_json = { "a_terms": ["cancer"], "b_terms": ["tumor"], "c_terms": ["skin"], "top_n": 50, "ab_fet_threshold": 0.01 }
response = requests.post('http://localhost:5000/skim/api/jobs', json=post_json).json()
job_id = response['id']

Response:

{ 
  'id': 'abcd', 
  'status': 'submitted' 
}

GET:

Returns the job's status given its ID, and, if the job is finished, the results of the job.

A finished job contains in the 'results' key a list of dictionaries, each with the key:

  • "a_term": string
  • "b_term": string
  • "c_term": string
  • "ab_pvalue": float
  • "ab_sort_ratio": float
  • "ab_pred_score": float
  • "bc_pvalue": float
  • "bc_sort_ratio": float
  • "bc_pred_score": float
  • "a_count": integer
  • "b_count": integer
  • "c_count": integer
  • "ab_count": integer
  • "bc_count": integer
  • "total_count": integer
  • "ab_pmid_intersection": set of integers, cast as a string
  • "bc_pmid_intersection": set of integers, cast as a string

Example:

import requests
get_response = requests.get("http://localhost:5000/skim/api/jobs?id=" + job_id).json()
job_status = get_response['status']
if job_status == 'finished':
  job_result = get_response['result']

Response:

{ 
  'id': 'abcd', 
  'status': 'finished', 
  'result': [{ "a_term": "cancer", "b_term": "tumor", ... }] 
}

fast_km's People

Contributors

cannonlock avatar rmillikin avatar xuanchengtu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.