Skip to content

Commit

Permalink
changes from stream mzml reading to sequential
Browse files Browse the repository at this point in the history
  • Loading branch information
ypriverol committed Mar 8, 2025
1 parent 15ed5d7 commit 68d9e89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"MD033": {
"allowed_elements": ["details", "summary"]
}
}
6 changes: 3 additions & 3 deletions quantmsutils/mzml/mzml_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def transform_mzml_spectrum(
# Extract peaks data
mz_array, intensity_array = spectrum.get_peaks()
peak_count = len(mz_array)
scan_id = self._extract_scan_id(spectrum)

# Basic spectrum properties
ms_level = spectrum.getMSLevel()
Expand All @@ -252,7 +253,6 @@ def transform_mzml_spectrum(

# Extract spectrum ID for ID-only mode
if self.id_only:
scan_id = self._extract_scan_id(spectrum)
self.psm_parts.append(
{
SCAN: scan_id,
Expand All @@ -273,7 +273,7 @@ def transform_mzml_spectrum(
intensity = first_precursor_calculated["intensity"]

row_data = {
SCAN: spectrum.getNativeID(),
SCAN: scan_id,
MS_LEVEL: ms_level,
NUM_PEAKS: peak_count,
BASE_PEAK_INTENSITY: base_peak_intensity,
Expand All @@ -297,7 +297,7 @@ def transform_mzml_spectrum(
else:
# Process MS1
row_data = {
SCAN: spectrum.getNativeID(),
SCAN: scan_id,
MS_LEVEL: ms_level,
CHARGE: None,
NUM_PEAKS: peak_count,
Expand Down

0 comments on commit 68d9e89

Please sign in to comment.