REST API

The following documentation covers all of the RESTful APIs. under rest_app.

Datasets

GET /api/v1/datasets/

Lists datasets

Example request:

GET /api/v1/datasets/ HTTP/1.1
Host: example.com
Accept: application/json, text/html

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json, text/html

{
    datasets: [
        {
            "color_force_field": "ImplicitMillsDean",
            "id": 2,
            "name": "emolecules_1M",
            "num_confs": 4791117,
            "num_mols": 1000001,
            "public": false,
            "shape_only": false,
            "status": "LOADED",
            "system": false,
            "user": 3
        },
        {
            "color_force_field": "ImplicitMillsDean",
            "id": 1,
            "name": "emolecules_1k",
            "num_confs": 3698,
            "num_mols": 1001,
            "public": false,
            "shape_only": false,
            "status": "LOADED",
            "system": false,
            "user": 3
        }
    ],
    num_pages: 1,
    page: 1,
    next: null,
    previous: null
}
Query Parameters
  • page (integer) – Page number

  • user (integer) – User ID

  • status (string) – Query status

  • name (string) – Query name

Request Headers
Status Codes
GET /api/v1/datasets/(int: dataset_id)/

Get dataset details

Example request:

GET /api/v1/datasets/1/ HTTP/1.1
Host: example.com
Accept: application/json, text/html

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json, text/html

{
    "color_force_field": "ImplicitMillsDean",
    "id": 1,
    "name": "emolecules_1k",
    "num_confs": 3698,
    "num_mols": 1001,
    "public": false,
    "shape_only": false,
    "status": "LOADED",
    "system": false,
    "user": 3
}
Request Headers
Status Codes
DELETE /api/v1/datasets/(int: dataset_id)/

Delete dataset

Example request:

DELETE /api/v1/datasets/1/ HTTP/1.1
Host: example.com
Accept: application/json, text/html

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json, text/html
Request Headers
Status Codes
PATCH /api/v1/datasets/(int: dataset_id)/

Update a dataset

Example request:

PATCH /api/v1/datasets/1/ HTTP/1.1
Host: example.com
Accept: application/json

{
  "public": True,
  "system": True
}

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
Request Headers
Status Codes
POST /api/v1/datasets/

Create dataset

Note

Non-staff users are not allowed to create datasets. Permission denied response will be returned.

Example request:

POST /api/v1/datasets/ HTTP/1.1
Host: example.com
Accept: application/json

{
  "public": True,
  "system": True,
  "shape_only": False,
  "color_force_field": "ImplicitMillsDean",
  "dataset": <File_data>
}

Example response:

HTTP/1.1 201 OK
Vary: Accept
Content-Type: application/json

{
  "color_force_field": "ImplicitMillsDean",
  "id": 1013,
  "name": "frcli_test_only_4cox",
  "public": true,
  "shape_only": false,
  "status": "QUEUED",
  "system": true,
  "user": 1
}
JSON Parameters
  • public (boolean) – whether it’s public or not. default is false

  • system (boolean) – whether it’s system or not. default is false

  • shape_only (boolean) – whether to use shape only (no color for scoring). default is false

  • color_force_field (string) – color force field to use to prep this dataset

  • dataset (file) – File data

Request Headers
Status Codes

Queries

GET /api/v1/queries/

Lists all of the Queries to which the User has access

Example request:

GET /api/v1/queries/ HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
    count: 13448,
    next: "?limit=20&offset=20",
    previous: null,
    results: [
        {
            id: 15125,
            user: 3,
            name: "CYCLOOXYGENASE-2 split 3",
            status: "COMPLETED",
            num_queries: 1,
            shape_only: false,
            output_format: null,
            num_hits: 50,
            sim_type: "TANIMOTO",
            tversky_alpha: 0,
            dataset_id: 2,
            queue: {
                queued: 0,
                place: 0
            },
            progress: {
                current: 4791117,
                total: 4791117
            }
        },
        {
            id: 15124,
            user: 3,
            name: "DIHYDROFOLATE REDUCTASE split 2",
            status: "COMPLETED",
            num_queries: 1,
            shape_only: false,
            output_format: null,
            num_hits: 50,
            sim_type: "TANIMOTO",
            tversky_alpha: 0,
            dataset_id: 2,
            queue: {
                queued: 0,
                place: 0
            },
            progress: {
                current: 4791117,
                total: 4791117
            }
        }
    ]
}
Query Parameters
  • offset (integer) – Number of results to start after

  • limit (integer) – Number of results to list on each page

Request Headers
Status Codes
GET /api/v1/queries/(int: query_id)/

Request data of an individual Query

Example request:

GET /api/v1/queries/14688/ HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
    id: 14688,
    user: 3,
    name: "8-celecoxib",
    status: "COMPLETED",
    num_queries: 1,
    shape_only: false,
    output_format: null,
    num_hits: 50,
    sim_type: "TANIMOTO",
    tversky_alpha: 0,
    dataset_id: 2,
    queue: {
        queued: 0,
        place: 0
    },
    progress: {
        current: 4791117,
        total: 4791117
    }
}
Request Headers
Status Codes
GET /api/v1/queries/(int: query_id)/(str: filename)

Request to download a Query file

Example request:

GET /api/v1/queries/14688/my_query.oeb HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/octet-stream
Request Headers
Status Codes
DELETE /api/v1/queries/(int: query_id)/

Delete a Query

Example request:

DELETE /api/v1/queries/14688/ HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 204 No Content
Vary: Accept
Content-Type: application/json
Request Headers
Status Codes
POST /api/v1/queries/

Create a new Query. This interface is intended for file sizes <100MB. The Query file is stored in the database.

Example request:

POST /api/v1/queries/ HTTP/1.1
Host: example.com
Accept: multipart/form-data

{
  "num_hits": 50,
  "dataset_identifier": 5,
  "query": <File_data>
}

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

{
    "id": 1618,
    "user": 1,
    "name": "frcli_test_only_4cox-ligD",
    "status": "STAGED",
    "num_queries": 1,
    "shape_only": false,
    "output_format": None,
    "num_hits": 50,
    "sim_type": "TANIMOTO",
    "tversky_alpha": 0.0,
    "dataset_id": 5,
    "queue": {
        "queued": 0,
        "place": None
    },
    "progress": {
        "current": 0,
        "total": 0
    }
}
JSON Parameters
  • num_hits (int) – Number of hits. Should not exceed 10,000

  • dataset_identifier (int) – Identifier of the dataset to send query to

  • query (file) – File data

  • shape_only (boolean) – whether to use shape only (no color for scoring). default is False

  • tversky_alpha (string) – Alpha coefficient to use for Tversky scoring. default is 0.95

  • sim_type (string) – Similarity score. default is tanimoto

  • output_format (string) – Format of the output.

Request Headers
Status Codes

Results

GET /api/v1/result_details/(int: query_id)/

Request data of a Query result

Example request:

GET /api/v1/result_details/15159/ HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
    "id": 13646,
    "name": "results_Ligand.oeb",
    "query": 15159
}
Request Headers
Status Codes
GET /api/v1/results/(int: query_id)/

Request to download a Query result file

Example request:

GET /api/v1/results/15159/ HTTP/1.1
Host: example.com
Accept: application/json, text/html

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/octet-stream
Request Headers
Status Codes

Status

GET /api/v1/status/

Request details of memory usage, GPUs, Datasets, Queries, OE License

Example request:

GET /api/v1/status/ HTTP/1.1
Host: example.com
Accept: application/json, text/html

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json, text/html

{
    "datasets": {
        "count": 2,
        "status": {
            "downloading": 0,
            "failed": 0,
            "loaded": 2,
            "loading": 0,
            "queued": 0
        }
    },
    "gpus": [
        {
            "driver": "390.116",
            "id": 0,
            "load": 0,
            "memoryUsed": 194,
            "name": "GeForce GTX 1050 Ti",
            "totalMemory": 4036
        }
    ],
    "queries": {
        "count": 560,
        "queue": {
            "queued": [ ],
            "running": null
        },
        "queued": 0
    },
    "system": {
        "disk": {
            "free": 852825788416,
            "percent": 8.5,
            "total": 981889826816
        },
        "memory": {
            "free": 29354520576,
            "percent": 12.7,
            "total": 33640460288
        }
    },
    "version": "1.1.0b1",
    "oe_license_expires": "2019-09-04",
    "FastROCS version": "1.4.0b2"
}
Request Headers
Status Codes

Version

GET /api/v1/version/

Request details of dependencies

Example request:

GET /api/v1/version/ HTTP/1.1
Host: example.com
Accept: application/json, text/html

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type:  application/json

{
    "fastrocs_services": {
        "oe_license_expires": "2019-09-04",
        "openeye_packages": [
            {
                "Name": "OpenEye-datarecord",
                "Version": "0.12.11"
            },
            {
                "Name": "OpenEye-drconvert",
                "Version": "0.6.17"
            },
            {
                "Name": "OpenEye-fastrocs-services",
                "Version": "1.1.0b1"
            },
            {
                "Name": "OpenEye-floe",
                "Version": "0.8.6"
            },
            {
                "Name": "OpenEye-orionclient",
                "Version": "2.0.1"
            },
            {
                "Name": "OpenEye-schemagen",
                "Version": "0.3.4"
            },
            {
                "Name": "OpenEye-toolkits",
                "Version": "2019.4.2"
            },
            {
                "Name": "OpenEye-toolkits-python3-linux-x64",
                "Version": "2019.4.2"
            }
        ],
        "thirdparty": [
            {
                "Author": "Armin Ronacher",
                "License": "BSD",
                "Name": "Click",
                "URL": "https://palletsprojects.com/p/click/",
            },
            {
                "Author": "Armin Ronacher",
                "License": "BSD",
                "Name": "Flask",
                "URL": "https://www.palletsprojects.com/p/flask/",
            },
            {
                "Author": "Twilio API Team",
                "License": "BSD",
                "Name": "Flask-RESTful",
                "URL": "https://www.github.com/flask-restful/flask-restful/",
            },
            {
                "Author": "Armin Ronacher",
                "License": "BSD",
                "Name": "ItsDangerous",
                "URL": "https://palletsprojects.com/p/itsdangerous/",
            },
            {
                "Author": "Armin Ronacher",
                "License": "BSD",
                "Name": "Jinja2",
                "URL": "http://jinja.pocoo.org/",
            },
            {
                "Author": "Armin Ronacher",
                "License": "BSD",
                "Name": "MarkupSafe",
                "URL": "http://github.com/pallets/markupsafe",
            },
            {
                "Author": "Mike Orr",
                "License": "MIT",
                "Name": "Unipath",
                "URL": "https://github.com/mikeorr/Unipath",
            },
            {
                "Author": "Armin Ronacher",
                "License": "BSD",
                "Name": "Werkzeug",
                "URL": "https://www.palletsprojects.org/p/werkzeug/",
            },
            {
                "Author": "Brandon Nielsen",
                "License": "UNKNOWN",
                "Name": "aniso8601",
                "URL": "https://bitbucket.org/nielsenb/aniso8601",
            },
            {
                "Author": "Hynek Schlawack",
                "License": "MIT",
                "Name": "attrs",
                "URL": "https://www.attrs.org/",
            },
            {
                "Author": "Kenneth Reitz",
                "License": "MPL-2.0",
                "Name": "certifi",
                "URL": "http://certifi.io/",
            },
            {
                "Author": "Daniel Blanchard",
                "License": "LGPL",
                "Name": "chardet",
                "URL": "https://github.com/chardet/chardet",
            },
            {
                "Author": "Vladimir Keleshev",
                "License": "MIT",
                "Name": "docopt",
                "URL": "http://docopt.org",
            },
            {
                "Author": "Jason Moiron",
                "License": "MIT",
                "Name": "humanize",
                "URL": "http://github.com/jmoiron/humanize",
            },
            {
                "Author": "Kim Davies",
                "License": "BSD-like",
                "Name": "idna",
                "URL": "https://github.com/kjd/idna",
            },
            {
                "Author": "Giampaolo Rodola",
                "License": "BSD",
                "Name": "psutil",
                "URL": "https://github.com/giampaolo/psutil",
            },
            {
                "Author": "Gustavo Niemeyer",
                "License": "Dual License",
                "Name": "python-dateutil",
                "URL": "https://dateutil.readthedocs.io",
            },
            {
                "Author": "Stuart Bishop",
                "License": "MIT",
                "Name": "pytz",
                "URL": "http://pythonhosted.org/pytz",
            },
            {
                "Author": "Kenneth Reitz",
                "License": "Apache 2.0",
                "Name": "requests",
                "URL": "http://python-requests.org",
            },
            {
                "Author": "Ian Cordasco, Cory Benfield",
                "License": "Apache 2.0",
                "Name": "requests-toolbelt",
                "URL": "https://toolbelt.readthedocs.org",
            },
            {
                "Author": "Andrew Moffat",
                "License": "MIT",
                "Name": "sh",
                "URL": "https://github.com/amoffat/sh",
            },
            {
                "Author": "Benjamin Peterson",
                "License": "MIT",
                "Name": "six",
                "URL": "http://pypi.python.org/pypi/six/",
            },
            {
                "Author": "Sergey Astanin",
                "License": "MIT",
                "Name": "tabulate",
                "URL": "https://bitbucket.org/astanin/python-tabulate",
            },
            {
                "Author": "Andrey Petrov",
                "License": "MIT",
                "Name": "urllib3",
                "URL": "https://urllib3.readthedocs.io/",
            }
        ],
        "Version": "1.1.0b1"
    },
    "django_fastrocs": {
        "Version": "1.4.0b2",
        "oe_license_expires": "2019-09-04",
        "openeye_packages": [
            {
                "Name": "OpenEye-datarecord",
                "Version": "0.12.11"
            },
            {
                "Name": "OpenEye-django-oeservices",
                "Version": "1.1.10b1"
            },
            {
                "Name": "OpenEye-drconvert",
                "Version": "0.6.17"
            },
            {
                "Name": "OpenEye-floe",
                "Version": "0.8.6"
            },
            {
                "Name": "OpenEye-orionclient",
                "Version": "2.0.1"
            },
            {
                "Name": "OpenEye-schemagen",
                "Version": "0.3.4"
            },
            {
                "Name": "OpenEye-toolkits",
                "Version": "2019.4.2"
            },
            {
                "Name": "OpenEye-toolkits-python3-linux-x64",
                "Version": "2019.4.2"
            }
        ],
        "thirdparty": [
            {
                "Author": "Armin Ronacher",
                "License": "BSD",
                "Name": "Click",
                "URL": "https://palletsprojects.com/p/click/",
            },
            {
                "Author": "Django Software Foundation",
                "License": "BSD",
                "Name": "Django",
                "URL": "https://www.djangoproject.com/",
            },
            {
                "Author": "Hynek Schlawack",
                "License": "MIT",
                "Name": "attrs",
                "URL": "https://www.attrs.org/",
            },
            {
                "Author": "Kenneth Reitz",
                "License": "MPL-2.0",
                "Name": "certifi",
                "URL": "http://certifi.io/",
            },
            {
                "Author": "Daniel Blanchard",
                "License": "LGPL",
                "Name": "chardet",
                "URL": "https://github.com/chardet/chardet",
            },
            {
                "Author": "Otto Yiu",
                "License": "MIT License",
                "Name": "django-cors-headers",
                "URL": "https://github.com/ottoyiu/django-cors-headers",
            },
            {
                "Author": "Christopher Grebs",
                "License": "BSD",
                "Name": "django-csp",
                "URL": "http://github.com/mozilla/django-csp",
            },
            {
                "Author": "Carlton Gibson",
                "License": "BSD",
                "Name": "django-filter",
                "URL": "https://github.com/carltongibson/django-filter/tree/master",
            },
            {
                "Author": "Tom Christie",
                "License": "BSD",
                "Name": "djangorestframework",
                "URL": "http://www.django-rest-framework.org",
            },
            {
                "Author": "Vladimir Keleshev",
                "License": "MIT",
                "Name": "docopt",
                "URL": "http://docopt.org",
            },
            {
                "Author": "Alexander Schepanovski",
                "License": "BSD",
                "Name": "funcy",
                "URL": "http://github.com/Suor/funcy",
            },
            {
                "Author": "Kim Davies",
                "License": "BSD-like",
                "Name": "idna",
                "URL": "https://github.com/kjd/idna",
            },
            {
                "Author": "Jeff Forcier",
                "License": "BSD",
                "Name": "invoke",
                "URL": "http://docs.pyinvoke.org",
            },
            {
                "Author": "Giovanni Cannata",
                "License": "LGPL v3",
                "Name": "ldap3",
                "URL": "https://github.com/cannatag/ldap3",
            },
            {
                "Author": "Federico Di Gregorio",
                "License": "LGPL with exceptions or ZPL",
                "Name": "psycopg2-binary",
                "URL": "http://initd.org/psycopg/",
            },
            {
                "Author": "Ilya Etingof <etingof@gmail.com>",
                "License": "BSD",
                "Name": "pyasn1",
                "URL": "https://github.com/etingof/pyasn1",
            },
            {
                "Author": "Gustavo Niemeyer",
                "License": "Dual License",
                "Name": "python-dateutil",
                "URL": "https://dateutil.readthedocs.io",
            },
            {
                "Author": "Stuart Bishop",
                "License": "MIT",
                "Name": "pytz",
                "URL": "http://pythonhosted.org/pytz",
            },
            {
                "Author": "Kenneth Reitz",
                "License": "Apache 2.0",
                "Name": "requests",
                "URL": "http://python-requests.org",
            },
            {
                "Author": "Ian Cordasco, Cory Benfield",
                "License": "Apache 2.0",
                "Name": "requests-toolbelt",
                "URL": "https://toolbelt.readthedocs.org",
            },
            {
                "Author": "Benjamin Peterson",
                "License": "MIT",
                "Name": "six",
                "URL": "http://pypi.python.org/pypi/six/",
            },
            {
                "Author": "Sergey Astanin",
                "License": "MIT",
                "Name": "tabulate",
                "URL": "https://bitbucket.org/astanin/python-tabulate",
            },
            {
                "Author": "Andrey Petrov",
                "License": "MIT",
                "Name": "urllib3",
                "URL": "https://urllib3.readthedocs.io/",
            },
            {
                "Name": "angular",
                "Author": "Angular Core Team <angular-core+npm@google.com>",
                "License": "MIT",
                "URL": "http://angularjs.org",
            },
            {
                "Name": "angular-ui",
                "Author": "https://github.com/angular-ui/angular-ui/graphs/contributors",
                "License": "MIT",
                "URL": "http://angular-ui.github.com",
            },
            {
                "Name": "bootstrap-sass",
                "Author": "Thomas McDonald,Tristan Harward,Peter Gumeson,Gleb Mazovetskiy",
                "License": "MIT",
                "URL": "git://github.com/twbs/bootstrap-sass",
            },
            {
                "Name": "angular-animate",
                "Author": "Angular Core Team <angular-core+npm@google.com>",
                "License": "MIT",
                "URL": "http://angularjs.org",
            },
            {
                "Name": "sweetalert",
                "Author": "Tristan Edwards <tristan.edwards@me.com> (http://tristanedwards.me)",
                "License": "MIT",
                "URL": "http://tristanedwards.me/sweetalert",
            },
            {
                "Name": "angular-ui-bootstrap",
                "Author": "https://github.com/angular-ui/bootstrap/graphs/contributors",
                "License": "MIT",
                "URL": "http://angular-ui.github.io/bootstrap/",
            }
        ]
    }
}
Request Headers
Status Codes

Depiction

GET /api/v1/depict/

Request a depiction of a molecule

Example request:

GET /api/v1/depict/?smiles=c1ccc(cc1)C HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: image/svg+xml
Query Parameters
  • smiles (string) – smiles representation of a molecule

Request Headers
Status Codes
GET /api/v1/depict/(int: query_id)/

Request a depiction of a molecule

Note

If a user is not authorized to view a depiction, the response code will be ‘200 OK’ but ‘access denied’ image will be returned.

Example request:

GET /api/v1/depict/15159/ HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: image/svg+xml
Request Headers
Status Codes