The 3D Molecule-Text Interpretation Project is an interactive web application built with Streamlit that interprets natural language queries or PubChem CIDs to visualize 3D molecular structures and retrieve chemical properties. By leveraging PubChem's API, RDKit, and py3Dmol, the app allows users to explore molecules using text inputs like "Acetylsalicylic acid" or numeric CIDs like "2244". The project combines natural language processing (spaCy) with cheminformatics for a seamless user experience.
- Text Query Interpretation: Parse compound names from natural language inputs using spaCy.
- CID Support: Directly query molecules using PubChem Compound IDs.
- 3D Visualization: Render interactive 3D molecular structures with atom labels using py3Dmol.
- Chemical Properties: Retrieve properties like molecular weight, XLogP, complexity, and hydrogen bond counts from PubChem.
- Dark Theme UI: Sleek, user-friendly interface for better visibility.
- Robust Error Handling: Graceful handling of invalid inputs, API errors, and visualization issues.
# Create a virtual environment (recommended)
python -m venv venv
# Activate the environment
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Download spaCy language model
python -m spacy download en_core_web_sm# Run the Streamlit app
streamlit run molecular_explorer.py-
Open the app in your browser (usually http://localhost:8501)
-
Select input type: "Compound Name" or "CID"
-
Enter a query (e.g.,
"Acetylsalicylic acid"or"2244") -
Click Visualize to display:
- 3D molecular structure with atom labels
- IUPAC name and SMILES string
- Chemical properties (MW, XLogP, etc.)
- Compound Name:
"Acetylsalicylic acid" - CID:
"2244"
- Interactive 3D molecular structure
- IUPAC Name, SMILES string
- Molecular Weight, Exact Mass, XLogP, Complexity
- Rotatable Bond Count, H-Bond Donors/Acceptors
We welcome contributions!
-
Fork the repository
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Commit your changes:
git commit -m "Add your feature" -
Push to your branch:
git push origin feature/your-feature-name
-
Open a Pull Request with a clear description
This project is licensed under the MIT License. See the LICENSE file for details.
- Open an issue on this repository
- Connect via YouTube - CartoonWorldVM
- GitHub: VipinMI2024
- PubChem for providing chemical data APIs
- RDKit for cheminformatics tools
- py3Dmol for molecular visualization
- spaCy for NLP
- Streamlit for web deployment
Built with passion by Vipin Mishra