Page tree

Structure Manipulation Web Service provides methods for the next manipulations on chemical structures:

  • extracting textbox content from the structures,
  • cutting structures into their fragment structures,
  • two-dimensional and three-dimensional cleaning of chemical structures.

Structure Manipulation Web Service is available in two modes:

  1. As part of a microservices system
  2. As standalone web application

Microservices system mode

In microservices system mode the Structure Manipulation Web Service runs together with Config service, Discovery service and Gateway service. These three services are mandatory and optionally other services can also be part of the system. All configuration must be done in the Config module.

The default configuration applies to the microservices system mode.

The web application runs on host <server-host> and listens on port <gateway-server-port>.

Standalone web application mode

In standalone web application mode the Structure Manipulation Web Service runs alone, without the Config service, Discovery service and Gateway service (however the installer installs them, as well).

The default configuration must be changed according to the standalone web application mode; set eureka.client.enabled=false in application.properties file and spring.cloud.config.failFast=false in bootstrap.properties file.

All configuration must be done in the Structure-Manipulation module.

The web application runs on host <server-host> and listens on port <server-port>.

Download

See here.

Software requirements

See here

Installation

See here.

Module is installed into folder: jws/jws-structure

Licenses

See here.

Logging

See here.

Configuration

Default configuration:

application.properties
server.port=8063

logging.file=../logs/jws-structure.log


eureka.client.enabled=true

set eureka.client.enabled=false to switch to standalone DB Web Services application mode 
bootstrap.properties

spring.cloud.config.failFast=true

spring.cloud.config.uri=${CONFIG_SERVER_URI:http\://localhost\:8888/}

spring.cloud.config.retry.initialInterval=3000

spring.cloud.config.retry.multiplier=1.2

spring.cloud.config.retry.maxInterval=60000

spring.cloud.config.retry.maxAttempts=100

For more settings possibilities see spring documentation page.

Running the server

Prerequisites in case of microservices system mode:

  1. Config service is running
  2. Discovery service is running
  3. Gateway service is running


Run the service in command line in folder jws/jws-structure:

jws-structure-service start (on Windows)

jws-structure-service start (on Linux)

or

run-jws-structure.exe (on Windows)

run-jws-structure (on Linux)

API documentation

Find and try out the API on the Swagger UI.

ModeURL of Swagger UIDefault URL of Swagger UI
Microservices system<serverhost>:<gateway-port>/structure-manipulation/API/localhost:8080/structure-manipulation/API/
Standalone web application mode<serverhost>:<server-port>/API/localhost:8063/API/

Demo site

For detailed description check out the JWS Structure Manipulation demo site:

https://jchem-microservices.chemaxon.com/structure-manipulation/api/index.html

Usage

Extractor

This controller makes extraction of textbox content from chemical structures - represented in string - possible.

MethodDescriptionParametersExample requestExample response
POST/rest-v1/extract/textboxThis operation extracts textbox content from the molecular structure.molString<?xml version="1.0" encoding="windows-1252"?>
<cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/schema/mrvSchema_18_11_0.xsd" version="ChemAxon file format v18.11.0, generated by v18.15.0">
<MDocument>
  <MChemicalStruct>
    <molecule molID="m1">
      <atomArray atomID="a1 a2 a3" elementType="C C C" x2="-19.29166603088379 -18.01046113657059 -16.5428093912086" y2="7.208333492279053 8.376914821736934 7.910440434084298"/>
      <bondArray>
        <bond id="b1" atomRefs2="a1 a2" order="1"/>
        <bond id="b2" atomRefs2="a2 a3" order="1"/>
      </bondArray>
    </molecule>
  </MChemicalStruct>
  <MTextBox id="o2" color="#000000" toption="NOROT" fontScale="10.0" halign="LEFT" valign="TOP" autoSize="true">
    <Field name="text"><![CDATA[{D font=SansSerif,size=10}{fg=#000000}ethanol]]></Field>
    <MPoint x="-17.25" y="6.041666507720947"/>
    <MPoint x="-15.270000000000003" y="6.041666507720947"/>
    <MPoint x="-15.270000000000003" y="5.271666507720944"/>
    <MPoint x="-17.250000000000014" y="5.271666507720944"/>
  </MTextBox>
  <MTextBox id="o3" color="#000000" toption="NOROT" fontScale="10.0" halign="LEFT" valign="TOP" autoSize="true">
    <Field name="text"><![CDATA[{D font=SansSerif,size=10}]]></Field>
    <MPoint x="-15.458333015441895" y="1.9166666269302368"/>
    <MPoint x="-15.458333015441902" y="1.9166666269302368"/>
    <MPoint x="-15.458333015441902" y="1.1466666269302337"/>
    <MPoint x="-15.458333015441902" y="1.1466666269302337"/>
  </MTextBox>
</MDocument>
</cml>
[ 

[

  "ethanol",

  ""

]


Fragmenter

This controller provides endpoints for cutting chemical structures - represented in string - to their fragments.

MethodDescriptionParametersExample requestExample response
POST/rest-v1/fragments/autodetectCuts chemical structures into their components.

exportAs

moleculeStr

SMILES

[#6]-[#6].[#6]-[#6]-[#6]

[
  "CC",
  "CCC"
]
POST/rest-v1/fragments/markushCuts Markush structures (R-group structures) into their scaffold and R-groups.

exportAs

moleculeStr

CXSMILES

[*]C1CCCC1 |$_R1;;;;;$,RG:_R1={CO* |$;;_AP1$|},{CN* |$;;_AP1$|},{CC* |$;;_AP1$|}|

{
  "scaffold": "[*]C1CCCC1 |$_R1;;;;;$|",
  "rgroups": {
    "R1": [
      "CO* |$;;_AP1$|",
      "CN* |$;;_AP1$|",
      "CC* |$;;_AP1$|"
    ]
  }
}
POST/rest-v1/fragments/markushReactionCuts reactions containing Markush structures into their components.

exportAs

moleculeStr

CXSMILES

OC1CCCC1[*]>O=O>[*]C1CCCC1=O |$;;;;;;_R1;;;_R2;;;;;;$,RG:_R1={CO* |$;;_AP1$|},{CN* |$;;_AP1$|},{CC* |$;;_AP1$|},_R2={CO* |$;;_AP1$|},{CN* |$;;_AP1$|},{CC* |$;;_AP1$|}|

{
  "markusFragments": {
    "scaffold": "OC1CCCC1[*]>O=O>[*]C1CCCC1=O |$;;;;;;_R1;;;_R2;;;;;;$|",
    "rgroups": {
      "R2": [
        "CO* |$;;_AP1$|",
        "CN* |$;;_AP1$|",
        "CC* |$;;_AP1$|"
      ],
      "R1": [
        "CO* |$;;_AP1$|",
        "CN* |$;;_AP1$|",
        "CC* |$;;_AP1$|"
      ]
    }
  },
  "reactionFragments": {
    "reactants": [
      "OC1CCCC1[*] |$;;;;;;_R1$|"
    ],
    "agents": [
      "O=O"
    ],
    "products": [
      "[*]C1CCCC1=O |$_R2;;;;;;$|"
    ]

  }

}

POST/rest-v1/fragments/moleculeCuts specific molecules into their fragments.

exportAs

moleculeStr

MRV

CN.Cl

[
  "<?xml version='1.0' encoding='windows-1252'?><cml xmlns=\"http://www.chemaxon.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.chemaxon.com/marvin/schema/mrvSchema_18_11_0.xsd\" version=\"ChemAxon file format v18.11.0, generated by v19.6.0\">\n<MDocument><MChemicalStruct><molecule molID=\"m1\"><atomArray atomID=\"a1 a2\" elementType=\"C N\"/><bondArray><bond id=\"b1\" atomRefs2=\"a1 a2\" order=\"1\"/></bondArray></molecule></MChemicalStruct></MDocument>\n</cml>",
  "<?xml version='1.0' encoding='windows-1252'?><cml xmlns=\"http://www.chemaxon.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.chemaxon.com/marvin/schema/mrvSchema_18_11_0.xsd\" version=\"ChemAxon file format v18.11.0, generated by v19.6.0\">\n<MDocument><MChemicalStruct><molecule molID=\"m1\"><atomArray atomID=\"a1\" elementType=\"Cl\"/><bondArray/></molecule></MChemicalStruct></MDocument>\n</cml>"
]
POST/rest-v1/fragments/reactionCuts reactions into their components.

exportAs

moleculeStr

MRV

CO>>C=O

{
  "reactants": [
    "<?xml version='1.0' encoding='windows-1252'?><cml xmlns=\"http://www.chemaxon.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.chemaxon.com/marvin/schema/mrvSchema_18_11_0.xsd\" version=\"ChemAxon file format v18.11.0, generated by v19.6.0\">\n<MDocument><MChemicalStruct><molecule molID=\"m1\"><atomArray atomID=\"a1 a2\" elementType=\"C O\"/><bondArray><bond id=\"b1\" atomRefs2=\"a1 a2\" order=\"1\"/></bondArray></molecule></MChemicalStruct></MDocument>\n</cml>"
  ],
  "agents": [],
  "products": [
    "<?xml version='1.0' encoding='windows-1252'?><cml xmlns=\"http://www.chemaxon.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.chemaxon.com/marvin/schema/mrvSchema_18_11_0.xsd\" version=\"ChemAxon file format v18.11.0, generated by v19.6.0\">\n<MDocument><MChemicalStruct><molecule molID=\"m1\"><atomArray atomID=\"a1 a2\" elementType=\"C O\"/><bondArray><bond id=\"b1\" atomRefs2=\"a1 a2\" order=\"2\"/></bondArray></molecule></MChemicalStruct></MDocument>\n</cml>"
  ]
}


Molecule Cleaner

Methods for 2D and 3D cleaning of chemical structures.

For input structures plain text chemical file formats are supported.

The format of the output structure is MRV.

Different cleaning options can be set for the 2D and 3D cleaning procedures.

Provided methods:

MethodDescriptionParametersExampleExample requestExample response
POST/rest-v1/structure/clean

Cleans the specified chemical structure

dim

Dimensions to clean molecule into

2, 3 or 0

Convert structure of SMILES format into MRV format with two-dimensional atom coordinates

/rest-v1/structure/clean?dim=2
c1ccccc1

<?xml version='1.0' encoding='UTF-8'?><cml xmlns="http://www.chemaxon.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.chemaxon.com/marvin/schema/mrvSchema_18_11_0.xsd" version="ChemAxon file format v18.11.0, generated by v18.25.0"> <MDocument><MChemicalStruct><molecule molID="m1"><atomArray atomID="a1 a2 a3 a4 a5 a6" elementType="C C C C C C" x2="1.3336791218280368 2.6673582436560745 2.6673582436560714 1.3336791218280346 0.0 1.3322676295501878E-15" y2="2.310000000000002 1.5399999999999978 -2.220446049250313E-15 -0.77 1.9984014443252818E-15 1.5400000000000018"/><bondArray><bond id="b1" atomRefs2="a1 a2" order="A"/><bond id="b2" atomRefs2="a2 a3" order="A"/><bond id="b3" atomRefs2="a3 a4" order="A"/><bond id="b4" atomRefs2="a4 a5" order="A"/><bond id="b5" atomRefs2="a5 a6" order="A"/><bond id="b6" atomRefs2="a1 a6" order="A"/></bondArray></molecule></MChemicalStruct></MDocument> </cml>