OpenMS
Loading...
Searching...
No Matches
MzMLSqliteSwathHandler Class Reference

Read-only accessor for SWATH/DIA spectrum indices stored in an sqMass file. More...

#include <OpenMS/FORMAT/HANDLERS/MzMLSqliteSwathHandler.h>

Collaboration diagram for MzMLSqliteSwathHandler:
[legend]

Public Member Functions

 MzMLSqliteSwathHandler (const std::string &filename)
 Construct from the path of an sqMass file.
 
std::vector< OpenSwath::SwathMapreadSwathWindows ()
 Read the SWATH window boundaries from the file.
 
std::vector< int > readMS1Spectra ()
 Read the indices of every MS1 spectrum.
 
std::vector< int > readSpectraForWindow (const OpenSwath::SwathMap &swath_map)
 Read the indices of every spectrum that belongs to a given SWATH window.
 

Protected Attributes

std::string filename_
 Path of the sqMass file passed in at construction time.
 
Int spec_id_
 Next spectrum id used when appending spectra to the database; lets multiple append passes coexist on the same file.
 
Int chrom_id_
 Next chromatogram id used when appending chromatograms to the database; lets multiple append passes coexist on the same file.
 

Detailed Description

Read-only accessor for SWATH/DIA spectrum indices stored in an sqMass file.

Exposes three lookups against a single sqMass file:

  • readSwathWindows – the SWATH window definitions (precursor isolation centre and lower/upper offsets),
  • readMS1Spectra – the spectrum indices of all MS1 scans,
  • readSpectraForWindow – the spectrum indices that belong to a given SWATH window, identified by its centre m/z.

Internal helper class used by the OpenSWATH I/O stack; not part of the stable public API.

Constructor & Destructor Documentation

◆ MzMLSqliteSwathHandler()

MzMLSqliteSwathHandler ( const std::string &  filename)
inline

Construct from the path of an sqMass file.

The file is not opened by the constructor; each accessor opens its own connection on demand.

Parameters
[in]filenamePath of the sqMass file to read.

Member Function Documentation

◆ readMS1Spectra()

std::vector< int > readMS1Spectra ( )

Read the indices of every MS1 spectrum.

Returns
Spectrum indices for the MS1 scans in the file's natural order.
Exceptions
Exception::SqlOperationFailedif the sqMass file cannot be opened.
Exception::IllegalArgumentif preparing the SQL query fails.

◆ readSpectraForWindow()

std::vector< int > readSpectraForWindow ( const OpenSwath::SwathMap swath_map)

Read the indices of every spectrum that belongs to a given SWATH window.

The window is identified by swath_map's center value; spectra whose precursor isolation centre lies within a small fixed tolerance (0.01 m/z) of swath_map.center are returned.

Note
Only swath_map.center is consulted; the lower and upper fields are ignored.
Parameters
[in]swath_mapSWATH window to look up; only its center is used.
Returns
Spectrum indices that fall into the window, in the file's natural order.
Exceptions
Exception::SqlOperationFailedif the sqMass file cannot be opened.
Exception::IllegalArgumentif preparing the SQL query fails.

◆ readSwathWindows()

std::vector< OpenSwath::SwathMap > readSwathWindows ( )

Read the SWATH window boundaries from the file.

Returns one SwathMap entry per distinct precursor isolation centre present at MS level 2; center, lower and upper are filled. Other SwathMap fields are left at their default values.

Returns
SWATH window definitions in the file's natural order.
Exceptions
Exception::SqlOperationFailedif the sqMass file cannot be opened.
Exception::IllegalArgumentif preparing the SQL query fails.

Member Data Documentation

◆ chrom_id_

Int chrom_id_
protected

Next chromatogram id used when appending chromatograms to the database; lets multiple append passes coexist on the same file.

◆ filename_

std::string filename_
protected

Path of the sqMass file passed in at construction time.

◆ spec_id_

Int spec_id_
protected

Next spectrum id used when appending spectra to the database; lets multiple append passes coexist on the same file.