seer-pas-sdk 0.1.2__tar.gz → 0.2.1__tar.gz

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.
Files changed (46) hide show
  1. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/.github/workflows/lint.yml +8 -2
  2. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/.github/workflows/publish.yml +1 -2
  3. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/.gitignore +1 -0
  4. seer_pas_sdk-0.2.1/PKG-INFO +230 -0
  5. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/README.md +1 -1
  6. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/docs/index.qmd +43 -268
  7. seer_pas_sdk-0.2.1/pyproject.toml +65 -0
  8. seer_pas_sdk-0.2.1/seer_pas_sdk/auth/__init__.py +1 -0
  9. seer_pas_sdk-0.1.2/seer_pas_sdk/auth/__init__.py → seer_pas_sdk-0.2.1/seer_pas_sdk/auth/auth.py +23 -1
  10. seer_pas_sdk-0.2.1/seer_pas_sdk/common/__init__.py +722 -0
  11. seer_pas_sdk-0.2.1/seer_pas_sdk/common/errors.py +5 -0
  12. seer_pas_sdk-0.2.1/seer_pas_sdk/common/groupanalysis.py +55 -0
  13. seer_pas_sdk-0.2.1/seer_pas_sdk/core/__init__.py +1 -0
  14. seer_pas_sdk-0.2.1/seer_pas_sdk/core/sdk.py +2632 -0
  15. seer_pas_sdk-0.2.1/seer_pas_sdk/core/unsupported.py +1634 -0
  16. seer_pas_sdk-0.2.1/seer_pas_sdk/objects/__init__.py +3 -0
  17. seer_pas_sdk-0.2.1/seer_pas_sdk/objects/groupanalysis.py +30 -0
  18. seer_pas_sdk-0.1.2/seer_pas_sdk/objects/__init__.py → seer_pas_sdk-0.2.1/seer_pas_sdk/objects/platemap.py +67 -22
  19. seer_pas_sdk-0.2.1/seer_pas_sdk/objects/volcanoplot.py +290 -0
  20. seer_pas_sdk-0.2.1/seer_pas_sdk.egg-info/PKG-INFO +230 -0
  21. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/seer_pas_sdk.egg-info/SOURCES.txt +12 -2
  22. seer_pas_sdk-0.2.1/seer_pas_sdk.egg-info/requires.txt +8 -0
  23. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/seer_pas_sdk.egg-info/top_level.txt +0 -1
  24. seer_pas_sdk-0.2.1/setup.cfg +4 -0
  25. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/tests/conftest.py +5 -1
  26. seer_pas_sdk-0.2.1/tests/objects/__init__.py +0 -0
  27. seer_pas_sdk-0.2.1/tests/objects/test_platemap.py +91 -0
  28. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/tests/test_auth.py +5 -1
  29. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/tests/test_common.py +15 -15
  30. seer_pas_sdk-0.2.1/tests/unsupported_platemap.py +265 -0
  31. seer_pas_sdk-0.1.2/PKG-INFO +0 -50
  32. seer_pas_sdk-0.1.2/pyproject.toml +0 -29
  33. seer_pas_sdk-0.1.2/seer_pas_sdk/common/__init__.py +0 -424
  34. seer_pas_sdk-0.1.2/seer_pas_sdk/core/__init__.py +0 -1307
  35. seer_pas_sdk-0.1.2/seer_pas_sdk.egg-info/PKG-INFO +0 -50
  36. seer_pas_sdk-0.1.2/seer_pas_sdk.egg-info/requires.txt +0 -8
  37. seer_pas_sdk-0.1.2/setup.cfg +0 -32
  38. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/.github/workflows/test.yml +0 -0
  39. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/.pre-commit-config.yaml +0 -0
  40. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/LICENSE.txt +0 -0
  41. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/docs/_quarto.yml +0 -0
  42. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/seer_pas_sdk/__init__.py +0 -0
  43. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/seer_pas_sdk.egg-info/dependency_links.txt +0 -0
  44. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/tests/__init__.py +0 -0
  45. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/tests/test_objects.py +0 -0
  46. {seer_pas_sdk-0.1.2 → seer_pas_sdk-0.2.1}/tests/test_sdk.py +0 -0
@@ -7,11 +7,11 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
9
  - uses: actions/checkout@v2
10
- - name: Set up Python 3.8
10
+ - name: Set up Python
11
11
  uses: actions/setup-python@v2
12
12
  with:
13
13
  python-version: "3.8"
14
- - uses: psf/black@stable
14
+ - uses: psf/black@24.8.0 # last release that supports 3.8
15
15
  - name: Install dependencies
16
16
  run: pip install . flake8
17
17
  - name: Lint with flake8
@@ -20,3 +20,9 @@ jobs:
20
20
  flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
21
21
  # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
22
22
  flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
23
+ - name: Run Bandit
24
+ uses: tj-actions/bandit@v5.5
25
+ with:
26
+ targets: "./seer_pas_sdk/"
27
+ options: "-r --severity-level=high"
28
+
@@ -41,8 +41,7 @@ jobs:
41
41
  uses: quarto-dev/quarto-actions/setup@v2
42
42
  - name: Set up QuartoDoc + Jupyter
43
43
 
44
- # TODO: remove upper bound on quartodoc and griffe after fix for machow/quartodoc#357 is released
45
- run: pip install 'quartodoc>=0.7.0,<=0.7.5' 'griffe<1.0.0' jupyter
44
+ run: pip install 'quartodoc>=0.7.6' jupyter
46
45
 
47
46
  - name: Install seer-pas-sdk
48
47
  run: pip install . # Install SDK libs so quartodoc can find them
@@ -80,6 +80,7 @@ docs/_build/
80
80
  doc/_build/
81
81
 
82
82
  # PyBuilder
83
+ .pybuilder/
83
84
  target/
84
85
 
85
86
  # Jupyter Notebook
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: seer-pas-sdk
3
+ Version: 0.2.1
4
+ Summary: SDK for Seer Proteograph Analysis Suite (PAS)
5
+ Author-email: Ryan Sun <rsun@seer.bio>
6
+ License:
7
+ Apache License
8
+ Version 2.0, January 2004
9
+ http://www.apache.org/licenses/
10
+
11
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
12
+
13
+ 1. Definitions.
14
+
15
+ "License" shall mean the terms and conditions for use, reproduction,
16
+ and distribution as defined by Sections 1 through 9 of this document.
17
+
18
+ "Licensor" shall mean the copyright owner or entity authorized by
19
+ the copyright owner that is granting the License.
20
+
21
+ "Legal Entity" shall mean the union of the acting entity and all
22
+ other entities that control, are controlled by, or are under common
23
+ control with that entity. For the purposes of this definition,
24
+ "control" means (i) the power, direct or indirect, to cause the
25
+ direction or management of such entity, whether by contract or
26
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
27
+ outstanding shares, or (iii) beneficial ownership of such entity.
28
+
29
+ "You" (or "Your") shall mean an individual or Legal Entity
30
+ exercising permissions granted by this License.
31
+
32
+ "Source" form shall mean the preferred form for making modifications,
33
+ including but not limited to software source code, documentation
34
+ source, and configuration files.
35
+
36
+ "Object" form shall mean any form resulting from mechanical
37
+ transformation or translation of a Source form, including but
38
+ not limited to compiled object code, generated documentation,
39
+ and conversions to other media types.
40
+
41
+ "Work" shall mean the work of authorship, whether in Source or
42
+ Object form, made available under the License, as indicated by a
43
+ copyright notice that is included in or attached to the work
44
+ (an example is provided in the Appendix below).
45
+
46
+ "Derivative Works" shall mean any work, whether in Source or Object
47
+ form, that is based on (or derived from) the Work and for which the
48
+ editorial revisions, annotations, elaborations, or other modifications
49
+ represent, as a whole, an original work of authorship. For the purposes
50
+ of this License, Derivative Works shall not include works that remain
51
+ separable from, or merely link (or bind by name) to the interfaces of,
52
+ the Work and Derivative Works thereof.
53
+
54
+ "Contribution" shall mean any work of authorship, including
55
+ the original version of the Work and any modifications or additions
56
+ to that Work or Derivative Works thereof, that is intentionally
57
+ submitted to Licensor for inclusion in the Work by the copyright owner
58
+ or by an individual or Legal Entity authorized to submit on behalf of
59
+ the copyright owner. For the purposes of this definition, "submitted"
60
+ means any form of electronic, verbal, or written communication sent
61
+ to the Licensor or its representatives, including but not limited to
62
+ communication on electronic mailing lists, source code control systems,
63
+ and issue tracking systems that are managed by, or on behalf of, the
64
+ Licensor for the purpose of discussing and improving the Work, but
65
+ excluding communication that is conspicuously marked or otherwise
66
+ designated in writing by the copyright owner as "Not a Contribution."
67
+
68
+ "Contributor" shall mean Licensor and any individual or Legal Entity
69
+ on behalf of whom a Contribution has been received by Licensor and
70
+ subsequently incorporated within the Work.
71
+
72
+ 2. Grant of Copyright License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ copyright license to reproduce, prepare Derivative Works of,
76
+ publicly display, publicly perform, sublicense, and distribute the
77
+ Work and such Derivative Works in Source or Object form.
78
+
79
+ 3. Grant of Patent License. Subject to the terms and conditions of
80
+ this License, each Contributor hereby grants to You a perpetual,
81
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
82
+ (except as stated in this section) patent license to make, have made,
83
+ use, offer to sell, sell, import, and otherwise transfer the Work,
84
+ where such license applies only to those patent claims licensable
85
+ by such Contributor that are necessarily infringed by their
86
+ Contribution(s) alone or by combination of their Contribution(s)
87
+ with the Work to which such Contribution(s) was submitted. If You
88
+ institute patent litigation against any entity (including a
89
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
90
+ or a Contribution incorporated within the Work constitutes direct
91
+ or contributory patent infringement, then any patent licenses
92
+ granted to You under this License for that Work shall terminate
93
+ as of the date such litigation is filed.
94
+
95
+ 4. Redistribution. You may reproduce and distribute copies of the
96
+ Work or Derivative Works thereof in any medium, with or without
97
+ modifications, and in Source or Object form, provided that You
98
+ meet the following conditions:
99
+
100
+ (a) You must give any other recipients of the Work or
101
+ Derivative Works a copy of this License; and
102
+
103
+ (b) You must cause any modified files to carry prominent notices
104
+ stating that You changed the files; and
105
+
106
+ (c) You must retain, in the Source form of any Derivative Works
107
+ that You distribute, all copyright, patent, trademark, and
108
+ attribution notices from the Source form of the Work,
109
+ excluding those notices that do not pertain to any part of
110
+ the Derivative Works; and
111
+
112
+ (d) If the Work includes a "NOTICE" text file as part of its
113
+ distribution, then any Derivative Works that You distribute must
114
+ include a readable copy of the attribution notices contained
115
+ within such NOTICE file, excluding those notices that do not
116
+ pertain to any part of the Derivative Works, in at least one
117
+ of the following places: within a NOTICE text file distributed
118
+ as part of the Derivative Works; within the Source form or
119
+ documentation, if provided along with the Derivative Works; or,
120
+ within a display generated by the Derivative Works, if and
121
+ wherever such third-party notices normally appear. The contents
122
+ of the NOTICE file are for informational purposes only and
123
+ do not modify the License. You may add Your own attribution
124
+ notices within Derivative Works that You distribute, alongside
125
+ or as an addendum to the NOTICE text from the Work, provided
126
+ that such additional attribution notices cannot be construed
127
+ as modifying the License.
128
+
129
+ You may add Your own copyright statement to Your modifications and
130
+ may provide additional or different license terms and conditions
131
+ for use, reproduction, or distribution of Your modifications, or
132
+ for any such Derivative Works as a whole, provided Your use,
133
+ reproduction, and distribution of the Work otherwise complies with
134
+ the conditions stated in this License.
135
+
136
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
137
+ any Contribution intentionally submitted for inclusion in the Work
138
+ by You to the Licensor shall be under the terms and conditions of
139
+ this License, without any additional terms or conditions.
140
+ Notwithstanding the above, nothing herein shall supersede or modify
141
+ the terms of any separate license agreement you may have executed
142
+ with Licensor regarding such Contributions.
143
+
144
+ 6. Trademarks. This License does not grant permission to use the trade
145
+ names, trademarks, service marks, or product names of the Licensor,
146
+ except as required for reasonable and customary use in describing the
147
+ origin of the Work and reproducing the content of the NOTICE file.
148
+
149
+ 7. Disclaimer of Warranty. Unless required by applicable law or
150
+ agreed to in writing, Licensor provides the Work (and each
151
+ Contributor provides its Contributions) on an "AS IS" BASIS,
152
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
153
+ implied, including, without limitation, any warranties or conditions
154
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
155
+ PARTICULAR PURPOSE. You are solely responsible for determining the
156
+ appropriateness of using or redistributing the Work and assume any
157
+ risks associated with Your exercise of permissions under this License.
158
+
159
+ 8. Limitation of Liability. In no event and under no legal theory,
160
+ whether in tort (including negligence), contract, or otherwise,
161
+ unless required by applicable law (such as deliberate and grossly
162
+ negligent acts) or agreed to in writing, shall any Contributor be
163
+ liable to You for damages, including any direct, indirect, special,
164
+ incidental, or consequential damages of any character arising as a
165
+ result of this License or out of the use or inability to use the
166
+ Work (including but not limited to damages for loss of goodwill,
167
+ work stoppage, computer failure or malfunction, or any and all
168
+ other commercial damages or losses), even if such Contributor
169
+ has been advised of the possibility of such damages.
170
+
171
+ 9. Accepting Warranty or Additional Liability. While redistributing
172
+ the Work or Derivative Works thereof, You may choose to offer,
173
+ and charge a fee for, acceptance of support, warranty, indemnity,
174
+ or other liability obligations and/or rights consistent with this
175
+ License. However, in accepting such obligations, You may act only
176
+ on Your own behalf and on Your sole responsibility, not on behalf
177
+ of any other Contributor, and only if You agree to indemnify,
178
+ defend, and hold each Contributor harmless for any liability
179
+ incurred by, or claims asserted against, such Contributor by reason
180
+ of your accepting any such warranty or additional liability.
181
+
182
+ END OF TERMS AND CONDITIONS
183
+
184
+ Project-URL: Issues, https://github.com/seerbio/seer-pas-sdk/issues
185
+ Keywords: seer,sdk,pas,mass spectrometry,proteomics
186
+ Classifier: Development Status :: 4 - Beta
187
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
188
+ Classifier: Operating System :: OS Independent
189
+ Classifier: Programming Language :: Python :: 3
190
+ Classifier: Programming Language :: Python :: 3 :: Only
191
+ Requires-Python: >=3.8
192
+ Description-Content-Type: text/markdown
193
+ License-File: LICENSE.txt
194
+ Requires-Dist: boto3>=1.26.152
195
+ Requires-Dist: botocore>=1.29.152
196
+ Requires-Dist: pandas>=2.0.1
197
+ Requires-Dist: numpy<2.0.0,>=1.5.3
198
+ Requires-Dist: PyJWT>=2.8.0
199
+ Requires-Dist: python-dotenv>=1.0.0
200
+ Requires-Dist: Requests>=2.31.0
201
+ Requires-Dist: tqdm>=4.65.0
202
+ Dynamic: license-file
203
+
204
+ # Seer PAS Python SDK
205
+
206
+ [![Test](https://github.com/seerbio/seer-pas-sdk/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/seerbio/seer-pas-sdk/actions/workflows/test.yml)
207
+ [![Lint](https://github.com/seerbio/seer-pas-sdk/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/seerbio/seer-pas-sdk/actions/workflows/lint.yml)
208
+
209
+ This SDK permits interaction with the Seer Proteograph Analysis Suite using Python.
210
+
211
+ ## Installation
212
+
213
+ ```shell
214
+ pip install seer-pas-sdk
215
+ ```
216
+
217
+ ## Usage
218
+
219
+ To import and set up the SDK:
220
+
221
+ ```python
222
+ from seer_pas_sdk import SeerSDK
223
+
224
+ # Instantiate an SDK object with your credentials:
225
+ sdk = SeerSDK(USERNAME, PASSWORD)
226
+ ```
227
+
228
+ You can then use the SDK's methods to create, query, or retrieve projects, plates, samples, and analyses.
229
+
230
+ For complete documentation of this SDK, visit [https://seerbio.github.io/seer-pas-sdk/](https://seerbio.github.io/seer-pas-sdk/ "Documentation").
@@ -22,6 +22,6 @@ from seer_pas_sdk import SeerSDK
22
22
  sdk = SeerSDK(USERNAME, PASSWORD)
23
23
  ```
24
24
 
25
- You can then use the SDK's functions to create, query, or retrieve projects, plates, samples, and analyses.
25
+ You can then use the SDK's methods to create, query, or retrieve projects, plates, samples, and analyses.
26
26
 
27
27
  For complete documentation of this SDK, visit [https://seerbio.github.io/seer-pas-sdk/](https://seerbio.github.io/seer-pas-sdk/ "Documentation").
@@ -49,11 +49,53 @@ sdk = SeerSDK(USERNAME, PASSWORD, INSTANCE)
49
49
  #| output: true
50
50
  print(f"User '{USERNAME}' logged in.")
51
51
  ```
52
+ You can then use the SDK's methods to create, query, or retrieve projects, plates, samples, and analyses.
53
+ Full documentation can be found [here](https://seerbio.github.io/seer-pas-sdk/reference/SeerSDK.html).
54
+ Additional information and examples can also be found below.
52
55
 
56
+ ### Multi Tenant Management
57
+ Introduced in version 0.2.0
58
+
59
+ By default, you will be active in your home tenant upon log in. The home tenant is defined as the organization account that issued the original invitation for the user to join PAS.
60
+ The optional 'tenant' parameter is available in the SeerSDK constructor to navigate directly to a desired tenant.
61
+ A notification message will display upon login.
62
+
63
+
64
+ The following tools are available to navigate between tenants:
65
+ ```{python}
66
+ #| eval: false
67
+ from seer_pas_sdk import SeerSDK
68
+
69
+ sdk = SeerSDK(USERNAME, PASSWORD, INSTANCE, tenant='My Active Tenant')
70
+
71
+ # Retrieve value of current active tenant
72
+ print(sdk.get_active_tenant())
73
+
74
+ # List available tenants
75
+ print(sdk.list_user_tenants())
76
+
77
+ # Switch active tenant
78
+ pas.switch_tenant('My Next Tenant')
79
+
80
+ ```
81
+
82
+ ```{python}
83
+ #| echo: false
84
+ #| output: true
85
+ print(f"User '{USERNAME}' logged in.")
86
+ print("You are now active in My Active Tenant")
87
+ print("My Active Tenant")
88
+ print(
89
+ {'My Active Tenant' : 'abc1234abc1234',
90
+ 'My Next Tenant' : 'abc1234abc1232'
91
+ }
92
+ )
93
+ print("You are now active in My Next Tenant")
94
+ ```
53
95
 
54
96
  ### `PlateMap` Object
55
97
 
56
- The PAS Python SDK would allow users to make plate maps file from within the SDK using the `PlateMap` object located in the `objects` module. This module is imported by default within the SDK. The interface of the plate map file contains the following parameters, all of which need to be passed in as lists:
98
+ The PAS Python SDK would allow users to make plate maps file from within the SDK using the `PlateMap` class. The interface of the plate map file contains the following parameters, all of which need to be passed in as lists:
57
99
 
58
100
  * MS file name as `ms_file_name`
59
101
  * Sample name as `sample_name`
@@ -540,33 +582,6 @@ The file will be stored in `downloads/` in the user-specified path under the uni
540
582
  <hr>
541
583
 
542
584
 
543
- ### Add Project
544
- Creates a new project with a given `project_name` and a list containing `project_id` strings.
545
-
546
- ###### <u>Params</u>
547
- * `project_name`: (`str`) Name of the project.
548
- * `plate_ids`: (`list[str]`) List of the plate ids to be added to the project.
549
- * `description`: (`str`, optional) Description of the project.
550
- * `notes`: (`str`, optional) Notes for the project.
551
- * `space`: (`str`, optional) Space where the object is contained. Defaults to the space of the user who is creating the project (or `None`).
552
- <br>
553
-
554
- ###### <u>Returns</u>
555
- `res`: (`dict`) A dictionary containing the status of the request if succeeded.
556
-
557
- ###### <u>Example</u>
558
- ```{python}
559
- #| eval: false
560
- project_name = "test_project"
561
- plate_ids = ["9872e3f0-544e-11ea-ad9e-1991e0725494", "5b05d440-6610-11ea-96e3-d5a4dab4ebf6"]
562
- log(sdk.add_project(project_name, plate_ids))
563
- ```
564
- ```
565
- {'status': 'Project started with id = 12a987d0-87d8-11ee-b03f-27a54e8c1798'}
566
- ```
567
-
568
- <hr>
569
-
570
585
  ### Analysis Complete
571
586
  Returns the status of the analysis with the given `analysis_id`.
572
587
 
@@ -588,218 +603,6 @@ log(sdk.analysis_complete(analysis_id))
588
603
 
589
604
  <hr>
590
605
 
591
- ### Add Plate
592
- Add a plate given a list of `ms_data_files`, `plate_map_file`, `plate_id`, `plate_name`, `sample_description_file` and `space`.
593
-
594
- ###### <u>Params</u>
595
- * `ms_data_files`: (`list[str]`) List of MS Data files.
596
- * `plate_map_file`: (`str` or `PlateMap` object) The plate map file path or `PlateMap` object.
597
- * `plate_id`: (`str`) The plate ID. Must be unique.
598
- * `plate_name`: (`str`) The plate name.
599
- * `sample_description_file`: (`str`, optional) Path to the sample description file which adds more detail to samples.
600
- * `space`: (`str`, optional) Space where the plate is contained. Defaults to the space of the user who is creating the project (or `None`).
601
- <br>
602
-
603
- ###### <u>Returns</u>
604
- `res`: (`dict`) A dictionary containing the status of the request if succeeded.
605
-
606
- ###### <u>Example</u>
607
- ```{python}
608
- #| eval: false
609
- data_file_locations = ["testing/AgamSDKTest1.raw", "testing/AgamSDKTest2.raw"]
610
- plate_map_location = "testing/AgamSDKPlateMapATest.csv"
611
- sample_plate_id= "unique223id"
612
- sample_plate_name = "some_plate_name"
613
-
614
- log(sdk.add_plate(data_file_locations, plate_map_location, sample_plate_id, sample_plate_name))
615
- ```
616
- ```
617
- {'message': "Plate generated with id: '147a7740-87d8-11ee-b03f-27a54e8c1798'"}
618
- ```
619
-
620
- Alternatively, instead of the `plate_map_location`, we could use the `PlateMap` object:
621
-
622
- ```{python}
623
- #| eval: false
624
- generated_plate_map_file = PlateMap(
625
- ms_file_name =["AgamSDKTest1.raw", "AgamSDKTest2.raw"],
626
- sample_name = ["A111", "A112"],
627
- sample_id = ["A111", "A112"],
628
- well_location = ["C11", "D11"],
629
- nanoparticle = ["NONE"],
630
- nanoparticle_id = ["NONE"],
631
- control = ["MPE Control"],
632
- control_id = ["MPE Control"],
633
- sample_volume = [20],
634
- peptide_concentration = [59.514],
635
- peptide_mass_sample = [8.57],
636
- dilution_factor = [1],
637
- plate_id = ["A11", "A11"],
638
- plate_name = ["A11", "A11"]
639
- )
640
-
641
- log(sdk.add_plate(data_file_locations, generated_plate_map_file, sample_plate_id, sample_plate_name))
642
- ```
643
- ```
644
- {'message': "Plate generated with id: '1f40cc10-87d8-11ee-b03f-27a54e8c1798'"}
645
- ```
646
-
647
- Similarly, you could specify a `sample_description_file` that would specify more parameters for all samples uploaded.
648
-
649
- ```{python}
650
- #| eval: false
651
- data_file_locations = ["testing/AgamSDKTest1.raw", "testing/AgamSDKTest2.raw"]
652
- plate_map_location = "testing/AgamSDKPlateMapATest.csv"
653
- sample_description_file = "testing/AgamSDKSampleDesc.csv"
654
- sample_plate_id= "unique2123id"
655
- sample_plate_name = "some_plate_name"
656
-
657
- log(sdk.add_plate(data_file_locations, plate_map_location, sample_plate_id, sample_plate_name, sample_description_file))
658
- ```
659
- ```
660
- {'message': "Plate generated with id: '147a7740-87d8-11ee-b03f-27a54e8c1798'"}
661
- ```
662
- <hr>
663
-
664
- ### Upload MS Data Files
665
- Upload MS data files to the PAS backend.
666
-
667
- ###### <u>Params</u>
668
- * `ms_data_files`: (`list[str]`) List of MS Data files.
669
- * `path`: (`str`, optional) Path to upload the files to in the S3, defaulted to an empty string. Should <b>not</b> contain trailing slashes.
670
- * `space`: (`str`, optional) ID of the user group to which the files belongs, defaulted to None.
671
- <br>
672
-
673
- ###### <u>Returns</u>
674
- `res`: (`dict`) Contains message whether the files were uploaded or not.
675
-
676
- ###### <u>Example</u>
677
- ```{python}
678
- #| eval: false
679
- data_file_locations = ["testing/AgamSDKTest1.raw", "testing/AgamSDKTest2.raw"]
680
-
681
- log(sdk.upload_ms_data_files(data_file_locations))
682
- ```
683
- ```
684
- {'message': 'Files uploaded successfully.'}
685
- ```
686
-
687
- <hr>
688
-
689
- ### Download Analysis Files
690
- Download a specific analysis file from the backend given an `analysis_id` to the specified `download_path`.
691
-
692
- If no `download_path` is specified or the `download_path` is invalid, the file will be downloaded to the current working directory.
693
-
694
- If no `file_name` is specified, all files for the analysis will be downloaded.
695
-
696
- ###### <u>Params</u>
697
- * `analysis_id` : (`str`) ID of the analysis to download.
698
- * `download_path` : (`str`, optional) Path to download the analysis file to, defaulted to current working directory.
699
- * file_name : (`str`, optional) Name of the analysis file to download, defaulted to None.
700
-
701
- ###### <u>Returns</u>
702
- (`dict`) Message containing whether the file was downloaded or not.
703
-
704
- ###### <u>Example</u>
705
- ```{python}
706
- #| eval: false
707
- analysis_id = "dd4314d0-22b5-11ee-b604-61b98afbb084"
708
- download_path = "agamjolly/something"
709
-
710
- log(sdk.download_analysis_files(analysis_id, download_path=download_path))
711
- ```
712
- ```
713
- The path "agamjolly/something" you specified does not exist, was either invalid or not absolute.
714
-
715
- Downloading files to "/Users/ajolly/Desktop/seer-sdk/downloads/dd4314d0-22b5-11ee-b604-61b98afbb084"
716
-
717
- Downloading 0714-diann181-libfree-mbr.json
718
- Finished downloading 0714-diann181-libfree-mbr.json
719
-
720
- Downloading diann.log
721
- Finished downloading diann.log
722
-
723
- Downloading lib.tsv.predicted.speclib
724
- Finished downloading lib.tsv.predicted.speclib
725
-
726
- Downloading DIANN.unique_genes_matrix.tsv
727
- Finished downloading DIANN.unique_genes_matrix.tsv
728
-
729
- Downloading lib.tsv.20230714213654
730
- Finished downloading lib.tsv.20230714213654
731
-
732
- Downloading lib.tsv.20230714213654.speclib
733
- Finished downloading lib.tsv.20230714213654.speclib
734
-
735
- Downloading DIANN-first-pass.unique_genes_matrix.tsv
736
- Finished downloading DIANN-first-pass.unique_genes_matrix.tsv
737
-
738
- Downloading DIANN.gg_matrix.tsv
739
- Finished downloading DIANN.gg_matrix.tsv
740
-
741
- Downloading DIANN.log.txt
742
- Finished downloading DIANN.log.txt
743
-
744
- Downloading DIANN.pg_matrix.tsv
745
- Finished downloading DIANN.pg_matrix.tsv
746
-
747
- Downloading DIANN.pr_matrix.tsv
748
- Finished downloading DIANN.pr_matrix.tsv
749
-
750
- Downloading DIANN.stats.tsv
751
- Finished downloading DIANN.stats.tsv
752
-
753
- Downloading DIANN.tsv
754
- Finished downloading DIANN.tsv
755
-
756
- Downloading DIANN-first-pass.gg_matrix.tsv
757
- Finished downloading DIANN-first-pass.gg_matrix.tsv
758
-
759
- Downloading DIANN-first-pass.pg_matrix.tsv
760
- Finished downloading DIANN-first-pass.pg_matrix.tsv
761
-
762
- Downloading DIANN-first-pass.pr_matrix.tsv
763
- Finished downloading DIANN-first-pass.pr_matrix.tsv
764
-
765
- Downloading DIANN-first-pass.stats.tsv
766
- Finished downloading DIANN-first-pass.stats.tsv
767
-
768
- Downloading DIANN-first-pass.tsv
769
- Finished downloading DIANN-first-pass.tsv
770
-
771
- Downloading EXP22006_2022ms0031bX26_B_BB4_1_4772.d.quant
772
- Finished downloading EXP22006_2022ms0031bX26_B_BB4_1_4772.d.quant
773
-
774
- Downloading EXP22006_2022ms0031bX26_B_BB4_1_4772/0714-diann181-libfree-mbr.json
775
- Finished downloading 0714-diann181-libfree-mbr.json
776
-
777
- Downloading EXP22006_2022ms0031bX26_B_BB4_1_4772/diann.log
778
- Finished downloading diann.log
779
-
780
- Downloading EXP22006_2022ms0031bX25_B_BA4_1_4768.d.quant
781
- Finished downloading EXP22006_2022ms0031bX25_B_BA4_1_4768.d.quant
782
-
783
- Downloading EXP22006_2022ms0031bX25_B_BA4_1_4768/0714-diann181-libfree-mbr.json
784
- Finished downloading 0714-diann181-libfree-mbr.json
785
-
786
- Downloading EXP22006_2022ms0031bX25_B_BA4_1_4768/diann.log
787
- Finished downloading diann.log
788
-
789
- Downloading EXP20004_2020ms0007X11_A.mzML.quant
790
- Finished downloading EXP20004_2020ms0007X11_A.mzML.quant
791
-
792
- Downloading EXP20004_2020ms0007X11_A/0714-diann181-libfree-mbr.json
793
- Finished downloading 0714-diann181-libfree-mbr.json
794
-
795
- Downloading EXP20004_2020ms0007X11_A/diann.log
796
- Finished downloading diann.log
797
-
798
- {'message': 'Files downloaded successfully to /Users/ajolly/Desktop/seer-sdk/downloads/dd4314d0-22b5-11ee-b604-61b98afbb084'}
799
- ```
800
-
801
- <hr>
802
-
803
606
  ### List MS Data Files
804
607
  Lists all the MS data files in the given folder as long as the folder path passed in the params is valid.
805
608
 
@@ -866,34 +669,6 @@ Finished downloading AgamSDKTest2.raw
866
669
 
867
670
  <hr>
868
671
 
869
- ### Link Plate
870
- Links existing MS data files to user uploaded files to create a new plate. Functionally, this acts the same way as `add_plate`, except this takes in files that already exist on the backend.
871
-
872
- ###### <u>Params</u>
873
- * `ms_data_files`: (`list[str]`) Path to MS data files on the PAS backend or the S3 bucket.
874
- * `plate_map_file`: (`str` or `PlateMap` object) Path to the plate map file, or `PlateMap` object to be linked.
875
- * `plate_id`: (`str`) The plate ID. Must be unique.
876
- * `plate_name`: (`str`) The plate name.
877
- * `sample_description_file`: (`str`, optional) Path to the sample description file which adds more detail to samples.
878
- * `space`: (`str`, optional) Space where the plate is contained. Defaults to the space of the user who is creating the project (or `None`).
879
- <br>
880
-
881
- ###### <u>Returns</u>
882
- (`dict`) Contains the message whether the plate was linked or not.
883
-
884
- ###### <u>Example</u>
885
- ```{python}
886
- #| eval: false
887
- ms_data_file_locations = ["147a7740-87d8-11ee-b03f-27a54e8c1798/20231120190742420/AgamSDKTest1.raw", "147a7740-87d8-11ee-b03f-27a54e8c1798/20231120190742420/AgamSDKTest2.raw"]
888
- plate_map_location = "testing/AgamSDKPlateMapATest.csv"
889
- sample_plate_id= "some_unique_id23"
890
- sample_plate_name = "linked_plate_name"
891
-
892
- log(sdk.link_plate(ms_data_file_locations, plate_map_location, sample_plate_id, sample_plate_name))
893
- ```
894
-
895
- <hr>
896
-
897
672
  ### Group Analysis Results
898
673
  Returns the group analysis data for given `analysis_id` (provided it is valid and the group analysis has been successful) and `box_plot` config info.
899
674