rowan-python 2.1.13__py3-none-any.whl → 2.1.15__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/workflow.py CHANGED
@@ -22,7 +22,7 @@ StJamesMolecule: TypeAlias = stjames.Molecule
22
22
  class Workflow(BaseModel):
23
23
  """A Rowan workflow.
24
24
 
25
- Dont instantiate this class directly. Instead use one of the submit workflow functions.
25
+ Don't instantiate this class directly. Instead use one of the submit workflow functions.
26
26
  Workflow data is not loaded by default to avoid unnecessary downloads that could impact
27
27
  performance. Call `load_data()` to fetch and attach the workflow data to this `Workflow` object.
28
28
 
@@ -575,7 +575,7 @@ def submit_basic_calculation_workflow(
575
575
 
576
576
  def submit_conformer_search_workflow(
577
577
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol,
578
- conf_gen_mode: str = "rapid",
578
+ conf_gen_settings: stjames.ConformerGenSettings,
579
579
  final_method: stjames.Method | str = "aimnet2_wb97md3",
580
580
  solvent: str | None = None,
581
581
  transition_state: bool = False,
@@ -587,9 +587,7 @@ def submit_conformer_search_workflow(
587
587
  Submits a conformer search workflow to the API.
588
588
 
589
589
  :param initial_molecule: The molecule to perform the conformer search on.
590
- :param conf_gen_mode: The mode to use for conformer generation. See
591
- [list of available modes](https://github.com/rowansci/stjames-public/blob/master/stjames/mode.py)
592
- for options.
590
+ :param conf_gen_settings: settings for conformer generation
593
591
  :param final_method: The method to use for the final optimization.
594
592
  See [list of available methods](https://github.com/rowansci/stjames-public/blob/master/stjames/method.py)
595
593
  for options.
@@ -631,8 +629,7 @@ def submit_conformer_search_workflow(
631
629
  workflow = stjames.ConformerSearchWorkflow(
632
630
  initial_molecule=initial_molecule,
633
631
  multistage_opt_settings=msos,
634
- conf_gen_mode=conf_gen_mode,
635
- mso_mode="manual",
632
+ conf_gen_settings=conf_gen_settings,
636
633
  solvent=solvent,
637
634
  transition_state=transition_state,
638
635
  )
@@ -1210,7 +1207,7 @@ def submit_protein_cofolding_workflow(
1210
1207
  def submit_docking_workflow(
1211
1208
  protein: str | Protein,
1212
1209
  pocket: list[list[float]],
1213
- initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol | None = None,
1210
+ initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol,
1214
1211
  executable: str = "vina",
1215
1212
  scoring_function: str = "vinardo",
1216
1213
  exhaustiveness: float = 8,
@@ -1255,7 +1252,7 @@ def submit_docking_workflow(
1255
1252
 
1256
1253
  workflow = stjames.DockingWorkflow(
1257
1254
  initial_molecule=initial_molecule,
1258
- target_uuid=protein,
1255
+ protein=protein,
1259
1256
  pocket=pocket,
1260
1257
  do_csearch=do_csearch,
1261
1258
  do_optimization=do_optimization,
@@ -1475,8 +1472,20 @@ def submit_pose_analysis_md_workflow(
1475
1472
  protein: str | Protein,
1476
1473
  initial_smiles: str,
1477
1474
  num_trajectories: int = 1,
1478
- simulation_time_ns: int = 10,
1475
+ equilibration_time_ns: float = 1,
1476
+ simulation_time_ns: float = 10,
1477
+ temperature: float = 300,
1478
+ pressure_atm: float = 1.0,
1479
+ langevin_timescale_ps: float = 1.0,
1480
+ timestep_fs: float = 2,
1481
+ constrain_hydrogens: bool = True,
1482
+ nonbonded_cutoff: float = 8.0,
1483
+ ionic_strength_M: float = 0.10,
1484
+ water_buffer: float = 6.0,
1479
1485
  ligand_residue_name: str = "LIG",
1486
+ protein_restraint_cutoff: float | None = None,
1487
+ protein_restraint_constant: float = 100,
1488
+ save_solvent: bool = False,
1480
1489
  name: str = "Pose-Analysis MD Workflow",
1481
1490
  folder_uuid: str | None = None,
1482
1491
  max_credits: int | None = None,
@@ -1485,11 +1494,23 @@ def submit_pose_analysis_md_workflow(
1485
1494
  Submits a pose-analysis MD workflow to the API.
1486
1495
 
1487
1496
  :param protein: The *holo* protein on which MD will be run.
1488
- Can be input as a uuid or a Protein object.
1497
+ Can be input as a UUID or a Protein object.
1489
1498
  :param initial_smiles: The SMILES for the ligand.
1490
1499
  :param num_trajectories: The number of trajectories to run.
1491
- :param simulation_time_ns: How long to run the simulation for, in nanoseconds.
1500
+ :param equilibration_time_ns: how long to equilibrate trajectories for, in ns
1501
+ :param simulation_time_ns: how long to run trajectories for, in ns
1502
+ :param temperature: temperature, in K
1503
+ :param pressure_atm: pressure, in atm
1504
+ :param langevin_timescale_ps: timescale for the Langevin integrator, in ps⁻¹
1505
+ :param timestep_fs: timestep, in femtoseconds
1492
1506
  :param ligand_residue_name: The name of the residue corresponding to the ligand.
1507
+ :param constrain_hydrogens: whether or not to use SHAKE to freeze bonds to hydrogen
1508
+ :param nonbonded_cutoff: nonbonded cutoff for particle-mesh Ewald, in Å
1509
+ :param ionic_strength_M: ionic strength of the solution, in M (molar)
1510
+ :param water_buffer: amount of water to add around the protein, in Å
1511
+ :param protein_restraint_cutoff: cutoff past which alpha-carbons will be constrained, in Å
1512
+ :param protein_restraint_constant: force constant for backbone restraints, in kcal/mol/Ų
1513
+ :param save_solvent: whether to save solvent molecules
1493
1514
  :param name: The name of the workflow.
1494
1515
  :param folder_uuid: The UUID of the folder to place the workflow in.
1495
1516
  :param max_credits: The maximum number of credits to use for the workflow.
@@ -1501,11 +1522,23 @@ def submit_pose_analysis_md_workflow(
1501
1522
  protein = protein.uuid
1502
1523
 
1503
1524
  workflow = stjames.PoseAnalysisMolecularDynamicsWorkflow(
1504
- protein_uuid=protein,
1525
+ protein=protein,
1505
1526
  initial_smiles=initial_smiles,
1506
1527
  num_trajectories=num_trajectories,
1528
+ equilibration_time_ns=equilibration_time_ns,
1507
1529
  simulation_time_ns=simulation_time_ns,
1530
+ temperature=temperature,
1531
+ pressure_atm=pressure_atm,
1532
+ langevin_timescale_ps=langevin_timescale_ps,
1533
+ timestep_fs=timestep_fs,
1508
1534
  ligand_residue_name=ligand_residue_name,
1535
+ constrain_hydrogens=constrain_hydrogens,
1536
+ nonbonded_cutoff=nonbonded_cutoff,
1537
+ ionic_strength_M=ionic_strength_M,
1538
+ water_buffer=water_buffer,
1539
+ protein_restraint_cutoff=protein_restraint_cutoff,
1540
+ protein_restraint_constant=protein_restraint_constant,
1541
+ save_solvent=save_solvent,
1509
1542
  )
1510
1543
 
1511
1544
  data = {
@@ -1558,6 +1591,7 @@ def submit_batch_docking_workflow(
1558
1591
  workflow = stjames.BatchDockingWorkflow(
1559
1592
  initial_smiles_list=smiles_list,
1560
1593
  target=protein,
1594
+ protein=protein,
1561
1595
  pocket=pocket,
1562
1596
  docking_settings=docking_settings,
1563
1597
  )
@@ -1710,3 +1744,143 @@ def submit_membrane_permeability_workflow(
1710
1744
  response = client.post("/workflow", json=data)
1711
1745
  response.raise_for_status()
1712
1746
  return Workflow(**response.json())
1747
+
1748
+
1749
+ def submit_analogue_docking_workflow(
1750
+ analogues: list[str],
1751
+ initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol,
1752
+ protein: str | Protein,
1753
+ executable: str = "vina",
1754
+ scoring_function: str = "vinardo",
1755
+ exhaustiveness: float = 8,
1756
+ name: str = "Analogue Docking Workflow",
1757
+ folder_uuid: str | None = None,
1758
+ max_credits: int | None = None,
1759
+ ) -> Workflow:
1760
+ """
1761
+ Submits an analogue docking workflow to the API.
1762
+
1763
+ :param smiles_list: The SMILES strings to dock.
1764
+ :param initial_molecule: The template to which to align molecules to.
1765
+ :param protein: The protein to dock. Can be input as a uuid or a Protein object.
1766
+ :param executable: Which docking implementation to use.
1767
+ :param scoring_function: Which docking scoring function to use.
1768
+ :param exhaustiveness: Which exhaustiveness to employ.
1769
+ :param name: The name of the workflow.
1770
+ :param folder_uuid: The UUID of the folder to place the workflow in.
1771
+ :param max_credits: The maximum number of credits to use for the workflow.
1772
+ :return: A Workflow object representing the submitted batch docking workflow.
1773
+ :raises requests.HTTPError: if the request to the API fails.
1774
+ """
1775
+
1776
+ docking_settings = {
1777
+ "executable": executable,
1778
+ "exhaustiveness": exhaustiveness,
1779
+ "scoring_function": scoring_function,
1780
+ }
1781
+
1782
+ if isinstance(initial_molecule, StJamesMolecule):
1783
+ initial_molecule = initial_molecule.model_dump(mode="json")
1784
+ elif isinstance(initial_molecule, RdkitMol):
1785
+ initial_molecule = StJamesMolecule.from_rdkit(initial_molecule, cid=0).model_dump(
1786
+ mode="json"
1787
+ )
1788
+
1789
+ if isinstance(protein, Protein):
1790
+ protein = protein.uuid
1791
+
1792
+ workflow = stjames.AnalogueDockingWorkflow(
1793
+ analogues=analogues,
1794
+ initial_molecule=initial_molecule,
1795
+ protein=protein,
1796
+ docking_settings=docking_settings,
1797
+ )
1798
+
1799
+ data = {
1800
+ "name": name,
1801
+ "folder_uuid": folder_uuid,
1802
+ "initial_molecule": initial_molecule,
1803
+ "workflow_type": "analogue_docking",
1804
+ "workflow_data": workflow.model_dump(serialize_as_any=True, mode="json"),
1805
+ "max_credits": max_credits,
1806
+ }
1807
+
1808
+ with api_client() as client:
1809
+ response = client.post("/workflow", json=data)
1810
+ response.raise_for_status()
1811
+ return Workflow(**response.json())
1812
+
1813
+
1814
+ def submit_protein_md_workflow(
1815
+ protein: str | Protein,
1816
+ num_trajectories: int = 1,
1817
+ equilibration_time_ns: float = 1,
1818
+ simulation_time_ns: float = 10,
1819
+ temperature: float = 300,
1820
+ pressure_atm: float = 1.0,
1821
+ langevin_timescale_ps: float = 1.0,
1822
+ timestep_fs: float = 2,
1823
+ constrain_hydrogens: bool = True,
1824
+ nonbonded_cutoff: float = 8.0,
1825
+ ionic_strength_M: float = 0.10,
1826
+ water_buffer: float = 6.0,
1827
+ save_solvent: bool = False,
1828
+ name: str = "Protein MD Workflow",
1829
+ folder_uuid: str | None = None,
1830
+ max_credits: int | None = None,
1831
+ ) -> Workflow:
1832
+ """
1833
+ Submits a pose-analysis MD workflow to the API.
1834
+
1835
+ :param protein: The *holo* protein on which MD will be run.
1836
+ Can be input as a UUID or a Protein object.
1837
+ :param num_trajectories: The number of trajectories to run.
1838
+ :param equilibration_time_ns: how long to equilibrate trajectories for, in ns
1839
+ :param simulation_time_ns: how long to run trajectories for, in ns
1840
+ :param temperature: temperature, in K
1841
+ :param pressure_atm: pressure, in atm
1842
+ :param langevin_timescale_ps: timescale for the Langevin integrator, in ps⁻¹
1843
+ :param timestep_fs: timestep, in femtoseconds
1844
+ :param constrain_hydrogens: whether or not to use SHAKE to freeze bonds to hydrogen
1845
+ :param nonbonded_cutoff: nonbonded cutoff for particle-mesh Ewald, in Å
1846
+ :param ionic_strength_M: ionic strength of the solution, in M (molar)
1847
+ :param water_buffer: amount of water to add around the protein, in Å
1848
+ :param save_solvent: whether solvent should be saed
1849
+ :param name: The name of the workflow.
1850
+ :param folder_uuid: The UUID of the folder to place the workflow in.
1851
+ :param max_credits: The maximum number of credits to use for the workflow.
1852
+ :return: A Workflow object representing the submitted workflow.
1853
+ :raises requests.HTTPError: if the request to the API fails.
1854
+ """
1855
+
1856
+ if isinstance(protein, Protein):
1857
+ protein = protein.uuid
1858
+
1859
+ workflow = stjames.ProteinMolecularDynamicsWorkflow(
1860
+ protein=protein,
1861
+ num_trajectories=num_trajectories,
1862
+ equilibration_time_ns=equilibration_time_ns,
1863
+ simulation_time_ns=simulation_time_ns,
1864
+ temperature=temperature,
1865
+ pressure_atm=pressure_atm,
1866
+ langevin_timescale_ps=langevin_timescale_ps,
1867
+ timestep_fs=timestep_fs,
1868
+ constrain_hydrogens=constrain_hydrogens,
1869
+ nonbonded_cutoff=nonbonded_cutoff,
1870
+ ionic_strength_M=ionic_strength_M,
1871
+ water_buffer=water_buffer,
1872
+ save_solvent=save_solvent,
1873
+ )
1874
+
1875
+ data = {
1876
+ "name": name,
1877
+ "folder_uuid": folder_uuid,
1878
+ "workflow_type": "protein_md",
1879
+ "workflow_data": workflow.model_dump(serialize_as_any=True, mode="json"),
1880
+ "max_credits": max_credits,
1881
+ }
1882
+
1883
+ with api_client() as client:
1884
+ response = client.post("/workflow", json=data)
1885
+ response.raise_for_status()
1886
+ return Workflow(**response.json())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rowan-python
3
- Version: 2.1.13
3
+ Version: 2.1.15
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.144
14
+ Requires-Dist: stjames>=0.0.155
15
15
  Description-Content-Type: text/markdown
16
16
 
17
17
  # Rowan Python Library
@@ -6,10 +6,10 @@ rowan/protein.py,sha256=mFSVCr-08bSikXBUtJtSWzjKcVAuBmTeRckn7JUHYSE,8810
6
6
  rowan/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  rowan/user.py,sha256=Dl--NPUPATKCs2VmILsW8HnLiunG0Lxr0n6mKuHm21U,3891
8
8
  rowan/utils.py,sha256=64II-cPOe_SFJK302Bm8hP62d_3_CgnTVYCbn3zKT7U,3334
9
- rowan/workflow.py,sha256=hsRh0J6bdNs78eByuL5G3_k1CrNQg2szR5sPPalWTMA,65376
9
+ rowan/workflow.py,sha256=QQWHTZ_O3PF2WbegYLPIKiszOEYj1frPKbI8U-B1muc,72419
10
10
  rowan/rowan_rdkit/__init__.py,sha256=EATX2VRzywzKxqkpCUMTf7RNQLkWsfi5VcCNDW6EIiw,503
11
11
  rowan/rowan_rdkit/chem_utils.py,sha256=sKCzul2e0ldVYTBImhTwso7ddNgPKmvS-OmvCEjVJH0,34788
12
- rowan_python-2.1.13.dist-info/METADATA,sha256=3zsPCrGRWTd9snLuYFsleM0iDWkChWQaOEaiGExtLbY,1601
13
- rowan_python-2.1.13.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
- rowan_python-2.1.13.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
- rowan_python-2.1.13.dist-info/RECORD,,
12
+ rowan_python-2.1.15.dist-info/METADATA,sha256=1E2yvHK_we1jaf5zvI7q3V3vGkjlXDx1f7ma71P_Ef4,1601
13
+ rowan_python-2.1.15.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
+ rowan_python-2.1.15.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
+ rowan_python-2.1.15.dist-info/RECORD,,