# Optimus Chem - Comprehensive Chemical Analysis Package
<div align="center">
<img src="https://raw.githubusercontent.com/pritampanda15/Optimus_Chemical_Analyzer/main/logo.png" alt="Optimus Logo" width="300">
</div>
<img src="https://img.shields.io/badge/Python-3.7%2B-blue.svg" alt="Python 3.7+">
<img src="https://img.shields.io/badge/RDKit-Latest-green.svg" alt="RDKit">
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT License">
Optimus Chem is a comprehensive Python package for molecular property calculations and ADMET (Absorption, Distribution, Metabolism, Excretion, Toxicity) rules analysis. It provides accurate calculations matching Discovery Studio standards for drug discovery applications.
## Features
### Molecular Property Calculations
- **Accurate RDKit-based calculations** matching Discovery Studio standards
- Molecular weight, LogP, LogD, pKa predictions
- Hydrogen bond donors/acceptors
- Topological Polar Surface Area (TPSA)
- Rotatable bonds and ring analysis
- Molar refractivity and more
### Complete ADMET Rules Analysis
Implementation of all 14 major drug screening rules:
1. **Lipinski (Ro5)** - Oral bioavailability
2. **Veber** - Permeability and solubility
3. **Ghose** - Drug-likeness
4. **Egan** - Oral absorption
5. **Muegge** - Broad drug-likeness
6. **Rule of 3** - Fragment-based design
7. **CNS MPO** - CNS exposure potential
8. **bRo5** - Non-classical scaffolds
9. **PAINS** - False positive alerts
10. **Pfizer 3/75** - Promiscuity/toxicity alert
11. **GSK 4/400** - ADMET risk reduction
12. **Lead-likeness** - Lead compound transition
13. **Brenk filters** - Unstable/toxic groups
14. **REOS** - Rapid compound filtering
### 🔧 Easy-to-Use API
```python
from optimus import ChemicalAnalyzer
analyzer = ChemicalAnalyzer()
results = analyzer.analyze_smiles("CCO") # Ethanol
print(results.lipinski_violations) # 0
print(results.drug_likeness_score) # 0.85
```
## Installation
```bash
pip install optimus-chem
```
### From Source
```bash
https://github.com/pritampanda15/Optimus_Chemical_Analyzer
cd Optimus_Chemical_Analyzer
pip install -e .
```
## Quick Start
### Basic Analysis
```python
from optimus import ChemicalAnalyzer
# Initialize analyzer
analyzer = ChemicalAnalyzer()
# Analyze a compound
results = analyzer.analyze_smiles("CC(=O)OC1=CC=CC=C1C(=O)O") # Aspirin
# Access results
print(f"Molecular Weight: {results.molecular_weight:.2f}")
print(f"LogP: {results.logp:.2f}")
print(f"Lipinski Violations: {results.lipinski_violations}")
print(f"Drug-likeness Score: {results.drug_likeness_score:.2f}")
```
### Batch Analysis
```python
smiles_list = [
"CCO", # Ethanol
"CC(=O)OC1=CC=CC=C1C(=O)O", # Aspirin
"CN1C=NC2=C1C(=O)N(C(=O)N2C)C" # Caffeine
]
results = analyzer.analyze_batch(smiles_list)
df = results.to_dataframe()
print(df[['SMILES', 'MW', 'LogP', 'Lipinski_Violations']])
```
### Command Line Interface
#### Available Commands
```bash
optimus --help
```
**Options:**
- `--version` Show the version and exit.
- `--help` Show this message and exit.
**Commands:**
- `analyze` Analyze a single SMILES string.
- `batch` Analyze multiple compounds from a file.
- `report` Generate HTML report from analysis results.
- `validate` Validate a SMILES string.
#### Command Usage Examples
```bash
# Get help for specific commands
optimus analyze --help
optimus batch --help
optimus report --help
optimus validate --help
# Analyze single compound
optimus analyze "CCO"
# Analyze from file
optimus batch compounds.smi --output results.csv
# Generate report
optimus report compounds.smi --format html
# Validate SMILES
optimus validate "CCO"
```
## API Reference
### ChemicalAnalyzer Class
#### Methods
- `analyze_smiles(smiles: str) -> AnalysisResult`
- `analyze_batch(smiles_list: List[str]) -> BatchResult`
- `analyze_mol(mol: Mol) -> AnalysisResult`
- `analyze_sdf(sdf_file: str) -> BatchResult`
#### Properties Calculated
- `molecular_weight`: Molecular weight (Da)
- `logp`: Partition coefficient
- `logd`: Distribution coefficient at pH 7.4
- `pka`: Acid dissociation constant
- `hbd`: Hydrogen bond donors
- `hba`: Hydrogen bond acceptors
- `tpsa`: Topological polar surface area
- `rotatable_bonds`: Number of rotatable bonds
- `aromatic_rings`: Number of aromatic rings
- `molar_refractivity`: Molar refractivity
#### ADMET Rules
Each rule returns a `RuleResult` object with:
- `passed`: Boolean indicating if rule is satisfied
- `violations`: Number of violations
- `details`: Detailed breakdown of criteria
## HTML Report Generation
Optimus can generate comprehensive HTML reports with interactive visualizations and detailed analysis results:
```python
from optimus import ChemicalAnalyzer
analyzer = ChemicalAnalyzer()
# Analyze multiple compounds
smiles_list = [
"CCO", # Ethanol
"CC(=O)OC1=CC=CC=C1C(=O)O", # Aspirin
"CN1C=NC2=C1C(=O)N(C(=O)N2C)C" # Caffeine
]
# Generate HTML report
analyzer.generate_html_report(smiles_list, output_file="analysis_report.html")
```
### Command Line HTML Report
```bash
# Generate HTML report from SMILES file
optimus report compounds.smi --format html --output report.html
```
The HTML report includes:
- **Summary Statistics**: Total compounds, success rates, average properties
- **Rule Pass Rates**: Pass/fail statistics for all 14 ADMET rules
- **Individual Results**: Detailed breakdown for each compound with color-coded pass/fail indicators
- **Interactive Features**: Sortable tables and responsive design
### Sample HTML Output Features:
- ✅ **Pass/Fail Indicators**: Green for pass, red for fail, gray for N/A
- **Summary Tables**: Key metrics and rule compliance rates
- **Detailed Analysis**: Molecular properties and ADMET rule results
- **Responsive Design**: Works on desktop and mobile devices
## Examples
### Drug-likeness Assessment
```python
from optimus import ChemicalAnalyzer
import pandas as pd
analyzer = ChemicalAnalyzer()
# FDA approved drugs
fda_drugs = [
"CC(=O)OC1=CC=CC=C1C(=O)O", # Aspirin
"CC(C)CC1=CC=C(C=C1)C(C)C(=O)O", # Ibuprofen
"CN1C=NC2=C1C(=O)N(C(=O)N2C)C", # Caffeine
]
results = []
for smiles in fda_drugs:
result = analyzer.analyze_smiles(smiles)
results.append({
'SMILES': smiles,
'MW': result.molecular_weight,
'LogP': result.logp,
'Lipinski_Pass': result.lipinski.passed,
'Drug_Score': result.drug_likeness_score
})
df = pd.DataFrame(results)
print(df)
```
### CNS Drug Analysis
```python
# Analyze CNS penetration potential
result = analyzer.analyze_smiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C") # Caffeine
print(f"CNS MPO Score: {result.cns_mpo.score}")
print(f"BBB Permeability: {result.bbb_permeability}")
print(f"P-gp Substrate: {result.pgp_substrate}")
```
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Citation
If you use Optimus in your research, please cite:
```
Optimus Chem: Comprehensive Chemical Analysis Package for Drug Discovery
P.K.Panda.et al. (2025)
```
## Support
- 📧 Email: pritam@stanford.edu
- 🐛 Issues: [GitHub Issues](https://github.com/pritampanda15/Optimus_Chemical_Analyzer)
Raw data
{
"_id": null,
"home_page": "https://github.com/pritampanda15/Optimus_Chemical_Analyzer",
"name": "optimus-chem",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Pritam Kumar Panda",
"author_email": "pritam@stanford.edu",
"download_url": "https://files.pythonhosted.org/packages/6a/ee/5ca9bc0686ed61ea78ca929d37ece90fab30173cc3a4704e07e33963adda/optimus_chem-1.0.0.tar.gz",
"platform": null,
"description": "# Optimus Chem - Comprehensive Chemical Analysis Package\n\n<div align=\"center\">\n <img src=\"https://raw.githubusercontent.com/pritampanda15/Optimus_Chemical_Analyzer/main/logo.png\" alt=\"Optimus Logo\" width=\"300\">\n</div>\n\n<img src=\"https://img.shields.io/badge/Python-3.7%2B-blue.svg\" alt=\"Python 3.7+\">\n<img src=\"https://img.shields.io/badge/RDKit-Latest-green.svg\" alt=\"RDKit\">\n<img src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"MIT License\">\n\nOptimus Chem is a comprehensive Python package for molecular property calculations and ADMET (Absorption, Distribution, Metabolism, Excretion, Toxicity) rules analysis. It provides accurate calculations matching Discovery Studio standards for drug discovery applications.\n\n## Features\n\n### Molecular Property Calculations\n- **Accurate RDKit-based calculations** matching Discovery Studio standards\n- Molecular weight, LogP, LogD, pKa predictions\n- Hydrogen bond donors/acceptors\n- Topological Polar Surface Area (TPSA)\n- Rotatable bonds and ring analysis\n- Molar refractivity and more\n\n### Complete ADMET Rules Analysis\nImplementation of all 14 major drug screening rules:\n\n1. **Lipinski (Ro5)** - Oral bioavailability\n2. **Veber** - Permeability and solubility \n3. **Ghose** - Drug-likeness\n4. **Egan** - Oral absorption\n5. **Muegge** - Broad drug-likeness\n6. **Rule of 3** - Fragment-based design\n7. **CNS MPO** - CNS exposure potential\n8. **bRo5** - Non-classical scaffolds\n9. **PAINS** - False positive alerts\n10. **Pfizer 3/75** - Promiscuity/toxicity alert\n11. **GSK 4/400** - ADMET risk reduction\n12. **Lead-likeness** - Lead compound transition\n13. **Brenk filters** - Unstable/toxic groups\n14. **REOS** - Rapid compound filtering\n\n### \ud83d\udd27 Easy-to-Use API\n```python\nfrom optimus import ChemicalAnalyzer\n\nanalyzer = ChemicalAnalyzer()\nresults = analyzer.analyze_smiles(\"CCO\") # Ethanol\nprint(results.lipinski_violations) # 0\nprint(results.drug_likeness_score) # 0.85\n```\n\n## Installation\n\n```bash\npip install optimus-chem\n```\n\n### From Source\n```bash\nhttps://github.com/pritampanda15/Optimus_Chemical_Analyzer\ncd Optimus_Chemical_Analyzer\npip install -e .\n```\n\n## Quick Start\n\n### Basic Analysis\n```python\nfrom optimus import ChemicalAnalyzer\n\n# Initialize analyzer\nanalyzer = ChemicalAnalyzer()\n\n# Analyze a compound\nresults = analyzer.analyze_smiles(\"CC(=O)OC1=CC=CC=C1C(=O)O\") # Aspirin\n\n# Access results\nprint(f\"Molecular Weight: {results.molecular_weight:.2f}\")\nprint(f\"LogP: {results.logp:.2f}\")\nprint(f\"Lipinski Violations: {results.lipinski_violations}\")\nprint(f\"Drug-likeness Score: {results.drug_likeness_score:.2f}\")\n```\n\n### Batch Analysis\n```python\nsmiles_list = [\n \"CCO\", # Ethanol\n \"CC(=O)OC1=CC=CC=C1C(=O)O\", # Aspirin\n \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" # Caffeine\n]\n\nresults = analyzer.analyze_batch(smiles_list)\ndf = results.to_dataframe()\nprint(df[['SMILES', 'MW', 'LogP', 'Lipinski_Violations']])\n```\n\n### Command Line Interface\n\n#### Available Commands\n```bash\noptimus --help\n```\n\n**Options:**\n- `--version` Show the version and exit.\n- `--help` Show this message and exit.\n\n**Commands:**\n- `analyze` Analyze a single SMILES string.\n- `batch` Analyze multiple compounds from a file.\n- `report` Generate HTML report from analysis results.\n- `validate` Validate a SMILES string.\n\n#### Command Usage Examples\n```bash\n# Get help for specific commands\noptimus analyze --help\noptimus batch --help\noptimus report --help\noptimus validate --help\n\n# Analyze single compound\noptimus analyze \"CCO\"\n\n# Analyze from file\noptimus batch compounds.smi --output results.csv\n\n# Generate report\noptimus report compounds.smi --format html\n\n# Validate SMILES\noptimus validate \"CCO\"\n```\n\n## API Reference\n\n### ChemicalAnalyzer Class\n\n#### Methods\n- `analyze_smiles(smiles: str) -> AnalysisResult`\n- `analyze_batch(smiles_list: List[str]) -> BatchResult`\n- `analyze_mol(mol: Mol) -> AnalysisResult`\n- `analyze_sdf(sdf_file: str) -> BatchResult`\n\n#### Properties Calculated\n- `molecular_weight`: Molecular weight (Da)\n- `logp`: Partition coefficient\n- `logd`: Distribution coefficient at pH 7.4\n- `pka`: Acid dissociation constant\n- `hbd`: Hydrogen bond donors\n- `hba`: Hydrogen bond acceptors\n- `tpsa`: Topological polar surface area\n- `rotatable_bonds`: Number of rotatable bonds\n- `aromatic_rings`: Number of aromatic rings\n- `molar_refractivity`: Molar refractivity\n\n#### ADMET Rules\nEach rule returns a `RuleResult` object with:\n- `passed`: Boolean indicating if rule is satisfied\n- `violations`: Number of violations\n- `details`: Detailed breakdown of criteria\n\n\n## HTML Report Generation\n\nOptimus can generate comprehensive HTML reports with interactive visualizations and detailed analysis results:\n\n```python\nfrom optimus import ChemicalAnalyzer\n\nanalyzer = ChemicalAnalyzer()\n\n# Analyze multiple compounds\nsmiles_list = [\n \"CCO\", # Ethanol\n \"CC(=O)OC1=CC=CC=C1C(=O)O\", # Aspirin\n \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\" # Caffeine\n]\n\n# Generate HTML report\nanalyzer.generate_html_report(smiles_list, output_file=\"analysis_report.html\")\n```\n\n### Command Line HTML Report\n```bash\n# Generate HTML report from SMILES file\noptimus report compounds.smi --format html --output report.html\n```\n\nThe HTML report includes:\n- **Summary Statistics**: Total compounds, success rates, average properties\n- **Rule Pass Rates**: Pass/fail statistics for all 14 ADMET rules\n- **Individual Results**: Detailed breakdown for each compound with color-coded pass/fail indicators\n- **Interactive Features**: Sortable tables and responsive design\n\n### Sample HTML Output Features:\n- \u2705 **Pass/Fail Indicators**: Green for pass, red for fail, gray for N/A\n- **Summary Tables**: Key metrics and rule compliance rates\n- **Detailed Analysis**: Molecular properties and ADMET rule results\n- **Responsive Design**: Works on desktop and mobile devices\n\n## Examples\n\n### Drug-likeness Assessment\n```python\nfrom optimus import ChemicalAnalyzer\nimport pandas as pd\n\nanalyzer = ChemicalAnalyzer()\n\n# FDA approved drugs\nfda_drugs = [\n \"CC(=O)OC1=CC=CC=C1C(=O)O\", # Aspirin\n \"CC(C)CC1=CC=C(C=C1)C(C)C(=O)O\", # Ibuprofen\n \"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\", # Caffeine\n]\n\nresults = []\nfor smiles in fda_drugs:\n result = analyzer.analyze_smiles(smiles)\n results.append({\n 'SMILES': smiles,\n 'MW': result.molecular_weight,\n 'LogP': result.logp,\n 'Lipinski_Pass': result.lipinski.passed,\n 'Drug_Score': result.drug_likeness_score\n })\n\ndf = pd.DataFrame(results)\nprint(df)\n```\n\n### CNS Drug Analysis\n```python\n# Analyze CNS penetration potential\nresult = analyzer.analyze_smiles(\"CN1C=NC2=C1C(=O)N(C(=O)N2C)C\") # Caffeine\n\nprint(f\"CNS MPO Score: {result.cns_mpo.score}\")\nprint(f\"BBB Permeability: {result.bbb_permeability}\")\nprint(f\"P-gp Substrate: {result.pgp_substrate}\")\n```\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\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 Optimus in your research, please cite:\n\n```\nOptimus Chem: Comprehensive Chemical Analysis Package for Drug Discovery\nP.K.Panda.et al. (2025)\n```\n\n\n## Support\n\n- \ud83d\udce7 Email: pritam@stanford.edu\n- \ud83d\udc1b Issues: [GitHub Issues](https://github.com/pritampanda15/Optimus_Chemical_Analyzer)\n",
"bugtrack_url": null,
"license": null,
"summary": "Comprehensive Chemical Analysis Package for Drug Discovery",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/pritampanda15/Optimus_Chemical_Analyzer"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ce47de4d16c151b58f64ff61bf9a54450b786517afb47025d43beac9cee2d567",
"md5": "074a6306ba89c1246bcf72a552e55670",
"sha256": "cd30285fbc31fb1580240d114b6034598b6771ada14e0d3d510294ed18a02a63"
},
"downloads": -1,
"filename": "optimus_chem-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "074a6306ba89c1246bcf72a552e55670",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 25432,
"upload_time": "2025-07-31T22:16:34",
"upload_time_iso_8601": "2025-07-31T22:16:34.451392Z",
"url": "https://files.pythonhosted.org/packages/ce/47/de4d16c151b58f64ff61bf9a54450b786517afb47025d43beac9cee2d567/optimus_chem-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6aee5ca9bc0686ed61ea78ca929d37ece90fab30173cc3a4704e07e33963adda",
"md5": "d0ac5a2c58aab11022f8464df07bb99e",
"sha256": "3e07ed67468db2fda78cc499242139390a6b3ace321b51bccf1343230a410f43"
},
"downloads": -1,
"filename": "optimus_chem-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "d0ac5a2c58aab11022f8464df07bb99e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 27301,
"upload_time": "2025-07-31T22:16:35",
"upload_time_iso_8601": "2025-07-31T22:16:35.824122Z",
"url": "https://files.pythonhosted.org/packages/6a/ee/5ca9bc0686ed61ea78ca929d37ece90fab30173cc3a4704e07e33963adda/optimus_chem-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-31 22:16:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pritampanda15",
"github_project": "Optimus_Chemical_Analyzer",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "click",
"specs": [
[
"==",
"8.2.1"
]
]
},
{
"name": "contourpy",
"specs": [
[
"==",
"1.3.3"
]
]
},
{
"name": "cycler",
"specs": [
[
"==",
"0.12.1"
]
]
},
{
"name": "fonttools",
"specs": [
[
"==",
"4.59.0"
]
]
},
{
"name": "kiwisolver",
"specs": [
[
"==",
"1.4.8"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.10.3"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"2.3.2"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"25.0"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.3.1"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"11.3.0"
]
]
},
{
"name": "pyparsing",
"specs": [
[
"==",
"3.2.3"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2025.2"
]
]
},
{
"name": "rdkit",
"specs": [
[
"==",
"2025.3.3"
]
]
},
{
"name": "seaborn",
"specs": [
[
"==",
"0.13.2"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "tqdm",
"specs": [
[
"==",
"4.67.1"
]
]
},
{
"name": "tzdata",
"specs": [
[
"==",
"2025.2"
]
]
}
],
"lcname": "optimus-chem"
}