Skip to content

Instantly share code, notes, and snippets.

@CS76
Created September 7, 2023 19:42
Show Gist options
  • Save CS76/c674a265a88cad829f34ae705afe6593 to your computer and use it in GitHub Desktop.
Save CS76/c674a265a88cad829f34ae705afe6593 to your computer and use it in GitHub Desktop.
Cheminformatics Microservice - v1.4.0 OpenAPI YAML
openapi: 3.1.0
info:
title: Cheminformatics Microservice
description: >-
This set of essential and valuable microservices is designed to be accessed
via API calls to support cheminformatics. Generally, it is designed to work
with SMILES-based inputs and could be used to translate between different
machine-readable representations, get Natural Product (NP) likeliness
scores, visualize chemical structures, and generate descriptors. In
addition, the microservices also host an instance of STOUT and another
instance of DECIMER (two deep learning models for IUPAC name generation and
optical chemical structure recognition, respectively).
version: '1'
servers:
- url: /latest
paths:
/chem/stereoisomers:
get:
tags:
- chem
summary: Enumerate all possible stereoisomers
description: >-
For a given SMILES string this function enumerates all possible
stereoisomers
Parameters:
- **SMILES**: required (query parameter): The SMILES string to be
enumerated.
Returns:
- List[str]: A list of stereoisomer SMILES strings if successful,
otherwise returns an error message.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
operationId: get_stereoisomers_chem_stereoisomers_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES string to be enumerated
description: SMILES string to be enumerated
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateStereoisomersResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/descriptors:
get:
tags:
- chem
summary: Generates descriptors for the input molecule
description: >-
Generates standard descriptors for the input molecule (SMILES).
Parameters:
- **SMILES**: required (query): The SMILES representation of the
molecule.
- **format**: optional (query): The desired format for the output.
- Supported values: "html" / "json" (default), "json".
- **toolkit**: optional (query): The chemical toolkit to use for
descriptor calculation. Default is "rdkit". Allowed "all", "cdk".
- Supported values: "cdk"/ "rdkit" / "all" (default), "rdkit".
Returns:
- If format is "html", returns an HTML response containing a table of
descriptors and their values.
- If format is not "html", returns the descriptors and their values in
the specified format (default: JSON).
Raises:
- None
operationId: get_descriptors_chem_descriptors_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: format
in: query
required: false
schema:
enum:
- json
- html
type: string
description: Desired display format
default: json
title: Format
description: Desired display format
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
- all
type: string
description: Cheminformatics toolkit used in the backend
default: rdkit
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateDescriptorsResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/descriptors/multiple:
get:
tags:
- chem
summary: Generates descriptors for the input molecules
description: >-
Retrieve multiple descriptors for a list of SMILES strings.
Parameters:
- **SMILES**: required (query): Comma-separated list of SMILES strings.
- **toolkit**: optional (query): Toolkit to use for descriptor
calculation.
- Supported values: "rdkit" / "cdk" (default), "rdkit".
Returns:
- Union[Dict[str, Any], str]: If multiple SMILES are provided, return a
dictionary with each SMILES as the key and the corresponding descriptors
as the value. If only one SMILES is provided, returns an error message.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
Example:
- Request: GET /descriptors/multiple?smiles=CCO,CCN&toolkit=rdkit
Response: {"CCO": {"descriptor1": value1, "descriptor2": value2}, "CCN": {"descriptor1": value3, "descriptor2": value4}}
- Request: GET /descriptors/multiple?smiles=CCC
Response: "Error invalid SMILES"
operationId: get_multiple_descriptors_chem_descriptors_multiple_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecules
description: SMILES representation of the molecules
examples:
example1:
summary: 'Example: Caffeine, Topiramate-13C6'
value: >-
CN1C=NC2=C1C(=O)N(C(=O)N2C)C,
CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
example2:
summary: 'Example: Topiramate-13C6, Ethane'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1, CC
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
type: string
description: Cheminformatics toolkit used in the backend
default: rdkit
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateMultipleDescriptorsResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/HOSEcode:
get:
tags:
- chem
summary: Generates HOSE codes for the input molecules
description: >-
Generates HOSE codes for a given SMILES string.
Parameters:
- **SMILES**: required (query): The SMILES string represents the
chemical compound.
- **spheres**: required (query): The number of spheres to use for
generating HOSE codes.
- **toolkit**: optional (default:cdk): The chemical toolkit to use for
generating HOSE codes.
Supported values: "cdk" (default), "rdkit".
- **ringsize**: optional (default:False): Determines whether to include
information about ring sizes
in the HOSE codes. Default is False.
Returns:
- List[str]: A list of HOSE codes if successful, indicating the HOSE
codes
for each atom in the molecule. Otherwise, returns an error message.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
operationId: hose_codes_chem_HOSEcode_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: spheres
in: query
required: true
schema:
type: integer
title: spheres
description: Number of spheres to use for generating HOSE codes
examples:
- '2'
- '1'
description: Number of spheres to use for generating HOSE codes
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
type: string
description: Cheminformatics toolkit used in the backend
default: rdkit
title: Toolkit
description: Cheminformatics toolkit used in the backend
- name: ringsize
in: query
required: false
schema:
anyOf:
- type: boolean
- type: 'null'
title: ringsize
description: Determines whether to include information about ring sizes
default: false
description: Determines whether to include information about ring sizes
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateHOSECodeResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/standardize:
post:
tags:
- chem
summary: Standardize molblock using the ChEMBL curation pipeline
description: >-
Standardize molblock using the ChEMBL curation pipeline
and return the standardized molecule, SMILES, InChI, and InCHI-Key.
Parameters:
- **molblock**: The request body containing the "molblock" string
representing the molecule to be standardized.
Returns:
- dict: A dictionary containing the following keys:
- "standardized_mol" (str): The standardized molblock of the molecule.
- "canonical_smiles" (str): The canonical SMILES representation of the molecule.
- "inchi" (str): The InChI representation of the molecule.
- "inchikey" (str): The InChI-Key of the molecule.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
operationId: standardize_mol_chem_standardize_post
requestBody:
content:
text/plain:
schema:
type: string
title: Data
examples:
example1:
summary: 'Example: C'
value: |2-
CDK 09012310592D
1 0 0 0 0 0 0 0 0 0999 V2000
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
M END
required: true
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateStandardizeResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/errors:
get:
tags:
- chem
summary: >-
Check a given SMILES string and the represented structure for issues and
standardize it
description: >-
Check a given SMILES string and the represented structure for issues and
standardize it using the ChEMBL curation pipeline.
Parameters:
- **SMILES**: required (str, query) The SMILES string to check and
standardize.
- **fix**: optional (bool): Flag indicating whether to fix the issues by
standardizing the SMILES. Defaults to False.
Returns:
- If fix is False:
- If issues are found in the SMILES string, return a list of issues.
- If no issues are found, return the string "No Errors Found".
- If fix is True:
- If issues are found in the SMILES string, return a dictionary containing the original SMILES, original issues,
standardized SMILES, and new issues after standardization.
- If no issues are found after standardization, return a dictionary with the original SMILES and "No Errors Found".
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
Notes:
- If the SMILES string contains spaces, they will be replaced with "+"
characters before processing.
- If the SMILES string cannot be read, the function returns the string
"Error reading SMILES string, check again."
operationId: check_errors_chem_errors_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: The SMILES string to check and standardize.
description: The SMILES string to check and standardize.
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: fix
in: query
required: false
schema:
anyOf:
- type: boolean
- type: 'null'
title: Fix
description: >-
Flag indicating whether to fix the issues by standardizing the
SMILES.
default: false
description: >-
Flag indicating whether to fix the issues by standardizing the
SMILES.
responses:
'200':
description: Successful response
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/SMILESStandardizedResult'
- $ref: '#/components/schemas/SMILESValidationResult'
title: Response 200 Check Errors Chem Errors Get
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/nplikeness/score:
get:
tags:
- chem
summary: Generates descriptors for the input molecules
description: >-
Calculates the natural product likeness score based on the RDKit
implementation.
Parameters:
- **SMILES**: required (query): The SMILES representation of the
molecule.
Returns:
- np_score (float): The natural product likeness score.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
operationId: np_likeness_score_chem_nplikeness_score_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: The SMILES string to calculate the natural product likeness score
description: The SMILES string to calculate the natural product likeness score
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/NPlikelinessScoreResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/tanimoto:
get:
tags:
- chem
summary: >-
Generates the Tanimoto similarity index for a given pair of SMILES
strings
description: >-
Generates the Tanimoto similarity index for a given pair of SMILES
strings.
The Tanimoto similarity index is calculated using different toolkits:
- When using the **'cdk'** toolkit (default), the Tanimoto similarity is
calculated
using the PubchemFingerprinter from the CDK library.
More information: https://cdk.github.io/cdk/2.8/docs/api/org/openscience/cdk/fingerprint/PubchemFingerprinter.html
- When using the **'rdkit'** toolkit, the Tanimoto similarity is
calculated
using Morgan fingerprints with a radius of 2 and nBits=1024.
Additional modifications can be found in the rdkit_wrapper module.
Usage:
- To calculate the Tanimoto similarity for a pair of SMILES strings,
provide them as a comma-separated parameter:
Example: api.naturalproducts.net/latest/chem/tanimoto?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C,CN1C=NC2=C1C(=O)NC(=O)N2C
Parameters:
- **SMILES**: required (query): The SMILES strings for which the
Tanimoto similarity will be calculated. Two SMILES strings should be
provided as a comma-separated parameter.
- **toolkit**: optional (defaults: cdk): The toolkit to use for Tanimoto
calculation.
- Supported values: "rdkit" / "cdk" (default), "rdkit".
Returns:
- The Tanimoto similarity index as a floating-point value.
Raises:
- If an error occurs during the Tanimoto similarity calculation or if
the input SMILES strings are invalid, an appropriate error message will
be returned.
operationId: tanimoto_similarity_chem_tanimoto_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecules
description: SMILES representation of the molecules
examples:
example1:
summary: 'Example: Caffeine, Topiramate-13C6'
value: >-
CN1C=NC2=C1C(=O)N(C(=O)N2C)C,CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
example2:
summary: 'Example: Topiramate-13C6, Ethane'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1,CC
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
type: string
description: Cheminformatics toolkit used in the backend
default: rdkit
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/TanimotoSimilarityResponse'
- $ref: '#/components/schemas/TanimotoMatrixResponse'
title: Response 200 Tanimoto Similarity Chem Tanimoto Get
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/coconut/pre-processing:
get:
tags:
- chem
summary: Generates an Input JSON file with information for COCONUT database
description: >-
Generates an Input JSON file with information on different molecular
representations and descriptors suitable for submission to the COCONUT
database.
Parameters:
- **SMILES**: required (query): The SMILES string represents a chemical
compound.
Returns:
- JSONResponse: The generated Input JSON file for COCONUT.
Raises:
- HTTPException: If there is an error reading the SMILES string.
operationId: coconut_preprocessing_chem_coconut_pre_processing_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES string representing a chemical compound
description: SMILES string representing a chemical compound
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/COCONUTPreprocessingModel'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/classyfire/classify:
get:
tags:
- chem
summary: Generate ClassyFire-based classifications using SMILES as input
description: >-
Generate ClassyFire-based classifications using SMILES as input.
Parameters:
- **SMILES**: required (query): The SMILES representation of the
compound to be classified.
Returns:
- The classification data generated by ClassyFire.
Raises:
- HTTPException: If the SMILES string is not provided or if an error
occurs during the classification process.
Note:
- ClassyFire is a chemical taxonomy classification tool that predicts
the chemical class and subclass of a compound based on its structural
features.
- This service pings the http://classyfire.wishartlab.com server for
information retrieval.
operationId: classyfire_classify_chem_classyfire_classify_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the compound to be classified
description: SMILES representation of the compound to be classified
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ClassyFireJob'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/chem/classyfire/{jobid}/result:
get:
tags:
- chem
summary: >-
Retrieve the ClassyFire classification results based on the provided Job
ID
description: >-
Retrieve the ClassyFire classification results based on the provided Job
ID.
To obtain the results from ClassyFire, please initiate a new request and
obtain a unique job ID.
Once you have the job ID, you need to submit another request using this
ID in order to retrieve the desired outcome.
Parameters:
- **jobid**: required (query): The Job ID used to query the ClassyFire
classification results.
Raises:
- HTTPException 422: If the Job ID is not provided.
- HTTPException 500: If an error occurs during the classification
process.
Returns:
- The ClassyFire classification results as JSON.
operationId: classyfire_result_chem_classyfire__jobid__result_get
parameters:
- name: jobid
in: path
required: true
schema:
type: string
title: Jobid
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ClassyFireResult'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/mol2D:
get:
tags:
- convert
summary: Generates 2D Coordinates for the input molecules
description: >-
Generates 2D Coordinates using the CDK Structure diagram
generator/RDKit/Open Babel and returns the mol block.
Parameters:
- **SMILES**: required (str): The SMILES string.
- **toolkit** (str, optional): The toolkit to use for generating 2D
coordinates.
- Supported values: "cdk" (default), "rdkit", "openbabel".
Returns:
- molblock (str): The generated mol block with 2D coordinates as a plain
text response.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
operationId: create2d_coordinates_convert_mol2D_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
- openbabel
type: string
description: Cheminformatics toolkit used in the backend
default: cdk
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/TwoDCoordinatesResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/mol3D:
get:
tags:
- convert
summary: Generates 3D Coordinates for the input molecules
description: >-
Generates a random 3D conformer from SMILES using the specified molecule
toolkit.
Parameters:
- **SMILES**: required (str): The SMILES representation of the molecule.
- **toolkit**: optional (str): The molecule toolkit to use.
- Supported values: "rdkit" (default) & "openbabel".
Returns:
- molblock (str): The generated mol block with 3D coordinates as a plain
text response.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
operationId: create3d_coordinates_convert_mol3D_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- rdkit
- openbabel
type: string
description: Cheminformatics toolkit used in the backend
default: rdkit
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ThreeDCoordinatesResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/smiles:
get:
tags:
- convert
summary: Generate SMILES from a given input
description: >-
Generate SMILES from a given IUPAC name or a SELFIES representation.
Parameters:
- **input_text**: required (str): The input text containing either the
IUPAC name or SELFIES representation.
- **representation**: optional (str): The representation type of the
input text.
- Supported values: "iupac" (default) & "selfies".
Returns:
- If representation is "iupac": The generated SMILES string
corresponding to the given IUPAC name.
- If the representation is "selfies": The generated SMILES string
corresponds to the given SELFIES representation.
Notes:
- The IUPAC name should follow the standard IUPAC naming conventions for
organic compounds.
- SELFIES (Self-Referencing Embedded Strings) is a concise yet
expressive chemical string notation.
Example Usage:
- To generate SMILES from an IUPAC name:
/smiles?input_text=benzene&representation=iupac
- To generate SMILES from a SELFIES representation:
/smiles?input_text=[C][C][C]&representation=selfies
operationId: iupac_name_or_selfies_to_smiles_convert_smiles_get
parameters:
- name: input_text
in: query
required: true
schema:
type: string
title: Input IUPAC name or SELFIES
description: IUPAC name or SELFIES representation of the molecule
description: IUPAC name or SELFIES representation of the molecule
examples:
example1:
summary: 'Example: IUPAC name'
value: 1,3,7-trimethylpurine-2,6-dione
example2:
summary: 'Example: SELFIES'
value: >-
[C][N][C][=N][C][=C][Ring1][Branch1][C][=Branch1][C][=O][N][Branch1][=Branch2][C][=Branch1][C][=O][N][Ring1][Branch2][C][C]
- name: representation
in: query
required: false
schema:
enum:
- iupac
- selfies
type: string
description: Required type of format conversion
default: iupac
title: Representation
description: Required type of format conversion
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateSMILESResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/canonicalsmiles:
get:
tags:
- convert
summary: Generate CanonicalSMILES from a given SMILES
description: >-
Canonicalizes a given SMILES string according to the allowed toolkits.
Parameters:
- **SMILES**: required (str): The input SMILES string to be
canonicalized.
- **toolkit**: optional (str): The toolkit to use for canonicalization.
- Supported values: "cdk" (default), "rdkit" & "openbabel".
Returns:
- SMILES (str): The canonicalized SMILES string.
Raises:
- ValueError: If the SMILES string is empty or contains invalid
characters.
- ValueError: If an unsupported toolkit option is provided.
operationId: smiles_canonicalise_convert_canonicalsmiles_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
- openbabel
type: string
description: Cheminformatics toolkit used in the backend
default: cdk
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateCanonicalResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/cxsmiles:
get:
tags:
- convert
summary: Generate CXSMILES from a given SMILES
description: >-
Convert SMILES to CXSMILES. For more information:
-
https://docs.chemaxon.com/display/docs/chemaxon-extended-smiles-and-smarts-cxsmiles-and-cxsmarts.md
Parameters:
- **SMILES**: required (str): The input SMILES string to convert.
- **toolkit**: optional (str): The toolkit to use for conversion.
- Supported values: "cdk" (default) & "rdkit".
Returns:
- CXSMILES (str): The converted CXSMILES string.
Raises:
- ValueError: If the SMILES string is empty or contains invalid
characters.
- ValueError: If an unsupported toolkit option is provided.
Note:
- CXSMILES is a Chemaxon Extended SMILES which is used for storing
special features of the molecules after the SMILES string.
operationId: smiles_to_cxsmiles_convert_cxsmiles_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
type: string
description: Cheminformatics toolkit used in the backend
default: cdk
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateCXSMILESResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/inchi:
get:
tags:
- convert
summary: Generate InChI from a given SMILES
description: >-
Convert SMILES to InChI.
Parameters:
- **SMILES**: required (str): The input SMILES string to convert.
- **toolkit**: optional (str): The toolkit to use for conversion.
- Supported values: "cdk" (default), "openbabel" & "rdkit".
Returns:
- InChI (str): The resulting InChI string.
Raises:
- ValueError: If the SMILES string is empty or contains invalid
characters.
- ValueError: If an unsupported toolkit option is provided.
operationId: smiles_to_inchi_convert_inchi_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
- openbabel
type: string
description: Cheminformatics toolkit used in the backend
default: cdk
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateInChIResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/inchikey:
get:
tags:
- convert
summary: Generate InChI-Key from a given SMILES
description: >-
Convert SMILES to InChI-Key.
Parameters:
- **SMILES**: required (str): The input SMILES string to convert.
- **toolkit**: optional (str): The toolkit to use for conversion.
- Supported values: "cdk" (default), "openbabel" & "rdkit".
Returns:
- InChI-Key (str): The resulting InChI-Key string.
Raises:
- ValueError: If the SMILES string is empty or contains invalid
characters.
- ValueError: If an unsupported toolkit option is provided.
operationId: smiles_to_inchikey_convert_inchikey_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
- openbabel
type: string
description: Cheminformatics toolkit used in the backend
default: cdk
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateInChIKeyResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/iupac:
get:
tags:
- convert
summary: Generates IUPAC name using STOUT package
description: >-
Generates IUPAC name using STOUT package. For more information:
- Rajan, K., Zielesny, A. & Steinbeck, C. STOUT: SMILES to IUPAC names
using neural machine translation. J Cheminform 13, 34 (2021).
https://doi.org/10.1186/s13321-021-00512-4
Parameters:
- **SMILES**: required (str): The input SMILES string to convert.
Returns:
- IUPAC name (str): The resulting IUPAC name of the chemical compound.
Raises:
- ValueError: If the SMILES string is empty or contains invalid
characters.
Note:
- Here we are using STOUT v2.0 which is available at:
https://github.com/Kohulan/Smiles-TO-iUpac-Translator
Disclaimer:
- Due to the fact that STOUT is a deep learning model, it may
occasionally display hallucinations or provide incorrect IUPAC names.
operationId: smiles_to_iupac_name_convert_iupac_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateIUPACResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/selfies:
get:
tags:
- convert
summary: Generates SELFIES string for a given SMILES string
description: >-
Generates SELFIES string for a given SMILES string. For more
information:
- Krenn et al, SELFIES and the future of molecular string
representations, Patterns, https://doi.org/10.1016/j.patter.2022.100588.
Parameters:
- **SMILES**: required (str): The input SMILES string to convert.
Returns:
- SELFIES (str): The resulting SELFIES of the chemical compound.
Raises:
- ValueError: If the SMILES string is empty or contains invalid
characters.
operationId: encode_selfies_convert_selfies_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateSELFIESResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/convert/formats:
get:
tags:
- convert
summary: Convert SMILES to various molecular formats using different toolkits
description: >-
Convert SMILES to various molecular formats using different toolkits.
Parameters:
- **SMILES**: required (str): The input SMILES string to convert.
- **toolkit**: optional (str): The toolkit to use for conversion.
- Supported values: "cdk" (default), "openbabel" & "rdkit".
Returns:
- dict: A dictionary containing the converted data in various formats.
The dictionary has the following keys:
- "mol" (str): The generated 2D mol block of the molecule.
- "canonicalsmiles" (str): The canonical SMILES representation of the molecule.
- "inchi" (str): The InChI representation of the molecule.
- "inchikey" (str): The InChIKey representation of the molecule.
Note:
- The returned dictionary may contain empty strings if conversion fails or the input SMILES string is invalid.
Raises:
- ValueError: If the SMILES string is empty or contains invalid
characters.
- ValueError: If an unsupported toolkit option is provided.
operationId: smiles_convert_to_formats_convert_formats_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES representation of the molecule
description: SMILES representation of the molecule
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
- openbabel
type: string
description: Cheminformatics toolkit used in the backend
default: cdk
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateFormatsResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/depict/2D:
get:
tags:
- depict
summary: Generates a 2D depiction of a molecule
description: >-
Generates a 2D depiction of a molecule using CDK or RDKit with the given
parameters.
Parameters:
- **SMILES**: required (query): The SMILES representation of the
molecule. [required]
- **toolkit**: (str, optional): The toolkit to use for the depiction.
Defaults to "cdk".
- Supported values: "cdk"/ "rdkit" (default), "cdk".
- **width**: (int, optional): The width of the generated image in
pixels. Defaults to 512.
- **height**: (int, optional): The height of the generated image in
pixels. Defaults to 512.
- **rotate**: (int, optional): The rotation angle of the molecule in
degrees. Defaults to 0.
- CIP (bool, optional): Whether to include Cahn-Ingold-Prelog (CIP)
stereochemistry information. Defaults to False.
- unicolor (bool, optional): Whether to use a single colour for the
molecule. Defaults to False.
Returns:
Response: An HTTP response containing the generated image in SVG+xml format.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
Note:
- The `smiles` parameter is required and must be provided as a query parameter.
- The `toolkit` parameter determines the backend library to use for molecule depiction.
Currently supported options are "cdksdg" (CDK with SDG) and RDKit (default).
- The `width` and `height` parameters control the dimensions of the generated image.
- The `rotate` parameter specifies the rotation angle of the molecule in degrees.
- The `CIP` parameter controls whether Cahn-Ingold-Prelog (CIP) stereochemistry information should be included / not.
- The `unicolor` parameter determines whether a single colour is used for the molecule.
operationId: depict_2d_molecule_depict_2D_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES string to be converted
description: SMILES string to be converted
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- cdk
- rdkit
type: string
description: Cheminformatics toolkit used in the backend
default: rdkit
title: Toolkit
description: Cheminformatics toolkit used in the backend
- name: width
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
title: Width
description: The width of the generated image in pixels.
default: 512
description: The width of the generated image in pixels.
- name: height
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
title: Height
description: The height of the generated image in pixels.
default: 512
description: The height of the generated image in pixels.
- name: rotate
in: query
required: false
schema:
anyOf:
- type: integer
- type: 'null'
title: Rotate
description: The rotation angle of the molecule in degrees.
default: 0
description: The rotation angle of the molecule in degrees.
- name: CIP
in: query
required: false
schema:
anyOf:
- type: boolean
- type: 'null'
title: CIP
description: >-
Whether to include Cahn-Ingold-Prelog (CIP) stereochemistry
information.
default: false
description: >-
Whether to include Cahn-Ingold-Prelog (CIP) stereochemistry
information.
- name: unicolor
in: query
required: false
schema:
anyOf:
- type: boolean
- type: 'null'
title: Unicolor
description: Whether to use a single colour for the molecule.
default: false
description: Whether to use a single colour for the molecule.
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Depict2DResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/depict/3D:
get:
tags:
- depict
summary: Generates a 3D depiction of a molecule
description: >-
Generate 3D depictions of molecules using OpenBabel or RDKit.
Parameters:
- **SMILES**: required (str): The SMILES string representing the
molecule to depict.
- **toolkit**: optional (str): The molecule toolkit to use. The default
is "rdkit".
- Supported values: "rdkit"/ "openbabel" (default), "rdkit".
Returns:
- If the toolkit is "openbabel", returns a TemplateResponse with the
molecule depiction generated using OpenBabel.
- If the toolkit is "rdkit", returns a TemplateResponse with the 3D
conformers of the molecule generated using RDKit.
- If the toolkit is neither "openbabel" nor "rdkit", returns a string
indicating that the SMILES string or the toolkit configuration should be
checked.
Raises:
- ValueError: If the SMILES string is not provided or is invalid.
Note:
- The function expects a GET request to the "/3D" endpoint.
- The generated depictions are rendered using the "mol.html" template
found under the templates directory.
operationId: depict_3d_molecule_depict_3D_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: SMILES string to be converted
description: SMILES string to be converted
examples:
example1:
summary: 'Example: Caffeine'
value: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
example2:
summary: 'Example: Topiramate-13C6'
value: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
- name: toolkit
in: query
required: false
schema:
enum:
- rdkit
- openbabel
type: string
description: Cheminformatics toolkit used in the backend
default: rdkit
title: Toolkit
description: Cheminformatics toolkit used in the backend
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Depict3DResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/tools/generate-structures:
get:
tags:
- tools
summary: Generates structures using the chemical structure generator
description: >-
Generates structures using the chemical structure generator based on the
canonical generation path method.
For more information refer to:
- McKay, B.D., Yirik, M.A. & Steinbeck, C. Surge: a fast open-source
chemical graph generator. J Cheminform 14, 24 (2022).
https://doi.org/10.1186/s13321-022-00604-9
Parameters:
- **Molecular_Formula**: required (str): The molecular formula of the compound.
Returns:
- List[str]: A list of generated structures.
Raises:
- HTTPException: If there was an error generating the structures.
Example:
- GET /generate-structures?molecular_formula=C4H10
Note:
- The maximum allowable count of heavy atoms is restricted to 10 to
mitigate excessive utilization of this service.
operationId: generate_structures_tools_generate_structures_get
parameters:
- name: molecular_formula
in: query
required: true
schema:
type: string
title: Molecular Formula
description: Molecular Formula for the chemical structure to be generated
description: Molecular Formula for the chemical structure to be generated
examples:
example1:
summary: 'Example: Heavy atom count 6'
value: C6H6
example2:
summary: 'Example: Heavy atom count 8'
value: C8H8
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateStructuresResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/tools/sugars-info:
get:
tags:
- tools
summary: Get information whether a given molecule has circular or linear sugars
description: >-
Get information on whether a given molecule has circular or linear
sugars.
For more information refer to:
- Schaub, J., Zielesny, A., Steinbeck, C. et al. Too sweet:
cheminformatics for deglycosylation in natural products. J Cheminform
12, 67 (2020). https://doi.org/10.1186/s13321-020-00467-y.
Parameters:
- **SMILES string**: (str): SMILES: string representation of the
molecule (required, query parameter)
Returns:
- str: A message indicating the type of sugars present in the molecule.
Note:
The function `get_sugar_info` is used internally to determine the
presence of linear and circular sugars in the molecule.
The returned message indicates the types of sugars present in the
molecule:
- If both linear and circular sugars are present, it returns "The molecule contains Linear and Circular sugars."
- If only linear sugar is present, it returns "The molecule contains only Linear sugar."
- If only circular sugars are present, it returns "The molecule contains only Circular sugar."
- If no sugars are found, it returns "The molecule contains no sugar."
operationId: get_sugar_information_tools_sugars_info_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: 'SMILES: string representation of the molecule'
description: 'SMILES: string representation of the molecule'
examples:
example1:
summary: >-
Example:
1-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]pentane-1,2,3,4,5-pentol
value: OCC(O)C(O)C(O)C(O)C1OC(CO)C(O)C(O)C1O
example2:
summary: >-
Example:
5-[1-(3,4-dihydroxyphenyl)-3-(2,3,4,5,6,7-hexahydroxyheptoxycarbonyl)-6-hydroxy-7-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]oxy-1,2-dihydronaphthalene-2-carbonyl]oxy-3,4-dihydroxycyclohexene-1-carboxylic
acid
value: >-
O=C(O)C1=CC(O)C(O)C(OC(=O)C2C(=CC=3C=C(O)C(OC4OC(CO)C(O)C(O)C4O)=CC3C2C5=CC=C(O)C(O)=C5)C(=O)OCC(O)C(O)C(O)C(O)C(O)CO)C1
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: string
title: Response Get Sugar Information Tools Sugars Info Get
$ref: '#/components/schemas/GetSugarInformationResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/tools/remove-linear-sugars:
get:
tags:
- tools
summary: Detect and remove linear sugars
description: >-
Detect and remove linear sugars from a given SMILES string using Sugar
Removal Utility.
Parameters:
- **SMILES string**: (str): SMILES: string representation of the
molecule (required, query parameter)
Returns:
- str: The modified SMILES string with linear sugars removed.
operationId: remove_linear_sugars_tools_remove_linear_sugars_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: 'SMILES: string representation of the molecule'
description: 'SMILES: string representation of the molecule'
examples:
example1:
summary: >-
Example:
1-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]pentane-1,2,3,4,5-pentol
value: OCC(O)C(O)C(O)C(O)C1OC(CO)C(O)C(O)C1O
example2:
summary: >-
Example:
5-[1-(3,4-dihydroxyphenyl)-3-(2,3,4,5,6,7-hexahydroxyheptoxycarbonyl)-6-hydroxy-7-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]oxy-1,2-dihydronaphthalene-2-carbonyl]oxy-3,4-dihydroxycyclohexene-1-carboxylic
acid
value: >-
O=C(O)C1=CC(O)C(O)C(OC(=O)C2C(=CC=3C=C(O)C(OC4OC(CO)C(O)C(O)C4O)=CC3C2C5=CC=C(O)C(O)=C5)C(=O)OCC(O)C(O)C(O)C(O)C(O)CO)C1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetLinearSugarResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/tools/remove-circular-sugars:
get:
tags:
- tools
summary: Detect and remove linear sugars
description: >-
Detect and remove circular sugars from a given SMILES string using Sugar
Removal Utility.
Parameters:
- **SMILES string**: (str): SMILES: string representation of the
molecule (required, query parameter)
Returns:
- str: The modified SMILES string with circular sugars removed.
operationId: remove_circular_sugars_tools_remove_circular_sugars_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: 'SMILES: string representation of the molecule'
description: 'SMILES: string representation of the molecule'
examples:
example1:
summary: >-
Example:
1-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]pentane-1,2,3,4,5-pentol
value: OCC(O)C(O)C(O)C(O)C1OC(CO)C(O)C(O)C1O
example2:
summary: >-
Example:
5-[1-(3,4-dihydroxyphenyl)-3-(2,3,4,5,6,7-hexahydroxyheptoxycarbonyl)-6-hydroxy-7-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]oxy-1,2-dihydronaphthalene-2-carbonyl]oxy-3,4-dihydroxycyclohexene-1-carboxylic
acid
value: >-
O=C(O)C1=CC(O)C(O)C(OC(=O)C2C(=CC=3C=C(O)C(OC4OC(CO)C(O)C(O)C4O)=CC3C2C5=CC=C(O)C(O)=C5)C(=O)OCC(O)C(O)C(O)C(O)C(O)CO)C1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetCircularSugarResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/tools/remove-sugars:
get:
tags:
- tools
summary: Detect and remove linear sugars
description: >-
Detect and remove linear and circular sugars from a given SMILES string
using Sugar Removal Utility.
Parameters:
- **SMILES string**: (str): SMILES: string representation of the
molecule (required, query parameter)
Returns:
- str: The modified SMILES string with linear and circular sugars
removed.
operationId: remove_linear_and_circular_sugars_tools_remove_sugars_get
parameters:
- name: smiles
in: query
required: true
schema:
type: string
title: SMILES
description: 'SMILES: string representation of the molecule'
description: 'SMILES: string representation of the molecule'
examples:
example1:
summary: >-
Example:
1-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]pentane-1,2,3,4,5-pentol
value: OCC(O)C(O)C(O)C(O)C1OC(CO)C(O)C(O)C1O
example2:
summary: >-
Example:
5-[1-(3,4-dihydroxyphenyl)-3-(2,3,4,5,6,7-hexahydroxyheptoxycarbonyl)-6-hydroxy-7-[3,4,5-trihydroxy-6-(hydroxymethyl)oxan-2-yl]oxy-1,2-dihydronaphthalene-2-carbonyl]oxy-3,4-dihydroxycyclohexene-1-carboxylic
acid
value: >-
O=C(O)C1=CC(O)C(O)C(OC(=O)C2C(=CC=3C=C(O)C(OC4OC(CO)C(O)C(O)C4O)=CC3C2C5=CC=C(O)C(O)=C5)C(=O)OCC(O)C(O)C(O)C(O)C(O)CO)C1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetCircularandLinearSugarResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/ocsr/process:
post:
tags:
- ocsr
summary: >-
Detect, segment and convert a chemical structure depiction into a SMILES
string using the DECIMER
description: >-
Detect, segment and convert a chemical structure depiction into a SMILES
string using the DECIMER modules.
Parameters:
- **path**: optional if img is provided (str): URL or local file path to
the chemical structure depiction image.
- **reference**: optional (str): URL or local file path to the chemical
structure depiction image.
- **img**: optional if a valid path is provided (str): URL or local file
path to the chemical structure depiction image.
Returns:
- JSONResponse: A JSON response containing the extracted SMILES and the
reference (if provided).
Raises:
- HTTPException: If the 'path' parameter is not provided or if it is an
invalid URL or file path.
- HTTPException: If the 'img' parameter is provided, but the content is
not accessible.
operationId: Extract_ChemicalInfo_From_File_ocsr_process_post
requestBody:
content:
application/json:
schema:
allOf:
- $ref: >-
#/components/schemas/Body_Extract_ChemicalInfo_From_File_ocsr_process_post
title: Body
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractChemicalInfoResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/ocsr/process-upload:
post:
tags:
- ocsr
summary: >-
Detect, segment and convert a chemical structure depiction in the
uploaded file into a SMILES string using the DECIMER
description: >-
Detect, segment and convert a chemical structure depiction in the
uploaded image file into a SMILES string using the DECIMER modules.
Parameters:
- **file**: required (File):
Returns:
- JSONResponse: A JSON response containing the extracted SMILES and the
reference (if provided).
Raises:
- HTTPException: If the 'path' parameter is not provided or if it is an
invalid URL or file path.
- HTTPException: If the 'img' parameter is provided, but the URL is not
accessible.
operationId: extract_chemicalinfo_from_upload_ocsr_process_upload_post
requestBody:
content:
multipart/form-data:
schema:
$ref: >-
#/components/schemas/Body_extract_chemicalinfo_from_upload_ocsr_process_upload_post
required: true
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractChemicalInfoResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BadRequestModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundModel'
'422':
description: Unprocessable Entity
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
BadRequestModel:
properties:
error:
type: string
title: Error
default: Bad Request
detail:
type: string
title: Detail
type: object
required:
- detail
title: BadRequestModel
description: |-
Represents a Bad Request response in an API.
Args:
detail (str): A detailed message describing the nature of the bad request.
Body_Extract_ChemicalInfo_From_File_ocsr_process_post:
properties:
path:
type: string
title: Path
description: URL or local file path to the chemical structure depiction image.
reference:
type: string
title: Reference
description: Reference information.
img:
type: string
title: Img
description: Bytes content of the chemical structure depiction image.
type: object
title: Body_Extract_ChemicalInfo_From_File_ocsr_process_post
Body_extract_chemicalinfo_from_upload_ocsr_process_upload_post:
properties:
file:
type: string
format: binary
title: File
type: object
required:
- file
title: Body_extract_chemicalinfo_from_upload_ocsr_process_upload_post
COCONUTPreprocessingModel:
properties:
original_mol:
type: string
title: Original Mol
standardised_mol:
type: string
title: Standardised Mol
standardised_SMILES:
type: string
title: Standardised Smiles
molecule_hash:
$ref: '#/components/schemas/MoleculeHash'
parent:
$ref: '#/components/schemas/Parent'
stereochemical_variants:
type: boolean
title: Stereochemical Variants
type: object
required:
- original_mol
- standardised_mol
- standardised_SMILES
- molecule_hash
- parent
- stereochemical_variants
title: COCONUTPreprocessingModel
description: |-
Represents a molecule after CocoNut preprocessing.
Attributes:
original_mol (str): Original molecule information.
standardised_mol (str): Standardized molecule information.
standardised_SMILES (str): Standardized SMILES notation.
molecule_hash (MoleculeHash): Hash information of the molecule.
parent (Parent): Parent molecule details.
stereochemical_variants (bool): Indicates presence of stereochemical variants.
Class:
properties:
name:
type: string
title: Name
description:
type: string
title: Description
chemont_id:
type: string
title: Chemont Id
url:
type: string
title: Url
type: object
required:
- name
- description
- chemont_id
- url
title: Class
description: |-
Represents a Class in ClassyFire taxonomy.
Attributes:
name (str): The name of the Class.
description (str): The description of the Class.
chemont_id (str): The ChemOnt ID of the Class.
url (str): The URL associated with the Class.
ClassyFireJob:
properties:
id:
type: integer
title: Id
label:
type: string
title: Label
finished_at:
title: Finished At
created_at:
type: string
title: Created At
updated_at:
type: string
title: Updated At
query_errors:
title: Query Errors
finished_processing_at:
title: Finished Processing At
query_type:
type: string
title: Query Type
fstruc_file_name:
title: Fstruc File Name
fstruc_content_type:
title: Fstruc Content Type
fstruc_file_size:
title: Fstruc File Size
fstruc_updated_at:
title: Fstruc Updated At
query_input:
type: string
title: Query Input
tag_list:
items:
type: string
type: array
title: Tag List
type: object
required:
- id
- label
- finished_at
- created_at
- updated_at
- query_errors
- finished_processing_at
- query_type
- fstruc_file_name
- fstruc_content_type
- fstruc_file_size
- fstruc_updated_at
- query_input
- tag_list
title: ClassyFireJob
description: |-
Represents a ClassyFire job.
Attributes:
id (int): The ID of the job.
label (str): The label of the job.
finished_at (Any): The timestamp when the job finished.
created_at (str): The timestamp when the job was created.
updated_at (str): The timestamp when the job was last updated.
query_errors (Any): Any errors related to the query.
finished_processing_at (Any): The timestamp when processing finished.
query_type (str): The type of query.
fstruc_file_name (Any): The name of the file containing structural data.
fstruc_content_type (Any): The content type of the structural file.
fstruc_file_size (Any): The size of the structural file.
fstruc_updated_at (Any): The timestamp when the structural file was updated.
query_input (str): The input for the query.
tag_list (List[str]): List of tags associated with the job.
ClassyFireResult:
properties:
id:
type: integer
title: Id
label:
type: string
title: Label
classification_status:
type: string
title: Classification Status
number_of_elements:
type: integer
title: Number Of Elements
number_of_pages:
type: integer
title: Number Of Pages
invalid_entities:
items: {}
type: array
title: Invalid Entities
entities:
items:
$ref: '#/components/schemas/Entity'
type: array
title: Entities
type: object
required:
- id
- label
- classification_status
- number_of_elements
- number_of_pages
- invalid_entities
- entities
title: ClassyFireResult
description: |-
Represents a classification result from ClassyFire.
Attributes:
id (int): Identifier for the result.
label (str): Label for the result.
classification_status (str): Status of the classification.
number_of_elements (int): Number of elements in the classification.
number_of_pages (int): Number of pages.
invalid_entities (List): List of invalid entities.
entities (List[Entity]): List of entities in the classification.
Depict2DResponse:
properties:
message:
type: string
title: Message
default: Success
output:
type: string
title: Output
type: object
required:
- output
title: Depict2DResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
output (str): SVG code block of the depicted image
examples:
- input: CCCOC
message: Success
output: SVG string
Depict3DResponse:
properties:
message:
type: string
title: Message
default: Success
output:
type: string
title: Output
type: object
required:
- output
title: Depict3DResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
output (str): HTML code block of the depicted image
examples:
- input: CCCOC
message: Success
output: HTML string
Descriptors:
properties:
atom_count:
type: integer
title: Atom Count
heavy_atom_count:
type: integer
title: Heavy Atom Count
molecular_weight:
type: number
title: Molecular Weight
exact_molecular_weight:
type: number
title: Exact Molecular Weight
alogp:
type: number
title: Alogp
rotatable_bond_count:
type: integer
title: Rotatable Bond Count
topological_polar_surface_area:
type: integer
title: Topological Polar Surface Area
hydrogen_bond_acceptors:
type: integer
title: Hydrogen Bond Acceptors
hydrogen_bond_donors:
type: integer
title: Hydrogen Bond Donors
hydrogen_bond_acceptors_lipinski:
type: integer
title: Hydrogen Bond Acceptors Lipinski
hydrogen_bond_donors_lipinski:
type: integer
title: Hydrogen Bond Donors Lipinski
lipinski_rule_of_five_violations:
type: integer
title: Lipinski Rule Of Five Violations
aromatic_rings_count:
type: integer
title: Aromatic Rings Count
qed_drug_likeliness:
type: number
title: Qed Drug Likeliness
formal_charge:
type: integer
title: Formal Charge
fraction_csp3:
type: integer
title: Fraction Csp3
number_of_minimal_rings:
type: integer
title: Number Of Minimal Rings
van_der_waals_volume:
type: string
title: Van Der Waals Volume
linear_sugars:
type: boolean
title: Linear Sugars
circular_sugars:
type: boolean
title: Circular Sugars
murko_framework:
type: string
title: Murko Framework
nplikeness:
type: number
title: Nplikeness
type: object
required:
- atom_count
- heavy_atom_count
- molecular_weight
- exact_molecular_weight
- alogp
- rotatable_bond_count
- topological_polar_surface_area
- hydrogen_bond_acceptors
- hydrogen_bond_donors
- hydrogen_bond_acceptors_lipinski
- hydrogen_bond_donors_lipinski
- lipinski_rule_of_five_violations
- aromatic_rings_count
- qed_drug_likeliness
- formal_charge
- fraction_csp3
- number_of_minimal_rings
- van_der_waals_volume
- linear_sugars
- circular_sugars
- murko_framework
- nplikeness
title: Descriptors
description: >-
Represents a collection of molecular descriptors.
This class provides a structure for storing various molecular
descriptors
that characterize a molecule's chemical properties.
Attributes:
atom_count (int): Total count of atoms in the molecule.
heavy_atom_count (int): Count of heavy (non-hydrogen) atoms.
molecular_weight (float): Molecular weight of the molecule.
exact_molecular_weight (float): Exact molecular weight.
alogp (float): Calculated ALogP (partition coefficient) value.
rotatable_bond_count (int): Count of rotatable bonds in the molecule.
topological_polar_surface_area (int): Topological polar surface area.
hydrogen_bond_acceptors (int): Count of hydrogen bond acceptors.
hydrogen_bond_donors (int): Count of hydrogen bond donors.
hydrogen_bond_acceptors_lipinski (int): Lipinski's count of hydrogen bond acceptors.
hydrogen_bond_donors_lipinski (int): Lipinski's count of hydrogen bond donors.
lipinski_rule_of_five_violations (int): Count of Lipinski's rule-of-five violations.
aromatic_rings_count (int): Count of aromatic rings in the molecule.
qed_drug_likeliness (float): Quantitative Estimate of Drug-likeness (QED) value.
formal_charge (int): Formal charge of the molecule.
fraction_csp3 (int): Fraction of carbon atoms that are sp3 hybridized.
number_of_minimal_rings (int): Count of minimal rings in the molecule.
van_der_waals_volume (str): Van der Waals volume description.
linear_sugars (bool): True if linear sugars are present, False otherwise.
circular_sugars (bool): True if circular sugars are present, False otherwise.
murko_framework (str): Murcko framework description.
nplikeness (float): NP-likeness value.
DirectParent:
properties:
name:
type: string
title: Name
description:
type: string
title: Description
chemont_id:
type: string
title: Chemont Id
url:
type: string
title: Url
type: object
required:
- name
- description
- chemont_id
- url
title: DirectParent
description: |-
Represents a Direct Parent within a classification.
Attributes:
name (str): The name of the direct parent.
description (str): Description of the direct parent.
chemont_id (str): Identifier for the direct parent.
url (str): URL associated with the direct parent.
Entity:
properties:
identifier:
type: string
title: Identifier
smiles:
type: string
title: Smiles
inchikey:
type: string
title: Inchikey
kingdom:
$ref: '#/components/schemas/Kingdom'
superclass:
$ref: '#/components/schemas/Superclass'
class:
$ref: '#/components/schemas/Class'
subclass:
$ref: '#/components/schemas/Subclass'
intermediate_nodes:
items: {}
type: array
title: Intermediate Nodes
direct_parent:
$ref: '#/components/schemas/DirectParent'
alternative_parents:
items: {}
type: array
title: Alternative Parents
molecular_framework:
type: string
title: Molecular Framework
substituents:
items:
type: string
type: array
title: Substituents
description:
type: string
title: Description
external_descriptors:
items:
$ref: '#/components/schemas/ExternalDescriptor'
type: array
title: External Descriptors
ancestors:
items:
type: string
type: array
title: Ancestors
predicted_chebi_terms:
items:
type: string
type: array
title: Predicted Chebi Terms
predicted_lipidmaps_terms:
items: {}
type: array
title: Predicted Lipidmaps Terms
classification_version:
type: string
title: Classification Version
type: object
required:
- identifier
- smiles
- inchikey
- kingdom
- superclass
- class
- subclass
- intermediate_nodes
- direct_parent
- alternative_parents
- molecular_framework
- substituents
- description
- external_descriptors
- ancestors
- predicted_chebi_terms
- predicted_lipidmaps_terms
- classification_version
title: Entity
description: |-
Represents a chemical Entity with classification information.
Attributes:
identifier (str): Unique identifier for the entity.
smiles (str): SMILES representation of the entity.
inchikey (str): InChIKey of the entity.
kingdom (Kingdom): Kingdom classification of the entity.
superclass (Superclass): Superclass classification of the entity.
class_ (Class): Class classification of the entity.
subclass (Subclass): Subclass classification of the entity.
intermediate_nodes (List): List of intermediate nodes.
direct_parent (DirectParent): Direct parent classification of the entity.
alternative_parents (List): List of alternative parent classifications.
molecular_framework (str): The molecular framework of the entity.
substituents (List[str]): List of substituents in the entity.
description (str): Description of the entity.
external_descriptors (List[ExternalDescriptor]): List of external descriptors.
ancestors (List[str]): List of ancestor classifications.
predicted_chebi_terms (List[str]): List of predicted ChEBI terms.
predicted_lipidmaps_terms (List): List of predicted LipidMaps terms.
classification_version (str): Version of the classification.
ErrorResponse:
properties:
detail:
type: string
title: Detail
type: object
required:
- detail
title: ErrorResponse
description: |-
Represents an error response.
Attributes:
detail (str): A description of the error. This attribute contains a human-readable description of the error.
ExternalDescriptor:
properties:
source:
type: string
title: Source
source_id:
type: string
title: Source Id
annotations:
items:
type: string
type: array
title: Annotations
type: object
required:
- source
- source_id
- annotations
title: ExternalDescriptor
description: |-
Represents an External Descriptor associated with an Entity.
Attributes:
source (str): The source of the external descriptor.
source_id (str): Identifier for the external descriptor.
annotations (List[str]): List of annotations for the descriptor.
ExtractChemicalInfoResponse:
properties:
message:
type: string
title: Message
default: Success
reference:
type: string
title: Reference
smiles:
type: string
title: Smiles
type: object
required:
- reference
- smiles
title: ExtractChemicalInfoResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
reference (str): Reference string to the image input.
smiles (str): SMILES string generated by DECIMER.
GenerateCXSMILESResponse:
properties:
smiles:
type: string
title: SMILES
description: The generated CXSMILES string corresponding to the input SMILES.
type: object
required:
- smiles
title: GenerateCXSMILESResponse
description: |-
Represents a response containing a generated CXSMILES string.
Properties:
- smiles (str): The generated CXSMILES string.
examples:
- input: CN1C(=O)C2=C(N=CN2C)N(C)C1=O
message: Success
output: >-
CN1C=NC2=C1C(=O)N(C)C(=O)N2C
|(2.68,2.45,;2.22,1.02,;3.1,-0.19,;2.22,-1.4,;0.8,-0.94,;0.8,0.56,;-0.5,1.31,;-0.5,2.81,;-1.8,0.56,;-3.1,1.31,;-1.8,-0.94,;-3.1,-1.69,;-0.5,-1.69,;-0.5,-3.19,)|
GenerateCanonicalResponse:
properties:
smiles:
type: string
title: SMILES
description: >-
The generated Canonical SMILES string corresponding to the input
SMILES.
type: object
required:
- smiles
title: GenerateCanonicalResponse
description: |-
Represents a response containing a generated SMILES string.
Properties:
- smiles (str): The generated Canonical SMILES string.
examples:
- input: CN1C(=O)C2=C(N=CN2C)N(C)C1=O
message: Success
output: CN1C=NC2=C1C(=O)N(C)C(=O)N2C
GenerateDescriptorsResponse:
properties:
descriptors:
type: object
title: Descriptors
description: A dictionary of descriptors and their values.
type: object
required:
- descriptors
title: GenerateDescriptorsResponse
description: |-
Represents a successful response containing descriptors for a molecule.
Properties:
- descriptors (dict): A dictionary of descriptors and their values.
examples:
- input: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
message: Success
output: a defined set of moleculare descriptors calculated
GenerateFormatsResponse:
properties:
iupac:
type: string
title: SMILES
description: The generated SELFIES string corresponding to the input SMILES.
type: object
required:
- iupac
title: GenerateFormatsResponse
description: |-
Represents a response containing a generated SELFIES string.
Properties:
- iupac (str): The generated SELFIES string.
examples:
- input: CN1C(=O)C2=C(N=CN2C)N(C)C1=O
message: Success
output: molblock, SMILES, InChI and InChI-Key
GenerateHOSECodeResponse:
properties:
hose_codes:
items:
type: string
type: array
title: HOSE Codes
description: A list of HOSE codes for each atom in the molecule.
type: object
required:
- hose_codes
title: GenerateHOSECodeResponse
description: >-
Represents a response containing HOSE codes for a molecule.
Properties:
- hose_codes (List[str]): A list of HOSE codes for each atom in the
molecule.
examples:
- input: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
message: Success
output: >-
[ "C-4;N(//)", "N-3;*C*CC(//)", "C-3;*N*N(//)", "N-2;*C*C(//)",
"C-3;*C*N*N(//)", "C-3;*C*C*N(//)", "C-3;=O*C*N(//)",
"O-1;=C(//)", "N-3;*C*CC(//)", "C-3;=O*N*N(//)", "O-1;=C(//)",
"N-3;*C*CC(//)", "C-4;N(//)"]
GenerateIUPACResponse:
properties:
iupac:
type: string
title: SMILES
description: The generated IUPAC name corresponding to the input SMILES.
type: object
required:
- iupac
title: GenerateIUPACResponse
description: |-
Represents a response containing a generated IUPAC string.
Properties:
- iupac (str): The generated IUPAC name.
examples:
- input: CN1C(=O)C2=C(N=CN2C)N(C)C1=O
message: Success
output: 1,3,7-trimethylpurine-2,6-dione
GenerateInChIKeyResponse:
properties:
inchikey:
type: string
title: SMILES
description: The generated InChI Key string corresponding to the input SMILES.
type: object
required:
- inchikey
title: GenerateInChIKeyResponse
description: |-
Represents a response containing a generated InChI Key string.
Properties:
- inchikey (str): The generated InChI Key string.
examples:
- input: CN1C(=O)C2=C(N=CN2C)N(C)C1=O
message: Success
output: RYYVLZVUVIJVGH-UHFFFAOYSA-N
GenerateInChIResponse:
properties:
inchi:
type: string
title: SMILES
description: The generated InChI string corresponding to the input SMILES.
type: object
required:
- inchi
title: GenerateInChIResponse
description: |-
Represents a response containing a generated InChI string.
Properties:
- inchi (str): The generated InChI string.
examples:
- input: CN1C(=O)C2=C(N=CN2C)N(C)C1=O
message: Success
output: InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3
GenerateMultipleDescriptorsResponse:
properties:
descriptors:
type: object
title: Descriptors
description: >-
A dictionary with each SMILES as the key and the corresponding
descriptors as the value.
type: object
required:
- descriptors
title: GenerateMultipleDescriptorsResponse
description: >-
Represents a response containing multiple descriptors for a list of
SMILES strings.
Properties:
- descriptors (dict): A dictionary with each SMILES as the key and the
corresponding descriptors as the value.
examples:
- input: >-
CN1C=NC2=C1C(=O)N(C(=O)N2C)C,
CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1
message: Success
output: >-
{"CN1C=NC2=C1C(=O)N(C(=O)N2C)C": {"A set of calculated molecular
descriptors"},"CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1": {"A set
of calculated molecular descriptors"}}
GenerateSELFIESResponse:
properties:
iupac:
type: string
title: SMILES
description: The generated SELFIES string corresponding to the input SMILES.
type: object
required:
- iupac
title: GenerateSELFIESResponse
description: |-
Represents a response containing a generated SELFIES string.
Properties:
- iupac (str): The generated SELFIES string.
examples:
- input: CN1C(=O)C2=C(N=CN2C)N(C)C1=O
message: Success
output: >-
[C][N][C][=Branch1][C][=O][C][=C][Branch1][#Branch1][N][=C][N][Ring1][Branch1][C][N][Branch1][C][C][C][Ring1][N][=O]
GenerateSMILESResponse:
properties:
smiles:
type: string
title: SMILES
description: The generated SMILES string corresponding to the input text.
type: object
required:
- smiles
title: GenerateSMILESResponse
description: |-
Represents a response containing a generated SMILES string.
Properties:
- smiles (str): The generated SMILES string.
examples:
- input: 1,3,7-trimethylpurine-2,6-dione
message: Success
output: CN1C=NC2=C1C(=O)N(C)C(=O)N2C
GenerateStandardizeResponse:
properties:
standardized_mol:
type: string
title: Standardized Molblock
description: The standardized molblock of the molecule.
canonical_smiles:
type: string
title: Canonical SMILES
description: The canonical SMILES representation of the molecule.
inchi:
type: string
title: InChI
description: The InChI representation of the molecule.
inchikey:
type: string
title: InChI-Key
description: The InChI-Key of the molecule.
type: object
required:
- standardized_mol
- canonical_smiles
- inchi
- inchikey
title: GenerateStandardizeResponse
description: >-
Represents a response containing standardized molecule information.
Properties:
- standardized_mol (str): The standardized molblock of the molecule.
- canonical_smiles (str): The canonical SMILES representation of the
molecule.
- inchi (str): The InChI representation of the molecule.
- inchikey (str): The InChI-Key of the molecule.
examples:
- input: |2-
CDK 09012310592D
1 0 0 0 0 0 0 0 0 0999 V2000
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
M END
message: Success
output: Standardized Molblock, Canonical SMILES, InChI, InChI-Key
GenerateStereoisomersResponse:
properties:
stereoisomers:
items: {}
type: array
title: Stereoisomers
description: A list of stereoisomer SMILES strings.
type: object
required:
- stereoisomers
title: GenerateStereoisomersResponse
description: >-
Represents a response containing enumerated stereo isomers for a
molecule.
Properties:
- stereoisomers (List[str]): A list of stereoisomer SMILES strings.
examples:
- input: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
message: Success
output: '["Cn1c(=O)c2c(ncn2C)n(C)c1=O"]'
GenerateStructuresResponse:
properties:
message:
type: string
title: Message
default: Success
output:
items:
type: string
type: array
title: Output
type: object
required:
- output
title: GenerateStructuresResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
output (List[str]): A list of generated structures.
examples:
- input: C4H8
message: Success
output:
- CC(C)C
- CCCC
GetCircularSugarResponse:
properties:
message:
type: string
title: Message
default: Success
output:
type: string
title: Output
type: object
required:
- output
title: GetCircularSugarResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
output (str): SMILES without circular sugar
examples:
- input: OCC(O)C(O)C(O)C(O)C1OC(CO)C(O)C(O)C1O
message: Success
output: C(C(C(C(C(C1C(C(C(C(CO)O1)O)O)O)O)O)O)O)O
GetCircularandLinearSugarResponse:
properties:
message:
type: string
title: Message
default: Success
output:
type: string
title: Output
type: object
required:
- output
title: GetCircularandLinearSugarResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
output (str): SMILES without circular and Linear sugar
examples:
- input: >-
O=C(O)C1=CC(O)C(O)C(OC(=O)C2C(=CC=3C=C(O)C(OC4OC(CO)C(O)C(O)C4O)=CC3C2C5=CC=C(O)C(O)=C5)C(=O)OCC(O)C(O)C(O)C(O)C(O)CO)C1
message: Success
output: >-
C1=C(C=C(C(=C1)O)O)C2C3=C(C=C(C=O)C2C(=O)OC4CC(=CC(C4O)O)C(=O)O)C=C(C(=C3)O)O
GetLinearSugarResponse:
properties:
message:
type: string
title: Message
default: Success
output:
type: string
title: Output
type: object
required:
- output
title: GetLinearSugarResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
output (str): SMILES without linear sugar
examples:
- input: OCC(O)C(O)C(O)C(O)C1OC(CO)C(O)C(O)C1O
message: Success
output: C(C1C(C(C(CO1)O)O)O)O
GetSugarInformationResponse:
properties:
message:
type: string
title: Message
default: Success
output:
type: string
title: Output
type: object
required:
- output
title: GetSugarInformationResponse
description: |-
A Pydantic model representing a successful response.
Attributes:
message (str): A message indicating the success status (default: "Success").
output (str): Information on containing sugar
examples:
- input: OCC(O)C(O)C(O)C(O)C1OC(CO)C(O)C(O)C1O
message: Success
output: The molecule contains Linear and Circular sugars
Kingdom:
properties:
name:
type: string
title: Name
description:
type: string
title: Description
chemont_id:
type: string
title: Chemont Id
url:
type: string
title: Url
type: object
required:
- name
- description
- chemont_id
- url
title: Kingdom
description: |-
Represents a Kingdom in ClassyFire taxonomy.
Attributes:
name (str): The name of the Kingdom.
description (str): The description of the Kingdom.
chemont_id (str): The ChemOnt ID of the Kingdom.
url (str): The URL associated with the Kingdom.
MoleculeHash:
properties:
Formula:
type: string
title: Formula
Isomeric_SMILES:
type: string
title: Isomeric Smiles
Canonical_SMILES:
type: string
title: Canonical Smiles
type: object
required:
- Formula
- Isomeric_SMILES
- Canonical_SMILES
title: MoleculeHash
description: |-
Represents a molecule's hash information.
Attributes:
Formula (str): Chemical formula of the molecule.
Isomeric_SMILES (str): Isomeric Simplified Molecular Input Line Entry System (SMILES) representation.
Canonical_SMILES (str): Canonical SMILES representation.
NPlikelinessScoreResponse:
properties:
np_score:
type: number
title: Natural Product Likeness Score
description: The calculated natural product likeness score.
type: object
required:
- np_score
title: NPlikelinessScoreResponse
description: |-
Represents a response containing the natural product likeness score.
Properties:
- np_score (float): The calculated natural product likeness score.
examples:
- input: CN1C=NC2=C1C(=O)N(C(=O)N2C)C
message: Success
output: '-1.09'
NotFoundModel:
properties:
error:
type: string
title: Error
default: Not Found
detail:
type: string
title: Detail
type: object
required:
- detail
title: NotFoundModel
description: |-
Represents a Not Found response in an API.
Args:
detail (str): A detailed message indicating that the requested resource was not found.
Parent:
properties:
2D_mol:
type: string
title: 2D Mol
3D_mol:
type: string
title: 3D Mol
v3000:
type: string
title: V3000
representations:
$ref: '#/components/schemas/Representations'
descriptors:
$ref: '#/components/schemas/Descriptors'
type: object
required:
- 2D_mol
- 3D_mol
- v3000
- representations
- descriptors
title: Parent
description: |-
Represents the parent molecule with various properties.
Attributes:
field_2D_mol (str): The 2D molecular structure of the parent molecule.
field_3D_mol (str): The 3D molecular structure of the parent molecule.
v3000 (str): A specific molecular structure format.
representations (Representations): Molecular representations.
descriptors (Descriptors): Molecular descriptors.
Representations:
properties:
InChI:
type: string
title: Inchi
InChI_Key:
type: string
title: Inchi Key
Murko:
type: string
title: Murko
type: object
required:
- InChI
- InChI_Key
- Murko
title: Representations
description: |-
Represents different representations of a molecule.
Attributes:
InChI (str): IUPAC International Chemical Identifier (InChI) representation.
InChI_Key (str): InChI key.
Murko (str): Murcko scaffold representation.
SMILESStandardizedResult:
properties:
original:
$ref: '#/components/schemas/SMILESValidationResult'
standardized:
$ref: '#/components/schemas/SMILESValidationResult'
type: object
required:
- original
- standardized
title: SMILESStandardizedResult
description: |-
Represents the original and standardized versions of a molecule.
Attributes:
original (SMILESValidationResult): The original SMILES validation result.
standardized (SMILESValidationResult): The standardized SMILES validation result.
SMILESValidationResult:
properties:
smi:
type: string
title: Smi
messages:
items: {}
type: array
title: Messages
type: object
required:
- smi
- messages
title: SMILESValidationResult
description: |-
Represents the result of validating a SMILES string.
Attributes:
smi (str): The SMILES string.
messages (tuple): A tuple of messages indicating validation results.
Subclass:
properties:
name:
type: string
title: Name
description:
type: string
title: Description
chemont_id:
type: string
title: Chemont Id
url:
type: string
title: Url
type: object
required:
- name
- description
- chemont_id
- url
title: Subclass
description: |-
Represents a Subclass within a classification.
Attributes:
name (str): The name of the subclass.
description (str): Description of the subclass.
chemont_id (str): Identifier for the subclass.
url (str): URL associated with the subclass.
Superclass:
properties:
name:
type: string
title: Name
description:
type: string
title: Description
chemont_id:
type: string
title: Chemont Id
url:
type: string
title: Url
type: object
required:
- name
- description
- chemont_id
- url
title: Superclass
description: |-
Represents a Superclass in ClassyFire taxonomy.
Attributes:
name (str): The name of the Superclass.
description (str): The description of the Superclass.
chemont_id (str): The ChemOnt ID of the Superclass.
url (str): The URL associated with the Superclass.
TanimotoMatrixResponse:
properties:
similarity_matrix:
items: {}
type: array
title: Tanimoto Similarities
description: >-
The Tanimoto similarities as a 2D list representing the Tanimoto
similarity matrix.
type: object
required:
- similarity_matrix
title: TanimotoMatrixResponse
description: >-
Response model for Tanimoto similarity matrix.
Attributes:
- similarity_matrix (List[List[float]]): A 2D list representing the
Tanimoto similarity matrix.
Each inner list corresponds to a row in the matrix, and each value inside the inner list
represents the similarity score between two molecules.
examples:
- input: CCC,CC,CCC
message: Success
output: '[[1.0, 0.2, 1.0], [0.2, 1.0, 0.2], [1.0, 0.2, 1.0]]'
TanimotoSimilarityResponse:
properties:
similarity:
type: number
title: Tanimoto Similarity
description: The Tanimoto similarity index as a floating-point value.
type: object
required:
- similarity
title: TanimotoSimilarityResponse
description: |-
Represents the Tanimoto similarity index for a pair of SMILES strings.
Properties:
- similarity (float): The Tanimoto similarity index.
examples:
- input: CC1(C)OC2COC3(COS(N)(=O)=O)OC(C)(C)OC3C2O1,CC
message: Success
output: '0.024390243902439025'
ThreeDCoordinatesResponse:
properties:
molblock:
type: string
title: Molecule Block
description: The generated mol block with 3D coordinates as plain text.
type: object
required:
- molblock
title: ThreeDCoordinatesResponse
description: |-
Represents a response containing 3D coordinates for a molecule.
Properties:
- molblock (str): The generated mol block with 3D coordinates.
examples:
- input: CC
message: Success
output: |2-
RDKit 3D
2 1 0 0 0 0 0 0 0 0999 V2000
-0.7044 -0.0850 -0.4900 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.9017 -0.1353 0.4322 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
M END
TwoDCoordinatesResponse:
properties:
molblock:
type: string
title: Molecule Block
description: The generated mol block with 2D coordinates as plain text.
type: object
required:
- molblock
title: TwoDCoordinatesResponse
description: |-
Represents a response containing 2D coordinates for a molecule.
Properties:
- molblock (str): The generated mol block with 2D coordinates.
examples:
- input: CC
message: Success
output: |2-
CDK 09012308392D
2 1 0 0 0 0 0 0 0 0999 V2000
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.5000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
M END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment