MoleculesResource Resource

Represents molecule sets.

GET /molecules

Create JSON list of available molecule sets.

Response Body
media type data type description
application/json MoleculeSetsInfo (JSON) List of molecule set descriptions for each set

Example

Request
GET /molecules
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "sets" : [ {
    "size" : 12345,
    "time" : 12345,
    "description" : "...",
    "absentmols" : 12345,
    "absentids" : 12345,
    "url" : "...",
    "name" : "...",
    "propnames" : [ "...", "..." ],
    "props" : [ {
      "name" : "...",
      "type" : "...",
      "numeric" : true,
      "extractor" : "..."
    }, {
      "name" : "...",
      "type" : "...",
      "numeric" : true,
      "extractor" : "..."
    } ]
  }, {
    "size" : 12345,
    "time" : 12345,
    "description" : "...",
    "absentmols" : 12345,
    "absentids" : 12345,
    "url" : "...",
    "name" : "...",
    "propnames" : [ "...", "..." ],
    "props" : [ {
      "name" : "...",
      "type" : "...",
      "numeric" : true,
      "extractor" : "..."
    }, {
      "name" : "...",
      "type" : "...",
      "numeric" : true,
      "extractor" : "..."
    } ]
  } ]
}
                
              

GET /molecules/{set}

Create description of a molecule set.

Request Parameters
name type description
set path Set name
Response Body
media type data type description
application/json MoleculeSetInfo (JSON) Metadata about the molecule set

Example

Request
GET /molecules/{set}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "size" : 12345,
  "time" : 12345,
  "description" : "...",
  "absentmols" : 12345,
  "absentids" : 12345,
  "url" : "...",
  "name" : "...",
  "propnames" : [ "...", "..." ],
  "props" : [ {
    "name" : "...",
    "type" : "...",
    "numeric" : true,
    "extractor" : "..."
  }, {
    "name" : "...",
    "type" : "...",
    "numeric" : true,
    "extractor" : "..."
  } ]
}
                
              

GET /molecules/{set}/find-id

Find index of an ID. Note that this method currently uses simple linear search; the performance is not optimal. This method return the molecule description if given ID is found. If the ID is not found then the thrown WuiNotFoundException will result in a "Not Found (404)" response status.

Request Parameters
name type description default constraints
set path Set name    
id query Id to find. Note that it is not possible to look up absent IDs    
smiles query Lookup SMILES. If false passed no SMILES will retrieved in the response. If true is passed but the given structure SMILES is absent then the response will not fail and no SMILES will be returned. true boolean
Response Body
media type data type description
application/json MoleculeInfo (JSON) Description of the first matching molecule.

Example

Request
GET /molecules/{set}/find-id
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "index" : 12345,
  "smiles" : "...",
  "id" : "...",
  "url" : "...",
  "props" : {
    "property1" : { },
    "property2" : { }
  },
  "searchtime" : 12345
}
                
              

POST /molecules/{set}/get-multiple-ids

Fetch IDs for multiple molecules.

Request Parameters
name type description default constraints multivalued
indices[] form Indices for which the stored IDs are requested   int yes
missing form Value to use for missing structures ????   no
set path Set name     no
Response Body
media type data type description
application/json MoleculeIds (JSON) Index to ID mapping for the requested indices

Example

Request
POST /molecules/{set}/get-multiple-ids
Content-Type: application/x-www-form-urlencoded
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "indextoid" : {
    "property1" : "...",
    "property2" : "..."
  }
}
                
              

POST /molecules/{set}/get-multiple-props

Fetch multiple property values

Request Parameters
name type description default constraints multivalued
indices[] form Indices for which the stored properties are requested   int yes
missing form Value to use for missing property values ????   no
props[] form Properties requested. When no property specified all properties are returned     yes
set path Set name     no
Response Body
media type data type description
application/json MoleculeProps (JSON) Index to property mapping for the requested indices

Example

Request
POST /molecules/{set}/get-multiple-props
Content-Type: application/x-www-form-urlencoded
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "props" : {
    "property1" : { },
    "property2" : { }
  }
}
                
              

GET /molecules/{set}/get-sizeinfo

Experimental endpoint to estimate allocated size. Please note that this endpoint is under construction, use with caution: execution might fail and execution might have significant memory/cpu impact. The availability/functionality of this endpoint might change in any of the subsequent releases.

Request Parameters
name type description default constraints
set path Set name    
dc query Duplicate check on the large storages. false boolean
method query Size info method to use.   "CALCULATED" or "JAVAAGENT"
Response Body
media type data type description
application/json SizeInfoDto (JSON) Size info description

Example

Request
GET /molecules/{set}/get-sizeinfo
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "size" : 12345,
  "details" : [ {
    "size" : 12345,
    "name" : "..."
  }, {
    "size" : 12345,
    "name" : "..."
  } ]
}
                
              

GET /molecules/{set}/{index}

Create description of a single molecule.

Request Parameters
name type description default constraints
index path Molecule index in the set   int
set path Set name    
props query Include additional properties true boolean
smiles query Lookup SMILES. If false passed no SMILES will retrieved in the response true boolean
Response Body
media type data type description
application/json MoleculeInfo (JSON) Description of the selected molecule

Example

Request
GET /molecules/{set}/{index}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "index" : 12345,
  "smiles" : "...",
  "id" : "...",
  "url" : "...",
  "props" : {
    "property1" : { },
    "property2" : { }
  },
  "searchtime" : 12345
}
                
              

GET /molecules/{set}/{index}/cxbinformat

Get molecule in an arbitrary binary format.

Request Parameters
name type description default constraints
index path Molecule index in the set   int
set path Set name    
clean2d query Clean2D structure false boolean
f query Format string parameter to pass to MolExporter#exportToBinFormat(chemaxon.struc.Molecule, java.lang.String)    
Response Body
media type data type description
application/octet-stream (custom) Export result

Example

Request
GET /molecules/{set}/{index}/cxbinformat
Content-Type: */*
Accept: application/octet-stream

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/octet-stream

                
...
                
              

GET /molecules/{set}/{index}/cxformat

Get molecule in an arbitrary text based format.

Request Parameters
name type description default constraints
index path Molecule index in the set   int
set path Set name    
clean2d query Clean2D structure false boolean
f query Format string parameter to pass to MolExporter#exportToFormat(chemaxon.struc.Molecule, java.lang.String)    
Response Body
media type data type description
text/plain (custom) Export result

Example

Request
GET /molecules/{set}/{index}/cxformat
Content-Type: */*
Accept: text/plain

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
...
                
              

GET /molecules/{set}/{index}/id

Get ID of a single molecule.

Request Parameters
name type description constraints
index path Molecule index in the set int
set path Set name  
Response Body
media type data type description
text/plain (custom) ID of the given molecule or String ???? when ID is absent

Example

Request
GET /molecules/{set}/{index}/id
Content-Type: */*
Accept: text/plain

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
...
                
              

GET /molecules/{set}/{index}/png

Get molecule image in PNG format. When the given molecule is absent then status 404 is set and a JSON response with details is sent.

Request Parameters
name type description default constraints
index path Molecule index in the set   int
set path Set name    
aromatize query Aromatize options, use source, aromatize or dearomatize source  
h query Image height in pixels 100 int
hydrogenize query Hydrogenize options. use source, hydrogenize or dehydrogenize source  
w query Image width in pixels 100 int
Response Body
media type data type description
image/png (custom) Molecule in SDF format with ID set to SDF property "id".

Example

Request
GET /molecules/{set}/{index}/png
Content-Type: */*
Accept: image/png

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: image/png

                
...
                
              

GET /molecules/{set}/{index}/png-or-placeholder

Get molecule image in PNG format or a placeholder image for absent molecules. When the given molecule is absent then a placeholder image is generated. Note that when the set is not found or the index is out of range still a status 404 with an error report JSON is returned.

Request Parameters
name type description default constraints
index path Molecule index in the set   int
set path Set name    
aromatize query Aromatize options, use source, aromatize or dearomatize source  
h query Image height in pixels 100 int
hydrogenize query Hydrogenize options. use source, hydrogenize or dehydrogenize source  
w query Image width in pixels 100 int
Response Body
media type data type description
image/png (custom) Molecule in SDF format with ID set to SDF property "id".

Example

Request
GET /molecules/{set}/{index}/png-or-placeholder
Content-Type: */*
Accept: image/png

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: image/png

                
...
                
              

GET /molecules/{set}/{index}/sdf

Get molecule in SDF format.

Request Parameters
name type description constraints
index path Molecule index in the set int
set path Set name  
Response Body
media type data type description
chemical/x-mdl-sdfile (custom) Molecule in SDF format with ID set to SDF property "id".

Example

Request
GET /molecules/{set}/{index}/sdf
Content-Type: */*
Accept: chemical/x-mdl-sdfile

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: chemical/x-mdl-sdfile

                
...
                
              

GET /molecules/{set}/{index}/smiles

Get molecule in Smiles format.

Request Parameters
name type description constraints
index path Molecule index in the set int
set path Set name  
Response Body
media type data type description
chemical/x-daylight-smiles (custom) Molecule in SMILES format with ID appended.

Example

Request
GET /molecules/{set}/{index}/smiles
Content-Type: */*
Accept: chemical/x-daylight-smiles

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: chemical/x-daylight-smiles

                
...
                
              

GET /molecules/{set}/props/{propname}/get-properties-on-index-range

Fetch property values for a range of Molecule indices.

Request Parameters
name type description default constraints
propname path Property name    
set path Set name    
maxcount query Maximal structure count 2147483647 int
missing query Value to use for missing values ????  
start query Index of first structure 0 int
Response Body
media type data type description
application/json MoleculePropRange (JSON) Index to ID mapping for the requested indices

Example

Request
GET /molecules/{set}/props/{propname}/get-properties-on-index-range
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "start" : 12345,
  "count" : 12345,
  "presentcount" : 12345,
  "missingcount" : 12345,
  "missingvalue" : { },
  "values" : [ { }, { } ]
}
                
              

POST /molecules/{set}/props/{propname}/get-properties-on-index-range

Fetch property values for a range of Molecule indices - POST endpoint.

Request Parameters
name type description default constraints
maxcount form Maximal structure count 2147483647 int
missing form Value to use for missing values ????  
start form Index of first structure 0 int
propname path Property name    
set path Set name    
Response Body
media type data type description
application/json MoleculePropRange (JSON) Index to ID mapping for the requested indices

Example

Request
POST /molecules/{set}/props/{propname}/get-properties-on-index-range
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "start" : 12345,
  "count" : 12345,
  "presentcount" : 12345,
  "missingcount" : 12345,
  "missingvalue" : { },
  "values" : [ { }, { } ]
}
                
              

GET /molecules/{set}/{index}/props/{propname}

Get a single property value.

Request Parameters
name type description constraints
index path Molecule index in the set int
propname path Name of additional property  
set path Set name  
Response Body
media type data type description
application/json MoleculeProp (JSON) Value of the additional property

Example

Request
GET /molecules/{set}/{index}/props/{propname}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "value" : { }
}