seer-pas-sdk 0.3.1__py3-none-any.whl → 0.3.2__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.
- seer_pas_sdk/core/sdk.py +99 -8
- {seer_pas_sdk-0.3.1.dist-info → seer_pas_sdk-0.3.2.dist-info}/METADATA +1 -1
- {seer_pas_sdk-0.3.1.dist-info → seer_pas_sdk-0.3.2.dist-info}/RECORD +6 -6
- {seer_pas_sdk-0.3.1.dist-info → seer_pas_sdk-0.3.2.dist-info}/WHEEL +0 -0
- {seer_pas_sdk-0.3.1.dist-info → seer_pas_sdk-0.3.2.dist-info}/licenses/LICENSE.txt +0 -0
- {seer_pas_sdk-0.3.1.dist-info → seer_pas_sdk-0.3.2.dist-info}/top_level.txt +0 -0
seer_pas_sdk/core/sdk.py
CHANGED
|
@@ -379,8 +379,8 @@ class SeerSDK:
|
|
|
379
379
|
|
|
380
380
|
URL = (
|
|
381
381
|
f"{self._auth.url}api/v1/projects"
|
|
382
|
-
if not project_id
|
|
383
|
-
else f"{self._auth.url}api/v1/projects/{project_id}"
|
|
382
|
+
# if not project_id
|
|
383
|
+
# else f"{self._auth.url}api/v1/projects/{project_id}"
|
|
384
384
|
)
|
|
385
385
|
res = []
|
|
386
386
|
if not project_id and not project_name:
|
|
@@ -391,7 +391,7 @@ class SeerSDK:
|
|
|
391
391
|
"searchItem": project_name,
|
|
392
392
|
}
|
|
393
393
|
else:
|
|
394
|
-
params =
|
|
394
|
+
params = {"searchFields": "id", "searchItem": project_id}
|
|
395
395
|
|
|
396
396
|
with self._get_auth_session() as s:
|
|
397
397
|
|
|
@@ -400,10 +400,10 @@ class SeerSDK:
|
|
|
400
400
|
raise ValueError(
|
|
401
401
|
"Invalid request. Please check your parameters."
|
|
402
402
|
)
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
403
|
+
res = projects.json()["data"]
|
|
404
|
+
|
|
405
|
+
if project_id and not res:
|
|
406
|
+
raise ValueError("Project ID is invalid.")
|
|
407
407
|
|
|
408
408
|
for entry in res:
|
|
409
409
|
if "tenant_id" in entry:
|
|
@@ -803,6 +803,7 @@ class SeerSDK:
|
|
|
803
803
|
analysis_only: bool = True,
|
|
804
804
|
project_id: str = None,
|
|
805
805
|
plate_name: str = None,
|
|
806
|
+
as_df=False,
|
|
806
807
|
**kwargs,
|
|
807
808
|
):
|
|
808
809
|
"""
|
|
@@ -832,6 +833,9 @@ class SeerSDK:
|
|
|
832
833
|
plate_name : str, optional
|
|
833
834
|
Name of the plate to be fetched, defaulted to None.
|
|
834
835
|
|
|
836
|
+
as_df : bool, optional
|
|
837
|
+
whether the result should be converted to a DataFrame, defaulted to False.
|
|
838
|
+
|
|
835
839
|
**kwargs : dict, optional
|
|
836
840
|
Search keyword parameters to be passed in. Acceptable values are 'analysis_name', 'folder_name', 'analysis_protocol_name', 'description', 'notes', or 'number_msdatafile'.
|
|
837
841
|
|
|
@@ -955,7 +959,7 @@ class SeerSDK:
|
|
|
955
959
|
res = [
|
|
956
960
|
analysis for analysis in res if not analysis["is_folder"]
|
|
957
961
|
]
|
|
958
|
-
return res
|
|
962
|
+
return res if not as_df else dict_to_df(res)
|
|
959
963
|
|
|
960
964
|
@deprecation.deprecated(deprecated_in="0.3.0", removed_in="1.0.0")
|
|
961
965
|
def get_analysis_result_protein_data(
|
|
@@ -1692,6 +1696,93 @@ class SeerSDK:
|
|
|
1692
1696
|
|
|
1693
1697
|
return {"status": res[0]["status"]}
|
|
1694
1698
|
|
|
1699
|
+
def get_protein_results_table(
|
|
1700
|
+
self,
|
|
1701
|
+
analysis_id: str = None,
|
|
1702
|
+
analysis_name: str = None,
|
|
1703
|
+
grouping: str = "condition",
|
|
1704
|
+
as_df=False,
|
|
1705
|
+
):
|
|
1706
|
+
"""Fetches the protein results table for a given analysis ID or analysis name.
|
|
1707
|
+
|
|
1708
|
+
Args:
|
|
1709
|
+
analysis_id (str, optional): id of the analysis. Defaults to None.
|
|
1710
|
+
analysis_name (str, optional): name of the analysis. Defaults to None.
|
|
1711
|
+
grouping (str, optional): group criteria of table result. Defaults to "condition".
|
|
1712
|
+
as_df (bool, optional): . Defaults to False.
|
|
1713
|
+
|
|
1714
|
+
Raises:
|
|
1715
|
+
ValueError: neither name or id were provided for an analysis.
|
|
1716
|
+
ServerError: the request to the server was not successful.
|
|
1717
|
+
|
|
1718
|
+
Returns:
|
|
1719
|
+
list[dict] | pd.DataFrame: data from the protein results table.
|
|
1720
|
+
"""
|
|
1721
|
+
if not analysis_name and not analysis_id:
|
|
1722
|
+
raise ValueError(
|
|
1723
|
+
"Please provide either analysis name or analysis id."
|
|
1724
|
+
)
|
|
1725
|
+
|
|
1726
|
+
if not analysis_id and analysis_name:
|
|
1727
|
+
analysis_id = self.get_analyses(analysis_name=analysis_name)[0][
|
|
1728
|
+
"id"
|
|
1729
|
+
]
|
|
1730
|
+
|
|
1731
|
+
URL = self._auth.url + "api/v2/groupanalysis/protein"
|
|
1732
|
+
with self._get_auth_session() as s:
|
|
1733
|
+
res = s.post(
|
|
1734
|
+
URL, json={"analysisId": analysis_id, "grouping": grouping}
|
|
1735
|
+
)
|
|
1736
|
+
if res.status_code != 200:
|
|
1737
|
+
raise ServerError(
|
|
1738
|
+
"Could not fetch protein results table. Please verify that your analysis completed."
|
|
1739
|
+
)
|
|
1740
|
+
return dict_to_df(res.json()) if as_df else res.json()
|
|
1741
|
+
|
|
1742
|
+
def get_peptide_results_table(
|
|
1743
|
+
self,
|
|
1744
|
+
analysis_id: str = None,
|
|
1745
|
+
analysis_name: str = None,
|
|
1746
|
+
grouping: str = "condition",
|
|
1747
|
+
as_df=False,
|
|
1748
|
+
):
|
|
1749
|
+
"""Fetches the peptide results table for a given analysis ID or analysis name.
|
|
1750
|
+
|
|
1751
|
+
Args:
|
|
1752
|
+
analysis_id (str, optional): id of the analysis. Defaults to None.
|
|
1753
|
+
analysis_name (str, optional): name of the analysis. Defaults to None.
|
|
1754
|
+
grouping (str, optional): group criteria of table results. Defaults to "condition".
|
|
1755
|
+
as_df (bool, optional): whether the result should be converted to a DataFrame, defaulted to False.
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
Raises:
|
|
1759
|
+
ValueError: neither name or id were provided for an analysis.
|
|
1760
|
+
ServerError: the request to the server was not successful.
|
|
1761
|
+
|
|
1762
|
+
Returns:
|
|
1763
|
+
list[dict] | pd.DataFrame: data from the peptide results table.
|
|
1764
|
+
"""
|
|
1765
|
+
if not analysis_name and not analysis_id:
|
|
1766
|
+
raise ValueError(
|
|
1767
|
+
"Please provide either analysis name or analysis id."
|
|
1768
|
+
)
|
|
1769
|
+
|
|
1770
|
+
if not analysis_id and analysis_name:
|
|
1771
|
+
analysis_id = self.get_analyses(analysis_name=analysis_name)[0][
|
|
1772
|
+
"id"
|
|
1773
|
+
]
|
|
1774
|
+
|
|
1775
|
+
URL = self._auth.url + "api/v2/groupanalysis/peptide"
|
|
1776
|
+
with self._get_auth_session() as s:
|
|
1777
|
+
res = s.post(
|
|
1778
|
+
URL, json={"analysisId": analysis_id, "grouping": grouping}
|
|
1779
|
+
)
|
|
1780
|
+
if res.status_code != 200:
|
|
1781
|
+
raise ServerError(
|
|
1782
|
+
"Could not fetch protein results table. Please verify that your analysis completed."
|
|
1783
|
+
)
|
|
1784
|
+
return dict_to_df(res.json()) if as_df else res.json()
|
|
1785
|
+
|
|
1695
1786
|
def list_ms_data_files(self, folder="", space=None):
|
|
1696
1787
|
"""
|
|
1697
1788
|
Lists all the MS data files in the given folder as long as the folder path passed in the params is valid.
|
|
@@ -5,14 +5,14 @@ seer_pas_sdk/common/__init__.py,sha256=jA5qm-t9x3qXMp5Q6v7vV2kZdLw32-lnbtf0fPY4l
|
|
|
5
5
|
seer_pas_sdk/common/errors.py,sha256=4HFORWnaQQCMXRE8kwdsJWvQRB_3KFEZ7yMb391e4gA,142
|
|
6
6
|
seer_pas_sdk/common/groupanalysis.py,sha256=DxB-gbQfYzl7p9MTYWDIqghcH-IeakzdYdrRZrlIHek,1730
|
|
7
7
|
seer_pas_sdk/core/__init__.py,sha256=rxbKgg-Qe24OaxX2zyHHYPYgDCTEKE_-41bB2wvpvL4,25
|
|
8
|
-
seer_pas_sdk/core/sdk.py,sha256=
|
|
8
|
+
seer_pas_sdk/core/sdk.py,sha256=P8t_QNS8YmwBhdTtkbW02RhzN0Mb2u9F92JAOqvvmUg,105847
|
|
9
9
|
seer_pas_sdk/core/unsupported.py,sha256=XAPZ3tidqjnsgftf3NUdTGIzvnsjHy0e_eGRCAo6GPo,59890
|
|
10
10
|
seer_pas_sdk/objects/__init__.py,sha256=HJLS6sOr7DfzdI14fv5dWcITEj5QQsKcdfED3YNvUrY,107
|
|
11
11
|
seer_pas_sdk/objects/groupanalysis.py,sha256=x3D_5NmYBoPDilNCQqUoCFARIfIeUq4FBY3_N6u8tfM,994
|
|
12
12
|
seer_pas_sdk/objects/platemap.py,sha256=8IvJPAecs_e_FyqibzhCw-O4zjCFnf-zMUp_5krTEsg,5864
|
|
13
13
|
seer_pas_sdk/objects/volcanoplot.py,sha256=tKuCWDIdoO8FLJlhpXhuwHn0aMYnvudTugxAslDXyGs,9357
|
|
14
|
-
seer_pas_sdk-0.3.
|
|
15
|
-
seer_pas_sdk-0.3.
|
|
16
|
-
seer_pas_sdk-0.3.
|
|
17
|
-
seer_pas_sdk-0.3.
|
|
18
|
-
seer_pas_sdk-0.3.
|
|
14
|
+
seer_pas_sdk-0.3.2.dist-info/licenses/LICENSE.txt,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
|
15
|
+
seer_pas_sdk-0.3.2.dist-info/METADATA,sha256=WZECPlPd8k2mEgEznlhfXqYbbMHbdOZn8q2D51B4blo,13448
|
|
16
|
+
seer_pas_sdk-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
seer_pas_sdk-0.3.2.dist-info/top_level.txt,sha256=-2kZ-KFMGtXwr8H1O5llMKlcJ8gRKohEmrIvazXB61s,13
|
|
18
|
+
seer_pas_sdk-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|