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

Method loadIdentifiedCompounds_

src/openms/source/FORMAT/OMSFileLoad.cpp:532–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530
531
532 void OMSFileLoad::loadIdentifiedCompounds_(IdentificationData& id_data)
533 {
534 if (!db_->tableExists("ID_IdentifiedCompound")) return;
535
536
537 SQLite::Statement query(*db_, "SELECT * FROM ID_IdentifiedMolecule JOIN ID_IdentifiedCompound " \
538 "ON ID_IdentifiedMolecule.id = ID_IdentifiedCompound.molecule_id");
539 // @TODO: can we combine handling of meta info and applied processing steps?
540 SQLite::Statement subquery_info(*db_, "");
541 bool have_meta_info = prepareQueryMetaInfo_(subquery_info, "ID_IdentifiedMolecule");
542 SQLite::Statement subquery_step(*db_, "");
543 bool have_applied_steps =
544 prepareQueryAppliedProcessingStep_(subquery_step, "ID_IdentifiedMolecule");
545
546 while (query.executeStep())
547 {
548 ID::IdentifiedCompound compound(
549 query.getColumn("identifier").getString(),
550 EmpiricalFormula(query.getColumn("formula").getString()),
551 query.getColumn("name").getString(),
552 query.getColumn("smile").getString(),
553 query.getColumn("inchi").getString());
554 Key id = query.getColumn("id").getInt64();
555 if (have_meta_info)
556 {
557 handleQueryMetaInfo_(subquery_info, compound, id);
558 }
559 if (have_applied_steps)
560 {
561 handleQueryAppliedProcessingStep_(subquery_step, compound, id);
562 }
563 ID::IdentifiedCompoundRef ref = id_data.registerIdentifiedCompound(compound);
564 identified_molecule_vars_[id] = ref;
565 }
566 }
567
568
569 void OMSFileLoad::handleQueryParentMatch_(SQLite::Statement& query,

Callers

nothing calls this directly

Calls 4

tableExistsMethod · 0.80
getStringMethod · 0.80
EmpiricalFormulaFunction · 0.50

Tested by

no test coverage detected