73 bool execAndReset(SQLite::Statement& query,
int expected_modifications);
76 void execWithExceptionAndReset(SQLite::Statement& query,
int expected_modifications,
int line,
const char*
function,
const char* context);
137 const String& key_column =
"id");
150 template<
class MetaInfoInterfaceContainer,
class DBKeyTable>
152 const String& parent_table,
const DBKeyTable& db_keys)
154 bool table_created =
false;
155 for (
const auto& element : container)
157 if (!element.isMetaEmpty())
162 table_created =
true;
216 const String& parent_table,
Key parent_id);
232 template<
class ScoredProcessingResultContainer,
class DBKeyTable>
234 const String& parent_table,
const DBKeyTable& db_keys)
236 bool table_created =
false;
237 for (
const auto& element : container)
239 if (!element.steps_and_scores.empty())
244 table_created =
true;
270 const Feature& feature,
int& feature_id,
int parent_id);
273 template <
class FeatureContainer,
class Predicate>
276 if (features.empty())
return false;
277 for (
const Feature& feature : features)
279 if (pred(feature))
return true;
286 template <
class MapType>
300 std::unique_ptr<SQLite::Database>
db_;
A basic LC-MS feature.
Definition: BaseFeature.h:59
Representation of controlled vocabulary term.
Definition: CVTerm.h:53
A container for consensus elements.
Definition: ConsensusMap.h:92
A container for features.
Definition: FeatureMap.h:106
An LC-MS feature.
Definition: Feature.h:72
Definition: IdentificationData.h:113
IdentificationDataInternal::ParentMatches ParentMatches
Definition: IdentificationData.h:164
Helper class for storing .oms files (SQLite format)
Definition: OMSFileStore.h:85
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:274
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:309
void createTableBaseFeature_(bool with_metainfo, bool with_idmatches)
std::map< const IdentificationData::ProcessingStep *, Key > processing_step_keys_
Definition: OMSFileStore.h:312
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:151
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:314
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:311
std::map< const IdentificationData::IdentifiedPeptide *, Key > identified_peptide_keys_
Definition: OMSFileStore.h:318
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:313
std::map< const IdentificationData::InputFile *, Key > input_file_keys_
Definition: OMSFileStore.h:310
std::map< const AdductInfo *, Key > adduct_keys_
Definition: OMSFileStore.h:320
int64_t Key
< Type used for database keys
Definition: OMSFileStore.h:88
std::map< const IdentificationData::ParentGroupSet *, Key > parent_grouping_keys_
Definition: OMSFileStore.h:316
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:319
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:303
std::map< const DataProcessing *, Key > feat_processing_keys_
Definition: OMSFileStore.h:323
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:300
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:317
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:315
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:233
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:321
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:72
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:53
LogType
Possible log types.
Definition: ProgressLogger.h:69
A more convenient string class.
Definition: String.h:60
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
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:48
Definition: OMSFileLoad.h:44
Definition: AppliedProcessingStep.h:56
Variant type holding Peptide/Compound/Oligo references and convenience functions.
Definition: IdentifiedMolecule.h:55