47 bool execAndReset(SQLite::Statement& query,
int expected_modifications);
50 void execWithExceptionAndReset(SQLite::Statement& query,
int expected_modifications,
int line,
const char*
function,
const char* context);
111 const String& key_column =
"id");
124 template<
class MetaInfoInterfaceContainer,
class DBKeyTable>
126 const String& parent_table,
const DBKeyTable& db_keys)
128 bool table_created =
false;
129 for (
const auto& element : container)
131 if (!element.isMetaEmpty())
136 table_created =
true;
190 const String& parent_table,
Key parent_id);
206 template<
class ScoredProcessingResultContainer,
class DBKeyTable>
208 const String& parent_table,
const DBKeyTable& db_keys)
210 bool table_created =
false;
211 for (
const auto& element : container)
213 if (!element.steps_and_scores.empty())
218 table_created =
true;
244 const Feature& feature,
int& feature_id,
int parent_id);
247 template <
class FeatureContainer,
class Predicate>
250 if (features.empty())
return false;
251 for (
const Feature& feature : features)
253 if (pred(feature))
return true;
260 template <
class MapType>
274 std::unique_ptr<SQLite::Database>
db_;
A basic LC-MS feature.
Definition: BaseFeature.h:33
Representation of controlled vocabulary term.
Definition: CVTerm.h:27
A container for consensus elements.
Definition: ConsensusMap.h:66
A container for features.
Definition: FeatureMap.h:80
An LC-MS feature.
Definition: Feature.h:46
Definition: IdentificationData.h:87
IdentificationDataInternal::ParentMatches ParentMatches
Definition: IdentificationData.h:138
Helper class for storing .oms files (SQLite format)
Definition: OMSFileStore.h:59
bool anyFeaturePredicate_(const FeatureContainer &features, const Predicate &pred)
check whether a predicate is true for any feature (or subordinate thereof) in a container
Definition: OMSFileStore.h:248
void storeProcessingSoftwares_(const IdentificationData &id_data)
Store information on data processing software from IdentificationData in the database.
void createTableIdentifiedMolecule_()
Create a database table for storing identified molecules (peptides, compounds, oligonucleotides)
void store(const FeatureMap &features)
Write data from a FeatureMap object to database.
std::map< const IdentificationData::ScoreType *, Key > score_type_keys_
Definition: OMSFileStore.h:283
void createTableBaseFeature_(bool with_metainfo, bool with_idmatches)
std::map< const IdentificationData::ProcessingStep *, Key > processing_step_keys_
Definition: OMSFileStore.h:286
void createTableAppliedProcessingStep_(const String &parent_table)
Create a database table for storing processing metadata.
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.
Definition: OMSFileStore.h:125
void storeConsensusColumnHeaders_(const ConsensusMap &consensus)
Store information on column headers from a consensus map in the database.
void storeMapMetaData_(const MapType &features, const String &experiment_type="")
Store feature/consensus map meta data in the database.
void createTableMoleculeType_()
Create a database table for molecule types (proteins, compounds, RNA)
void storeDBSearchParams_(const IdentificationData &id_data)
Store sequence database search parameters from IdentificationData in the database.
void storeIdentifiedCompounds_(const IdentificationData &id_data)
Store information on identified compounds from IdentificationData in the database.
void storeScoreTypes_(const IdentificationData &id_data)
std::map< const IdentificationData::Observation *, Key > observation_keys_
Definition: OMSFileStore.h:288
void createTableDataValue_DataType_()
Create a database table for the data types used in DataValue.
void store(const ConsensusMap &consensus)
Write data from a ConsensusMap object to database.
std::map< const IdentificationData::ProcessingSoftware *, Key > processing_software_keys_
Definition: OMSFileStore.h:285
std::map< const IdentificationData::IdentifiedPeptide *, Key > identified_peptide_keys_
Definition: OMSFileStore.h:292
void createTable_(const String &name, const String &definition, bool may_exist=false)
Helper function to create a database table.
void storeMetaInfo_(const MetaInfoInterface &info, const String &parent_table, Key parent_id)
Store meta values (associated with one object) in the database.
~OMSFileStore()
Destructor.
std::map< const IdentificationData::DBSearchParam *, Key > search_param_keys_
Definition: OMSFileStore.h:287
std::map< const IdentificationData::InputFile *, Key > input_file_keys_
Definition: OMSFileStore.h:284
std::map< const AdductInfo *, Key > adduct_keys_
Definition: OMSFileStore.h:294
int64_t Key
< Type used for database keys
Definition: OMSFileStore.h:62
std::map< const IdentificationData::ParentGroupSet *, Key > parent_grouping_keys_
Definition: OMSFileStore.h:290
Key storeCVTerm_(const CVTerm &cv_term)
Store a CV term in the database.
std::map< const IdentificationData::IdentifiedOligo *, Key > identified_oligo_keys_
Definition: OMSFileStore.h:293
void store(const IdentificationData &id_data)
Write data from an IdentificationData object to database.
void createTableCVTerm_()
Create a database table (and prepare a query) for storing CV terms.
void storeObservationMatches_(const IdentificationData &id_data)
Store information on observation matches (e.g. PSMs) from IdentificationData in the database.
void storeParentGroupSets_(const IdentificationData &id_data)
Store information on parent group sets (e.g. protein groups) from IdentificationData in the database.
void storeObservations_(const IdentificationData &id_data)
Store information on observations (e.g. spectra) from IdentificationData in the database.
void storeParentSequences_(const IdentificationData &id_data)
Store information on parent sequences (e.g. proteins) from IdentificationData in the database.
void storeBaseFeature_(const BaseFeature &feature, int feature_id, int parent_id)
Store information on a feature in the database.
void createTableMetaInfo_(const String &parent_table, const String &key_column="id")
Create a database table (and prepare a query) for storing meta values.
void storeConsensusFeatures_(const ConsensusMap &consensus)
Store information on consensus features from a consensus map in the database.
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.
std::map< std::string, std::unique_ptr< SQLite::Statement > > prepared_queries_
Prepared queries for inserting data into different tables.
Definition: OMSFileStore.h:277
std::map< const DataProcessing *, Key > feat_processing_keys_
Definition: OMSFileStore.h:297
void storeFeatures_(const FeatureMap &features)
Store information on features from a feature map in the database.
void storeInputFiles_(const IdentificationData &id_data)
Store input file information from IdentificationData in the database.
std::unique_ptr< SQLite::Database > db_
The database connection (read/write)
Definition: OMSFileStore.h:274
void storeProcessingSteps_(const IdentificationData &id_data)
Store information on data processing steps from IdentificationData in the database.
Key getDatabaseKey_(const IdentificationData::IdentifiedMolecule &molecule_var)
Return the database key used for an identified molecule (peptide, compound or oligonucleotide)
void storeAdducts_(const IdentificationData &id_data)
Store information on adducts from IdentificationData in the database.
void storeVersionAndDate_()
Store version information and current date/time in the database.
void storeIdentifiedSequences_(const IdentificationData &id_data)
Store information on identified sequences (peptides or oligonucleotides) from IdentificationData in t...
std::map< const IdentificationData::IdentifiedCompound *, Key > identified_compound_keys_
Definition: OMSFileStore.h:291
void storeFeatureAndSubordinates_(const Feature &feature, int &feature_id, int parent_id)
Store a feature (incl. its subordinate features) in the database.
std::map< const IdentificationData::ParentSequence *, Key > parent_sequence_keys_
Definition: OMSFileStore.h:289
void storeParentMatches_(const IdentificationData::ParentMatches &matches, Key molecule_id)
Store information on parent matches in the database.
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.
Definition: OMSFileStore.h:207
void storeDataProcessing_(const std::vector< DataProcessing > &data_processing)
Store information on data processing from a feature/consensus map in the database.
OMSFileStore(const String &filename, LogType log_type)
Constructor.
std::map< const IdentificationData::ObservationMatch *, Key > observation_match_keys_
Definition: OMSFileStore.h:295
void createTableParentMatches_()
Create a database table for storing parent matches (e.g. proteins for a peptide)
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
LogType
Possible log types.
Definition: ProgressLogger.h:43
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
bool execAndReset(SQLite::Statement &query, int expected_modifications)
Execute and reset an SQL query.
void execWithExceptionAndReset(SQLite::Statement &query, int expected_modifications, int line, const char *function, const char *context)
If execAndReset() returns false, call raiseDBError_()
void raiseDBError_(const String &error, int line, const char *function, const String &context, const String &query="")
Raise a more informative database error.
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: OMSFileLoad.h:18
Definition: AppliedProcessingStep.h:30
Variant type holding Peptide/Compound/Oligo references and convenience functions.
Definition: IdentifiedMolecule.h:29