Skip to content

Commit f263346

Browse files
committed
Merge branch 'master' into i70_resolvingpower
2 parents 59ed041 + 1255fff commit f263346

File tree

9 files changed

+4044
-3936
lines changed

9 files changed

+4044
-3936
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.3.0
2+
current_version = 3.4.1
33
commit = False
44
tag = False
55

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ CoreMS aims to provide
4949

5050
## Current Version
5151

52-
`3.3.0`
52+
`3.4.1`
5353

5454
***
5555

@@ -336,11 +336,11 @@ UML (unified modeling language) diagrams for Direct Infusion FT-MS and GC-MS cla
336336
337337
If you use CoreMS in your work, please use the following citation:
338338
339-
Version [3.3.0 Release on GitHub](https://github.com/EMSL-Computing/CoreMS/releases/tag/v3.3.0), archived on Zenodo:
339+
Version [3.4.1 Release on GitHub](https://github.com/EMSL-Computing/CoreMS/releases/tag/v3.4.1), archived on Zenodo:
340340
341341
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14009575.svg)](https://doi.org/10.5281/zenodo.14009575)
342342
343-
Yuri E. Corilo, William R. Kew, Lee Ann McCue, Katherine R . Heal, James C. Carr (2024, October 29). EMSL-Computing/CoreMS: CoreMS 3.3.0 (Version v3.3.0), as developed on Github. Zenodo. http://doi.org/10.5281/zenodo.14009575
343+
Yuri E. Corilo, William R. Kew, Lee Ann McCue, Katherine R . Heal, James C. Carr (2024, October 29). EMSL-Computing/CoreMS: CoreMS 3.4.1 (Version v3.4.1), as developed on Github. Zenodo. http://doi.org/10.5281/zenodo.14009575
344344
345345
```
346346

corems/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Yuri E. Corilo"
2-
__version__ = "3.3.0"
2+
__version__ = "3.4.1"
33
import time
44
import os
55
import sys

corems/mass_spectra/input/rawFileReader.py

+45-26
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,40 @@ def get_filter_for_scan_num(self, scan_number: int) -> List[str]:
307307

308308
return str(scan_label).split()
309309

310+
def get_ms_level_for_scan_num(self, scan_number: int) -> str:
311+
"""
312+
Get the MS order for the given scan number.
313+
314+
Parameters:
315+
-----------
316+
scan_number : int
317+
The scan number
318+
319+
Returns:
320+
--------
321+
int
322+
The MS order type (1 for MS, 2 for MS2, etc.)
323+
"""
324+
scan_filter = self.iRawDataPlus.GetFilterForScanNumber(scan_number)
325+
326+
msordertype = {
327+
MSOrderType.Ms: 1,
328+
MSOrderType.Ms2: 2,
329+
MSOrderType.Ms3: 3,
330+
MSOrderType.Ms4: 4,
331+
MSOrderType.Ms5: 5,
332+
MSOrderType.Ms6: 6,
333+
MSOrderType.Ms7: 7,
334+
MSOrderType.Ms8: 8,
335+
MSOrderType.Ms9: 9,
336+
MSOrderType.Ms10: 10,
337+
}
338+
339+
if scan_filter.MSOrder in msordertype:
340+
return msordertype[scan_filter.MSOrder]
341+
else:
342+
raise Exception("MS Order Type not found")
343+
310344
def check_full_scan(self, scan_number: int) -> bool:
311345
# scan_filter.ScanMode 0 = FULL
312346
scan_filter = self.iRawDataPlus.GetFilterForScanNumber(scan_number)
@@ -1286,31 +1320,16 @@ def get_scan_df(self):
12861320
# This automatically brings in all the data
12871321
self.chromatogram_settings.scans = (-1, -1)
12881322

1289-
# Get scan df info; starting with bulk ms1 and ms2 scans
1290-
ms1_tic_data, _ = self.get_tic(ms_type="MS", peak_detection=False, smooth=False)
1291-
ms1_scan_dict = {
1292-
"scan": ms1_tic_data.scans,
1293-
"scan_time": ms1_tic_data.time,
1294-
"tic": ms1_tic_data.tic,
1295-
}
1296-
ms1_tic_df = pd.DataFrame.from_dict(ms1_scan_dict)
1297-
ms1_tic_df["ms_level"] = "ms1"
1298-
1299-
ms2_tic_data, _ = self.get_tic(
1300-
ms_type="MS2", peak_detection=False, smooth=False
1301-
)
1302-
ms2_scan_dict = {
1303-
"scan": ms2_tic_data.scans,
1304-
"scan_time": ms2_tic_data.time,
1305-
"tic": ms2_tic_data.tic,
1323+
# Get scan df info; starting with TIC data
1324+
tic_data, _ = self.get_tic(ms_type="all", peak_detection=False, smooth=False)
1325+
tic_data = {
1326+
"scan": tic_data.scans,
1327+
"scan_time": tic_data.time,
1328+
"tic": tic_data.tic,
13061329
}
1307-
ms2_tic_df = pd.DataFrame.from_dict(ms2_scan_dict)
1308-
ms2_tic_df["ms_level"] = "ms2"
1309-
1310-
scan_df = (
1311-
pd.concat([ms1_tic_df, ms2_tic_df], axis=0).sort_values(by="scan").reindex()
1312-
)
1313-
1330+
scan_df = pd.DataFrame.from_dict(tic_data)
1331+
scan_df["ms_level"] = None
1332+
13141333
# get scan text
13151334
scan_filter_df = pd.DataFrame.from_dict(
13161335
self.get_all_filters()[0], orient="index"
@@ -1330,11 +1349,11 @@ def get_scan_df(self):
13301349
)
13311350
scan_df["precursor_mz"] = scan_df.scan_text.str.extract(r"(\d+\.\d+)@")
13321351
scan_df["precursor_mz"] = scan_df["precursor_mz"].astype(float)
1333-
scan_df["ms_level"] = scan_df["ms_level"].str.replace("ms", "").astype(int)
13341352

1335-
# Assign each scan as centroid or profile
1353+
# Assign each scan as centroid or profile and add ms_level
13361354
scan_df["ms_format"] = None
13371355
for i in scan_df.scan.to_list():
1356+
scan_df.loc[scan_df.scan == i, "ms_level"] = self.get_ms_level_for_scan_num(i)
13381357
if self.iRawDataPlus.IsCentroidScanFromScanNumber(i):
13391358
scan_df.loc[scan_df.scan == i, "ms_format"] = "centroid"
13401359
else:

docs/corems.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ <h1 id="corems">CoreMS</h1>
154154

155155
<h2 id="current-version">Current Version</h2>
156156

157-
<p><code>3.3.0</code></p>
157+
<p><code>3.4.1</code></p>
158158

159159
<hr />
160160

@@ -489,11 +489,11 @@ <h2 id="citing-corems">Citing CoreMS</h2>
489489

490490
<p>If you use CoreMS in your work, please use the following citation:</p>
491491

492-
<p>Version <a href="https://github.com/EMSL-Computing/CoreMS/releases/tag/v3.3.0">3.3.0 Release on GitHub</a>, archived on Zenodo: </p>
492+
<p>Version <a href="https://github.com/EMSL-Computing/CoreMS/releases/tag/v3.4.1">3.4.1 Release on GitHub</a>, archived on Zenodo: </p>
493493

494494
<p><a href="https://doi.org/10.5281/zenodo.14009575"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.14009575.svg" alt="DOI" /></a></p>
495495

496-
<p>Yuri E. Corilo, William R. Kew, Lee Ann McCue, Katherine R . Heal, James C. Carr (2024, October 29). EMSL-Computing/CoreMS: CoreMS 3.3.0 (Version v3.3.0), as developed on Github. Zenodo. <a href="http://doi.org/10.5281/zenodo.14009575">http://doi.org/10.5281/zenodo.14009575</a></p>
496+
<p>Yuri E. Corilo, William R. Kew, Lee Ann McCue, Katherine R . Heal, James C. Carr (2024, October 29). EMSL-Computing/CoreMS: CoreMS 3.4.1 (Version v3.4.1), as developed on Github. Zenodo. <a href="http://doi.org/10.5281/zenodo.14009575">http://doi.org/10.5281/zenodo.14009575</a></p>
497497

498498
<p>```</p>
499499

@@ -529,7 +529,7 @@ <h2 id="citing-corems">Citing CoreMS</h2>
529529
<label class="view-source-button" for="mod-corems-view-source"><span>View Source</span></label>
530530

531531
<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos"> 1</span></a><span class="n">__author__</span> <span class="o">=</span> <span class="s2">&quot;Yuri E. Corilo&quot;</span>
532-
</span><span id="L-2"><a href="#L-2"><span class="linenos"> 2</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;3.3.0&quot;</span>
532+
</span><span id="L-2"><a href="#L-2"><span class="linenos"> 2</span></a><span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;3.4.1&quot;</span>
533533
</span><span id="L-3"><a href="#L-3"><span class="linenos"> 3</span></a><span class="kn">import</span> <span class="nn">time</span>
534534
</span><span id="L-4"><a href="#L-4"><span class="linenos"> 4</span></a><span class="kn">import</span> <span class="nn">os</span>
535535
</span><span id="L-5"><a href="#L-5"><span class="linenos"> 5</span></a><span class="kn">import</span> <span class="nn">sys</span>

0 commit comments

Comments
 (0)