rowan-python 2.1.15__py3-none-any.whl → 3.0.0__py3-none-any.whl
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.
- rowan/__init__.py +7 -1
- rowan/calculation.py +112 -0
- rowan/config.py +680 -0
- rowan/folder.py +57 -16
- rowan/molecule.py +268 -0
- rowan/project.py +36 -9
- rowan/protein.py +147 -26
- rowan/rowan_rdkit/__init__.py +0 -15
- rowan/rowan_rdkit/chem_utils.py +49 -42
- rowan/types.py +15 -0
- rowan/user.py +1 -1
- rowan/utils.py +14 -3
- rowan/workflows/__init__.py +123 -0
- rowan/workflows/admet.py +69 -0
- rowan/workflows/analogue_docking.py +220 -0
- rowan/workflows/base.py +766 -0
- rowan/workflows/basic_calculation.py +167 -0
- rowan/workflows/batch_docking.py +93 -0
- rowan/workflows/bde.py +169 -0
- rowan/workflows/conformer_search.py +199 -0
- rowan/workflows/constants.py +19 -0
- rowan/workflows/descriptors.py +66 -0
- rowan/workflows/docking.py +204 -0
- rowan/workflows/double_ended_ts_search.py +196 -0
- rowan/workflows/electronic_properties.py +188 -0
- rowan/workflows/fukui.py +119 -0
- rowan/workflows/hydrogen_bond_donor_acceptor_strength.py +137 -0
- rowan/workflows/interaction_energy_decomposition.py +149 -0
- rowan/workflows/ion_mobility.py +96 -0
- rowan/workflows/irc.py +200 -0
- rowan/workflows/macropka.py +162 -0
- rowan/workflows/membrane_permeability.py +127 -0
- rowan/workflows/msa.py +132 -0
- rowan/workflows/multistage_optimization.py +172 -0
- rowan/workflows/nmr.py +151 -0
- rowan/workflows/pka.py +200 -0
- rowan/workflows/pose_analysis_md.py +241 -0
- rowan/workflows/protein_binder_design.py +201 -0
- rowan/workflows/protein_cofolding.py +322 -0
- rowan/workflows/protein_md.py +179 -0
- rowan/workflows/rbfe_graph.py +149 -0
- rowan/workflows/redox_potential.py +140 -0
- rowan/workflows/relative_binding_free_energy_perturbation.py +319 -0
- rowan/workflows/scan.py +156 -0
- rowan/workflows/solubility.py +228 -0
- rowan/workflows/solvent_dependent_conformers.py +175 -0
- rowan/workflows/spin_states.py +190 -0
- rowan/workflows/strain.py +162 -0
- rowan/workflows/tautomer_search.py +148 -0
- {rowan_python-2.1.15.dist-info → rowan_python-3.0.0.dist-info}/METADATA +3 -3
- rowan_python-3.0.0.dist-info/RECORD +55 -0
- {rowan_python-2.1.15.dist-info → rowan_python-3.0.0.dist-info}/WHEEL +1 -1
- rowan/workflow.py +0 -1886
- rowan_python-2.1.15.dist-info/RECORD +0 -15
- {rowan_python-2.1.15.dist-info → rowan_python-3.0.0.dist-info}/licenses/LICENSE +0 -0
rowan/__init__.py
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# ruff: noqa
|
|
2
2
|
from . import constants
|
|
3
3
|
|
|
4
|
+
api_key: str | None = None
|
|
5
|
+
project_uuid: str | None = None
|
|
6
|
+
|
|
7
|
+
from .calculation import *
|
|
4
8
|
from .folder import *
|
|
5
|
-
from .
|
|
9
|
+
from .molecule import *
|
|
10
|
+
from .types import RdkitMol, StJamesMolecule
|
|
11
|
+
from .workflows import *
|
|
6
12
|
from .project import *
|
|
7
13
|
from .protein import *
|
|
8
14
|
from .user import *
|
rowan/calculation.py
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""Calculation results from Rowan workflows."""
|
|
2
|
+
|
|
3
|
+
from typing import Self
|
|
4
|
+
|
|
5
|
+
import stjames
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from .molecule import Molecule
|
|
9
|
+
from .utils import api_client
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _parse_molecules(data: list[dict]) -> list[Molecule]:
|
|
13
|
+
"""Parse molecule dicts into Molecule objects."""
|
|
14
|
+
return [Molecule.from_stjames(stjames.Molecule.model_validate(m)) for m in data]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Calculation(BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
Rowan calculation result.
|
|
20
|
+
|
|
21
|
+
:param uuid: UUID of the calculation.
|
|
22
|
+
:param name: Name of the calculation.
|
|
23
|
+
:param status: Status code of the calculation.
|
|
24
|
+
:param elapsed: Execution time in seconds.
|
|
25
|
+
:param engine: Compute engine used.
|
|
26
|
+
:param molecules: Molecules (geometries) from this calculation.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
uuid: str
|
|
30
|
+
name: str | None = None
|
|
31
|
+
status: int | None = None
|
|
32
|
+
elapsed: float | None = None
|
|
33
|
+
engine: str | None = None
|
|
34
|
+
molecules: list[Molecule] = Field(default_factory=list)
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
37
|
+
|
|
38
|
+
def __repr__(self) -> str:
|
|
39
|
+
n_mols = len(self.molecules)
|
|
40
|
+
energy = self.energy
|
|
41
|
+
e_str = f"{energy:.6f}" if energy is not None else "None"
|
|
42
|
+
return f"<Calculation energy={e_str} molecules={n_mols} uuid='{self.uuid}'>"
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def energy(self) -> float | None:
|
|
46
|
+
"""Energy of the final molecule (Hartree)."""
|
|
47
|
+
if self.molecules:
|
|
48
|
+
return self.molecules[-1].energy
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def molecule(self) -> Molecule | None:
|
|
53
|
+
"""Final molecule geometry."""
|
|
54
|
+
if self.molecules:
|
|
55
|
+
return self.molecules[-1]
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
def refresh(self, in_place: bool = True) -> Self:
|
|
59
|
+
"""
|
|
60
|
+
Fetch the latest calculation data from the API.
|
|
61
|
+
|
|
62
|
+
:param in_place: If True, update this instance in-place. If False, return new instance.
|
|
63
|
+
:returns: Updated Calculation object.
|
|
64
|
+
"""
|
|
65
|
+
with api_client() as client:
|
|
66
|
+
response = client.get(f"/calculation/{self.uuid}/stjames")
|
|
67
|
+
response.raise_for_status()
|
|
68
|
+
data = response.json()
|
|
69
|
+
|
|
70
|
+
molecules = _parse_molecules(data.get("molecules", []))
|
|
71
|
+
|
|
72
|
+
if not in_place:
|
|
73
|
+
return self.__class__(
|
|
74
|
+
uuid=self.uuid,
|
|
75
|
+
name=data.get("name"),
|
|
76
|
+
status=data.get("status"),
|
|
77
|
+
elapsed=data.get("elapsed"),
|
|
78
|
+
engine=data.get("engine"),
|
|
79
|
+
molecules=molecules,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
self.name = data.get("name")
|
|
83
|
+
self.status = data.get("status")
|
|
84
|
+
self.elapsed = data.get("elapsed")
|
|
85
|
+
self.engine = data.get("engine")
|
|
86
|
+
self.molecules = molecules
|
|
87
|
+
return self
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def retrieve_calculation(uuid: str) -> Calculation:
|
|
91
|
+
"""
|
|
92
|
+
Retrieve a calculation from the API by UUID.
|
|
93
|
+
|
|
94
|
+
:param uuid: UUID of the calculation to retrieve.
|
|
95
|
+
:returns: Calculation object with the fetched data.
|
|
96
|
+
:raises requests.HTTPError: If the API request fails.
|
|
97
|
+
"""
|
|
98
|
+
with api_client() as client:
|
|
99
|
+
response = client.get(f"/calculation/{uuid}/stjames")
|
|
100
|
+
response.raise_for_status()
|
|
101
|
+
data = response.json()
|
|
102
|
+
|
|
103
|
+
molecules = _parse_molecules(data.get("molecules", []))
|
|
104
|
+
|
|
105
|
+
return Calculation(
|
|
106
|
+
uuid=uuid,
|
|
107
|
+
name=data.get("name"),
|
|
108
|
+
status=data.get("status"),
|
|
109
|
+
elapsed=data.get("elapsed"),
|
|
110
|
+
engine=data.get("engine"),
|
|
111
|
+
molecules=molecules,
|
|
112
|
+
)
|