tidyms.MSData¶
- class MSData(ms_mode: str = 'centroid', instrument: str = 'qtof', separation: str = 'uplc', is_virtual_sample: bool = False)¶
Reader object for raw MS data.
Manages chromatogram, roi and spectra creation.
- Attributes:
- pathstr
Path to a mzML file.
- ms_mode{“centroid”, “profile”}, default=”centroid”
The mode in which the MS data is stored.
- instrument{“qtof”. “orbitrap”}, default=”qtof”
The MS instrument type used to acquire the experimental data. Used to set default parameters in the methods.
- separation{“uplc”, “hplc”}, default=”uplc”
The separation technique used before MS analysis. Used to set default parameters in the methods.
- abstract get_chromatogram(n: int) Tuple[str, Chromatogram]¶
Get the nth chromatogram stored in the file.
- Parameters:
- nint
- Returns:
- namestr
- chromatogramlcms.Chromatogram
- abstract get_n_chromatograms() int¶
Get the chromatogram count in the file
- Returns:
- n_chromatogramsint
- abstract get_n_spectra() int¶
Get the spectra count in the file
- Returns:
- n_spectraint
- abstract get_spectra_iterator(ms_level: int = 1, start: int = 0, end: int | None = None, start_time: float = 0.0, end_time: float | None = None) Generator[Tuple[int, MSSpectrum], None, None]¶
Yields the spectra in the file.
- Parameters:
- ms_levelint, default=1
Use data from this ms level.
- startint, default=0
Starts iteration at this spectrum index.
- endint or None, default=None
Ends iteration at this spectrum index. If None, stops after the last spectrum.
- start_timefloat, default=0.0
Ignore scans with acquisition times lower than this value.
- end_timefloat or None, default=None
Ignore scans with acquisition times higher than this value.
- Yields:
- scan_number: int
- spectrumlcms.MSSpectrum
- abstract get_spectrum(n: int) MSSpectrum¶
get the nth spectrum stored in the file.
- Parameters:
- n: int
scan number
- Returns:
- MSSpectrum