seer-pas-sdk 0.1.2__py3-none-any.whl → 0.1.3__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/auth/__init__.py +1 -77
- seer_pas_sdk/auth/auth.py +77 -0
- seer_pas_sdk/core/__init__.py +1 -1307
- seer_pas_sdk/core/sdk.py +1250 -0
- seer_pas_sdk/objects/__init__.py +1 -129
- seer_pas_sdk/objects/platemap.py +129 -0
- {seer_pas_sdk-0.1.2.dist-info → seer_pas_sdk-0.1.3.dist-info}/METADATA +2 -2
- seer_pas_sdk-0.1.3.dist-info/RECORD +19 -0
- seer_pas_sdk-0.1.2.dist-info/RECORD +0 -16
- {seer_pas_sdk-0.1.2.dist-info → seer_pas_sdk-0.1.3.dist-info}/LICENSE.txt +0 -0
- {seer_pas_sdk-0.1.2.dist-info → seer_pas_sdk-0.1.3.dist-info}/WHEEL +0 -0
- {seer_pas_sdk-0.1.2.dist-info → seer_pas_sdk-0.1.3.dist-info}/top_level.txt +0 -0
seer_pas_sdk/objects/__init__.py
CHANGED
|
@@ -1,129 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class PlateMap:
|
|
5
|
-
"""
|
|
6
|
-
Plate map object containing information about samples and corresponding MS data files.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
def __init__(
|
|
10
|
-
self,
|
|
11
|
-
ms_file_name=None,
|
|
12
|
-
sample_name=None,
|
|
13
|
-
sample_id=None,
|
|
14
|
-
well_location=None,
|
|
15
|
-
nanoparticle=None,
|
|
16
|
-
nanoparticle_id=None,
|
|
17
|
-
control=None,
|
|
18
|
-
control_id=None,
|
|
19
|
-
instrument_name=None,
|
|
20
|
-
date_sample_preparation=None,
|
|
21
|
-
sample_volume=None,
|
|
22
|
-
peptide_concentration=None,
|
|
23
|
-
peptide_mass_sample=None,
|
|
24
|
-
dilution_factor=None,
|
|
25
|
-
kit_id=None,
|
|
26
|
-
plate_id=None,
|
|
27
|
-
plate_name=None,
|
|
28
|
-
):
|
|
29
|
-
|
|
30
|
-
if not ms_file_name:
|
|
31
|
-
raise ValueError("MS file name(s) must be provided.")
|
|
32
|
-
|
|
33
|
-
self.ms_file_name = ms_file_name
|
|
34
|
-
self.length = len(ms_file_name)
|
|
35
|
-
|
|
36
|
-
self.sample_name = sample_name
|
|
37
|
-
self.sample_id = sample_id
|
|
38
|
-
self.well_location = well_location
|
|
39
|
-
self.nanoparticle = nanoparticle
|
|
40
|
-
self.nanoparticle_id = nanoparticle_id
|
|
41
|
-
self.control = control
|
|
42
|
-
self.control_id = control_id
|
|
43
|
-
self.instrument_name = instrument_name
|
|
44
|
-
self.date_sample_preparation = date_sample_preparation
|
|
45
|
-
self.sample_volume = sample_volume
|
|
46
|
-
self.peptide_concentration = peptide_concentration
|
|
47
|
-
self.peptide_mass_sample = peptide_mass_sample
|
|
48
|
-
self.dilution_factor = dilution_factor
|
|
49
|
-
self.kit_id = kit_id
|
|
50
|
-
self.plate_id = plate_id
|
|
51
|
-
self.plate_name = plate_name
|
|
52
|
-
|
|
53
|
-
self.__cols = [
|
|
54
|
-
"MS file name",
|
|
55
|
-
"Sample name",
|
|
56
|
-
"Sample ID",
|
|
57
|
-
"Well location",
|
|
58
|
-
"Nanoparticle",
|
|
59
|
-
"Nanoparticle ID",
|
|
60
|
-
"Control",
|
|
61
|
-
"Control ID",
|
|
62
|
-
"Instrument name",
|
|
63
|
-
"Date sample preparation",
|
|
64
|
-
"Sample volume",
|
|
65
|
-
"Peptide concentration",
|
|
66
|
-
"Peptide mass sample",
|
|
67
|
-
"Dilution factor",
|
|
68
|
-
"Kit ID",
|
|
69
|
-
"Plate ID",
|
|
70
|
-
"Plate Name",
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
self.__attrs = [
|
|
74
|
-
"ms_file_name",
|
|
75
|
-
"sample_name",
|
|
76
|
-
"sample_id",
|
|
77
|
-
"well_location",
|
|
78
|
-
"nanoparticle",
|
|
79
|
-
"nanoparticle_id",
|
|
80
|
-
"control",
|
|
81
|
-
"control_id",
|
|
82
|
-
"instrument_name",
|
|
83
|
-
"date_sample_preparation",
|
|
84
|
-
"sample_volume",
|
|
85
|
-
"peptide_concentration",
|
|
86
|
-
"peptide_mass_sample",
|
|
87
|
-
"dilution_factor",
|
|
88
|
-
"kit_id",
|
|
89
|
-
"plate_id",
|
|
90
|
-
"plate_name",
|
|
91
|
-
]
|
|
92
|
-
|
|
93
|
-
for attr in self.__attrs:
|
|
94
|
-
if not getattr(self, attr):
|
|
95
|
-
# Replace falsey values with empty lists
|
|
96
|
-
setattr(self, attr, [])
|
|
97
|
-
|
|
98
|
-
attr_len = len(getattr(self, attr))
|
|
99
|
-
|
|
100
|
-
if attr_len > self.length:
|
|
101
|
-
raise ValueError(
|
|
102
|
-
"Parameter lengths must not exceed the number of MS files."
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
elif attr_len < self.length:
|
|
106
|
-
for i in range(self.length - attr_len):
|
|
107
|
-
getattr(self, attr).append(None)
|
|
108
|
-
|
|
109
|
-
def to_dict(self):
|
|
110
|
-
res = {}
|
|
111
|
-
|
|
112
|
-
for i in range(len(self.__attrs)):
|
|
113
|
-
res[self.__cols[i]] = getattr(self, self.__attrs[i])
|
|
114
|
-
|
|
115
|
-
for entry in res:
|
|
116
|
-
res[entry] = {i: res[entry][i] for i in range(len(res[entry]))}
|
|
117
|
-
|
|
118
|
-
return res
|
|
119
|
-
|
|
120
|
-
def to_df(self):
|
|
121
|
-
return pd.DataFrame(self.to_dict())
|
|
122
|
-
|
|
123
|
-
def to_csv(self, path=None):
|
|
124
|
-
if not path:
|
|
125
|
-
return self.to_df().to_csv(index=False)
|
|
126
|
-
return self.to_df().to_csv(path_or_buf=path, index=False)
|
|
127
|
-
|
|
128
|
-
def __repr__(self):
|
|
129
|
-
return str(self.to_dict())
|
|
1
|
+
from .platemap import PlateMap
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PlateMap:
|
|
5
|
+
"""
|
|
6
|
+
Plate map object containing information about samples and corresponding MS data files.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
ms_file_name=None,
|
|
12
|
+
sample_name=None,
|
|
13
|
+
sample_id=None,
|
|
14
|
+
well_location=None,
|
|
15
|
+
nanoparticle=None,
|
|
16
|
+
nanoparticle_id=None,
|
|
17
|
+
control=None,
|
|
18
|
+
control_id=None,
|
|
19
|
+
instrument_name=None,
|
|
20
|
+
date_sample_preparation=None,
|
|
21
|
+
sample_volume=None,
|
|
22
|
+
peptide_concentration=None,
|
|
23
|
+
peptide_mass_sample=None,
|
|
24
|
+
dilution_factor=None,
|
|
25
|
+
kit_id=None,
|
|
26
|
+
plate_id=None,
|
|
27
|
+
plate_name=None,
|
|
28
|
+
):
|
|
29
|
+
|
|
30
|
+
if not ms_file_name:
|
|
31
|
+
raise ValueError("MS file name(s) must be provided.")
|
|
32
|
+
|
|
33
|
+
self.ms_file_name = ms_file_name
|
|
34
|
+
self.length = len(ms_file_name)
|
|
35
|
+
|
|
36
|
+
self.sample_name = sample_name
|
|
37
|
+
self.sample_id = sample_id
|
|
38
|
+
self.well_location = well_location
|
|
39
|
+
self.nanoparticle = nanoparticle
|
|
40
|
+
self.nanoparticle_id = nanoparticle_id
|
|
41
|
+
self.control = control
|
|
42
|
+
self.control_id = control_id
|
|
43
|
+
self.instrument_name = instrument_name
|
|
44
|
+
self.date_sample_preparation = date_sample_preparation
|
|
45
|
+
self.sample_volume = sample_volume
|
|
46
|
+
self.peptide_concentration = peptide_concentration
|
|
47
|
+
self.peptide_mass_sample = peptide_mass_sample
|
|
48
|
+
self.dilution_factor = dilution_factor
|
|
49
|
+
self.kit_id = kit_id
|
|
50
|
+
self.plate_id = plate_id
|
|
51
|
+
self.plate_name = plate_name
|
|
52
|
+
|
|
53
|
+
self.__cols = [
|
|
54
|
+
"MS file name",
|
|
55
|
+
"Sample name",
|
|
56
|
+
"Sample ID",
|
|
57
|
+
"Well location",
|
|
58
|
+
"Nanoparticle",
|
|
59
|
+
"Nanoparticle ID",
|
|
60
|
+
"Control",
|
|
61
|
+
"Control ID",
|
|
62
|
+
"Instrument name",
|
|
63
|
+
"Date sample preparation",
|
|
64
|
+
"Sample volume",
|
|
65
|
+
"Peptide concentration",
|
|
66
|
+
"Peptide mass sample",
|
|
67
|
+
"Dilution factor",
|
|
68
|
+
"Kit ID",
|
|
69
|
+
"Plate ID",
|
|
70
|
+
"Plate Name",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
self.__attrs = [
|
|
74
|
+
"ms_file_name",
|
|
75
|
+
"sample_name",
|
|
76
|
+
"sample_id",
|
|
77
|
+
"well_location",
|
|
78
|
+
"nanoparticle",
|
|
79
|
+
"nanoparticle_id",
|
|
80
|
+
"control",
|
|
81
|
+
"control_id",
|
|
82
|
+
"instrument_name",
|
|
83
|
+
"date_sample_preparation",
|
|
84
|
+
"sample_volume",
|
|
85
|
+
"peptide_concentration",
|
|
86
|
+
"peptide_mass_sample",
|
|
87
|
+
"dilution_factor",
|
|
88
|
+
"kit_id",
|
|
89
|
+
"plate_id",
|
|
90
|
+
"plate_name",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
for attr in self.__attrs:
|
|
94
|
+
if not getattr(self, attr):
|
|
95
|
+
# Replace falsey values with empty lists
|
|
96
|
+
setattr(self, attr, [])
|
|
97
|
+
|
|
98
|
+
attr_len = len(getattr(self, attr))
|
|
99
|
+
|
|
100
|
+
if attr_len > self.length:
|
|
101
|
+
raise ValueError(
|
|
102
|
+
"Parameter lengths must not exceed the number of MS files."
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
elif attr_len < self.length:
|
|
106
|
+
for i in range(self.length - attr_len):
|
|
107
|
+
getattr(self, attr).append(None)
|
|
108
|
+
|
|
109
|
+
def to_dict(self):
|
|
110
|
+
res = {}
|
|
111
|
+
|
|
112
|
+
for i in range(len(self.__attrs)):
|
|
113
|
+
res[self.__cols[i]] = getattr(self, self.__attrs[i])
|
|
114
|
+
|
|
115
|
+
for entry in res:
|
|
116
|
+
res[entry] = {i: res[entry][i] for i in range(len(res[entry]))}
|
|
117
|
+
|
|
118
|
+
return res
|
|
119
|
+
|
|
120
|
+
def to_df(self):
|
|
121
|
+
return pd.DataFrame(self.to_dict())
|
|
122
|
+
|
|
123
|
+
def to_csv(self, path=None):
|
|
124
|
+
if not path:
|
|
125
|
+
return self.to_df().to_csv(index=False)
|
|
126
|
+
return self.to_df().to_csv(path_or_buf=path, index=False)
|
|
127
|
+
|
|
128
|
+
def __repr__(self):
|
|
129
|
+
return str(self.to_dict())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: seer-pas-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: SDK for Seer Proteograph Analysis Suite (PAS)
|
|
5
5
|
Home-page: https://github.com/seerbio/seer-pas-sdk
|
|
6
6
|
Author: Agam Jolly
|
|
@@ -45,6 +45,6 @@ from seer_pas_sdk import SeerSDK
|
|
|
45
45
|
sdk = SeerSDK(USERNAME, PASSWORD)
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
You can then use the SDK's
|
|
48
|
+
You can then use the SDK's methods to create, query, or retrieve projects, plates, samples, and analyses.
|
|
49
49
|
|
|
50
50
|
For complete documentation of this SDK, visit [https://seerbio.github.io/seer-pas-sdk/](https://seerbio.github.io/seer-pas-sdk/ "Documentation").
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
seer_pas_sdk/__init__.py,sha256=Ie6atdmdBV-OmdHHXjhrGhdFGXiyP3JKhKrr3hyvSsA,563
|
|
2
|
+
seer_pas_sdk/auth/__init__.py,sha256=e_eM4jJnnyKUdg4Nggzi9ypt2MLWcEJ8CmCPkUaQDSs,23
|
|
3
|
+
seer_pas_sdk/auth/auth.py,sha256=DZcbkYel11GvIn-iiutt9UOVfj9URZ_f89QMHhyGfRg,2277
|
|
4
|
+
seer_pas_sdk/common/__init__.py,sha256=QnBup2dT6okt62Yjdhik4DmLf36Ozgv6KybdvFAULaA,12260
|
|
5
|
+
seer_pas_sdk/core/__init__.py,sha256=rxbKgg-Qe24OaxX2zyHHYPYgDCTEKE_-41bB2wvpvL4,25
|
|
6
|
+
seer_pas_sdk/core/sdk.py,sha256=IlTFn09nZ21iHffh502qAvKUhWcO_bcR6c9723AJckw,45291
|
|
7
|
+
seer_pas_sdk/objects/__init__.py,sha256=ljq6G4yeE3GoefDPqEYx1tLrDuD_9H_7_hedo6-OAuk,31
|
|
8
|
+
seer_pas_sdk/objects/platemap.py,sha256=DosquJu2-XvDjVj4JFKoXa0DBVS8OroYCDeS5Np4U8Q,3693
|
|
9
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
tests/conftest.py,sha256=nu5Qu8CHwgJEwFpLQ0iX8e5csz4HGIC2oe50AdkA2Ms,317
|
|
11
|
+
tests/test_auth.py,sha256=np4XXbEzoSFf-zXKaZQFL4Ry1ehMtjbXtHG3J6D-zzc,933
|
|
12
|
+
tests/test_common.py,sha256=3VgHPbeLVJCh8V0kBGMvkhTKMd6sN_eLJF3AgvbyH0I,3433
|
|
13
|
+
tests/test_objects.py,sha256=BcQtE8CbGUAnFlbkwsaJalUV6D8WbdwN2aWiQddh3k4,2521
|
|
14
|
+
tests/test_sdk.py,sha256=ZNfsRAe_YHIXfteVugfkcds_lmYb0emIfDbJz7jpqR4,239
|
|
15
|
+
seer_pas_sdk-0.1.3.dist-info/LICENSE.txt,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
|
16
|
+
seer_pas_sdk-0.1.3.dist-info/METADATA,sha256=3OrGnwgKw2ECRB-LTulbhxFAlbVw7ialPFQdfR39ddg,1714
|
|
17
|
+
seer_pas_sdk-0.1.3.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
|
18
|
+
seer_pas_sdk-0.1.3.dist-info/top_level.txt,sha256=gMffZ5LfTF87Sr-oiyl-rtY6omfBslYCA2S4DM7YNC8,19
|
|
19
|
+
seer_pas_sdk-0.1.3.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
seer_pas_sdk/__init__.py,sha256=Ie6atdmdBV-OmdHHXjhrGhdFGXiyP3JKhKrr3hyvSsA,563
|
|
2
|
-
seer_pas_sdk/auth/__init__.py,sha256=DZcbkYel11GvIn-iiutt9UOVfj9URZ_f89QMHhyGfRg,2277
|
|
3
|
-
seer_pas_sdk/common/__init__.py,sha256=QnBup2dT6okt62Yjdhik4DmLf36Ozgv6KybdvFAULaA,12260
|
|
4
|
-
seer_pas_sdk/core/__init__.py,sha256=J8dAiYsvNbc11zN1mgp7KqjHSVPw9CVwI-uc85UHw5s,47488
|
|
5
|
-
seer_pas_sdk/objects/__init__.py,sha256=DosquJu2-XvDjVj4JFKoXa0DBVS8OroYCDeS5Np4U8Q,3693
|
|
6
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
tests/conftest.py,sha256=nu5Qu8CHwgJEwFpLQ0iX8e5csz4HGIC2oe50AdkA2Ms,317
|
|
8
|
-
tests/test_auth.py,sha256=np4XXbEzoSFf-zXKaZQFL4Ry1ehMtjbXtHG3J6D-zzc,933
|
|
9
|
-
tests/test_common.py,sha256=3VgHPbeLVJCh8V0kBGMvkhTKMd6sN_eLJF3AgvbyH0I,3433
|
|
10
|
-
tests/test_objects.py,sha256=BcQtE8CbGUAnFlbkwsaJalUV6D8WbdwN2aWiQddh3k4,2521
|
|
11
|
-
tests/test_sdk.py,sha256=ZNfsRAe_YHIXfteVugfkcds_lmYb0emIfDbJz7jpqR4,239
|
|
12
|
-
seer_pas_sdk-0.1.2.dist-info/LICENSE.txt,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
|
13
|
-
seer_pas_sdk-0.1.2.dist-info/METADATA,sha256=VuuOZGQuA6LaN6MgYSZEHKBJXKRuVZxXNDFLLM63shk,1716
|
|
14
|
-
seer_pas_sdk-0.1.2.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
|
15
|
-
seer_pas_sdk-0.1.2.dist-info/top_level.txt,sha256=gMffZ5LfTF87Sr-oiyl-rtY6omfBslYCA2S4DM7YNC8,19
|
|
16
|
-
seer_pas_sdk-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|