OpenMS
|
Helper class for storing .oms files (SQLite format) More...
#include <OpenMS/FORMAT/OMSFileStore.h>
Public Types | |
using | Key = int64_t |
< Type used for database keys More... | |
Public Types inherited from ProgressLogger | |
enum | LogType { CMD , GUI , NONE } |
Possible log types. More... | |
Public Member Functions | |
OMSFileStore (const String &filename, LogType log_type) | |
Constructor. More... | |
~OMSFileStore () | |
Destructor. More... | |
void | store (const IdentificationData &id_data) |
Write data from an IdentificationData object to database. More... | |
void | store (const FeatureMap &features) |
Write data from a FeatureMap object to database. More... | |
void | store (const ConsensusMap &consensus) |
Write data from a ConsensusMap object to database. 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 | setLogger (ProgressLoggerImpl *logger) |
Sets the logger to be used for progress logging. 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 | createTable_ (const String &name, const String &definition, bool may_exist=false) |
Helper function to create a database table. More... | |
void | createTableDataValue_DataType_ () |
Create a database table for the data types used in DataValue. More... | |
void | createTableCVTerm_ () |
Create a database table (and prepare a query) for storing CV terms. More... | |
void | createTableMetaInfo_ (const String &parent_table, const String &key_column="id") |
Create a database table (and prepare a query) for storing meta values. More... | |
void | storeVersionAndDate_ () |
Store version information and current date/time in the database. More... | |
Key | storeCVTerm_ (const CVTerm &cv_term) |
Store a CV term in the database. More... | |
void | storeMetaInfo_ (const MetaInfoInterface &info, const String &parent_table, Key parent_id) |
Store meta values (associated with one object) in the database. More... | |
template<class MetaInfoInterfaceContainer , class DBKeyTable > | |
void | storeMetaInfos_ (const MetaInfoInterfaceContainer &container, const String &parent_table, const DBKeyTable &db_keys) |
Store meta values (for all objects in a container) in the database. More... | |
Helper functions for storing identification data | |
Store score type information from IdentificationData in the database | |
void | storeScoreTypes_ (const IdentificationData &id_data) |
void | storeInputFiles_ (const IdentificationData &id_data) |
Store input file information from IdentificationData in the database. More... | |
void | storeProcessingSoftwares_ (const IdentificationData &id_data) |
Store information on data processing software from IdentificationData in the database. More... | |
void | storeDBSearchParams_ (const IdentificationData &id_data) |
Store sequence database search parameters from IdentificationData in the database. More... | |
void | storeProcessingSteps_ (const IdentificationData &id_data) |
Store information on data processing steps from IdentificationData in the database. More... | |
void | storeObservations_ (const IdentificationData &id_data) |
Store information on observations (e.g. spectra) from IdentificationData in the database. More... | |
void | storeParentSequences_ (const IdentificationData &id_data) |
Store information on parent sequences (e.g. proteins) from IdentificationData in the database. More... | |
void | storeParentGroupSets_ (const IdentificationData &id_data) |
Store information on parent group sets (e.g. protein groups) from IdentificationData in the database. More... | |
void | storeIdentifiedCompounds_ (const IdentificationData &id_data) |
Store information on identified compounds from IdentificationData in the database. More... | |
void | storeIdentifiedSequences_ (const IdentificationData &id_data) |
Store information on identified sequences (peptides or oligonucleotides) from IdentificationData in the database. More... | |
void | storeAdducts_ (const IdentificationData &id_data) |
Store information on adducts from IdentificationData in the database. More... | |
void | storeObservationMatches_ (const IdentificationData &id_data) |
Store information on observation matches (e.g. PSMs) from IdentificationData in the database. More... | |
void | createTableMoleculeType_ () |
Create a database table for molecule types (proteins, compounds, RNA) More... | |
void | createTableAppliedProcessingStep_ (const String &parent_table) |
Create a database table for storing processing metadata. More... | |
void | storeAppliedProcessingStep_ (const IdentificationData::AppliedProcessingStep &step, Size step_order, const String &parent_table, Key parent_id) |
Store processing metadata for a particular class (stored in parent_table ) in the database. More... | |
void | createTableIdentifiedMolecule_ () |
Create a database table for storing identified molecules (peptides, compounds, oligonucleotides) More... | |
Key | getDatabaseKey_ (const IdentificationData::IdentifiedMolecule &molecule_var) |
Return the database key used for an identified molecule (peptide, compound or oligonucleotide) More... | |
void | createTableParentMatches_ () |
Create a database table for storing parent matches (e.g. proteins for a peptide) More... | |
void | storeParentMatches_ (const IdentificationData::ParentMatches &matches, Key molecule_id) |
Store information on parent matches in the database. More... | |
template<class ScoredProcessingResultContainer , class DBKeyTable > | |
void | storeScoredProcessingResults_ (const ScoredProcessingResultContainer &container, const String &parent_table, const DBKeyTable &db_keys) |
Store metadata on scores/processing steps (for all objects in a container) in the database. More... | |
Helper functions for storing (consensus) feature data | |
Create a table for storing feature information | |
void | createTableBaseFeature_ (bool with_metainfo, bool with_idmatches) |
void | storeBaseFeature_ (const BaseFeature &feature, int feature_id, int parent_id) |
Store information on a feature in the database. More... | |
void | storeFeatures_ (const FeatureMap &features) |
Store information on features from a feature map in the database. More... | |
void | storeFeatureAndSubordinates_ (const Feature &feature, int &feature_id, int parent_id) |
Store a feature (incl. its subordinate features) in the database. More... | |
template<class FeatureContainer , class Predicate > | |
bool | anyFeaturePredicate_ (const FeatureContainer &features, const Predicate &pred) |
check whether a predicate is true for any feature (or subordinate thereof) in a container More... | |
template<class MapType > | |
void | storeMapMetaData_ (const MapType &features, const String &experiment_type="") |
Store feature/consensus map meta data in the database. More... | |
void | storeDataProcessing_ (const std::vector< DataProcessing > &data_processing) |
Store information on data processing from a feature/consensus map in the database. More... | |
void | storeConsensusFeatures_ (const ConsensusMap &consensus) |
Store information on consensus features from a consensus map in the database. More... | |
void | storeConsensusColumnHeaders_ (const ConsensusMap &consensus) |
Store information on column headers from a consensus map in the database. More... | |
Additional Inherited Members | |
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 storing .oms files (SQLite format)
This class encapsulates the SQLite database in a .oms file and allows to write data to it.
using Key = int64_t |
< Type used for database keys
OMSFileStore | ( | const String & | filename, |
LogType | log_type | ||
) |
Constructor.
Deletes the output file if it exists, then creates an SQLite database in its place. Opens the database and configures it for fast writing.
filename | Path to the .oms output file (SQLite database) |
log_type | Type of logging to use |
Exception::FailedAPICall | Database cannot be opened |
~OMSFileStore | ( | ) |
Destructor.
Closes the connection to the database file.
|
inlineprivate |
check whether a predicate is true for any feature (or subordinate thereof) in a container
|
private |
Helper function to create a database table.
name | Name of the new table |
definition | Table definition in SQL |
may_exist | If true, the table may already exist (otherwise this is an error) |
|
private |
Create a database table for storing processing metadata.
Referenced by OMSFileStore::storeScoredProcessingResults_().
|
private |
|
private |
Create a database table (and prepare a query) for storing CV terms.
|
private |
Create a database table for the data types used in DataValue.
|
private |
Create a database table for storing identified molecules (peptides, compounds, oligonucleotides)
Create a database table (and prepare a query) for storing meta values.
Referenced by OMSFileStore::storeMetaInfos_().
|
private |
Create a database table for molecule types (proteins, compounds, RNA)
|
private |
Create a database table for storing parent matches (e.g. proteins for a peptide)
|
private |
Return the database key used for an identified molecule (peptide, compound or oligonucleotide)
void store | ( | const ConsensusMap & | consensus | ) |
Write data from a ConsensusMap object to database.
void store | ( | const FeatureMap & | features | ) |
Write data from a FeatureMap object to database.
void store | ( | const IdentificationData & | id_data | ) |
Write data from an IdentificationData object to database.
|
private |
Store information on adducts from IdentificationData in the database.
|
private |
Store processing metadata for a particular class (stored in parent_table
) in the database.
Referenced by OMSFileStore::storeScoredProcessingResults_().
|
private |
Store information on a feature in the database.
|
private |
Store information on column headers from a consensus map in the database.
|
private |
Store information on consensus features from a consensus map in the database.
|
private |
Store information on data processing from a feature/consensus map in the database.
|
private |
Store sequence database search parameters from IdentificationData in the database.
|
private |
Store a feature (incl. its subordinate features) in the database.
|
private |
Store information on features from a feature map in the database.
|
private |
Store information on identified compounds from IdentificationData in the database.
|
private |
Store information on identified sequences (peptides or oligonucleotides) from IdentificationData in the database.
|
private |
Store input file information from IdentificationData in the database.
Store feature/consensus map meta data in the database.
|
private |
Store meta values (associated with one object) in the database.
Referenced by OMSFileStore::storeMetaInfos_().
|
inlineprivate |
Store meta values (for all objects in a container) in the database.
References OMSFileStore::createTableMetaInfo_(), and OMSFileStore::storeMetaInfo_().
Referenced by OMSFileStore::storeScoredProcessingResults_().
|
private |
Store information on observation matches (e.g. PSMs) from IdentificationData in the database.
|
private |
Store information on observations (e.g. spectra) from IdentificationData in the database.
|
private |
Store information on parent group sets (e.g. protein groups) from IdentificationData in the database.
|
private |
Store information on parent matches in the database.
|
private |
Store information on parent sequences (e.g. proteins) from IdentificationData in the database.
|
private |
Store information on data processing software from IdentificationData in the database.
|
private |
Store information on data processing steps from IdentificationData in the database.
|
inlineprivate |
Store metadata on scores/processing steps (for all objects in a container) in the database.
References OMSFileStore::createTableAppliedProcessingStep_(), OMSFileStore::storeAppliedProcessingStep_(), and OMSFileStore::storeMetaInfos_().
|
private |
|
private |
Store version information and current date/time in the database.
|
private |
|
private |
The database connection (read/write)
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Prepared queries for inserting data into different tables.
|
private |
|
private |
|
private |
|
private |