You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/user_guide/ms_data.rst
+30-2Lines changed: 30 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -653,7 +653,8 @@ mass spectra that are not :term:`MS1` spectra
653
653
654
654
# 'filtered' now only contains spectra with MS level >= 2
655
655
656
-
Alternatively, we can chose to load only spectra of a certain level using :py:class:`~.PeakFileOptions`, which is even more efficient.
656
+
Alternatively, we can choose to load only spectra of a certain level using :py:class:`~.PeakFileOptions`, which is even more efficient since
657
+
unwanted data is not even loaded into memory.
657
658
658
659
.. code-block:: python
659
660
:linenos:
@@ -669,7 +670,7 @@ Alternatively, we can chose to load only spectra of a certain level using :py:cl
669
670
670
671
# 'filtered' now only contains spectra with MS level == 2
671
672
672
-
# Now exp contains only MS level 2 spectra
673
+
Now exp contains only MS level 2 spectra
673
674
674
675
675
676
Filtering by Scan Number
@@ -687,6 +688,33 @@ to only retain a list of MS scans we are interested in:
687
688
for k, s inenumerate(inp):
688
689
if k in scan_nrs:
689
690
filtered.addSpectrum(s)
691
+
692
+
Note: the scan numbers are the index of the respective spectra in the data file (mzML). This may not be identical to the vendor scan number, especially if the data has been sliced/filtered before.
693
+
694
+
Advanced Filtering of NativeID via SpectrumLookup
695
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
696
+
697
+
To find a spectrum using their original scan number from their native ID we can use :py:class:`~.SpectrumLookup`:
698
+
699
+
.. code-block:: python
700
+
:linenos:
701
+
702
+
lookup = oms.SpectrumLookup()
703
+
704
+
## now, we need to define how to extract the vendor scan number from the 'id' attribute in mzML:
0 commit comments