Extended functionalities
Extended functionalities means those features that are only available when web services are setup.
- Clean 2D button is visible on the toolbar if Clean2D web service is available.
- Importing molecule in any Marvin supported text based chemical format (SMILES, InChi, naming, ...) via the import dialog, if MolConvert web service is available. Without the desired service, only MDL molfile and MRV format are available.
- Exporting molecule into any Marvin supported text based chemical format (SMILES, InChi, naming, ...) via the save dialog, if MolConvert web service is available. Without the desired service, only MDL molfile and MRV format are available.
- Calculate Stereo button is visible on the toolbar if stereoinfo web service is available.
Refer web services
By default, those functionalities in the editor that require live connection to existing web services are disabled. To activate them, you have to set up address of these web services for the editor.
Use the setServices
method of the editor to apply its webservice settings. See the Sketch apidoc for more details. If you want to activate all web services, please, see the How To Embed section in the documentation that describes how you can insert an editor into a web page where all available web services are preset.
The default address of these services is defined in the webservices.js
. By default, it points to a copy of JChem Webservices.
If you have your own implementation for these services or your copy of JChem Webservices are located on a different URL, you may have to overwrite default settings.
Specification of Webservices
Those web services that are referred by Marvin JS have to complete the following specifications.
Clean 2D
- Request:
- Type: application/json
- Method: POST
Posted JSON object:
{ "structure": <molecule source>, "parameters": { "dim": 2, "opts": <optional clean options> } }
- Response:
- Response-type: plain/text
- Response text: result in MRV format
MolConvert
- Request:
- Type: application/json
- Method: POST
Posted JSON object:
{ "structure": <molecule source>, "inputFormat": <input format>, "parameters": <output format> }
- Response:
- Response-type: application/json
Response text:
{ "structure" : <output structure>, "format" : <output format>, "contentUrl" : <download link> }
Stereo info
- Request
- Type: application/json
- Method: POST
Posted JSON object:
{ "structure" : <molecule source> }
- Response
- Response-type: application/json
Response text:
{ "tetraHedral" : [ { "atomIndex" : < 0 based index of atom>, "chirality" : < chirality flag ("R", "S", "R/S" )> }, ... ], "doubleBond" : [ { "atomIndex1" : <0 based index of first atom of the bond>, "atomIndex2" : <0 based index of second atom of the bond>, "cistrans" : <cistrans info ("E", "Z", "E/Z")> }, ... ] }
reactionExport
- Request:
- Type: application/json
- Method: POST
Posted JSON object:
{ "structure": <molecule source>, "inputFormat": <input format>, "parameters": <output format> }
- Response:
- Response-type: application/json
Response text:
{ "structure" : <output structure>, "format" : <output format>, "contentUrl" : <download link> }