BW provides a REST service that allows the user to retrieve information on the banks in JSON format via the URL.
You can get 3 types of result :
The formats list : <BW URL>/GET?formats
{
"formats":[
{
"value":"blast"
},
{
"value":"emboss"
},
{
"value":"fasta"
}
]
}
The types list : <BW URL>/GET?types
{
"types":[
{
"value":"aphidbase/nucleic"
},
{
"value":"aphidbase/proteic"
},
{
"value":"gene/duplicate"
}
]
}
The banks list (URL format is described below) : The structure of the JSON object is the following :
{
"banks":[
{
"name":"bank name",
"session_date":"session date",
"current_release":"release number",
"releases":{
"release number":{
"path":"directory path",
"formats":[
{
"value":"format 1",
"sections":[
{
"name":"section name",
"files":[
"filepath_1",...,"filepath_n"
],
"sections":[
...
]
},...
]
},
{
"value":"format 2",
"sections":[
...
]
}
]
},
...
},
"db_type":"bank type"
}...
]
}
For each format, a list of the associated files is returned as a section element. A section structures the files according to their directory structure.
Here is an example :
Directory structure :
fasta
|- dir_1
| |- dir_11
| | |- file_a
| | |- file_b
| |- dir_12
| |- file_c
|- dir_2
|- file_d
|- dir_21
|- file_e
Sections :
"format":[
{
"value":"fasta",
"sections":[
{
"name":"dir_1",
"sections":[
{
"name":"dir_11",
"files":[
"file_a","file_b"
]
},
{
"name":"dir_12",
"files":[
"file_c"
]
}
]
},
{
"name":"dir_2",
"files":[
"file_d"
],
"sections":[
{
"name":"dir_21",
"files":[
"file_e"
]
}
]
}
]
}
]
You can specify 4 parameters to to retrieve the bank list.
banks (mandatory) : Can be either the bank name or "all" to retrieve all the banks.
formats (optional) : Can be either a specific format or "all". Multiple formats are separated with | character.
types (optional) : Can be either a specific type or "all". Multiple types are separated with | character.
lightmode (optional) : Use these parameter if you don't need the formats directories to be listed.
Examples :
All banks with fasta format and lightmode enabled :