OpenMS  2.8.0
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
OMSFileLoad Class Reference

Helper class for loading .oms files (SQLite format) More...

#include <OpenMS/FORMAT/OMSFileLoad.h>

Inheritance diagram for OMSFileLoad:
[legend]
Collaboration diagram for OMSFileLoad:
[legend]

Public Types

using Key = qint64
 Type used for database keys. More...
 
- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 

Public Member Functions

 OMSFileLoad (const String &filename, LogType log_type)
 Constructor. More...
 
 ~OMSFileLoad ()
 Destructor. More...
 
void load (IdentificationData &id_data)
 Load data from database and populate an IdentificationData object. More...
 
void load (FeatureMap &features)
 Load data from database and populate a FeatureMap object. More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress () const
 Ends the progress display. More...
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Private Member Functions

void loadScoreTypes_ (IdentificationData &id_data)
 
void loadInputFiles_ (IdentificationData &id_data)
 
void loadProcessingSoftwares_ (IdentificationData &id_data)
 
void loadDBSearchParams_ (IdentificationData &id_data)
 
void loadProcessingSteps_ (IdentificationData &id_data)
 
void loadObservations_ (IdentificationData &id_data)
 
void loadParentSequences_ (IdentificationData &id_data)
 
void loadParentGroupSets_ (IdentificationData &id_data)
 
void loadIdentifiedCompounds_ (IdentificationData &id_data)
 
void loadIdentifiedSequences_ (IdentificationData &id_data)
 
void loadAdducts_ (IdentificationData &id_data)
 
void loadObservationMatches_ (IdentificationData &id_data)
 
void loadMapMetaData_ (FeatureMap &features)
 
void loadDataProcessing_ (FeatureMap &features)
 
void loadFeatures_ (FeatureMap &features)
 
Feature loadFeatureAndSubordinates_ (QSqlQuery &query_feat, std::optional< QSqlQuery > &query_meta, std::optional< QSqlQuery > &query_hull, std::optional< QSqlQuery > &query_match)
 
bool prepareQueryMetaInfo_ (QSqlQuery &query, const String &parent_table)
 
void handleQueryMetaInfo_ (QSqlQuery &query, MetaInfoInterface &info, Key parent_id)
 
bool prepareQueryAppliedProcessingStep_ (QSqlQuery &query, const String &parent_table)
 
void handleQueryAppliedProcessingStep_ (QSqlQuery &query, IdentificationDataInternal::ScoredProcessingResult &result, Key parent_id)
 
void handleQueryParentMatch_ (QSqlQuery &query, IdentificationData::ParentMatches &parent_matches, Key molecule_id)
 
void handleQueryPeakAnnotation_ (QSqlQuery &query, IdentificationData::ObservationMatch &match, Key parent_id)
 

Static Private Member Functions

static DataValue makeDataValue_ (const QSqlQuery &query)
 

Private Attributes

QString db_name_
 
std::unordered_map< Key, IdentificationData::ScoreTypeRefscore_type_refs_
 
std::unordered_map< Key, IdentificationData::InputFileRefinput_file_refs_
 
std::unordered_map< Key, IdentificationData::ProcessingSoftwareRefprocessing_software_refs_
 
std::unordered_map< Key, IdentificationData::ProcessingStepRefprocessing_step_refs_
 
std::unordered_map< Key, IdentificationData::SearchParamRefsearch_param_refs_
 
std::unordered_map< Key, IdentificationData::ObservationRefobservation_refs_
 
std::unordered_map< Key, IdentificationData::ParentSequenceRefparent_refs_
 
std::unordered_map< Key, IdentificationData::IdentifiedMoleculeidentified_molecule_vars_
 
std::unordered_map< Key, IdentificationData::ObservationMatchRefobservation_match_refs_
 
std::unordered_map< Key, IdentificationData::AdductRefadduct_refs_
 

Additional Inherited Members

- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

Helper class for loading .oms files (SQLite format)

This class encapsulates the SQLite database stored in a .oms file and allows to load data from it.

Member Typedef Documentation

◆ Key

using Key = qint64

Type used for database keys.

Constructor & Destructor Documentation

◆ OMSFileLoad()

OMSFileLoad ( const String filename,
LogType  log_type 
)

Constructor.

Opens the connection to the database file (in read-only mode).

Parameters
filenamePath to the .oms input file (SQLite database)
log_typeType of logging to use
Exceptions
Exception::FailedAPICallDatabase cannot be opened

◆ ~OMSFileLoad()

Destructor.

Closes the connection to the database file.

Member Function Documentation

◆ handleQueryAppliedProcessingStep_()

void handleQueryAppliedProcessingStep_ ( QSqlQuery &  query,
IdentificationDataInternal::ScoredProcessingResult result,
Key  parent_id 
)
private

◆ handleQueryMetaInfo_()

void handleQueryMetaInfo_ ( QSqlQuery &  query,
MetaInfoInterface info,
Key  parent_id 
)
private

◆ handleQueryParentMatch_()

void handleQueryParentMatch_ ( QSqlQuery &  query,
IdentificationData::ParentMatches parent_matches,
Key  molecule_id 
)
private

◆ handleQueryPeakAnnotation_()

void handleQueryPeakAnnotation_ ( QSqlQuery &  query,
IdentificationData::ObservationMatch match,
Key  parent_id 
)
private

◆ load() [1/2]

void load ( FeatureMap features)

Load data from database and populate a FeatureMap object.

◆ load() [2/2]

void load ( IdentificationData id_data)

Load data from database and populate an IdentificationData object.

◆ loadAdducts_()

void loadAdducts_ ( IdentificationData id_data)
private

◆ loadDataProcessing_()

void loadDataProcessing_ ( FeatureMap features)
private

◆ loadDBSearchParams_()

void loadDBSearchParams_ ( IdentificationData id_data)
private

◆ loadFeatureAndSubordinates_()

Feature loadFeatureAndSubordinates_ ( QSqlQuery &  query_feat,
std::optional< QSqlQuery > &  query_meta,
std::optional< QSqlQuery > &  query_hull,
std::optional< QSqlQuery > &  query_match 
)
private

◆ loadFeatures_()

void loadFeatures_ ( FeatureMap features)
private

◆ loadIdentifiedCompounds_()

void loadIdentifiedCompounds_ ( IdentificationData id_data)
private

◆ loadIdentifiedSequences_()

void loadIdentifiedSequences_ ( IdentificationData id_data)
private

◆ loadInputFiles_()

void loadInputFiles_ ( IdentificationData id_data)
private

◆ loadMapMetaData_()

void loadMapMetaData_ ( FeatureMap features)
private

◆ loadObservationMatches_()

void loadObservationMatches_ ( IdentificationData id_data)
private

◆ loadObservations_()

void loadObservations_ ( IdentificationData id_data)
private

◆ loadParentGroupSets_()

void loadParentGroupSets_ ( IdentificationData id_data)
private

◆ loadParentSequences_()

void loadParentSequences_ ( IdentificationData id_data)
private

◆ loadProcessingSoftwares_()

void loadProcessingSoftwares_ ( IdentificationData id_data)
private

◆ loadProcessingSteps_()

void loadProcessingSteps_ ( IdentificationData id_data)
private

◆ loadScoreTypes_()

void loadScoreTypes_ ( IdentificationData id_data)
private

◆ makeDataValue_()

static DataValue makeDataValue_ ( const QSqlQuery &  query)
staticprivate

◆ prepareQueryAppliedProcessingStep_()

bool prepareQueryAppliedProcessingStep_ ( QSqlQuery &  query,
const String parent_table 
)
private

◆ prepareQueryMetaInfo_()

bool prepareQueryMetaInfo_ ( QSqlQuery &  query,
const String parent_table 
)
private

Member Data Documentation

◆ adduct_refs_

std::unordered_map<Key, IdentificationData::AdductRef> adduct_refs_
private

◆ db_name_

QString db_name_
private

◆ identified_molecule_vars_

std::unordered_map<Key, IdentificationData::IdentifiedMolecule> identified_molecule_vars_
private

◆ input_file_refs_

std::unordered_map<Key, IdentificationData::InputFileRef> input_file_refs_
private

◆ observation_match_refs_

std::unordered_map<Key, IdentificationData::ObservationMatchRef> observation_match_refs_
private

◆ observation_refs_

std::unordered_map<Key, IdentificationData::ObservationRef> observation_refs_
private

◆ parent_refs_

std::unordered_map<Key, IdentificationData::ParentSequenceRef> parent_refs_
private

◆ processing_software_refs_

std::unordered_map<Key, IdentificationData::ProcessingSoftwareRef> processing_software_refs_
private

◆ processing_step_refs_

std::unordered_map<Key, IdentificationData::ProcessingStepRef> processing_step_refs_
private

◆ score_type_refs_

std::unordered_map<Key, IdentificationData::ScoreTypeRef> score_type_refs_
private

◆ search_param_refs_

std::unordered_map<Key, IdentificationData::SearchParamRef> search_param_refs_
private