Skip to content

API Submit

Kevin Levitz edited this page Jul 27, 2020 · 2 revisions

datamonkey_logo

API Job Submission

Common API format

Method: POST

Body: JSON

Response: JSON

Supported Methods

Example Code

Python

import requests
URL = 'http://datamonkey.org/api/v1/submit'
BODY = {
    'api_key': 'Your API Key',
    "method": "MEME",
    "fastaLoc": "http://your file location",
    "mail": "email",
    "gencodeid": "Universal",
    "fileExtension": "fasta"
}
req = requests.post(URL, json = BODY)
data = req.json()
print(data)
Javascript

  • Requires Request
  • npm install request
var request = require("request");
request(
    {
        method: 'POST',
        uri: 'http://datamonkey.org/api/v1/submit',
        json: true,
        body: {
            api_key: "Your API Key",
            method: "MEME",
            fastaLoc: "http://your file locaiton",
            nwkLoc: "None",
            mail: "email",
            gencodeid: "Universal",
            fileExtension: "fasta"
        }
    }, function (err, res, body) {
        if(err){console.error('error:', err)};
        console.log('statusCode:', res && res.statusCode);
        console.log('body:', body);
});

aBSREL

  • Requires annotated NWK tree

Example Body:

{
  "api_key": "Your API Key",
  "method": "aBSREL",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "nwk_tree": "(((((((TREESPARROW_HENAN_1_2004{FG}:0.0111333782927653,TREESPARROW_HENAN_3_2004:0.006193745941169043):0.0009956664967877545,TREESPARROW_HENAN_4_2004:0.004351652686857959):0.002267763895256407,(CHICKEN_HEBEI_326_2005:0.02100885319673648,(SWINE_ANHUI_2004:0.007702393698306516,TREESPARROW_HENAN_2_2004:0.00906278098731238):0.002095219592954275):0.003887237703073042):0.003404921392531202,(((CHICKEN_HONGKONG_915_97:0,(GOOSE_HONGKONG_W355_97:0,DUCK_HONGKONG_Y283_97:0.002798420018760263):0.002899766890966483):0.001306376767766534,HONGKONG_97_98:0.003844928589233716):0.000182535836694054,HONGKONG_538_97:0):0.02096173714686362):0.003130608143291779,(((DUCK_GUANGZHOU_20_2005:0.006299389645455026,GOOSE_SHANTOU_2216_2005:0.006207842095177651):0.002530613798219486,PEREGRINEFALCON_HK_D0028_2004:0.003608296348267232):0.003288900909856382,CK_HK_WF157_2003:0.00663129750258774):0.004655295319725731):0.0116808817874948,(((HUMAN_VIETNAM_CL105_2005:0.006521522005742001,DUCK_VIETNAM_376_2005:0.007877615936285868):0.001967887030302483,VIETNAM_3062_2004:0.001641397323851184):0.0003125512332168847,MALLARD_VIETNAM_16_2003:0.003244216605281072):0.0004125980823087554):0.0003400912533471183,CHICKEN_THAILAND_KANCHANABURI_CK_160_2005:0.006168335080088849,DUCK_VIETNAM_272_2005:0.009465302724994452)"
  
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:52:51.740Z",
    "id": "5ef26ba3b0e8f0fd7c10e59d",
    "status": "queue",
    "url": "datamonkey.org/absrel/5ef26ba3b0e8f0fd7c10e59d"
}

BGM

Example Body:

{
  "api_key": "Your API Key",
  "method": "bgm",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "datatype": 3,
  "length_of_each_chain": 100000,
  "substitution_model": 0,
  "number_of_burn_in_samples": 10000,
  "number_of_samples": 100,
  "maximum_parents_per_node": 1,
  "minimum_subs_per_site": 1
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:53:47.792Z",
    "id": "5ef26bdbb0e8f0fd7c10e5e5",
    "status": "queue",
    "url": "dev.datamonkey.org/bgm/5ef26bdbb0e8f0fd7c10e5e5"
}

Busted

  • Requires annotated NWK tree

Example Body:

{
  "api_key": "Your API Key",
  "method": "Busted",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "nwk_tree": "(((((((TREESPARROW_HENAN_1_2004{FG}:0.0111333782927653,TREESPARROW_HENAN_3_2004:0.006193745941169043):0.0009956664967877545,TREESPARROW_HENAN_4_2004:0.004351652686857959):0.002267763895256407,(CHICKEN_HEBEI_326_2005:0.02100885319673648,(SWINE_ANHUI_2004:0.007702393698306516,TREESPARROW_HENAN_2_2004:0.00906278098731238):0.002095219592954275):0.003887237703073042):0.003404921392531202,(((CHICKEN_HONGKONG_915_97:0,(GOOSE_HONGKONG_W355_97:0,DUCK_HONGKONG_Y283_97:0.002798420018760263):0.002899766890966483):0.001306376767766534,HONGKONG_97_98:0.003844928589233716):0.000182535836694054,HONGKONG_538_97:0):0.02096173714686362):0.003130608143291779,(((DUCK_GUANGZHOU_20_2005:0.006299389645455026,GOOSE_SHANTOU_2216_2005:0.006207842095177651):0.002530613798219486,PEREGRINEFALCON_HK_D0028_2004:0.003608296348267232):0.003288900909856382,CK_HK_WF157_2003:0.00663129750258774):0.004655295319725731):0.0116808817874948,(((HUMAN_VIETNAM_CL105_2005:0.006521522005742001,DUCK_VIETNAM_376_2005:0.007877615936285868):0.001967887030302483,VIETNAM_3062_2004:0.001641397323851184):0.0003125512332168847,MALLARD_VIETNAM_16_2003:0.003244216605281072):0.0004125980823087554):0.0003400912533471183,CHICKEN_THAILAND_KANCHANABURI_CK_160_2005:0.006168335080088849,DUCK_VIETNAM_272_2005:0.009465302724994452)",
    "ds_variation": 1
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:53:07.124Z",
    "id": "5ef26bb3b0e8f0fd7c10e5b5",
    "status": "queue",
    "url": "datamonkey.org/busted/5ef26bb3b0e8f0fd7c10e5b5"
}

Contrast-FEL

  • Requires annotated NWK tree

Example Body:

{
  "api_key": "Your API Key",
  "method": "CONTRAST-FEL",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "ds_variation": 1,
  "nwk_tree": "(((EELA{Foreground}:0.150276,CONGERA{2ndTag}:0.213019):0.230956,(EELB{Foreground}:0.263487,CONGERB{2ndTag}:0.202633):0.246917):0.094785,((CAVEFISH:0.451027,(GOLDFISH:0.340495,ZEBRAFISH:0.390163):0.220565):0.067778,((((((NSAM:0.008113,NARG:0.014065):0.052991,SPUN:0.061003,(SMIC:0.027806,SDIA:0.015298,SXAN:0.046873):0.046977):0.009822,(NAUR:0.081298,(SSPI:0.023876,STIE:0.013652):0.058179):0.091775):0.073346,(MVIO:0.012271,MBER:0.039798):0.178835):0.147992,((BFNKILLIFISH:0.317455,(ONIL:0.029217,XCAU:0.084388):0.201166):0.055908,THORNYHEAD:0.252481):0.061905):0.157214,LAMPFISH:0.717196,((SCABBARDA:0.189684,SCABBARDB:0.362015):0.282263,((VIPERFISH:0.318217,BLACKDRAGON:0.109912):0.123642,LOOSEJAW:0.3971):0.287152):0.140663):0.206729):0.222485,(COELACANTH:0.558103,((CLAWEDFROG:0.441842,SALAMANDER:0.299607):0.135307,((CHAMELEON:0.771665,((PIGEON:0.150909,CHICKEN:0.172733):0.082163,ZEBRAFINCH:0.099172):0.272338):0.014055,((BOVINE:0.167569,DOLPHIN:0.15745):0.104783,ELEPHANT:0.166557):0.367205):0.050892):0.114731):0.295021)",
  "analysis_type": 0
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:51:20.409Z",
    "id": "5ef26b48b0e8f0fd7c10e525",
    "status": "queue",
    "url": "datamonkey.org/contrast_fel/5ef26b48b0e8f0fd7c10e525"
}

FADE

Example Body:

{
  "api_key": "Your API Key",
  "method": "fade",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "mail": "[email protected]",
  "fileExtension": "fna",
  "number_of_grid_points": 20,
  "number_of_mcmc_chains": 5,
  "length_of_each_chain": 2000000,
  "number_of_burn_in_samples": 1000000,
  "number_of_samples": 100,
  "concentration_of_dirichlet_prior": 0.5,
  "substitution_model": 2,
  "posterior_estimation_method": 3
  
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:53:59.654Z",
    "id": "5ef26be7b0e8f0fd7c10e5fd",
    "status": "queue",
    "url": "datamonkey.org/fade/5ef26be7b0e8f0fd7c10e5fd"
}

FEL

  • Requires annotated NWK tree

Example Body:

{
  "api_key": "Your API Key",
  "method": "FEL",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "mail": "[email protected]",
  "ds_variation": 1,
  "nwk_tree": "(((((((TREESPARROW_HENAN_1_2004{FG}:0.0111333782927653,TREESPARROW_HENAN_3_2004:0.006193745941169043):0.0009956664967877545,TREESPARROW_HENAN_4_2004:0.004351652686857959):0.002267763895256407,(CHICKEN_HEBEI_326_2005:0.02100885319673648,(SWINE_ANHUI_2004:0.007702393698306516,TREESPARROW_HENAN_2_2004:0.00906278098731238):0.002095219592954275):0.003887237703073042):0.003404921392531202,(((CHICKEN_HONGKONG_915_97:0,(GOOSE_HONGKONG_W355_97:0,DUCK_HONGKONG_Y283_97:0.002798420018760263):0.002899766890966483):0.001306376767766534,HONGKONG_97_98:0.003844928589233716):0.000182535836694054,HONGKONG_538_97:0):0.02096173714686362):0.003130608143291779,(((DUCK_GUANGZHOU_20_2005:0.006299389645455026,GOOSE_SHANTOU_2216_2005:0.006207842095177651):0.002530613798219486,PEREGRINEFALCON_HK_D0028_2004:0.003608296348267232):0.003288900909856382,CK_HK_WF157_2003:0.00663129750258774):0.004655295319725731):0.0116808817874948,(((HUMAN_VIETNAM_CL105_2005:0.006521522005742001,DUCK_VIETNAM_376_2005:0.007877615936285868):0.001967887030302483,VIETNAM_3062_2004:0.001641397323851184):0.0003125512332168847,MALLARD_VIETNAM_16_2003:0.003244216605281072):0.0004125980823087554):0.0003400912533471183,CHICKEN_THAILAND_KANCHANABURI_CK_160_2005:0.006168335080088849,DUCK_VIETNAM_272_2005:0.009465302724994452)",
  "analysis_type": 0
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:51:07.530Z",
    "id": "5ef26b3bb0e8f0fd7c10e50d",
    "status": "queue",
    "url": "datamonkey.org/fel/5ef26b3bb0e8f0fd7c10e50d"
}

FUBAR

Example Body:

{
  "api_key": "Your API Key",
  "method": "fubar",
  "fastaLoc": "https://www.dropbox.com/s/dn8mcv02dte2mkj/Flu.fasta?dl=1",
  "fileExtension": "fasta",
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "number_of_grid_points": 20,
  "concentration_of_dirichlet_prior": 0.5,
  "number_of_mcmc_chains": 1,
  "length_of_each_chain": 1,
  "number_of_burn_in_samples": 1,
  "number_of_samples": 1
  
}

Example Reply:

{
    "time_stamp": "2020-07-10T17:07:59.420Z",
    "id": "5f08a06f7f9f353eaf7f51cc",
    "status": "queue",
    "url": "datamonkey.org/fubar/5f08a06f7f9f353eaf7f51cc"
}

GARD

Example Body:

{
  "api_key": "Your API Key",
  "method": "GARD",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "site_to_site_variation": "None",
  "rate_classes": 2
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:51:42.763Z",
    "id": "5ef26b5eb0e8f0fd7c10e53d",
    "status": "queue",
    "url": "datamonkey.org/gard/5ef26b5eb0e8f0fd7c10e53d"
}

MULTIHIT

Example Body:

{
  "api_key": "Your API Key",
   "method": "multihit",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "rate_classes": 2,
  "triple_islands": "Yes"
  
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:52:35.998Z",
    "id": "5ef26b93b0e8f0fd7c10e585",
    "status": "queue",
    "url": "datamonkey.org/multihit/5ef26b93b0e8f0fd7c10e585"
}

MEME

Example Body:

{
  "api_key": "Your API Key",
  "method": "MEME",
  "fastaLoc": "URL TO DOWNLOAD LINK",
   "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta"
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:51:57.298Z",
    "id": "5ef26b6db0e8f0fd7c10e555",
    "status": "queue",
    "url": "datamonkey.org/meme/5ef26b6db0e8f0fd7c10e555"
}

RELAX

  • Requires annotated NWK tree

Example Body:

{
  "api_key": "Your API Key",
  "method": "Relax",
  "fastaLoc": "URL TO DOWNLOAD LINK",
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta",
  "nwk_tree": "(((((((TREESPARROW_HENAN_1_2004{TEST}:0.0111333782927653,TREESPARROW_HENAN_3_2004:0.006193745941169043):0.0009956664967877545,TREESPARROW_HENAN_4_2004:0.004351652686857959):0.002267763895256407,(CHICKEN_HEBEI_326_2005:0.02100885319673648,(SWINE_ANHUI_2004:0.007702393698306516,TREESPARROW_HENAN_2_2004:0.00906278098731238):0.002095219592954275):0.003887237703073042):0.003404921392531202,(((CHICKEN_HONGKONG_915_97:0,(GOOSE_HONGKONG_W355_97:0,DUCK_HONGKONG_Y283_97:0.002798420018760263):0.002899766890966483):0.001306376767766534,HONGKONG_97_98:0.003844928589233716):0.000182535836694054,HONGKONG_538_97:0):0.02096173714686362):0.003130608143291779,(((DUCK_GUANGZHOU_20_2005:0.006299389645455026,GOOSE_SHANTOU_2216_2005:0.006207842095177651):0.002530613798219486,PEREGRINEFALCON_HK_D0028_2004:0.003608296348267232):0.003288900909856382,CK_HK_WF157_2003:0.00663129750258774):0.004655295319725731):0.0116808817874948,(((HUMAN_VIETNAM_CL105_2005:0.006521522005742001,DUCK_VIETNAM_376_2005:0.007877615936285868):0.001967887030302483,VIETNAM_3062_2004:0.001641397323851184):0.0003125512332168847,MALLARD_VIETNAM_16_2003:0.003244216605281072):0.0004125980823087554):0.0003400912533471183,CHICKEN_THAILAND_KANCHANABURI_CK_160_2005:0.006168335080088849,DUCK_VIETNAM_272_2005:0.009465302724994452)",
  "analysis_type": 1
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:53:20.863Z",
    "id": "5ef26bc0b0e8f0fd7c10e5cd",
    "status": "queue",
    "url": "datamonkey.org/relax/5ef26bc0b0e8f0fd7c10e5cd"
}

SLAC

Example Body:

{
  "api_key": "Your API Key",
  "method": "SLAC",
  "fastaLoc": "URL TO DOWNLOAD LINK", 
  "mail": "[email protected]",
  "gencodeid": "Universal",
  "fileExtension": "fasta"
}

Example Reply:

{
    "time_stamp": "2020-06-23T20:52:17.452Z",
    "id": "5ef26b81b0e8f0fd7c10e56d",
    "status": "queue",
    "url": "datamonkey.org/slac/5ef26b81b0e8f0fd7c10e56d"
}
Clone this wiki locally