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

Method loadDataProcessing_

src/openms/source/FORMAT/OMSFileLoad.cpp:829–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827
828
829 void OMSFileLoad::loadDataProcessing_(vector<DataProcessing>& data_processing)
830 {
831 if (!db_->tableExists("FEAT_DataProcessing")) return;
832
833 // "position" column was removed in schema version 3:
834 String order_by = version_number_ > 2 ? "id" : "position";
835 SQLite::Statement query(*db_, "SELECT * FROM FEAT_DataProcessing ORDER BY " + order_by + " ASC");
836
837 SQLite::Statement subquery_info(*db_, "");
838 bool have_meta_info = prepareQueryMetaInfo_(subquery_info, "FEAT_DataProcessing");
839
840 while (query.executeStep())
841 {
842 DataProcessing proc;
843 Software sw(query.getColumn("software_name").getString(),
844 query.getColumn("software_version").getString());
845 proc.setSoftware(sw);
846 vector<String> actions =
847 ListUtils::create<String>(query.getColumn("processing_actions").getString());
848 for (const String& action : actions)
849 {
850 auto pos = find(begin(DataProcessing::NamesOfProcessingAction),
851 end(DataProcessing::NamesOfProcessingAction), action);
852 if (pos != end(DataProcessing::NamesOfProcessingAction))
853 {
854 Size index = pos - begin(DataProcessing::NamesOfProcessingAction);
855 proc.getProcessingActions().insert(DataProcessing::ProcessingAction(index));
856 }
857 else // @TODO: throw an exception here?
858 {
859 OPENMS_LOG_ERROR << "Error: unknown data processing action '" << action << "' - skipping";
860 }
861 }
862 DateTime time;
863 time.set(query.getColumn("completion_time").getString());
864 proc.setCompletionTime(time);
865 if (have_meta_info)
866 {
867 Key id = query.getColumn("id").getInt64();
868 handleQueryMetaInfo_(subquery_info, proc, id);
869 }
870 data_processing.push_back(proc);
871 }
872 }
873
874
875 BaseFeature OMSFileLoad::makeBaseFeature_(int id, SQLite::Statement& query_feat,

Callers

nothing calls this directly

Calls 10

ProcessingActionEnum · 0.85
tableExistsMethod · 0.80
getStringMethod · 0.80
setCompletionTimeMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
setSoftwareMethod · 0.45
insertMethod · 0.45
setMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected