OpenMS
|
Helper class for loading .oms files (SQLite format) More...
#include <OpenMS/FORMAT/OMSFileLoad.h>
Public Types | |
using | Key = OMSFileStore::Key |
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... | |
void | load (ConsensusMap &consensus) |
Load data from database and populate a ConsensusMap object. More... | |
void | exportToJSON (std::ostream &output) |
Export database contents in JSON format, write to stream. More... | |
Public Member Functions inherited from ProgressLogger | |
ProgressLogger () | |
Constructor. More... | |
virtual | ~ProgressLogger () |
Destructor. More... | |
ProgressLogger (const ProgressLogger &other) | |
Copy constructor. More... | |
ProgressLogger & | operator= (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 (UInt64 bytes_processed=0) const |
void | nextProgress () const |
increment progress by 1 (according to range begin-end) More... | |
Private Member Functions | |
void | loadScoreTypes_ (IdentificationData &id_data) |
Load information on score type from the database into IdentificationData. More... | |
void | loadInputFiles_ (IdentificationData &id_data) |
Load information on input files from the database into IdentificationData. More... | |
void | loadProcessingSoftwares_ (IdentificationData &id_data) |
Load information on data processing software from the database into IdentificationData. More... | |
void | loadDBSearchParams_ (IdentificationData &id_data) |
Load information on sequence database search parameters from the database into IdentificationData. More... | |
void | loadProcessingSteps_ (IdentificationData &id_data) |
Load information on data processing steps from the database into IdentificationData. More... | |
void | loadObservations_ (IdentificationData &id_data) |
Load information on observations (e.g. spectra) from the database into IdentificationData. More... | |
void | loadParentSequences_ (IdentificationData &id_data) |
Load information on parent sequences (e.g. proteins) from the database into IdentificationData. More... | |
void | loadParentGroupSets_ (IdentificationData &id_data) |
Load information on parent group sets (e.g. protein groups) from the database into IdentificationData. More... | |
void | loadIdentifiedCompounds_ (IdentificationData &id_data) |
Load information on identified compounds from the database into IdentificationData. More... | |
void | loadIdentifiedSequences_ (IdentificationData &id_data) |
Load information on identified sequences (peptides or oligonucleotides) from the database into IdentificationData. More... | |
void | loadAdducts_ (IdentificationData &id_data) |
Load information on adducts from the database into IdentificationData. More... | |
void | loadObservationMatches_ (IdentificationData &id_data) |
Load information on observation matches (e.g. PSMs) from the database into IdentificationData. More... | |
template<class MapType > | |
String | loadMapMetaDataTemplate_ (MapType &features) |
Helper function for loading meta data on feature/consensus maps from the database. More... | |
void | loadMapMetaData_ (FeatureMap &features) |
Load feature map meta data from the database. More... | |
void | loadMapMetaData_ (ConsensusMap &consensus) |
Load consensus map meta data from the database. More... | |
void | loadDataProcessing_ (std::vector< DataProcessing > &data_processing) |
Load information on data processing for feature/consensus maps from the database. More... | |
void | loadFeatures_ (FeatureMap &features) |
Load information on features from the database into a feature map. More... | |
Feature | loadFeatureAndSubordinates_ (SQLite::Statement &query_feat, SQLite::Statement &query_meta, SQLite::Statement &query_match, SQLite::Statement &query_hull) |
Generate a feature (incl. subordinate features) from data returned by SQL queries. More... | |
void | loadConsensusColumnHeaders_ (ConsensusMap &consensus) |
Load consensus map column headers from the database. More... | |
void | loadConsensusFeatures_ (ConsensusMap &consensus) |
Load information on consensus features from the database into a consensus map. More... | |
BaseFeature | makeBaseFeature_ (int id, SQLite::Statement &query_feat, SQLite::Statement &query_meta, SQLite::Statement &query_match) |
Generate a BaseFeature (parent class) from data returned by SQL queries. More... | |
void | prepareQueriesBaseFeature_ (SQLite::Statement &query_meta, SQLite::Statement &query_match) |
Prepare SQL queries for loading (meta) data on BaseFeatures from the database. More... | |
bool | prepareQueryMetaInfo_ (SQLite::Statement &query, const String &parent_table) |
Prepare SQL query for loading meta values associated with a particular class (stored in parent_table ) More... | |
void | handleQueryMetaInfo_ (SQLite::Statement &query, MetaInfoInterface &info, Key parent_id) |
Store results from an SQL query on meta values in a MetaInfoInterface(-derived) object. More... | |
bool | prepareQueryAppliedProcessingStep_ (SQLite::Statement &query, const String &parent_table) |
Prepare SQL query for loading processing metadata associated with a particular class (stored in parent_table ) More... | |
void | handleQueryAppliedProcessingStep_ (SQLite::Statement &query, IdentificationDataInternal::ScoredProcessingResult &result, Key parent_id) |
Store results from an SQL query on processing metadata in a ScoredProcessingResult(-derived) object. More... | |
void | handleQueryParentMatch_ (SQLite::Statement &query, IdentificationData::ParentMatches &parent_matches, Key molecule_id) |
Store results from an SQL query on parent matches. More... | |
void | handleQueryPeakAnnotation_ (SQLite::Statement &query, IdentificationData::ObservationMatch &match, Key parent_id) |
Store results from an SQL query on peak annotations in an observation match. More... | |
QJsonArray | exportTableToJSON_ (const QString &table, const QString &order_by) |
Export the contents of a database table to JSON. More... | |
Static Private Member Functions | |
static bool | isEmpty_ (const SQLite::Statement &query) |
Does the query contain an empty SQL statement (signifying that it shouldn't be executed)? More... | |
static DataValue | makeDataValue_ (const SQLite::Statement &query) |
Generate a DataValue with information returned by an SQL query. More... | |
Static Private Attributes | |
static std::map< QString, QString > | export_order_by_ |
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_ |
ProgressLoggerImpl * | current_logger_ |
Static Protected Attributes inherited from ProgressLogger | |
static int | recursion_depth_ |
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.
using Key = OMSFileStore::Key |
Type used for database keys.
OMSFileLoad | ( | const String & | filename, |
LogType | log_type | ||
) |
Constructor.
Opens the connection to the database file (in read-only mode).
filename | Path to the .oms input file (SQLite database) |
log_type | Type of logging to use |
Exception::FailedAPICall | Database cannot be opened |
~OMSFileLoad | ( | ) |
Destructor.
Closes the connection to the database file.
|
private |
Export the contents of a database table to JSON.
void exportToJSON | ( | std::ostream & | output | ) |
Export database contents in JSON format, write to stream.
|
private |
Store results from an SQL query on processing metadata in a ScoredProcessingResult(-derived) object.
|
private |
Store results from an SQL query on meta values in a MetaInfoInterface(-derived) object.
|
private |
Store results from an SQL query on parent matches.
|
private |
Store results from an SQL query on peak annotations in an observation match.
|
staticprivate |
Does the query
contain an empty SQL statement (signifying that it shouldn't be executed)?
void load | ( | ConsensusMap & | consensus | ) |
Load data from database and populate a ConsensusMap object.
void load | ( | FeatureMap & | features | ) |
Load data from database and populate a FeatureMap object.
void load | ( | IdentificationData & | id_data | ) |
Load data from database and populate an IdentificationData object.
|
private |
Load information on adducts from the database into IdentificationData.
|
private |
Load consensus map column headers from the database.
|
private |
Load information on consensus features from the database into a consensus map.
|
private |
Load information on data processing for feature/consensus maps from the database.
|
private |
Load information on sequence database search parameters from the database into IdentificationData.
|
private |
Generate a feature (incl. subordinate features) from data returned by SQL queries.
|
private |
Load information on features from the database into a feature map.
|
private |
Load information on identified compounds from the database into IdentificationData.
|
private |
Load information on identified sequences (peptides or oligonucleotides) from the database into IdentificationData.
|
private |
Load information on input files from the database into IdentificationData.
|
private |
Load consensus map meta data from the database.
|
private |
Load feature map meta data from the database.
Helper function for loading meta data on feature/consensus maps from the database.
|
private |
Load information on observation matches (e.g. PSMs) from the database into IdentificationData.
|
private |
Load information on observations (e.g. spectra) from the database into IdentificationData.
|
private |
Load information on parent group sets (e.g. protein groups) from the database into IdentificationData.
|
private |
Load information on parent sequences (e.g. proteins) from the database into IdentificationData.
|
private |
Load information on data processing software from the database into IdentificationData.
|
private |
Load information on data processing steps from the database into IdentificationData.
|
private |
Load information on score type from the database into IdentificationData.
|
private |
Generate a BaseFeature (parent class) from data returned by SQL queries.
|
staticprivate |
Generate a DataValue with information returned by an SQL query.
|
private |
Prepare SQL queries for loading (meta) data on BaseFeatures from the database.
|
private |
Prepare SQL query for loading processing metadata associated with a particular class (stored in parent_table
)
|
private |
Prepare SQL query for loading meta values associated with a particular class (stored in parent_table
)
|
private |
|
private |
The database connection (read)
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
query for score types used in JSON export
|
private |
schema version number