ms-mint 0.3.2__tar.gz → 0.3.3__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 (30) hide show
  1. {ms-mint-0.3.2/ms_mint.egg-info → ms-mint-0.3.3}/PKG-INFO +1 -1
  2. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/MintPlotter.py +23 -13
  3. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/_version.py +3 -3
  4. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/matplotlib_tools.py +11 -5
  5. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/processing.py +2 -2
  6. {ms-mint-0.3.2 → ms-mint-0.3.3/ms_mint.egg-info}/PKG-INFO +1 -1
  7. {ms-mint-0.3.2 → ms-mint-0.3.3}/LICENSE +0 -0
  8. {ms-mint-0.3.2 → ms-mint-0.3.3}/MANIFEST.in +0 -0
  9. {ms-mint-0.3.2 → ms-mint-0.3.3}/README.md +0 -0
  10. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/Chromatogram.py +0 -0
  11. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/Mint.py +0 -0
  12. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/TargetOptimizer.py +0 -0
  13. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/__init__.py +0 -0
  14. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/filelock.py +0 -0
  15. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/filters.py +0 -0
  16. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/io.py +0 -0
  17. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/notebook.py +0 -0
  18. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/pca.py +0 -0
  19. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/plotly_tools.py +0 -0
  20. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/standards.py +0 -0
  21. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/targets.py +0 -0
  22. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint/tools.py +0 -0
  23. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint.egg-info/SOURCES.txt +0 -0
  24. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint.egg-info/dependency_links.txt +0 -0
  25. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint.egg-info/requires.txt +0 -0
  26. {ms-mint-0.3.2 → ms-mint-0.3.3}/ms_mint.egg-info/top_level.txt +0 -0
  27. {ms-mint-0.3.2 → ms-mint-0.3.3}/scripts/ms-mint-convert.py +0 -0
  28. {ms-mint-0.3.2 → ms-mint-0.3.3}/setup.cfg +0 -0
  29. {ms-mint-0.3.2 → ms-mint-0.3.3}/setup.py +0 -0
  30. {ms-mint-0.3.2 → ms-mint-0.3.3}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ms-mint
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Metabolomics Integrator (Mint)
5
5
  Home-page: https://github.com/LewisResearchGroup/ms-mint
6
6
  Author: Soren Wacker
@@ -235,7 +235,7 @@ class MintPlotter:
235
235
  plt.title(f'{P(fn).with_suffix("").name}\n{peak_label}')
236
236
  return fig
237
237
 
238
- def chromatogram(self, fns=None, peak_labels=None, interactive=False, filters=None, **kwargs):
238
+ def chromatogram(self, fns=None, peak_labels=None, interactive=False, filters=None, ax=None, **kwargs):
239
239
  """Plot the chromatogram extracted from one or more files.
240
240
 
241
241
  :param fns: File names to extract chromatogram from.
@@ -283,18 +283,28 @@ class MintPlotter:
283
283
  linewidth=0,
284
284
  )
285
285
  params.update(kwargs)
286
- g = sns.relplot(data=data, **params)
287
-
288
- for peak_label, ax in zip(peak_labels, g.axes.flatten()):
289
- _, _, rt_min, rt_max = self.mint.get_target_params(
290
- peak_label
291
- )
292
- if rt_min is not None and rt_max is not None:
293
- ax.axvspan(rt_min, rt_max, color="lightgreen", alpha=0.5, zorder=-1)
294
- ax.ticklabel_format(
295
- style="sci", axis="y", useOffset=False, scilimits=(0, 0)
296
- )
297
- g.set_titles(template="{col_name}")
286
+
287
+ if ax is None:
288
+ g = sns.relplot(data=data, **params)
289
+
290
+ for peak_label, ax in zip(peak_labels, g.axes.flatten()):
291
+ _, _, rt_min, rt_max = self.mint.get_target_params(
292
+ peak_label
293
+ )
294
+ if rt_min is not None and rt_max is not None:
295
+ ax.axvspan(rt_min, rt_max, color="lightgreen", alpha=0.5, zorder=-1)
296
+ ax.ticklabel_format(
297
+ style="sci", axis="y", useOffset=False, scilimits=(0, 0)
298
+ )
299
+ g.set_titles(template="{col_name}")
300
+
301
+ else:
302
+ g = sns.lineplot(data=data,
303
+ x="scan_time",
304
+ y="intensity",
305
+ hue='ms_file_label',
306
+ ax=ax,
307
+ **kwargs)
298
308
  return g
299
309
 
300
310
  else:
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2023-08-18T12:58:02-0600",
11
+ "date": "2023-08-22T11:34:29-0600",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "2563246318a0e00988500da34daed80721f81b98",
15
- "version": "v0.3.2"
14
+ "full-revisionid": "64a5dc5327b4ff4c4c58498b79d6c63b534f52aa",
15
+ "version": "v0.3.3"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -212,29 +212,35 @@ def plot_peak_shapes(
212
212
  "Scan time [s]": peak_rt,
213
213
  "Intensity": peak_int,
214
214
  "ms_file_label": ms_file_label,
215
- "peak_label": peak_label + f"\nm/z={mz:.3f}",
215
+ "peak_label": peak_label,
216
216
  "Expected Scan time [s]": rt,
217
217
  }
218
218
  )
219
219
  dfs.append(df)
220
-
221
- df = pd.concat(dfs).reset_index(drop=True)
220
+
221
+
222
+ df = pd.concat(dfs, ignore_index=True).reset_index(drop=True)
222
223
 
223
224
  # Add metadata
224
225
  if mint_metadata is not None:
225
- df = pd.merge(df, mint_metadata, left_on='ms_file_label', right_index=True)
226
+ df = pd.merge(df, mint_metadata, left_on='ms_file_label', right_index=True, how='left')
226
227
 
228
+ _facet_kws = dict(sharex=sharex, sharey=sharey)
229
+ if 'facet_kws' in kwargs.keys():
230
+ _facet_kws.update(kwargs.pop('facet_kws'))
231
+
227
232
  g = sns.relplot(
228
233
  data=df,
229
234
  x="Scan time [s]",
230
235
  y="Intensity",
231
236
  hue=hue,
232
237
  col="peak_label",
238
+ col_order=peak_labels,
233
239
  kind=kind,
234
240
  col_wrap=col_wrap,
235
241
  height=height,
236
242
  aspect=aspect,
237
- facet_kws=dict(sharex=sharex, sharey=sharey),
243
+ facet_kws=_facet_kws,
238
244
  legend=legend,
239
245
  **kwargs,
240
246
  )
@@ -231,8 +231,8 @@ def extract_ms1_properties(array, mz_mean):
231
231
  peak_max = intensities.max()
232
232
  peak_min = intensities.min()
233
233
  peak_median = np.median(intensities)
234
-
235
- peak_rt_of_max = times[masses.argmax()]
234
+
235
+ peak_rt_of_max = times[intensities.argmax()]
236
236
 
237
237
  peak_delta_int = np.abs(intensities[0] - intensities[-1])
238
238
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ms-mint
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Metabolomics Integrator (Mint)
5
5
  Home-page: https://github.com/LewisResearchGroup/ms-mint
6
6
  Author: Soren Wacker
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes