MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / storeDataProcessing_

Method storeDataProcessing_

src/openms/source/FORMAT/OMSFileStore.cpp:1395–1433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1393
1394
1395 void OMSFileStore::storeDataProcessing_(const vector<DataProcessing>& data_processing)
1396 {
1397 if (data_processing.empty()) return;
1398
1399 createTable_("FEAT_DataProcessing",
1400 "id INTEGER PRIMARY KEY NOT NULL, " \
1401 "software_name TEXT, " \
1402 "software_version TEXT, " \
1403 "processing_actions TEXT, " \
1404 "completion_time TEXT");
1405 // "id" is needed to connect to meta info table (see "storeMetaInfos_");
1406 // "position" is position in the vector ("index" is a reserved word in SQL)
1407 SQLite::Statement query(*db_, "INSERT INTO FEAT_DataProcessing VALUES (" \
1408 ":id, " \
1409 ":software_name, " \
1410 ":software_version, " \
1411 ":processing_actions, " \
1412 ":completion_time)");
1413
1414 Key id = 1;
1415 for (const DataProcessing& proc : data_processing)
1416 {
1417 query.bind(":id", id);
1418 query.bind(":software_name", proc.getSoftware().getName());
1419 query.bind(":software_version", proc.getSoftware().getVersion());
1420 String actions;
1421 for (DataProcessing::ProcessingAction action : proc.getProcessingActions())
1422 {
1423 if (!actions.empty()) actions += ","; // @TODO: use different separator?
1424 actions += DataProcessing::NamesOfProcessingAction[action];
1425 }
1426 query.bind(":processing_actions", actions);
1427 query.bind(":completion_time", proc.getCompletionTime().get());
1428 execWithExceptionAndReset(query, 1, __LINE__, OPENMS_PRETTY_FUNCTION, "error inserting data");
1429 feat_processing_keys_[&proc] = id;
1430 ++id;
1431 }
1432 storeMetaInfos_(data_processing, "FEAT_DataProcessing", feat_processing_keys_);
1433 }
1434
1435
1436 void OMSFileStore::store(const FeatureMap& features)

Callers

nothing calls this directly

Calls 5

emptyMethod · 0.45
getNameMethod · 0.45
getVersionMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected