Skip to content
David Johnson edited this page May 2, 2018 · 8 revisions

Usage

With Docker

docker build -t isarest:latest .
docker run -d -p 5000:5000 isarest

With Python 3

*Requires: Python 3.4 or 3.5 and isatools v0.8+ installed via pip

Basically to test directly, make sure you've got the right prerequisites installed:

Run pip install -r requirements.txt

In config.py set UPLOAD_FOLDER to somewhere sensible (e.g. /tmp/ - it stores just temporary files for the conversion.

then:

python isarest.py to start flask's embedded server, and browse. localhost:5000/api/spec.html for swagger UI (Swagger documentation not yet complete) localhost:5000/api/spec.json for swagger JSON

For deployment to a production Web server, follow this documentation http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/

We have included a simple REST client to go with the service. You can find it in isarest_client. To use it, you can do something like to convert a ZIP file containing ISA tab files into an ISA JSON file:

from isarest_client import IsaRestClient
client = IsaRestClient(dl_folder='tmp/')
returned_file_path = client.convert_tab_to_json(open('testdata/BII-S-3.zip', 'rb').read())

If all went well, this call should return an absolute path to the returned JSON file in your local file system (inside dl_folder, in this case tmp/).

You can also load the project directly into something like PyCharm and play with the tests.py tests.

Convert ISA-Tab to JSON

POST /api/v1/convert/tab-to-json

Consumes Produces Description
application/zip application/json Takes a zip file containing ISA-Tab .txt files, converts and returns a single ISA JSON. Returns 200 OK if succeeded.

Convert ISA JSON to ISA tab

POST /api/v1/convert/json-to-tab

Consumes Produces Description
application/json application/zip Takes a ISA-JSON .json files, converts and returns a zip containing ISA-Tab .txt files. Returns 200 OK if succeeded.

Convert ISA tab to SRA

POST /api/v1/convert/tab-to-sra

Consumes Produces Description
application/zip application/zip Takes a zip file containing ISA tab .txt files, converts and returns a zip containing SRA XML files. Returns 200 OK if succeeded.

Convert ISA JSON to SRA

POST /api/v1/convert/tab-to-sra

Consumes Produces Description
application/zip application/zip Takes a zip file containing ISA JSON file and data files, converts and returns a zip containing SRA XML files. Returns 200 OK if succeeded.

Convert ISA tab to CEDAR JSON

POST /api/v1/convert/tab-to-cedar

Consumes Produces Description
application/zip application/json Takes a zip file containing a collection of ISA tab .txt files, converts and returns a single CEDAR JSON. Returns 200 OK if succeeded.

Validate ISA tab

POST /api/v1/validate/isatab

Consumes Produces Description
application/zip application/json Takes a zip file containing a collection of ISA tab .txt files, runs the validator, and returns a validation report in JSON. Returns 200 OK if succeeded.

Validate ISA JSON

POST /api/v1/validate/json

Consumes Produces Description
application/json application/json Takes a ISA JSON file, runs the validator, and returns a validation report in JSON. Returns 200 OK if succeeded.