rowan-python 2.1.3__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
@@ -1,6 +1,6 @@
1
1
  import time
2
2
  from datetime import datetime
3
- from typing import Any, Self, TypeAlias
3
+ from typing import Any, Literal, Self, TypeAlias
4
4
 
5
5
  import stjames
6
6
  from pydantic import BaseModel, Field
@@ -493,6 +493,7 @@ def submit_conformer_search_workflow(
493
493
 
494
494
  def submit_solubility_workflow(
495
495
  initial_smiles: str,
496
+ solubility_method: Literal["fastsolv", "kingfisher", "esol"] = "fastsolv",
496
497
  solvents: list[str] | None = None,
497
498
  temperatures: list[float] | None = None,
498
499
  name: str = "Solubility Workflow",
@@ -502,6 +503,7 @@ def submit_solubility_workflow(
502
503
  """
503
504
  Submits a solubility workflow to the API.
504
505
 
506
+ :param solubility_method: The name of the desired model for solubility prediction.
505
507
  :param initial_smiles: The smiles of the molecule to calculate the solubility of.
506
508
  :param solvents: The list of solvents to use for the calculation.
507
509
  :param temperatures: The list of temperatures to use for the calculation.
@@ -520,6 +522,7 @@ def submit_solubility_workflow(
520
522
 
521
523
  workflow = stjames.SolubilityWorkflow(
522
524
  initial_smiles=initial_smiles,
525
+ solubility_method=solubility_method,
523
526
  solvents=solvents,
524
527
  temperatures=temperatures,
525
528
  )
@@ -857,7 +860,8 @@ def submit_macropka_workflow(
857
860
  max_pH: int = 14,
858
861
  min_charge: int = -2,
859
862
  max_charge: int = 2,
860
- compute_solvation_energy: bool = True,
863
+ compute_solvation_energy: bool = False,
864
+ compute_aqueous_solubility: bool = False,
861
865
  name: str = "Macropka Workflow",
862
866
  folder_uuid: str | None = None,
863
867
  max_credits: int | None = None,
@@ -870,6 +874,7 @@ def submit_macropka_workflow(
870
874
  :param max_pH: The maximum pH to use in the macropka workflow.
871
875
  :param min_charge: The minimum charge to use in the macropka workflow.
872
876
  :param max_charge: The maximum charge to use in the macropka workflow.
877
+ :param compute_aqueous_solubility: Whether to compute the aqueous solubility for each pH.
873
878
  :param compute_solvation_energy: Whether to compute the solvation energy.
874
879
  :param name: The name of the workflow.
875
880
  :param folder_uuid: The UUID of the folder to store the workflow in.
@@ -885,6 +890,7 @@ def submit_macropka_workflow(
885
890
  min_charge=min_charge,
886
891
  max_charge=max_charge,
887
892
  compute_solvation_energy=compute_solvation_energy,
893
+ compute_aqueous_solubility=compute_aqueous_solubility,
888
894
  )
889
895
 
890
896
  data = {
@@ -1021,8 +1027,9 @@ def submit_docking_workflow(
1021
1027
  protein: str | Protein,
1022
1028
  pocket: list[list[float]],
1023
1029
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol | None = None,
1024
- do_csearch: bool = True,
1025
- do_optimization: bool = True,
1030
+ do_csearch: bool = False,
1031
+ do_optimization: bool = False,
1032
+ do_pose_refinement: bool = False,
1026
1033
  name: str = "Docking Workflow",
1027
1034
  folder_uuid: str | None = None,
1028
1035
  max_credits: int | None = None,
@@ -1034,6 +1041,7 @@ def submit_docking_workflow(
1034
1041
  :param initial_molecule: The initial molecule to be docked
1035
1042
  :param do_csearch: Whether to perform a conformational search on the ligand.
1036
1043
  :param do_optimization: Whether to perform an optimization on the ligand.
1044
+ :param do_pose_refinement: Whether or not to optimize output poses.
1037
1045
  :param name: The name of the workflow.
1038
1046
  :param folder_uuid: The UUID of the folder to place the workflow in.
1039
1047
  :param max_credits: The maximum number of credits to use for the workflow.
@@ -1055,6 +1063,7 @@ def submit_docking_workflow(
1055
1063
  pocket=pocket,
1056
1064
  do_csearch=do_csearch,
1057
1065
  do_optimization=do_optimization,
1066
+ do_pose_refinement=do_pose_refinement
1058
1067
  )
1059
1068
 
1060
1069
  data = {
@@ -1070,3 +1079,108 @@ def submit_docking_workflow(
1070
1079
  response = client.post("/workflow", json=data)
1071
1080
  response.raise_for_status()
1072
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.3
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=SzdLu68Tldom6KTeDaPQCc9s7GWJTuOpXYvn-lejbMo,40306
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.3.dist-info/METADATA,sha256=srhR5GteY8OKS4xX72YXxZqzOuoP6C76UsZi-E4ZIDs,1598
13
- rowan_python-2.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- rowan_python-2.1.3.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
- rowan_python-2.1.3.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,,