masster 0.3.2__py3-none-any.whl → 0.3.4__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.
Potentially problematic release.
This version of masster might be problematic. Click here for more details.
- masster/sample/sample.py +2 -2
- masster/study/plot.py +23 -2
- {masster-0.3.2.dist-info → masster-0.3.4.dist-info}/METADATA +1 -1
- {masster-0.3.2.dist-info → masster-0.3.4.dist-info}/RECORD +7 -7
- {masster-0.3.2.dist-info → masster-0.3.4.dist-info}/WHEEL +0 -0
- {masster-0.3.2.dist-info → masster-0.3.4.dist-info}/entry_points.txt +0 -0
- {masster-0.3.2.dist-info → masster-0.3.4.dist-info}/licenses/LICENSE +0 -0
masster/sample/sample.py
CHANGED
|
@@ -202,9 +202,9 @@ class Sample:
|
|
|
202
202
|
find_adducts = find_adducts
|
|
203
203
|
find_ms2 = find_ms2
|
|
204
204
|
get_spectrum = get_spectrum
|
|
205
|
-
filter =
|
|
205
|
+
filter = features_filter
|
|
206
206
|
select = select
|
|
207
|
-
features_filter =
|
|
207
|
+
features_filter = filter # New function that keeps only specified features
|
|
208
208
|
filter_features = filter
|
|
209
209
|
features_select = select
|
|
210
210
|
select_features = select
|
masster/study/plot.py
CHANGED
|
@@ -161,7 +161,9 @@ def plot_consensus_2d(
|
|
|
161
161
|
alpha=0.7,
|
|
162
162
|
cmap=None,
|
|
163
163
|
width=900,
|
|
164
|
-
height=900
|
|
164
|
+
height=900,
|
|
165
|
+
mz_range=None,
|
|
166
|
+
rt_range=None
|
|
165
167
|
):
|
|
166
168
|
"""
|
|
167
169
|
Plot consensus features in a 2D scatter plot with retention time vs m/z.
|
|
@@ -178,11 +180,20 @@ def plot_consensus_2d(
|
|
|
178
180
|
cmap (str, optional): Color map name
|
|
179
181
|
width (int): Plot width in pixels (default: 900)
|
|
180
182
|
height (int): Plot height in pixels (default: 900)
|
|
183
|
+
mz_range (tuple, optional): m/z range for filtering consensus features (min_mz, max_mz)
|
|
184
|
+
rt_range (tuple, optional): Retention time range for filtering consensus features (min_rt, max_rt)
|
|
181
185
|
"""
|
|
182
186
|
if self.consensus_df is None:
|
|
183
187
|
self.logger.error("No consensus map found.")
|
|
184
188
|
return
|
|
185
189
|
data = self.consensus_df.clone()
|
|
190
|
+
|
|
191
|
+
# Filter by mz_range and rt_range if provided
|
|
192
|
+
if mz_range is not None:
|
|
193
|
+
data = data.filter((pl.col("mz") >= mz_range[0]) & (pl.col("mz") <= mz_range[1]))
|
|
194
|
+
if rt_range is not None:
|
|
195
|
+
data = data.filter((pl.col("rt") >= rt_range[0]) & (pl.col("rt") <= rt_range[1]))
|
|
196
|
+
|
|
186
197
|
if colorby not in data.columns:
|
|
187
198
|
self.logger.error(f"Column {colorby} not found in consensus_df.")
|
|
188
199
|
return
|
|
@@ -329,7 +340,9 @@ def plot_samples_2d(
|
|
|
329
340
|
cmap="Turbo256",
|
|
330
341
|
max_features=50000,
|
|
331
342
|
width=900,
|
|
332
|
-
height=900
|
|
343
|
+
height=900,
|
|
344
|
+
mz_range=None,
|
|
345
|
+
rt_range=None
|
|
333
346
|
):
|
|
334
347
|
"""
|
|
335
348
|
Plot all feature maps for sample_uid in parameter uids in an overlaid scatter plot.
|
|
@@ -349,6 +362,8 @@ def plot_samples_2d(
|
|
|
349
362
|
max_features (int): Maximum number of features to plot (default: 50000)
|
|
350
363
|
width (int): Plot width in pixels (default: 900)
|
|
351
364
|
height (int): Plot height in pixels (default: 900)
|
|
365
|
+
mz_range (tuple, optional): m/z range for filtering features (min_mz, max_mz)
|
|
366
|
+
rt_range (tuple, optional): Retention time range for filtering features (min_rt, max_rt)
|
|
352
367
|
"""
|
|
353
368
|
|
|
354
369
|
sample_uids = self._get_sample_uids(samples)
|
|
@@ -370,6 +385,12 @@ def plot_samples_2d(
|
|
|
370
385
|
|
|
371
386
|
# OPTIMIZATION 1: Batch filter all features for selected samples at once
|
|
372
387
|
features_batch = self.features_df.filter(pl.col("sample_uid").is_in(sample_uids))
|
|
388
|
+
|
|
389
|
+
# Filter by mz_range and rt_range if provided
|
|
390
|
+
if mz_range is not None:
|
|
391
|
+
features_batch = features_batch.filter((pl.col("mz") >= mz_range[0]) & (pl.col("mz") <= mz_range[1]))
|
|
392
|
+
if rt_range is not None:
|
|
393
|
+
features_batch = features_batch.filter((pl.col("rt") >= rt_range[0]) & (pl.col("rt") <= rt_range[1]))
|
|
373
394
|
|
|
374
395
|
if features_batch.is_empty():
|
|
375
396
|
self.logger.error("No features found for the selected samples.")
|
|
@@ -19,7 +19,7 @@ masster/sample/parameters.py,sha256=Gg2KcuNbV_wZ_Wwv93QlM5J19ji0oSIvZLPV1NoBmq0,
|
|
|
19
19
|
masster/sample/plot.py,sha256=uUJAd2qxhVG6Ev2hLuU406zFA2TDkkBz2MG12P9fLik,71449
|
|
20
20
|
masster/sample/processing.py,sha256=NjNLt47Fy0UF3Xs35NBhADg57qTC6Lfa4Xz8Y30v83A,58250
|
|
21
21
|
masster/sample/quant.py,sha256=tHNjvUFTdehKR31BXBZnVsBxMD9XJHgaltITOjr71uE,7562
|
|
22
|
-
masster/sample/sample.py,sha256=
|
|
22
|
+
masster/sample/sample.py,sha256=bsCieIitztHiys7xyyfkKAkyHQRTo9uc0MLq10tsEn0,16178
|
|
23
23
|
masster/sample/sample5_schema.json,sha256=3SPFQZH4SooLYUt_lW-PCOE9rHnl56Vhc2XG-r1nyEQ,3586
|
|
24
24
|
masster/sample/save.py,sha256=o9eFSqqr7KYwvCD3gOJt_nZ4h3pkflWqs0n0oSLM-sU,31970
|
|
25
25
|
masster/sample/sciex.py,sha256=q6PdcjCtV2PWnJiXuvfISu09zjkaTR_fvHvWN9OvOcM,46870
|
|
@@ -36,7 +36,7 @@ masster/study/helpers.py,sha256=SeW17rA3BIM2I2Whiye6wegRRSCabIpQoCsjOCafjKw,7488
|
|
|
36
36
|
masster/study/helpers_optimized.py,sha256=EgOgPaL3c2LA8jDhnlEHvzb7O9Um-vnMIcnNaoH90gA,13620
|
|
37
37
|
masster/study/load.py,sha256=TLxVhXu0HHb51lGggXitQLtfNxz2JJfKMkAXJbxhvhM,46880
|
|
38
38
|
masster/study/parameters.py,sha256=0elaF7YspTsB7qyajWAbRNL2VfKlGz5GJLifmO8IGkk,3276
|
|
39
|
-
masster/study/plot.py,sha256=
|
|
39
|
+
masster/study/plot.py,sha256=NW31XdM9Bf5wNvIAs-56AIoPA8VLTqBzr6qJInfZmhc,25159
|
|
40
40
|
masster/study/processing.py,sha256=BQuSBO7O8iTlCjXenECyg0_PAsPF1NNiUllypuemPZI,46101
|
|
41
41
|
masster/study/save.py,sha256=bcRADWTvhTER9WRkT9zNU5mDUPQZkZB2cuJwpRsYmrM,6589
|
|
42
42
|
masster/study/study.py,sha256=5TZgG7tr7mzqHh1tm48V8SEcvRcWiFYG9iDqz0U9ACc,27073
|
|
@@ -52,8 +52,8 @@ masster/study/defaults/integrate_chrom_def.py,sha256=Rih3-vat7fHGVfIvRitjNJJI3zL
|
|
|
52
52
|
masster/study/defaults/integrate_def.py,sha256=Vf4SAzdBfnsSZ3IRaF0qZvWu3gMDPHdgPfMYoPKeWv8,7246
|
|
53
53
|
masster/study/defaults/merge_def.py,sha256=EBsKE3hsAkTEzN9dpdRD5W3_suTKy_WZ_96rwS0uBuE,8572
|
|
54
54
|
masster/study/defaults/study_def.py,sha256=hj8bYtEPwzdowC95yfyoCFt6fZkQePLjpJtmpNz9Z5M,9533
|
|
55
|
-
masster-0.3.
|
|
56
|
-
masster-0.3.
|
|
57
|
-
masster-0.3.
|
|
58
|
-
masster-0.3.
|
|
59
|
-
masster-0.3.
|
|
55
|
+
masster-0.3.4.dist-info/METADATA,sha256=Uoaha8t5IJHoWFgMcN2w5bci1GT2wtXCbCIoJvCftlg,44356
|
|
56
|
+
masster-0.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
masster-0.3.4.dist-info/entry_points.txt,sha256=ZHguQ_vPmdbpqq2uGtmEOLJfgP-DQ1T0c07Lxh30wc8,58
|
|
58
|
+
masster-0.3.4.dist-info/licenses/LICENSE,sha256=bx5iLIKjgAdYQ7sISn7DsfHRKkoCUm1154sJJKhgqnU,35184
|
|
59
|
+
masster-0.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|