rowan-mcp 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rowan-mcp might be problematic. Click here for more details.
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/.gitignore +1 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/PKG-INFO +40 -50
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/README.md +38 -48
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/pyproject.toml +2 -2
- rowan_mcp-1.0.2/rowan-dxt.dxt +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/__init__.py +1 -1
- rowan_mcp-1.0.2/rowan_mcp/functions/conformers.py +80 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/electronic_properties.py +2 -60
- rowan_mcp-1.0.2/rowan_mcp/functions/fukui.py +219 -0
- rowan_mcp-1.0.2/rowan_mcp/functions/macropka.py +120 -0
- rowan_mcp-1.0.2/rowan_mcp/functions/molecule_lookup.py +57 -0
- rowan_mcp-1.0.2/rowan_mcp/functions/pka.py +88 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/uv.lock +1 -1
- rowan_mcp-1.0.0/MANIFEST.in +0 -8
- rowan_mcp-1.0.0/rowan-dxt.dxt +0 -0
- rowan_mcp-1.0.0/rowan_mcp/functions/conformers.py +0 -135
- rowan_mcp-1.0.0/rowan_mcp/functions/fukui.py +0 -355
- rowan_mcp-1.0.0/rowan_mcp/functions/macropka.py +0 -195
- rowan_mcp-1.0.0/rowan_mcp/functions/molecule_cache.db +0 -0
- rowan_mcp-1.0.0/rowan_mcp/functions/molecule_lookup.py +0 -446
- rowan_mcp-1.0.0/rowan_mcp/functions/pka.py +0 -137
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/ROWAN_MCP_TEST_QUERIES.md +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/ROWAN_MCP_TOOLS.md +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/__main__.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/admet.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/bde.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/calculation_retrieve.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/descriptors.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/docking.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/docking_enhanced.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/folder_management.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/hydrogen_bond_basicity.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/irc.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/molecular_converter.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/molecular_dynamics.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/multistage_opt.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/pdb_handler.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/redox_potential.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/scan.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/scan_analyzer.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/solubility.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/spin_states.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/system_management.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/tautomers.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/functions/workflow_management.py +0 -0
- {rowan_mcp-1.0.0 → rowan_mcp-1.0.2}/rowan_mcp/server.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rowan-mcp
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Model Context Protocol server for Rowan computational chemistry platform
|
|
5
5
|
Project-URL: Homepage, https://github.com/k-yenko/rowan-mcp
|
|
6
|
-
Author-email: Katherine Yenko <
|
|
6
|
+
Author-email: Katherine Yenko <katherineayenko@gmail.com>
|
|
7
7
|
License: MIT
|
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
|
9
9
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
|
|
33
33
|
# Rowan MCP Server
|
|
34
34
|
|
|
35
|
-
This project wraps an MCP (Model Context Protocol) around Rowan's tools, making it easy for users to
|
|
35
|
+
This project wraps an MCP (Model Context Protocol) around Rowan's tools, making it easy for users to design molecuels and run simulations in natural everyday language.
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
@@ -52,36 +52,17 @@ That's it - no command line setup needed!
|
|
|
52
52
|
|
|
53
53
|
## **Package Installation**
|
|
54
54
|
|
|
55
|
-
### **
|
|
56
|
-
```bash
|
|
57
|
-
# Install the package
|
|
58
|
-
uv add rowan-mcp
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### **Using pip:**
|
|
62
|
-
```bash
|
|
63
|
-
# Install the package
|
|
64
|
-
pip install rowan-mcp
|
|
65
|
-
|
|
66
|
-
# Or in a virtual environment
|
|
67
|
-
python -m venv venv
|
|
68
|
-
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
69
|
-
pip install rowan-mcp
|
|
70
|
-
```
|
|
55
|
+
### **Option 1: Auto-Install (No manual installation needed!)**
|
|
71
56
|
|
|
72
|
-
|
|
57
|
+
Just add this to your MCP configuration and it will automatically install and run:
|
|
73
58
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
2. **Configure your MCP client** (e.g., Claude Code, VSCode, Cursor, etc.):
|
|
77
|
-
|
|
78
|
-
**With uv:**
|
|
59
|
+
**Using uvx (simplest):**
|
|
79
60
|
```json
|
|
80
61
|
{
|
|
81
62
|
"mcpServers": {
|
|
82
63
|
"rowan": {
|
|
83
|
-
"command": "
|
|
84
|
-
"args": ["
|
|
64
|
+
"command": "uvx",
|
|
65
|
+
"args": ["--from", "rowan-mcp", "rowan-mcp"],
|
|
85
66
|
"env": {
|
|
86
67
|
"ROWAN_API_KEY": "your_api_key_here"
|
|
87
68
|
}
|
|
@@ -90,12 +71,13 @@ pip install rowan-mcp
|
|
|
90
71
|
}
|
|
91
72
|
```
|
|
92
73
|
|
|
93
|
-
**
|
|
74
|
+
**Using uv run (alternative):**
|
|
94
75
|
```json
|
|
95
76
|
{
|
|
96
77
|
"mcpServers": {
|
|
97
78
|
"rowan": {
|
|
98
|
-
"command": "
|
|
79
|
+
"command": "uv",
|
|
80
|
+
"args": ["run", "--with", "rowan-mcp", "-m", "rowan_mcp"],
|
|
99
81
|
"env": {
|
|
100
82
|
"ROWAN_API_KEY": "your_api_key_here"
|
|
101
83
|
}
|
|
@@ -104,30 +86,26 @@ pip install rowan-mcp
|
|
|
104
86
|
}
|
|
105
87
|
```
|
|
106
88
|
|
|
107
|
-
### **
|
|
108
|
-
Ask your AI: *"Calculate the pKa of aspirin"* or *"Optimize the geometry of caffeine"*
|
|
109
|
-
|
|
110
|
-
---
|
|
89
|
+
### **Option 2: Manual Installation**
|
|
111
90
|
|
|
112
|
-
|
|
91
|
+
If you prefer to install the package first:
|
|
113
92
|
|
|
114
|
-
**
|
|
93
|
+
**Using uv:**
|
|
94
|
+
```bash
|
|
95
|
+
uv add rowan-mcp
|
|
96
|
+
```
|
|
115
97
|
|
|
116
|
-
|
|
98
|
+
**Using pip:**
|
|
117
99
|
```bash
|
|
118
|
-
|
|
119
|
-
cd rowan-mcp
|
|
120
|
-
uv sync
|
|
100
|
+
pip install rowan-mcp
|
|
121
101
|
```
|
|
122
102
|
|
|
123
|
-
|
|
103
|
+
Then use this configuration:
|
|
124
104
|
```json
|
|
125
105
|
{
|
|
126
106
|
"mcpServers": {
|
|
127
107
|
"rowan": {
|
|
128
|
-
"command": "
|
|
129
|
-
"args": ["run", "python", "-m", "rowan_mcp"],
|
|
130
|
-
"cwd": "/path/to/rowan-mcp",
|
|
108
|
+
"command": "rowan-mcp",
|
|
131
109
|
"env": {
|
|
132
110
|
"ROWAN_API_KEY": "your_api_key_here"
|
|
133
111
|
}
|
|
@@ -136,7 +114,13 @@ uv sync
|
|
|
136
114
|
}
|
|
137
115
|
```
|
|
138
116
|
|
|
139
|
-
|
|
117
|
+
### **Get API Key**
|
|
118
|
+
|
|
119
|
+
Visit [labs.rowansci.com](https://labs.rowansci.com) → Create account → Generate API key
|
|
120
|
+
|
|
121
|
+
### **Start Using**
|
|
122
|
+
|
|
123
|
+
Ask your AI: *"Calculate the pKa of aspirin"* or *"Optimize the geometry of caffeine"*
|
|
140
124
|
|
|
141
125
|
---
|
|
142
126
|
|
|
@@ -155,7 +139,6 @@ Ask the LLM to:
|
|
|
155
139
|
- **Rowan API key** (free at [labs.rowansci.com](https://labs.rowansci.com))
|
|
156
140
|
- **MCP-compatible client** (Claude Desktop, etc.)
|
|
157
141
|
|
|
158
|
-
|
|
159
142
|
**Development commands** (if you cloned the repo):
|
|
160
143
|
```bash
|
|
161
144
|
# Run from source
|
|
@@ -164,7 +147,7 @@ uv run python -m rowan_mcp --http
|
|
|
164
147
|
|
|
165
148
|
---
|
|
166
149
|
|
|
167
|
-
## Available Tools
|
|
150
|
+
## **Available Tools**
|
|
168
151
|
|
|
169
152
|
### Chemistry Calculations
|
|
170
153
|
- `rowan_basic_calculation` - Energy, optimization, frequencies
|
|
@@ -183,7 +166,6 @@ uv run python -m rowan_mcp --http
|
|
|
183
166
|
### Drug Discovery
|
|
184
167
|
- `rowan_admet` - ADME-Tox properties
|
|
185
168
|
|
|
186
|
-
|
|
187
169
|
### Reactivity Analysis
|
|
188
170
|
- `rowan_fukui` - Reactivity sites
|
|
189
171
|
- `rowan_spin_states` - Spin multiplicities
|
|
@@ -192,13 +174,13 @@ uv run python -m rowan_mcp --http
|
|
|
192
174
|
- `rowan_folder_create/list/update/delete` - Organize calculations
|
|
193
175
|
- `rowan_workflow_create/list/status/stop` - Manage workflows
|
|
194
176
|
|
|
195
|
-
## Requirements
|
|
177
|
+
## **Requirements**
|
|
196
178
|
|
|
197
179
|
- Python 3.10+
|
|
198
180
|
- Rowan API key
|
|
199
181
|
- MCP-compatible AI assistant (Claude Desktop, etc.)
|
|
200
182
|
|
|
201
|
-
## Getting Help
|
|
183
|
+
## **Getting Help**
|
|
202
184
|
|
|
203
185
|
- **Documentation**: [docs.rowansci.com](https://docs.rowansci.com/)
|
|
204
186
|
- or ping me!
|
|
@@ -218,7 +200,7 @@ uv run python -m rowan_mcp --http
|
|
|
218
200
|
- [ ] Multistage optimization sometimes shows unexpected imaginary frequencies
|
|
219
201
|
- [ ] Some calculations show as finished in logs but not in Rowan UI
|
|
220
202
|
|
|
221
|
-
## Citation
|
|
203
|
+
## **Citation**
|
|
222
204
|
|
|
223
205
|
If you use this MCP tool in your research, please cite the underlying Rowan platform:
|
|
224
206
|
|
|
@@ -243,3 +225,11 @@ uv publish
|
|
|
243
225
|
# Or publish to TestPyPI first
|
|
244
226
|
uv publish --index-url https://test.pypi.org/simple/
|
|
245
227
|
```
|
|
228
|
+
|
|
229
|
+
To update the dxt file:
|
|
230
|
+
```bash
|
|
231
|
+
# After updating the PyPI package, update all changed tools/functions
|
|
232
|
+
|
|
233
|
+
# Then update the desktop extension
|
|
234
|
+
dxt pack rowan-dxt
|
|
235
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Rowan MCP Server
|
|
2
2
|
|
|
3
|
-
This project wraps an MCP (Model Context Protocol) around Rowan's tools, making it easy for users to
|
|
3
|
+
This project wraps an MCP (Model Context Protocol) around Rowan's tools, making it easy for users to design molecuels and run simulations in natural everyday language.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -20,36 +20,17 @@ That's it - no command line setup needed!
|
|
|
20
20
|
|
|
21
21
|
## **Package Installation**
|
|
22
22
|
|
|
23
|
-
### **
|
|
24
|
-
```bash
|
|
25
|
-
# Install the package
|
|
26
|
-
uv add rowan-mcp
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### **Using pip:**
|
|
30
|
-
```bash
|
|
31
|
-
# Install the package
|
|
32
|
-
pip install rowan-mcp
|
|
33
|
-
|
|
34
|
-
# Or in a virtual environment
|
|
35
|
-
python -m venv venv
|
|
36
|
-
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
37
|
-
pip install rowan-mcp
|
|
38
|
-
```
|
|
23
|
+
### **Option 1: Auto-Install (No manual installation needed!)**
|
|
39
24
|
|
|
40
|
-
|
|
25
|
+
Just add this to your MCP configuration and it will automatically install and run:
|
|
41
26
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
2. **Configure your MCP client** (e.g., Claude Code, VSCode, Cursor, etc.):
|
|
45
|
-
|
|
46
|
-
**With uv:**
|
|
27
|
+
**Using uvx (simplest):**
|
|
47
28
|
```json
|
|
48
29
|
{
|
|
49
30
|
"mcpServers": {
|
|
50
31
|
"rowan": {
|
|
51
|
-
"command": "
|
|
52
|
-
"args": ["
|
|
32
|
+
"command": "uvx",
|
|
33
|
+
"args": ["--from", "rowan-mcp", "rowan-mcp"],
|
|
53
34
|
"env": {
|
|
54
35
|
"ROWAN_API_KEY": "your_api_key_here"
|
|
55
36
|
}
|
|
@@ -58,12 +39,13 @@ pip install rowan-mcp
|
|
|
58
39
|
}
|
|
59
40
|
```
|
|
60
41
|
|
|
61
|
-
**
|
|
42
|
+
**Using uv run (alternative):**
|
|
62
43
|
```json
|
|
63
44
|
{
|
|
64
45
|
"mcpServers": {
|
|
65
46
|
"rowan": {
|
|
66
|
-
"command": "
|
|
47
|
+
"command": "uv",
|
|
48
|
+
"args": ["run", "--with", "rowan-mcp", "-m", "rowan_mcp"],
|
|
67
49
|
"env": {
|
|
68
50
|
"ROWAN_API_KEY": "your_api_key_here"
|
|
69
51
|
}
|
|
@@ -72,30 +54,26 @@ pip install rowan-mcp
|
|
|
72
54
|
}
|
|
73
55
|
```
|
|
74
56
|
|
|
75
|
-
### **
|
|
76
|
-
Ask your AI: *"Calculate the pKa of aspirin"* or *"Optimize the geometry of caffeine"*
|
|
77
|
-
|
|
78
|
-
---
|
|
57
|
+
### **Option 2: Manual Installation**
|
|
79
58
|
|
|
80
|
-
|
|
59
|
+
If you prefer to install the package first:
|
|
81
60
|
|
|
82
|
-
**
|
|
61
|
+
**Using uv:**
|
|
62
|
+
```bash
|
|
63
|
+
uv add rowan-mcp
|
|
64
|
+
```
|
|
83
65
|
|
|
84
|
-
|
|
66
|
+
**Using pip:**
|
|
85
67
|
```bash
|
|
86
|
-
|
|
87
|
-
cd rowan-mcp
|
|
88
|
-
uv sync
|
|
68
|
+
pip install rowan-mcp
|
|
89
69
|
```
|
|
90
70
|
|
|
91
|
-
|
|
71
|
+
Then use this configuration:
|
|
92
72
|
```json
|
|
93
73
|
{
|
|
94
74
|
"mcpServers": {
|
|
95
75
|
"rowan": {
|
|
96
|
-
"command": "
|
|
97
|
-
"args": ["run", "python", "-m", "rowan_mcp"],
|
|
98
|
-
"cwd": "/path/to/rowan-mcp",
|
|
76
|
+
"command": "rowan-mcp",
|
|
99
77
|
"env": {
|
|
100
78
|
"ROWAN_API_KEY": "your_api_key_here"
|
|
101
79
|
}
|
|
@@ -104,7 +82,13 @@ uv sync
|
|
|
104
82
|
}
|
|
105
83
|
```
|
|
106
84
|
|
|
107
|
-
|
|
85
|
+
### **Get API Key**
|
|
86
|
+
|
|
87
|
+
Visit [labs.rowansci.com](https://labs.rowansci.com) → Create account → Generate API key
|
|
88
|
+
|
|
89
|
+
### **Start Using**
|
|
90
|
+
|
|
91
|
+
Ask your AI: *"Calculate the pKa of aspirin"* or *"Optimize the geometry of caffeine"*
|
|
108
92
|
|
|
109
93
|
---
|
|
110
94
|
|
|
@@ -123,7 +107,6 @@ Ask the LLM to:
|
|
|
123
107
|
- **Rowan API key** (free at [labs.rowansci.com](https://labs.rowansci.com))
|
|
124
108
|
- **MCP-compatible client** (Claude Desktop, etc.)
|
|
125
109
|
|
|
126
|
-
|
|
127
110
|
**Development commands** (if you cloned the repo):
|
|
128
111
|
```bash
|
|
129
112
|
# Run from source
|
|
@@ -132,7 +115,7 @@ uv run python -m rowan_mcp --http
|
|
|
132
115
|
|
|
133
116
|
---
|
|
134
117
|
|
|
135
|
-
## Available Tools
|
|
118
|
+
## **Available Tools**
|
|
136
119
|
|
|
137
120
|
### Chemistry Calculations
|
|
138
121
|
- `rowan_basic_calculation` - Energy, optimization, frequencies
|
|
@@ -151,7 +134,6 @@ uv run python -m rowan_mcp --http
|
|
|
151
134
|
### Drug Discovery
|
|
152
135
|
- `rowan_admet` - ADME-Tox properties
|
|
153
136
|
|
|
154
|
-
|
|
155
137
|
### Reactivity Analysis
|
|
156
138
|
- `rowan_fukui` - Reactivity sites
|
|
157
139
|
- `rowan_spin_states` - Spin multiplicities
|
|
@@ -160,13 +142,13 @@ uv run python -m rowan_mcp --http
|
|
|
160
142
|
- `rowan_folder_create/list/update/delete` - Organize calculations
|
|
161
143
|
- `rowan_workflow_create/list/status/stop` - Manage workflows
|
|
162
144
|
|
|
163
|
-
## Requirements
|
|
145
|
+
## **Requirements**
|
|
164
146
|
|
|
165
147
|
- Python 3.10+
|
|
166
148
|
- Rowan API key
|
|
167
149
|
- MCP-compatible AI assistant (Claude Desktop, etc.)
|
|
168
150
|
|
|
169
|
-
## Getting Help
|
|
151
|
+
## **Getting Help**
|
|
170
152
|
|
|
171
153
|
- **Documentation**: [docs.rowansci.com](https://docs.rowansci.com/)
|
|
172
154
|
- or ping me!
|
|
@@ -186,7 +168,7 @@ uv run python -m rowan_mcp --http
|
|
|
186
168
|
- [ ] Multistage optimization sometimes shows unexpected imaginary frequencies
|
|
187
169
|
- [ ] Some calculations show as finished in logs but not in Rowan UI
|
|
188
170
|
|
|
189
|
-
## Citation
|
|
171
|
+
## **Citation**
|
|
190
172
|
|
|
191
173
|
If you use this MCP tool in your research, please cite the underlying Rowan platform:
|
|
192
174
|
|
|
@@ -211,3 +193,11 @@ uv publish
|
|
|
211
193
|
# Or publish to TestPyPI first
|
|
212
194
|
uv publish --index-url https://test.pypi.org/simple/
|
|
213
195
|
```
|
|
196
|
+
|
|
197
|
+
To update the dxt file:
|
|
198
|
+
```bash
|
|
199
|
+
# After updating the PyPI package, update all changed tools/functions
|
|
200
|
+
|
|
201
|
+
# Then update the desktop extension
|
|
202
|
+
dxt pack rowan-dxt
|
|
203
|
+
```
|
|
@@ -4,10 +4,10 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rowan-mcp"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.2"
|
|
8
8
|
description = "Model Context Protocol server for Rowan computational chemistry platform"
|
|
9
9
|
authors = [
|
|
10
|
-
{name = "Katherine Yenko", email = "
|
|
10
|
+
{name = "Katherine Yenko", email = "katherineayenko@gmail.com"}
|
|
11
11
|
]
|
|
12
12
|
license = {text = "MIT"}
|
|
13
13
|
readme = "README.md"
|
|
Binary file
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Rowan conformers function for conformational analysis.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import logging
|
|
7
|
+
import time
|
|
8
|
+
from typing import Optional
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
import rowan
|
|
12
|
+
except ImportError:
|
|
13
|
+
rowan = None
|
|
14
|
+
|
|
15
|
+
# Setup logging
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
# Setup API key
|
|
19
|
+
api_key = os.getenv("ROWAN_API_KEY")
|
|
20
|
+
if rowan and api_key:
|
|
21
|
+
rowan.api_key = api_key
|
|
22
|
+
|
|
23
|
+
def log_rowan_api_call(workflow_type: str, **kwargs):
|
|
24
|
+
"""Log Rowan API calls and let Rowan handle its own errors."""
|
|
25
|
+
|
|
26
|
+
# Simple logging for long-running calculations
|
|
27
|
+
if workflow_type in ["multistage_opt", "conformer_search"]:
|
|
28
|
+
blocking = kwargs.get('blocking', True)
|
|
29
|
+
if blocking:
|
|
30
|
+
logger.info(f" Starting {workflow_type.replace('_', ' ')}...")
|
|
31
|
+
else:
|
|
32
|
+
logger.info(f" Submitting {workflow_type.replace('_', ' ')} without waiting")
|
|
33
|
+
|
|
34
|
+
# Let Rowan handle everything - no custom error handling
|
|
35
|
+
return rowan.compute(workflow_type=workflow_type, **kwargs)
|
|
36
|
+
|
|
37
|
+
def rowan_conformers(
|
|
38
|
+
name: str,
|
|
39
|
+
molecule: str,
|
|
40
|
+
max_conformers: int = 50,
|
|
41
|
+
mode: str = "rapid",
|
|
42
|
+
folder_uuid: Optional[str] = None,
|
|
43
|
+
blocking: bool = True,
|
|
44
|
+
ping_interval: int = 5
|
|
45
|
+
):
|
|
46
|
+
"""Generate and optimize molecular conformers using Rowan's conformer_search workflow. Valid modes are "reckless", "rapid", "careful", and "meticulous", and default to using SMILES strings for the "molecule" parameter.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
name: Name for the calculation
|
|
50
|
+
molecule: Molecule SMILES string or common name
|
|
51
|
+
max_conformers: Maximum number of conformers to generate (default: 50)
|
|
52
|
+
mode: Conformer search mode - "reckless", "rapid", "careful", "meticulous" (default: "rapid")
|
|
53
|
+
folder_uuid: UUID of folder to organize calculation in
|
|
54
|
+
blocking: Whether to wait for completion (default: True)
|
|
55
|
+
ping_interval: How often to check status in seconds (default: 5)
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
Conformer search results (actual results if blocking=True)
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
# Validate mode parameter
|
|
62
|
+
valid_modes = ["reckless", "rapid", "careful", "meticulous"]
|
|
63
|
+
if mode not in valid_modes:
|
|
64
|
+
raise ValueError(
|
|
65
|
+
f"Invalid mode '{mode}'. Valid modes are: {', '.join(valid_modes)}"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
return log_rowan_api_call(
|
|
69
|
+
workflow_type="conformer_search",
|
|
70
|
+
name=name,
|
|
71
|
+
molecule=molecule,
|
|
72
|
+
mode=mode,
|
|
73
|
+
max_conformers=max_conformers,
|
|
74
|
+
folder_uuid=folder_uuid,
|
|
75
|
+
blocking=blocking,
|
|
76
|
+
ping_interval=ping_interval
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
if __name__ == "__main__":
|
|
80
|
+
pass
|
|
@@ -186,68 +186,10 @@ def rowan_electronic_properties(
|
|
|
186
186
|
**electronic_params
|
|
187
187
|
)
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
if blocking:
|
|
191
|
-
status = result.get('status', result.get('object_status', 'Unknown'))
|
|
192
|
-
|
|
193
|
-
if status == 2: # Completed successfully
|
|
194
|
-
formatted = f"Electronic properties calculation for '{name}' completed successfully!\n\n"
|
|
195
|
-
elif status == 3: # Failed
|
|
196
|
-
formatted = f"Electronic properties calculation for '{name}' failed!\n\n"
|
|
197
|
-
else:
|
|
198
|
-
formatted = f"Electronic properties calculation for '{name}' submitted!\n\n"
|
|
199
|
-
|
|
200
|
-
formatted += f"Molecule: {molecule}\n"
|
|
201
|
-
formatted += f"Canonical SMILES: {canonical_smiles}\n"
|
|
202
|
-
formatted += f"Job UUID: {result.get('uuid', 'N/A')}\n"
|
|
203
|
-
formatted += f"Status: {status}\n\n"
|
|
204
|
-
|
|
205
|
-
formatted += f"Molecule Lookup: Advanced PubChemPy + SQLite + RDKit system\n\n"
|
|
206
|
-
formatted += f"Calculation Settings:\n"
|
|
207
|
-
formatted += f"• Method: {method.upper()}\n"
|
|
208
|
-
formatted += f"• Basis Set: {basis_set}\n"
|
|
209
|
-
formatted += f"• Engine: {engine.upper()}\n"
|
|
210
|
-
formatted += f"• Charge: {charge}, Multiplicity: {multiplicity}\n\n"
|
|
211
|
-
|
|
212
|
-
formatted += f"Property Calculations:\n"
|
|
213
|
-
formatted += f"• Density Cube: {'Enabled' if compute_density_cube else 'Disabled'}\n"
|
|
214
|
-
formatted += f"• ESP Cube: {'Enabled' if compute_electrostatic_potential_cube else 'Disabled'}\n"
|
|
215
|
-
formatted += f"• Occupied MOs: {compute_num_occupied_orbitals}\n"
|
|
216
|
-
formatted += f"• Virtual MOs: {compute_num_virtual_orbitals}\n\n"
|
|
217
|
-
|
|
218
|
-
if status == 2:
|
|
219
|
-
formatted += f"Additional Analysis:\n"
|
|
220
|
-
formatted += f"• Use rowan_calculation_retrieve('{result.get('uuid')}') for full calculation details\n"
|
|
221
|
-
formatted += f"• Use rowan_workflow_management(action='retrieve', workflow_uuid='{result.get('uuid')}') for workflow metadata\n"
|
|
222
|
-
|
|
223
|
-
elif status == 3:
|
|
224
|
-
formatted += f"Troubleshooting:\n"
|
|
225
|
-
formatted += f"• Try simpler method/basis: method='hf', basis_set='sto-3g'\n"
|
|
226
|
-
formatted += f"• Check molecular charge and multiplicity\n"
|
|
227
|
-
formatted += f"• Disable cube generation for faster calculations\n"
|
|
228
|
-
formatted += f"• Use rowan_workflow_management(action='retrieve', workflow_uuid='{result.get('uuid')}') for error details\n"
|
|
229
|
-
else:
|
|
230
|
-
formatted += f"Next Steps:\n"
|
|
231
|
-
formatted += f"• Monitor status with rowan_workflow_management(action='retrieve', workflow_uuid='{result.get('uuid')}')\n"
|
|
232
|
-
formatted += f"• Electronic properties calculations may take several minutes\n"
|
|
233
|
-
|
|
234
|
-
return formatted
|
|
235
|
-
else:
|
|
236
|
-
return str(result)
|
|
189
|
+
return result
|
|
237
190
|
|
|
238
191
|
except Exception as e:
|
|
239
|
-
|
|
240
|
-
error_msg += f"Molecule: {molecule}\n"
|
|
241
|
-
error_msg += f"Canonical SMILES: {canonical_smiles}\n"
|
|
242
|
-
error_msg += f"Settings: {method}/{basis_set}/{engine}\n\n"
|
|
243
|
-
error_msg += f"Molecule Lookup: Advanced PubChemPy + SQLite + RDKit system\n\n"
|
|
244
|
-
error_msg += f"Common Issues:\n"
|
|
245
|
-
error_msg += f"• Invalid method/basis set combination\n"
|
|
246
|
-
error_msg += f"• Incorrect charge/multiplicity for molecule\n"
|
|
247
|
-
error_msg += f"• Engine compatibility issues\n"
|
|
248
|
-
error_msg += f"• Molecule not found in PubChem database\n"
|
|
249
|
-
error_msg += f"• Try with default parameters first\n"
|
|
250
|
-
return error_msg
|
|
192
|
+
return f"Electronic properties calculation failed: {str(e)}"
|
|
251
193
|
|
|
252
194
|
def test_electronic_properties():
|
|
253
195
|
"""Test the electronic properties function with advanced molecule lookup."""
|