# eDeriv2
A molecular graph generation and analysis toolkit using Graph Neural Networks for drug discovery and molecular design.
## Overview
eDeriv2 is a comprehensive Python package for molecular graph generation, analysis, and machine learning applications in chemistry and drug discovery. It provides state-of-the-art Graph Neural Network (GNN) models for molecular representation learning, graph generation, and molecular property prediction.
## Features
- **Molecular Graph Generation**: Advanced GNN-based models for generating molecular graphs
- **Graph Neural Networks**: Implementation of various GNN architectures (GVAE, GAE, EGATConv)
- **Molecular Analysis**: Tools for molecular property prediction and analysis
- **RDKit Integration**: Seamless integration with RDKit for molecular operations
- **DGL Support**: Built on Deep Graph Library (DGL) for efficient graph operations
- **PyTorch Backend**: Full PyTorch support for deep learning models
- **Visualization**: Built-in visualization tools for molecular graphs and results
## Installation
### From PyPI (Recommended)
```bash
pip install ederiv2
```
### From Source
```bash
# Clone the repository
git clone https://github.com/yourusername/eDeriv2.git
cd eDeriv2
# Install in development mode
pip install -e .
```
### Dependencies
The package requires the following key dependencies:
- Python >= 3.8
- PyTorch >= 1.9.0
- DGL >= 1.0.0
- RDKit >= 2022.9.1
- NumPy >= 1.21.0
- Pandas >= 1.3.0
For a complete list of dependencies, see `requirements.txt`.
## Quick Start
### Basic Usage
```python
import torch
from ederiv.graph_handler import DGLGraphHandler
from ederiv.gvae_models import GVAE
# Initialize a GVAE model
model = GVAE(
node_feat_dim=13,
edge_feat_dim=4,
hidden_dim=64,
latent_dim=32,
node_classes=13,
edge_classes=4
)
# Create a graph handler
handler = DGLGraphHandler()
# Your molecular data processing here
# ...
```
### Molecular Graph Generation
```python
from ederiv.graph_maker import DGLGraphMaker
from rdkit import Chem
# Create a graph maker
graph_maker = DGLGraphMaker()
# Convert SMILES to graph
smiles = "CCO"
mol = Chem.MolFromSmiles(smiles)
graph = graph_maker.create(mol, "rdkit_mol")
```
### Training a Model
```python
from ederiv.nn_tools.trainers import GVAETrainer
# Initialize trainer
trainer = GVAETrainer(model, device='cuda')
# Train the model
trainer.train(train_dataloader, val_dataloader, epochs=100)
```
## Project Structure
```
eDeriv2/
├── src/ # Main package source
│ ├── chem_handlers/ # Chemical data handling
│ ├── input_tools/ # Input processing tools
│ ├── nn_tools/ # Neural network utilities
│ ├── optm_tools/ # Optimization tools
│ ├── output_tools/ # Output and visualization
│ └── sys_tools/ # System utilities
├── assets/ # Data assets
├── outputs/ # Output files
├── training_plots/ # Training visualizations
├── setup.py # Package setup
├── pyproject.toml # Modern Python packaging
├── requirements.txt # Dependencies
└── README.md # This file
```
## Models
### GVAE (Graph Variational Autoencoder)
- **File**: `gvae_v1.py`, `gvae_v2.py`
- **Description**: Graph Variational Autoencoder for molecular graph generation
- **Features**: Encoder-decoder architecture with variational inference
### GAE (Graph Autoencoder)
- **File**: `gae.py`
- **Description**: Graph Autoencoder for graph representation learning
- **Features**: Simple autoencoder architecture for graphs
### EGATConv (Edge-aware Graph Attention)
- **File**: `graph_encoder.py`
- **Description**: Edge-aware Graph Attention Convolution
- **Features**: Attention mechanism for both nodes and edges
## Examples
### Molecular Property Prediction
```python
from ederiv.models import MolecularPropertyPredictor
# Initialize predictor
predictor = MolecularPropertyPredictor(model_path="path/to/model.pth")
# Predict properties
properties = predictor.predict(smiles_list)
```
### Graph Visualization
```python
from ederiv.utils import plot_molecules_and_fragments
# Visualize molecular graphs
plot_molecules_and_fragments(molecules, fragments, output_path="output.png")
```
## Contributing
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
### Development Setup
```bash
# Clone the repository
git clone https://github.com/yourusername/eDeriv2.git
cd eDeriv2
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Citation
If you use eDeriv2 in your research, please cite:
```bibtex
@software{ederiv2,
title={eDeriv2: A molecular graph generation and analysis toolkit},
author={eDeriv2 Team},
year={2024},
url={https://github.com/yourusername/eDeriv2}
}
```
## Support
- **Documentation**: [https://github.com/yourusername/eDeriv2#readme](https://github.com/yourusername/eDeriv2#readme)
- **Issues**: [https://github.com/yourusername/eDeriv2/issues](https://github.com/yourusername/eDeriv2/issues)
- **Discussions**: [https://github.com/yourusername/eDeriv2/discussions](https://github.com/yourusername/eDeriv2/discussions)
## Acknowledgments
- [RDKit](https://www.rdkit.org/) for molecular informatics
- [DGL](https://www.dgl.ai/) for deep graph library
- [PyTorch](https://pytorch.org/) for deep learning framework
Raw data
{
"_id": null,
"home_page": "https://github.com/yourusername/eDeriv2",
"name": "ederiv2",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "eDeriv2 Team <your.email@example.com>",
"keywords": "molecular-graphs, graph-neural-networks, chemistry, machine-learning, drug-discovery",
"author": "eDeriv2 Team",
"author_email": "eDeriv2 Team <your.email@example.com>",
"download_url": "https://files.pythonhosted.org/packages/ce/eb/fa915464c3f25e1abd9eeb7ed97e74d1ba275b6dfa4777645fc314246c85/ederiv2-0.1.2.tar.gz",
"platform": null,
"description": "# eDeriv2\n\nA molecular graph generation and analysis toolkit using Graph Neural Networks for drug discovery and molecular design.\n\n## Overview\n\neDeriv2 is a comprehensive Python package for molecular graph generation, analysis, and machine learning applications in chemistry and drug discovery. It provides state-of-the-art Graph Neural Network (GNN) models for molecular representation learning, graph generation, and molecular property prediction.\n\n## Features\n\n- **Molecular Graph Generation**: Advanced GNN-based models for generating molecular graphs\n- **Graph Neural Networks**: Implementation of various GNN architectures (GVAE, GAE, EGATConv)\n- **Molecular Analysis**: Tools for molecular property prediction and analysis\n- **RDKit Integration**: Seamless integration with RDKit for molecular operations\n- **DGL Support**: Built on Deep Graph Library (DGL) for efficient graph operations\n- **PyTorch Backend**: Full PyTorch support for deep learning models\n- **Visualization**: Built-in visualization tools for molecular graphs and results\n\n## Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install ederiv2\n```\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/eDeriv2.git\ncd eDeriv2\n\n# Install in development mode\npip install -e .\n```\n\n### Dependencies\n\nThe package requires the following key dependencies:\n- Python >= 3.8\n- PyTorch >= 1.9.0\n- DGL >= 1.0.0\n- RDKit >= 2022.9.1\n- NumPy >= 1.21.0\n- Pandas >= 1.3.0\n\nFor a complete list of dependencies, see `requirements.txt`.\n\n## Quick Start\n\n### Basic Usage\n\n```python\nimport torch\nfrom ederiv.graph_handler import DGLGraphHandler\nfrom ederiv.gvae_models import GVAE\n\n# Initialize a GVAE model\nmodel = GVAE(\n node_feat_dim=13,\n edge_feat_dim=4,\n hidden_dim=64,\n latent_dim=32,\n node_classes=13,\n edge_classes=4\n)\n\n# Create a graph handler\nhandler = DGLGraphHandler()\n\n# Your molecular data processing here\n# ...\n```\n\n### Molecular Graph Generation\n\n```python\nfrom ederiv.graph_maker import DGLGraphMaker\nfrom rdkit import Chem\n\n# Create a graph maker\ngraph_maker = DGLGraphMaker()\n\n# Convert SMILES to graph\nsmiles = \"CCO\"\nmol = Chem.MolFromSmiles(smiles)\ngraph = graph_maker.create(mol, \"rdkit_mol\")\n```\n\n### Training a Model\n\n```python\nfrom ederiv.nn_tools.trainers import GVAETrainer\n\n# Initialize trainer\ntrainer = GVAETrainer(model, device='cuda')\n\n# Train the model\ntrainer.train(train_dataloader, val_dataloader, epochs=100)\n```\n\n## Project Structure\n\n```\neDeriv2/\n\u251c\u2500\u2500 src/ # Main package source\n\u2502 \u251c\u2500\u2500 chem_handlers/ # Chemical data handling\n\u2502 \u251c\u2500\u2500 input_tools/ # Input processing tools\n\u2502 \u251c\u2500\u2500 nn_tools/ # Neural network utilities\n\u2502 \u251c\u2500\u2500 optm_tools/ # Optimization tools\n\u2502 \u251c\u2500\u2500 output_tools/ # Output and visualization\n\u2502 \u2514\u2500\u2500 sys_tools/ # System utilities\n\u251c\u2500\u2500 assets/ # Data assets\n\u251c\u2500\u2500 outputs/ # Output files\n\u251c\u2500\u2500 training_plots/ # Training visualizations\n\u251c\u2500\u2500 setup.py # Package setup\n\u251c\u2500\u2500 pyproject.toml # Modern Python packaging\n\u251c\u2500\u2500 requirements.txt # Dependencies\n\u2514\u2500\u2500 README.md # This file\n```\n\n## Models\n\n### GVAE (Graph Variational Autoencoder)\n- **File**: `gvae_v1.py`, `gvae_v2.py`\n- **Description**: Graph Variational Autoencoder for molecular graph generation\n- **Features**: Encoder-decoder architecture with variational inference\n\n### GAE (Graph Autoencoder)\n- **File**: `gae.py`\n- **Description**: Graph Autoencoder for graph representation learning\n- **Features**: Simple autoencoder architecture for graphs\n\n### EGATConv (Edge-aware Graph Attention)\n- **File**: `graph_encoder.py`\n- **Description**: Edge-aware Graph Attention Convolution\n- **Features**: Attention mechanism for both nodes and edges\n\n## Examples\n\n### Molecular Property Prediction\n\n```python\nfrom ederiv.models import MolecularPropertyPredictor\n\n# Initialize predictor\npredictor = MolecularPropertyPredictor(model_path=\"path/to/model.pth\")\n\n# Predict properties\nproperties = predictor.predict(smiles_list)\n```\n\n### Graph Visualization\n\n```python\nfrom ederiv.utils import plot_molecules_and_fragments\n\n# Visualize molecular graphs\nplot_molecules_and_fragments(molecules, fragments, output_path=\"output.png\")\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/eDeriv2.git\ncd eDeriv2\n\n# Create a virtual environment\npython -m venv venv\nsource venv/bin/activate # On Windows: venv\\Scripts\\activate\n\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Citation\n\nIf you use eDeriv2 in your research, please cite:\n\n```bibtex\n@software{ederiv2,\n title={eDeriv2: A molecular graph generation and analysis toolkit},\n author={eDeriv2 Team},\n year={2024},\n url={https://github.com/yourusername/eDeriv2}\n}\n```\n\n## Support\n\n- **Documentation**: [https://github.com/yourusername/eDeriv2#readme](https://github.com/yourusername/eDeriv2#readme)\n- **Issues**: [https://github.com/yourusername/eDeriv2/issues](https://github.com/yourusername/eDeriv2/issues)\n- **Discussions**: [https://github.com/yourusername/eDeriv2/discussions](https://github.com/yourusername/eDeriv2/discussions)\n\n## Acknowledgments\n\n- [RDKit](https://www.rdkit.org/) for molecular informatics\n- [DGL](https://www.dgl.ai/) for deep graph library\n- [PyTorch](https://pytorch.org/) for deep learning framework\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A molecular graph generation and analysis toolkit using Graph Neural Networks",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/yourusername/eDeriv2/issues",
"Documentation": "https://github.com/yourusername/eDeriv2#readme",
"Homepage": "https://github.com/yourusername/eDeriv2",
"Repository": "https://github.com/yourusername/eDeriv2"
},
"split_keywords": [
"molecular-graphs",
" graph-neural-networks",
" chemistry",
" machine-learning",
" drug-discovery"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "62d2fad6a85c1eefed4b721813947b3e353f6e4473a08dca3189272dacc94474",
"md5": "351d3a6f02b602812d1f18aa4a0b8797",
"sha256": "9dc7cf4bfe74dae9daf1905611000413da8ce71bce2bddeaa70587aad26471c2"
},
"downloads": -1,
"filename": "ederiv2-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "351d3a6f02b602812d1f18aa4a0b8797",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 50186,
"upload_time": "2025-08-13T20:57:18",
"upload_time_iso_8601": "2025-08-13T20:57:18.777661Z",
"url": "https://files.pythonhosted.org/packages/62/d2/fad6a85c1eefed4b721813947b3e353f6e4473a08dca3189272dacc94474/ederiv2-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ceebfa915464c3f25e1abd9eeb7ed97e74d1ba275b6dfa4777645fc314246c85",
"md5": "8efccfeebc5a0eebd6c424706f3605c9",
"sha256": "98309b155ba6cf33b849a10e30c919c5d6fad267e1ff66e8806aab58b0ddc82b"
},
"downloads": -1,
"filename": "ederiv2-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "8efccfeebc5a0eebd6c424706f3605c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 287954,
"upload_time": "2025-08-13T20:57:20",
"upload_time_iso_8601": "2025-08-13T20:57:20.161659Z",
"url": "https://files.pythonhosted.org/packages/ce/eb/fa915464c3f25e1abd9eeb7ed97e74d1ba275b6dfa4777645fc314246c85/ederiv2-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-13 20:57:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "eDeriv2",
"github_not_found": true,
"lcname": "ederiv2"
}