Examples

The examples below were obtained using the CDK REST API on MetaboCloud Web Portal. The input used (InChI, MOL/SDF file) were obtained from the Human Metabolome DataBase (HMDB).

Note

All examples describe below are using POST type request


Chemical properties computing

One of the functionality offer by this application is the computing of some chemical properties from an InCHI, a MOL or a SDF of a compound. It is provided by the /properties endpoint. The properties computed are :

  • The sum formula of the molecule

  • The monoisotopic mass of the molecule

  • The average mass of the molecule

  • The canonical SMILES of the molecule

  • The stereochemical SMILES of the molecule

  • The InCHI Key of the molecule

  • The LogP of the molecule

Here, some examples of output obtained after querying the /properties application endpoint.

Example of the properties computing for the Caffeine from its InChI
Request URL :
https://metabocloud.mesocentre.uca.fr/cdk/properties
Request body :
Content-Type : multipart/form-data
inchi=[InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3]
Output :
{
    "state": "Success",
    "formula": "C8H10N4O2",
    "monoisotopic_mass": 194.08037556,
    "average_mass": 194.19091739584468,
    "canonical_smiles": "O=C1C2=C(N=CN2C)N(C(=O)N1C)C",
    "stereo_smiles": "CN1C=NC2=C1C(N(C)C(N2C)=O)=O",
    "inchi": "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3",
    "inchikey": "RYYVLZVUVIJVGH-UHFFFAOYSA-N",
    "logP": -0.10858213188126853,
    "CDK_version": "2.9"
}

Caution

The result obtained for the same molecule may differed depending on the type of input used. e.g. A MOL or SDF file gives more detailed SMILES than an InChI.


Molecular depiction

Another functionality offer by this application is the depiction of a molecule from an InCHI, a MOL or a SDF of a compound. It is provided by the /depiction/{format} endpoint. It returns a image representation of the molecule in PNG or SVG format.

Here, some examples of output obtained after querying the /depiction/{format} application endpoint.

Note

The following examples are all output in PNG format. However, they still apply to SVG output. The only difference is the format indicated in the request URL with /depiction/svg instead of /depiction/png.

Three additional query parameters can be used in the request :

  • width : The width of the output image (px). (500 by default)

  • height : The height of the output image (px). (500 by default)

  • hydrogenDisplay : The way hydrogens are displayed. There are 3 arguments for this option. (non-chiral by default)

    • minimal : Suppress any explicit hydrogens

    • non-chiral : Suppress explicit non stereo-relevant hydrogens

    • cdk-default : CDK default way to display hydrogens

Query parameters : Default values

width = 500, height = 500, hydrogenDisplay = “non-chiral”

Example of the depiction for the Caffeine from its InChI
Request URL :
https://metabocloud.mesocentre.uca.fr/cdk/depiction/png
Request body :
Content-Type : multipart/form-data
inchi=[InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3]
Output :
PNG representation of the Caffeine from the InChI with option by default

Query parameters : Minimal display of hydrogens

width = 500, height = 500, hydrogenDisplay = “minimal”

Example of the depiction for the Caffeine from its InChI with a minimum of hydrogens displayed
Request URL :
https://metabocloud.mesocentre.uca.fr/cdk/depiction/png?hydrogenDisplay=minimal
Request body :
Content-Type : multipart/form-data
inchi=[InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3]
Output :
PNG representation of the Caffeine from the InChI with hydrogenDisplay option set to "minimal"

Query parameters : Default way of CDK to display hydrogens

width = 500, height = 500, hydrogenDisplay = “cdk-default”

Example of the depiction for the Caffeine from its InChI with the default way of CDK to display hydrogens
Request URL :
https://metabocloud.mesocentre.uca.fr/cdk/depiction/png?hydrogenDisplay=cdk-default
Request body :
Content-Type : multipart/form-data
inchi=[InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3]
Output :
PNG representation of the Caffeine from the InChI with hydrogenDisplay option set to "cdk-default"

Caution

When an InChI is used as input, the molecule is only depict in 2D (flat) by default when the parameter displayHydrogen is not filled.


Molecular structural format conversion

The last functionality offer by this application is the conversion of a molecular structural representation format into another. It is provided by the /conversion/{format} endpoint. It can convert a InChI, a MOL or a SDF format into a InChI, an InChI Key, a MOL or a SDF format.

Here, some examples of output obtained after querying the /conversion/{format} application endpoint.

Caution

When a molecular structural representation format is converted into a SDF format, another parameter than the input is required in the request body. It is the properties parameter which takes a string as argument following a specific structure. It must have one property by line following the structure “key : value”.

Example :

name : Caffeine
formula : C8H10N4O2
inchi : InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3
inchikey : RYYVLZVUVIJVGH-UHFFFAOYSA-N

Converting from InChI, MOL and SDF to InChi, InChI Key, MOL and SDF

Example of the conversion for the Caffeine from its InChI in InChI Key
Request URL :
https://metabocloud.mesocentre.uca.fr/cdk/conversion/inchikey
Request body :
Content-Type : multipart/form-data
inchi=[InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3]
Output :
RYYVLZVUVIJVGH-UHFFFAOYSA-N

Converting from SDF to SDF

This functionality can be used to modify a SDF file of a molecule by converting this format into a SDF format which enables to add or update properties.

Example with the Caffeine :

Request URL :

https://metabocloud.mesocentre.uca.fr/cdk/conversion/sdf

Request body : Content-Type : multipart/form-data

sdf=[HMDB0001847 (Caffeine).sdf]
properties=[name : Le nouveau nom de la Caffeine
            stereo smiles : C=1(N(C([H])([H])[H])C=2C(=O)N(C([H])([H])[H])C(=O)N(C([H])([H])[H])C2N1)[H]
            canonical smiles : [H]C1=NC2=C(C(=O)N(C(=O)N2C([H])([H])[H])C([H])([H])[H])N1C([H])([H])[H]]

Output :

Caffeine C8H10N4O2
  CDK     01172416313D

 24 25  0  0  0  0  0  0  0  0999 V2000
    2.2630    0.0434   -0.0012 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.0911   -2.4393    0.0019 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.8658    2.8096   -0.0067 C   0  0  0  0  0  0  0  0  0  0  0  0
   -3.4094   -1.4106   -0.0079 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0290   -2.7289   -0.0023 O   0  0  0  0  0  0  0  0  0  0  0  0
   -3.2278    1.3341   -0.0051 O   0  0  0  0  0  0  0  0  0  0  0  0
   -0.9964   -1.5009   -0.0026 C   0  0  0  0  0  0  0  0  0  0  0  0
   -2.1651    0.7060   -0.0046 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.2095   -0.7482   -0.0017 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.2255    0.6157   -0.0030 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.4934    1.1125   -0.0028 N   0  0  0  0  0  0  0  0  0  0  0  0
   -0.9313    1.3589   -0.0043 N   0  0  0  0  0  0  0  0  0  0  0  0
   -2.1449   -0.7009   -0.0044 N   0  0  0  0  0  0  0  0  0  0  0  0
    1.5255   -1.1145   -0.0002 N   0  0  0  0  0  0  0  0  0  0  0  0
    3.3462    0.0466   -0.0006 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.7064   -2.5519   -0.8945 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.7052   -2.5496    0.8998 H   0  0  0  0  0  0  0  0  0  0  0  0
    1.3095   -3.1985    0.0025 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.3298    3.1458    0.8865 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.3327    3.1425   -0.9028 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.8606    3.2631   -0.0060 H   0  0  0  0  0  0  0  0  0  0  0  0
   -3.4539   -2.0485   -0.8969 H   0  0  0  0  0  0  0  0  0  0  0  0
   -3.4569   -2.0531    0.8778 H   0  0  0  0  0  0  0  0  0  0  0  0
   -4.2735   -0.7428   -0.0075 H   0  0  0  0  0  0  0  0  0  0  0  0
  1 14  1  0  0  0  0
   1 11  2  0  0  0  0
   1 15  1  0  0  0  0
   2 14  1  0  0  0  0
   2 16  1  0  0  0  0
   2 17  1  0  0  0  0
   2 18  1  0  0  0  0
   3 12  1  0  0  0  0
   3 19  1  0  0  0  0
   3 20  1  0  0  0  0
   3 21  1  0  0  0  0
   4 13  1  0  0  0  0
   4 22  1  0  0  0  0
   4 23  1  0  0  0  0
   4 24  1  0  0  0  0
   5  7  2  0  0  0  0
   6  8  2  0  0  0  0
   7  9  1  0  0  0  0
   7 13  1  0  0  0  0
   8 12  1  0  0  0  0
   8 13  1  0  0  0  0
   9 10  2  0  0  0  0
   9 14  1  0  0  0  0
  10 12  1  0  0  0  0
  10 11  1  0  0  0  0
M  END
> <ID>
PFc000015

> <PEAKFOREST_INSTANCE>
https://demo.peakforest.org/webapp/

> <NAME>
Le nouveau nom de la Caffeine

> <CURATION_STAR>
3

> <SYNONYMS>
1,3,7-Trimethylpurine-2,6-Dione; 1,3,7-Trimethylxanthine; 1,3,7-Trimethyl-2,6-Dioxopurine; 1-Methyltheobromine; Guaranine; 7-Methyltheophylline; Theine;

> <IUPAC_NAME>
1,3,7-Trimethyl-3,7-Dihydro-1H-Purine-2,6-Dione

> <FORMULA>
C8H10N4O2

> <AVERAGE_MASS>
194.19060000000002

> <MONOISOTOPIC_MASS>
194.08037558

> <LOG_P>
-0.54

> <CANONICAL_SMILES>
Cn1cnc2c1c(=O)n(C)c(=O)n2C

> <INCHI>
InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3

> <INCHIKEY>
RYYVLZVUVIJVGH-UHFFFAOYSA-N

> <PUBCHEM_ACCESSION>
2519

> <KEGG_COMPOUND_ACCESSION>
C07481;

> <CHEBI_ACCESSION>
CHEBI:27732

> <HMDB_ACCESSION>
HMDB0001847

> <NETWORKS_ACCESSION>


> <EXTERNAL_ACCESSIONS>


> <CAS>
58-08-2:Sigma-Aldrich:27600;

> <IS_A_MAMMALIAN_BIOCHEMICAL_STRUCTURE>
true

> <PUBMED_CITATION>


> <RELATED_COMPOUNDS>


> <DERIVATIVE_COMPOUNDS>


> <SPECTRA_URLS>
https://demo.peakforest.org/webapp/PFs000299; https://demo.peakforest.org/webapp/PFs000308; https://demo.peakforest.org/webapp/PFs000309; https://demo.peakforest.org/webapp/PFs000585;

> <STEREO_SMILES>
C=1(N(C([H])([H])[H])C=2C(=O)N(C([H])([H])[H])C(=O)N(C([H])([H])[H])C2N1)[H]

> <CANONICAL_SMILES>
[H]C1=NC2=C(C(=O)N(C(=O)N2C([H])([H])[H])C([H])([H])[H])N1C([H])([H])[H]

$$$$

Note

You can observe than the NAME field has been updated and that two new fields STEREO_SMILES and CANONICAL_SMILES has been added.