rowan-python 2.1.8__py3-none-any.whl → 2.1.9__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/protein.py CHANGED
@@ -114,6 +114,27 @@ class Protein(BaseModel):
114
114
  response = client.post(f"/protein/sanitize/{self.uuid}")
115
115
  response.raise_for_status()
116
116
 
117
+ def download_pdb_file(self, path: Path | None = None, name: str | None = None) -> None:
118
+ """
119
+ Downloads the PDB file for a protein
120
+
121
+ :param path: Directory to save the file to (defaults to current directory)
122
+ :param name: Optional custom name for the file (defaults to protein name)
123
+ :raises requests.HTTPError: if the request to the API fails
124
+ """
125
+ if path is None:
126
+ path = Path.cwd()
127
+
128
+ path.mkdir(parents=True, exist_ok=True)
129
+
130
+ with api_client() as client:
131
+ response = client.get(f"/protein/{self.uuid}/get_pdb_file")
132
+ response.raise_for_status()
133
+
134
+ file_path = path / f"{name or self.name}.pdb"
135
+ with open(file_path, "wb") as f:
136
+ f.write(response.content)
137
+
117
138
 
118
139
  def retrieve_protein(uuid: str) -> Protein:
119
140
  """
rowan/workflow.py CHANGED
@@ -240,6 +240,35 @@ class Workflow(BaseModel):
240
240
  with open(path / f"{self.name}-msa.tar.gz", "wb") as f:
241
241
  f.write(response.content)
242
242
 
243
+ def download_dcd_files(self, replicates: list[int],
244
+ name: str | None = None, path: Path | None = None) -> None:
245
+ """
246
+ Downloads DCD trajectory files for specified replicates
247
+
248
+ :param replicates: List of replicate indices to download
249
+ :param name: Optional custom name for the tar.gz file (defaults to workflow name)
250
+ :param path: Directory to save the file to (defaults to current directory)
251
+ :raises ValueError: if workflow is not a pose analysis MD workflow
252
+ :raises requests.HTTPError: if the request to the API fails
253
+ """
254
+ if self.workflow_type != "pose_analysis_md":
255
+ raise ValueError("This workflow is not a pose analysis molecular dynamics workflow.")
256
+
257
+ if path is None:
258
+ path = Path.cwd()
259
+
260
+ path.mkdir(parents=True, exist_ok=True)
261
+
262
+ with api_client() as client:
263
+ response = client.post(
264
+ f"/trajectory/{self.uuid}/trajectory_dcds", json=replicates
265
+ )
266
+ response.raise_for_status()
267
+
268
+ file_path = path / f"{name or self.name}.tar.gz"
269
+ with open(file_path, "wb") as f:
270
+ f.write(response.content)
271
+
243
272
 
244
273
  def submit_workflow(
245
274
  workflow_type: stjames.WORKFLOW_NAME,
@@ -1520,7 +1549,16 @@ def submit_msa_workflow(
1520
1549
  max_credits: int | None = None,
1521
1550
  ) -> Workflow:
1522
1551
  """
1523
- Submits an MSA workflow to the API.
1552
+ Submits a multiple sequence alignment (MSA) workflow to the API.
1553
+
1554
+ :param initial_protein_sequences: List of protein sequences to align, as ProteinSequence objects
1555
+ sor strings.
1556
+ :param output_formats: List of output formats for the resulting MSA files.
1557
+ :param name: The name to assign to the workflow.
1558
+ :param folder_uuid: UUID of the folder where the workflow will be stored.
1559
+ :param max_credits: The maximum number of credits to use for the workflow.
1560
+ :return: A Workflow object representing the submitted MSA workflow.
1561
+ :raises HTTPError: If the API request fails.
1524
1562
  """
1525
1563
  workflow = stjames.MSAWorkflow(
1526
1564
  initial_protein_sequences=initial_protein_sequences,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rowan-python
3
- Version: 2.1.8
3
+ Version: 2.1.9
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
@@ -2,14 +2,14 @@ rowan/__init__.py,sha256=2rz6dW0l9DzawiFi6S0WSv8XlZq1CoTBKJrsJ1uesvk,171
2
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
- rowan/protein.py,sha256=bMemvLZua_pnTrYOxHFZ4jFlRH9KgpYvtjj5M2__28k,8026
5
+ 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=tPvFXYC9O8Qr_9HVGDzYTgW-3MrFcDLGqbGDzlOq5tI,58562
9
+ rowan/workflow.py,sha256=ovhjVUaoI0K-pepk3u_xGnymBOq9cEEUEoyzsFr36Sc,60331
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.8.dist-info/METADATA,sha256=H4imf_mPDAVYyT8l7AYJsC947qE2yfu0labnvuhDdX4,1600
13
- rowan_python-2.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- rowan_python-2.1.8.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
- rowan_python-2.1.8.dist-info/RECORD,,
12
+ rowan_python-2.1.9.dist-info/METADATA,sha256=Teu23XCt-9sjkXXVcsjC5PID3Pgp5bR-conmLvaPiFE,1600
13
+ rowan_python-2.1.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
+ rowan_python-2.1.9.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
+ rowan_python-2.1.9.dist-info/RECORD,,