rowan-python 2.1.4__py3-none-any.whl → 2.1.5__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/constants.py CHANGED
@@ -1 +1,3 @@
1
- API_URL = "https://api.rowansci.com"
1
+ import os
2
+
3
+ API_URL = os.getenv("ROWAN_API_URL", default="https://api.rowansci.com")
rowan/utils.py CHANGED
@@ -47,6 +47,7 @@ def api_client() -> Generator[httpx.Client, None, None]:
47
47
  with httpx.Client(
48
48
  base_url=API_URL,
49
49
  headers={"X-API-Key": get_api_key()},
50
+ timeout=30,
50
51
  ) as client:
51
52
  yield client
52
53
 
rowan/workflow.py CHANGED
@@ -860,8 +860,8 @@ def submit_macropka_workflow(
860
860
  max_pH: int = 14,
861
861
  min_charge: int = -2,
862
862
  max_charge: int = 2,
863
+ compute_solvation_energy: bool = False,
863
864
  compute_aqueous_solubility: bool = False,
864
- compute_solvation_energy: bool = True,
865
865
  name: str = "Macropka Workflow",
866
866
  folder_uuid: str | None = None,
867
867
  max_credits: int | None = None,
@@ -1027,8 +1027,9 @@ def submit_docking_workflow(
1027
1027
  protein: str | Protein,
1028
1028
  pocket: list[list[float]],
1029
1029
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol | None = None,
1030
- do_csearch: bool = True,
1031
- do_optimization: bool = True,
1030
+ do_csearch: bool = False,
1031
+ do_optimization: bool = False,
1032
+ do_pose_refinement: bool = False,
1032
1033
  name: str = "Docking Workflow",
1033
1034
  folder_uuid: str | None = None,
1034
1035
  max_credits: int | None = None,
@@ -1040,6 +1041,7 @@ def submit_docking_workflow(
1040
1041
  :param initial_molecule: The initial molecule to be docked
1041
1042
  :param do_csearch: Whether to perform a conformational search on the ligand.
1042
1043
  :param do_optimization: Whether to perform an optimization on the ligand.
1044
+ :param do_pose_refinement: Whether or not to optimize output poses.
1043
1045
  :param name: The name of the workflow.
1044
1046
  :param folder_uuid: The UUID of the folder to place the workflow in.
1045
1047
  :param max_credits: The maximum number of credits to use for the workflow.
@@ -1061,6 +1063,7 @@ def submit_docking_workflow(
1061
1063
  pocket=pocket,
1062
1064
  do_csearch=do_csearch,
1063
1065
  do_optimization=do_optimization,
1066
+ do_pose_refinement=do_pose_refinement
1064
1067
  )
1065
1068
 
1066
1069
  data = {
@@ -1076,3 +1079,108 @@ def submit_docking_workflow(
1076
1079
  response = client.post("/workflow", json=data)
1077
1080
  response.raise_for_status()
1078
1081
  return Workflow(**response.json())
1082
+
1083
+
1084
+ def submit_ion_mobility_workflow(
1085
+ initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol,
1086
+ temperature: float = 300,
1087
+ protonate: bool = False,
1088
+ do_csearch: bool = True,
1089
+ do_optimization: bool = True,
1090
+ name: str = "Ion-Mobility Workflow",
1091
+ folder_uuid: str | None = None,
1092
+ max_credits: int | None = None,
1093
+ ) -> Workflow:
1094
+ """
1095
+ Submits an ion-mobility workflow to the API.
1096
+
1097
+ :param initial_molecule: The molecule used in the scan.
1098
+ :param temperature: The temperature at which to predict CCS values.
1099
+ :param protonate: Whether or not to automatically detect protonation site.
1100
+ If `True`, every basic site will be protonated and values returned for the most stable.
1101
+ :param do_csearch: Whether to perform a conformational search on the molecule.
1102
+ :param do_optimization: Whether to perform an optimization on the molecule.
1103
+ :param name: The name of the workflow.
1104
+ :param folder_uuid: The UUID of the folder to store the workflow in.
1105
+ :param max_credits: The maximum number of credits to use for the workflow.
1106
+ :return: A Workflow object representing the submitted workflow.
1107
+ :raises requests.HTTPError: if the request to the API fails.
1108
+ """
1109
+ if isinstance(initial_molecule, StJamesMolecule):
1110
+ initial_molecule = initial_molecule.model_dump()
1111
+ elif isinstance(initial_molecule, RdkitMol):
1112
+ initial_molecule = StJamesMolecule.from_rdkit(initial_molecule, cid=0)
1113
+
1114
+ workflow = stjames.IonMobilityWorkflow(
1115
+ initial_molecule=initial_molecule,
1116
+ temperature=temperature,
1117
+ protonate=protonate,
1118
+ do_csearch=do_csearch,
1119
+ do_optimization=do_optimization,
1120
+ )
1121
+
1122
+ data = {
1123
+ "name": name,
1124
+ "folder_uuid": folder_uuid,
1125
+ "workflow_type": "ion_mobility",
1126
+ "workflow_data": workflow.model_dump(),
1127
+ "initial_molecule": initial_molecule,
1128
+ "max_credits": max_credits,
1129
+ }
1130
+
1131
+ with api_client() as client:
1132
+ response = client.post("/workflow", json=data)
1133
+ response.raise_for_status()
1134
+ return Workflow(**response.json())
1135
+
1136
+
1137
+ def submit_nmr_workflow(
1138
+ initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol,
1139
+ solvent: str | None = "chloroform",
1140
+ do_csearch: bool = True,
1141
+ do_optimization: bool = True,
1142
+ name: str = "NMR Workflow",
1143
+ folder_uuid: str | None = None,
1144
+ max_credits: int | None = None,
1145
+ ) -> Workflow:
1146
+ """
1147
+ Submits an NMR-prediction workflow to the API.
1148
+
1149
+ :param initial_molecule: The molecule used in the scan.
1150
+ :param solvent: The solvent in which to compute NMR spectra.
1151
+ :param do_csearch: Whether to perform a conformational search on the input structure.
1152
+ :param do_optimization: Whether to perform an optimization on the input structure.
1153
+ :param name: The name of the workflow.
1154
+ :param folder_uuid: The UUID of the folder to store the workflow in.
1155
+ :param max_credits: The maximum number of credits to use for the workflow.
1156
+ :return: A Workflow object representing the submitted workflow.
1157
+ :raises requests.HTTPError: if the request to the API fails.
1158
+ """
1159
+ if isinstance(initial_molecule, StJamesMolecule):
1160
+ initial_molecule = initial_molecule.model_dump()
1161
+ elif isinstance(initial_molecule, RdkitMol):
1162
+ initial_molecule = StJamesMolecule.from_rdkit(initial_molecule, cid=0)
1163
+
1164
+ workflow_data = {"initial_molecule": initial_molecule, "solvent": solvent}
1165
+
1166
+ if not do_csearch:
1167
+ workflow_data["conf_gen_settings"] = None
1168
+
1169
+ if not do_optimization:
1170
+ workflow_data["multistage_opt_settings"] = None
1171
+
1172
+ workflow = stjames.NMRSpectroscopyWorkflow.model_validate(workflow_data)
1173
+
1174
+ data = {
1175
+ "name": name,
1176
+ "folder_uuid": folder_uuid,
1177
+ "workflow_type": "nmr",
1178
+ "workflow_data": workflow.model_dump(serialize_as_any=True),
1179
+ "initial_molecule": initial_molecule,
1180
+ "max_credits": max_credits,
1181
+ }
1182
+
1183
+ with api_client() as client:
1184
+ response = client.post("/workflow", json=data)
1185
+ response.raise_for_status()
1186
+ return Workflow(**response.json())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rowan-python
3
- Version: 2.1.4
3
+ Version: 2.1.5
4
4
  Summary: Rowan Python Library
5
5
  Project-URL: Homepage, https://github.com/rowansci/rowan-client
6
6
  Project-URL: Bug Tracker, https://github.com/rowansci/rowan-client/issues
@@ -11,7 +11,7 @@ Requires-Dist: httpx
11
11
  Requires-Dist: nest-asyncio
12
12
  Requires-Dist: rdkit
13
13
  Requires-Dist: setuptools
14
- Requires-Dist: stjames>=0.0.83
14
+ Requires-Dist: stjames>=0.0.104
15
15
  Description-Content-Type: text/markdown
16
16
 
17
17
  # Rowan Python Library
@@ -1,15 +1,15 @@
1
1
  rowan/__init__.py,sha256=2rz6dW0l9DzawiFi6S0WSv8XlZq1CoTBKJrsJ1uesvk,171
2
- rowan/constants.py,sha256=ZZvv3L0b2y3dMGlWGeaRmx40J5tBrpxNxvJgjP1TNjg,37
2
+ rowan/constants.py,sha256=emCH4m9OL2Hm5E-6mJGM_FgzrK_JrZT-FiKJ6pMNQ4Y,84
3
3
  rowan/folder.py,sha256=n9WkjHMweQLtVcWUvCttOrmezvUdbFxam_eDEMzLF_A,6791
4
4
  rowan/project.py,sha256=ALPPkMa_cg7w5OkXno1cs6acCofw8AOUYRSeWgr3L0o,3774
5
5
  rowan/protein.py,sha256=bMemvLZua_pnTrYOxHFZ4jFlRH9KgpYvtjj5M2__28k,8026
6
6
  rowan/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  rowan/user.py,sha256=Dl--NPUPATKCs2VmILsW8HnLiunG0Lxr0n6mKuHm21U,3891
8
- rowan/utils.py,sha256=907lV0fEP6BnjOWyisd3Uh8Mk5JuQMOX9QEjGi_mdew,3314
9
- rowan/workflow.py,sha256=uFgI-yTSHW6JY5KulpnGPdM3Xrl0UGYtne9OnDIkzz8,40729
8
+ rowan/utils.py,sha256=64II-cPOe_SFJK302Bm8hP62d_3_CgnTVYCbn3zKT7U,3334
9
+ rowan/workflow.py,sha256=y5Jn-MuWYSNPimyrz4X5D2h7IJqeVViezrnLtuDmk0U,44988
10
10
  rowan/rowan_rdkit/__init__.py,sha256=EATX2VRzywzKxqkpCUMTf7RNQLkWsfi5VcCNDW6EIiw,503
11
11
  rowan/rowan_rdkit/chem_utils.py,sha256=i7-EmAcmvHYtc9NiZblLY_k2DoQKofAZo5KT2qtkUCI,34775
12
- rowan_python-2.1.4.dist-info/METADATA,sha256=PJ8hu2ynkYFAQ1hpyKwE0nlKfmtQcAWCQf61NOIkoPU,1598
13
- rowan_python-2.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- rowan_python-2.1.4.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
- rowan_python-2.1.4.dist-info/RECORD,,
12
+ rowan_python-2.1.5.dist-info/METADATA,sha256=iJPuEi74RV_XDnSZ2yWSQv5eY1mGzWEI5Oh0CmIgHwA,1599
13
+ rowan_python-2.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
+ rowan_python-2.1.5.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
+ rowan_python-2.1.5.dist-info/RECORD,,