Skip to content

Commit

Permalink
Merge pull request #152 from Steinbeck-Lab/development
Browse files Browse the repository at this point in the history
New Developments
  • Loading branch information
CS76 authored Jun 5, 2023
2 parents dd124b2 + 2c361a8 commit 75b201c
Show file tree
Hide file tree
Showing 16 changed files with 4,856 additions and 9,447 deletions.
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
FROM debian:buster-20230227-slim AS cheminf-python-ms
FROM continuumio/miniconda3 AS cheminf-python-ms

ENV PYTHON_VERSION=3.10
ENV RDKIT_VERSION=2023.03.1

ARG RELEASE_VERSION
ENV RELEASE_VERSION=${RELEASE_VERSION}

# Install runtime dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
python3 \
python3-pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-get update -y && \
apt-get install -y openjdk-11-jre

RUN conda install -c conda-forge python>=$PYTHON_VERSION
RUN conda install -c conda-forge rdkit>=RDKIT_VERSION

RUN python3 -m pip install -U pip

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
Expand Down
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[![framework](https://img.shields.io/badge/Framework-FastAPI-blue?style)](https://fastapi.tiangolo.com/)
[![FastAPI Documentation](https://img.shields.io/badge/docs-fastapi-blue)](https://api.naturalproducts.net/docs#/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7747862.svg)](https://doi.org/10.5281/zenodo.7747862)
## Overview of Cheminformatics Micro Services
## Overview of Cheminformatics Python Microservices

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](https://github.com/Kohulan/Smiles-TO-iUpac-Translator) and another instance of [DECIMER](https://github.com/Kohulan/DECIMER-Image_Transformer) (two deep learning models for IUPAC name generation and optical chemical structure recognition, respectively).

Expand All @@ -23,37 +23,37 @@ This set of essential and valuable microservices is designed to be accessed via

- SMILES to IUPAC name
```fastapi
https://api.naturalproducts.net/convert/iupac?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
https://api.naturalproducts.net/v1/convert/iupac?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
```
- SMILES to SELFIES
```fastapi
https://api.naturalproducts.net/convert/selfies?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
https://api.naturalproducts.net/v1/convert/selfies?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
```
- SMILES to mol (default: CDK)
```fastapi
https://api.naturalproducts.net/convert/mol?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
https://api.naturalproducts.net/v1/convert/mol?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
```
```fastapi
https://api.naturalproducts.net/convert/mol?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C&generator=rdkit
https://api.naturalproducts.net/v1/convert/mol?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C&generator=rdkit
```

- Chem

- Calculate Descriptors
```fastapi
https://api.naturalproducts.net/chem/descriptors?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
https://api.naturalproducts.net/v1/chem/descriptors?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
```
- Depict molecule (default: CDK)
```fastapi
https://api.naturalproducts.net/chem/depict?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
https://api.naturalproducts.net/v1/chem/depict?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
```
- Depict molecule with settings
```fastapi
https://api.naturalproducts.net/chem/depict?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C&generator=rdkit&width=256&height=256&rotate=75
https://api.naturalproducts.net/v1/chem/depict?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C&generator=rdkit&width=256&height=256&rotate=75
```
- Visualize molecule in 3D
```fastapi
https://api.naturalproducts.net/chem/depict3D?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
https://api.naturalproducts.net/v1/chem/depict3D?smiles=CN1C=NC2=C1C(=O)N(C(=O)N2C)C
```

> **Note**
Expand All @@ -65,10 +65,28 @@ This project is licensed under the MIT License - see the [LICENSE](https://githu

## Citation

Venkata, C., Sharma, N., & Rajan, K. (2023). cheminformatics-python-microservice (Version v0.3.0 - prerelease) [Computer software]. https://doi.org/10.5281/zenodo.7747862
Venkata, C., Sharma, N., & Rajan, K. (2023). Cheminformatics Python Microservice (Version v0.8.0 - prerelease) [Computer software]. https://doi.org/10.5281/zenodo.7747862

## Version information
<p align="center">
<b>Cheminformatics Python Microservice: V0.8.0</b>
</p>

<p align="center">

| Tools | Version |
|------------|-----------|
| RDKit | 2023.03.1 |
| CDK | 2.8.0 |
| STOUT | 2.0.0 |
| DECIMER | 2.2.0 |

</p>



## Maintained by

Cheminformatics Micro Services and [Natural Products Online](https://naturalproducts.net) are developed and maintained by the [Steinbeck group](https://cheminf.uni-jena.de) at the [Friedrich Schiller University](https://www.uni-jena.de/en/) Jena, Germany.
Cheminformatics Python Microservice and [Natural Products Online](https://naturalproducts.net) are developed and maintained by the [Steinbeck group](https://cheminf.uni-jena.de) at the [Friedrich Schiller University](https://www.uni-jena.de/en/) Jena, Germany.
The code for this web application is released under the [MIT license](https://opensource.org/licenses/MIT). Copyright © CC-BY-SA 2023
<p align="center"><a href="https://cheminf.uni-jena.de/" target="_blank"><img src="https://github.com/Kohulan/DECIMER-Image-to-SMILES/blob/master/assets/CheminfGit.png" width="800" alt="cheminf Logo"></a></p>
12 changes: 12 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-

"""
Cheminformatics Micro Services Python Modules.
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).
For comments, bug reports or feature requests,
please raise a issue on our Github repository.
"""

__version__ = "0.8.0"
12 changes: 0 additions & 12 deletions app/config.py

This file was deleted.

53 changes: 31 additions & 22 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
from fastapi import FastAPI
from fastapi.responses import RedirectResponse
from fastapi_versioning import VersionedFastAPI

# from .config import settings
from .routers import chem, converters, compose, decimer
from .routers import chem, converters, decimer
from fastapi.middleware.cors import CORSMiddleware
from fastapi.openapi.utils import get_openapi
import os

app = FastAPI()
app = FastAPI(
title="Cheminf Micro Services",
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).",
terms_of_service="https://github.com/Steinbeck-Lab",
contact={
"name": "Steinbeck Lab",
"url": "https://cheminf.uni-jena.de/",
"email": "caffeine@listserv.uni-jena.de",
},
license_info={
"name": "CC BY 4.0",
"url": "https://creativecommons.org/licenses/by/4.0/",
},
)

origins = ["*"]

Expand All @@ -21,7 +33,6 @@

app.include_router(chem.router)
app.include_router(converters.router)
app.include_router(compose.router)
app.include_router(decimer.router)


Expand All @@ -30,20 +41,18 @@ async def docs_redirect():
return RedirectResponse(url="/docs")


def custom_openapi():
if app.openapi_schema:
return app.openapi_schema
openapi_schema = get_openapi(
title="Cheminf Micro Services",
version=os.getenv("RELEASE_VERSION", "latest"),
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).",
routes=app.routes,
)
openapi_schema["info"]["x-logo"] = {
"url": "https://github.com/Steinbeck-Lab/cheminformatics-python-microservice/raw/main/public/img/logo.png"
}
app.openapi_schema = openapi_schema
return app.openapi_schema


app.openapi = custom_openapi
app = VersionedFastAPI(
app,
version_format="{major}",
prefix_format="/v{major}",
terms_of_service="https://github.com/Steinbeck-Lab",
contact={
"name": "Steinbeck Lab",
"url": "https://cheminf.uni-jena.de/",
"email": "caffeine@listserv.uni-jena.de",
},
license_info={
"name": "CC BY 4.0",
"url": "https://creativecommons.org/licenses/by/4.0/",
},
)
2 changes: 1 addition & 1 deletion app/modules/alldescriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def getCDKRDKitcombinedDescriptors(smiles: str):
"Heavy atom count",
"Molecular weight",
"Exact molecular weight",
"ALogP",
"Calculated LogP",
"Rotatable bond count",
"Topological polar surface area",
"Hydrogen bond acceptors",
Expand Down
Loading

0 comments on commit 75b201c

Please sign in to comment.