Skip to content

Commit ae2d163

Browse files
authored
Merge pull request #544 from Steinbeck-Lab/development
Feat: Frontend
2 parents 5d029cf + 4fe89cb commit ae2d163

File tree

101 files changed

+40503
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+40503
-601
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
* add roatation to CDKDepict ([01b90f0](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/01b90f06efa35459621c593f88ad18d130a0cb4f))
406406
* add rotation to CDKDepict ([9e3c29e](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/9e3c29ed6de98606d74ac74b3274721c3bf946d9))
407407
* add SMILES parser error handling ([9c9202a](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/9c9202a814cd64733edf99ecc9959e3c00780778))
408-
* add SRU, Murko framework and implement COCONUT related descriptors ([abf9991](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/abf9991815adbc98c48a0c1f19fdf1e0d162d326))
408+
* add SRU, Murcko framework and implement COCONUT related descriptors ([abf9991](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/abf9991815adbc98c48a0c1f19fdf1e0d162d326))
409409
* Add sugar removal utility [#231](https://github.com/Steinbeck-Lab/cheminformatics-microservice/issues/231) ([7d9d8cf](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/7d9d8cfc7f9fcf5fe6619a90441dd243fd67af7f))
410410
* Add table preview & JSON,HTML toggle [#76](https://github.com/Steinbeck-Lab/cheminformatics-microservice/issues/76),[#77](https://github.com/Steinbeck-Lab/cheminformatics-microservice/issues/77) ([7e2e063](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/7e2e0632f22f1bccee02dcbed387a6c67db8b3cc))
411411
* add test workflow ([d484b9d](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/d484b9d347b967883cc9c121f4ced6f6e7b63501))
@@ -884,7 +884,7 @@
884884

885885
### Features
886886

887-
* add SRU, Murko framework and implement COCONUT related descriptors ([abf9991](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/abf9991815adbc98c48a0c1f19fdf1e0d162d326))
887+
* add SRU, Murcko framework and implement COCONUT related descriptors ([abf9991](https://github.com/Steinbeck-Lab/cheminformatics-microservice/commit/abf9991815adbc98c48a0c1f19fdf1e0d162d326))
888888

889889

890890
### Bug Fixes

README.md

Lines changed: 86 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cheminformatics Microservice
1+
# Cheminformatics Microservice & UI
22

33
<p align="center">
44
<a href="https://api.naturalproducts.net/" target="_blank">
@@ -17,6 +17,8 @@
1717
<a href="https://www.tensorflow.org"><img src="https://img.shields.io/badge/TensorFlow-2.10.1-FF6F00.svg?style=flat&logo=tensorflow" alt="tensorflow"></a>
1818
<a href="https://cdk.github.io"><img src="https://img.shields.io/badge/Powered%20by-CDK-blue.svg?style=flat&logo=chem" alt="Powered by CDK"></a>
1919
<a href="https://www.rdkit.org/"><img src="https://img.shields.io/badge/Powered%20by-RDKit-3838ff.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEXc3NwUFP8UPP9kZP+MjP+0tP////9ZXZotAAAAAXRSTlMAQObYZgAAAAFiS0dEBmFmuH0AAAAHdElNRQfmAwsPGi+MyC9RAAAAQElEQVQI12NgQABGQUEBMENISUkRLKBsbGwEEhIyBgJFsICLC0iIUdnExcUZwnANQWfApKCK4doRBsKtQFgKAQC5Ww1JEHSEkAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMy0xMVQxNToyNjo0NyswMDowMDzr2J4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDMtMTFUMTU6MjY6NDcrMDA6MDBNtmAiAAAAAElFTkSuQmCC" alt="RDKit badge"></a>
20+
<a href="https://reactjs.org/"><img src="https://img.shields.io/badge/React-18.2.0-61DAFB.svg?style=flat&logo=react" alt="React"></a>
21+
<a href="https://tailwindcss.com/"><img src="https://img.shields.io/badge/Tailwind%20CSS-3.3.5-38B2AC.svg?style=flat&logo=tailwind-css" alt="Tailwind CSS"></a>
2022
</p>
2123

2224
<p align="center">
@@ -26,7 +28,7 @@
2628
</p>
2729

2830
<p align="center">
29-
<a href="https://fastapi.tiangolo.com/"><img src="https://img.shields.io/badge/Framework-FastAPI-blue?style" alt="framework"></a>
31+
<a href="https://fastapi.tiangolo.com/"><img src="https://img.shields.io/badge/Backend-FastAPI-blue?style" alt="backend framework"></a>
3032
<a href="https://api.naturalproducts.net/v1/docs#/"><img src="https://img.shields.io/badge/docs-fastapi-blue" alt="FastAPI Documentation"></a>
3133
<a href="https://cheminformatics-microservice.readthedocs.io/en/latest/?badge=latest"><img src="https://readthedocs.org/projects/cheminformatics-microservice/badge/?version=latest" alt="Documentation Status"></a>
3234
<a href="https://codecov.io/gh/Steinbeck-Lab/cheminformatics-microservice"><img src="https://codecov.io/gh/Steinbeck-Lab/cheminformatics-microservice/graph/badge.svg?token=5BIQJPNCBA" alt="codecov"></a>
@@ -35,27 +37,101 @@
3537

3638
## 🌐 Overview
3739

38-
A set of microservices to support cheminformatics through API calls. It primarily works with SMILES-based inputs and offers functionalities such as:
40+
A comprehensive cheminformatics solution consisting of:
3941

40-
- Translating between different machine-readable representations
41-
- Calculating Natural Product (NP) likeliness scores
42-
- Visualizing chemical structures
43-
- Generating descriptors
42+
1. **Backend Microservices API** that provides cheminformatics functionality through API calls:
43+
- Translating between different machine-readable representations
44+
- Calculating Natural Product (NP) likeliness scores
45+
- Visualizing chemical structures
46+
- Generating descriptors
47+
- Hosting instances of [DECIMER](https://github.com/Kohulan/DECIMER-Image_Transformer) for optical chemical structure recognition
48+
49+
2. **Modern React Frontend** that provides an intuitive user interface for:
50+
- Chemical structure analysis and validation
51+
- Format conversion (SMILES, InChI, IUPAC, etc.)
52+
- 2D and 3D molecular visualization
53+
- Optical Chemical Structure Recognition (OCSR)
54+
- Molecular property calculation
4455

45-
Additionally, it hosts instances of:
46-
- [DECIMER](https://github.com/Kohulan/DECIMER-Image_Transformer): A deep learning model for optical chemical structure recognition
4756
> Important Note: STOUT (Smiles-TO-iUpac-Translator) is currently unavailable due to legal issues.
4857
4958
## 📚 Documentation
5059

60+
### Backend API
61+
5162
Comprehensive documentation is available at: [https://docs.api.naturalproducts.net/](https://docs.api.naturalproducts.net/)
5263

5364
### API Swagger Docs
5465

5566
- Production: [https://api.naturalproducts.net/latest/docs](https://api.naturalproducts.net/latest/docs)
5667
- Development: [https://dev.api.naturalproducts.net/latest/docs](https://dev.api.naturalproducts.net/latest/docs)
5768

58-
## 💻 Installation
69+
## ⚛️ Frontend Application
70+
71+
The frontend application provides a modern, user-friendly interface to the cheminformatics microservices.
72+
73+
### Key Features
74+
75+
- **Chemical Analysis Tools:**
76+
- Structure validation and standardization
77+
- Molecular descriptor calculation
78+
- Stereoisomer generation
79+
- Natural product likeness scoring
80+
- Functional group detection (Ertl)
81+
- Tautomer standardization
82+
- HOSE code generation
83+
- Tanimoto similarity calculation
84+
85+
- **Format Conversion:**
86+
- SMILES to various chemical formats (InChI, InChIKey, SELFIES, etc.)
87+
- IUPAC name to SMILES conversion
88+
- 2D/3D coordinate generation (Molblock)
89+
90+
- **Molecule Depiction:**
91+
- 2D molecule visualization with customizable settings
92+
- Interactive 3D molecule visualization
93+
- Batch depiction for multiple molecules
94+
95+
- **OCSR (Optical Chemical Structure Recognition):**
96+
- Convert chemical structure images to SMILES notation
97+
98+
### Technical Stack
99+
100+
- **React 18:** Core UI library
101+
- **React Router 6:** Client-side routing
102+
- **Tailwind CSS:** Utility-first styling
103+
- **Framer Motion:** Enhanced UI animations
104+
- **Axios:** API communication
105+
- **React Dropzone:** File upload handling
106+
107+
### Frontend Architecture
108+
109+
- **Component-Based Design:** Modular components for reusability and maintainability
110+
- **Service Layer:** Specialized services for API interaction
111+
- **Context API:** Global state management for theme, recent molecules, etc.
112+
- **Responsive Design:** Mobile-first approach with responsive layouts
113+
- **Dark/Light Theme:** Full theme support with Tailwind dark mode
114+
115+
### Installation & Setup (Frontend)
116+
117+
```bash
118+
# Clone the repository
119+
git clone https://github.com/Steinbeck-Lab/cheminformatics-microservice.git
120+
cd cheminformatics-microservice/frontend
121+
122+
# Install dependencies
123+
npm install
124+
125+
# Start development server
126+
npm start
127+
128+
# Build for production
129+
npm run build
130+
```
131+
132+
For detailed frontend configuration options, see the [Frontend Documentation](https://docs.api.naturalproducts.net/frontend.html).
133+
134+
## 💻 Backend Installation
59135

60136
You can run Cheminformatics Microservice in multiple ways:
61137

app/main.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,26 @@ def create_app_metadata() -> Dict:
3232
"contact": {
3333
"name": "Steinbeck Lab",
3434
"url": "https://cheminf.uni-jena.de",
35-
"email": "[email protected]"
35+
"email": "[email protected]",
3636
},
3737
"license_info": {
3838
"name": "CC BY 4.0",
39-
"url": "https://creativecommons.org/licenses/by/4.0"
39+
"url": "https://creativecommons.org/licenses/by/4.0",
4040
},
41-
"openapi_tags": [{
42-
"name": "Chemical Analysis",
43-
"description": "Advanced molecular structure analysis and property prediction"
44-
}, {
45-
"name": "Visualization",
46-
"description": "High-fidelity chemical structure rendering and visualization"
47-
}, {
48-
"name": "Conversion",
49-
"description": "Sophisticated molecular format transformation tools"
50-
}]
41+
"openapi_tags": [
42+
{
43+
"name": "Chemical Analysis",
44+
"description": "Advanced molecular structure analysis and property prediction",
45+
},
46+
{
47+
"name": "Visualization",
48+
"description": "High-fidelity chemical structure rendering and visualization",
49+
},
50+
{
51+
"name": "Conversion",
52+
"description": "Sophisticated molecular format transformation tools",
53+
},
54+
],
5155
}
5256

5357

app/modules/coconut/descriptors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from app.modules.npscorer import get_np_score
88
from app.modules.toolkits.cdk_wrapper import get_CDK_descriptors
99
from app.modules.toolkits.cdk_wrapper import get_CDK_MolecularFormula
10-
from app.modules.toolkits.cdk_wrapper import get_murko_framework
10+
from app.modules.toolkits.cdk_wrapper import get_murcko_framework
1111
from app.modules.toolkits.helpers import parse_input
1212
from app.modules.toolkits.rdkit_wrapper import get_rdkit_descriptors
1313
from app.modules.tools.sugar_removal import get_sugar_info
@@ -59,7 +59,7 @@ def get_COCONUT_descriptors(smiles: str, toolkit: str) -> Union[Dict[str, float]
5959

6060
cdkMolecule = parse_input(smiles, "cdk", False)
6161
hasLinearSugar, hasCircularSugars = get_sugar_info(cdkMolecule)
62-
framework = get_murko_framework(cdkMolecule)
62+
framework = get_murcko_framework(cdkMolecule)
6363
molFormula = get_CDK_MolecularFormula(cdkMolecule)
6464

6565
CombinedDescriptors = list(Descriptors)
@@ -93,7 +93,7 @@ def get_COCONUT_descriptors(smiles: str, toolkit: str) -> Union[Dict[str, float]
9393
{
9494
"linear_sugars": hasLinearSugar,
9595
"circular_sugars": hasCircularSugars,
96-
"murko_framework": framework,
96+
"murcko_framework": framework,
9797
"nplikeness": nplikeliness,
9898
"molecular_formula": str(molFormula),
9999
},

app/modules/coconut/preprocess.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,17 @@ def get_representations(molecule: Chem.Mol) -> dict:
158158
molecule (Chem.Mol): An RDKit molecule object representing the molecular structure.
159159
160160
Returns:
161-
dict: Dictionary containing InChI, InChi Key, and Murko framework.
161+
dict: Dictionary containing InChI, InChi Key, and Murcko framework.
162162
"""
163163
if molecule:
164164
InChI = Chem.inchi.MolToInchi(molecule)
165165
InChI_Key = Chem.inchi.MolToInchiKey(molecule)
166166
cdkMolecule = parse_input(Chem.MolToSmiles(molecule), "cdk", False)
167-
Murko = cdk.get_murko_framework(cdkMolecule)
167+
Murcko = cdk.get_murcko_framework(cdkMolecule)
168168
return {
169169
"standard_inchi": InChI,
170170
"standard_inchikey": InChI_Key,
171-
"murko_framework": Murko,
171+
"Murcko_framework": Murcko,
172172
}
173173
else:
174174
return {"Error": "Check input SMILES"}

0 commit comments

Comments
 (0)