| 588 | |
| 589 | |
| 590 | void OMSFileLoad::loadIdentifiedSequences_(IdentificationData& id_data) |
| 591 | { |
| 592 | if (!db_->tableExists("ID_IdentifiedMolecule")) return; |
| 593 | |
| 594 | SQLite::Statement query(*db_, "SELECT * FROM ID_IdentifiedMolecule " \ |
| 595 | "WHERE molecule_type_id = :molecule_type_id"); |
| 596 | // @TODO: can we combine handling of meta info and applied processing steps? |
| 597 | SQLite::Statement subquery_info(*db_, ""); |
| 598 | bool have_meta_info = prepareQueryMetaInfo_(subquery_info, |
| 599 | "ID_IdentifiedMolecule"); |
| 600 | SQLite::Statement subquery_step(*db_, ""); |
| 601 | bool have_applied_steps = |
| 602 | prepareQueryAppliedProcessingStep_(subquery_step, |
| 603 | "ID_IdentifiedMolecule"); |
| 604 | SQLite::Statement subquery_parent(*db_, ""); |
| 605 | bool have_parent_matches = db_->tableExists( |
| 606 | "ID_ParentMatch"); |
| 607 | if (have_parent_matches) |
| 608 | { |
| 609 | subquery_parent = SQLite::Statement(*db_, "SELECT * FROM ID_ParentMatch " \ |
| 610 | "WHERE molecule_id = :id"); |
| 611 | } |
| 612 | |
| 613 | // load peptides: |
| 614 | query.bind(":molecule_type_id", int(ID::MoleculeType::PROTEIN) + 1); |
| 615 | while (query.executeStep()) |
| 616 | { |
| 617 | Key id = query.getColumn("id").getInt64(); |
| 618 | String sequence = query.getColumn("identifier").getString(); |
| 619 | ID::IdentifiedPeptide peptide(AASequence::fromString(sequence)); |
| 620 | if (have_meta_info) |
| 621 | { |
| 622 | handleQueryMetaInfo_(subquery_info, peptide, id); |
| 623 | } |
| 624 | if (have_applied_steps) |
| 625 | { |
| 626 | handleQueryAppliedProcessingStep_(subquery_step, peptide, id); |
| 627 | } |
| 628 | if (have_parent_matches) |
| 629 | { |
| 630 | handleQueryParentMatch_(subquery_parent, peptide.parent_matches, id); |
| 631 | } |
| 632 | ID::IdentifiedPeptideRef ref = id_data.registerIdentifiedPeptide(peptide); |
| 633 | identified_molecule_vars_[id] = ref; |
| 634 | } |
| 635 | query.reset(); // get ready for new executeStep() |
| 636 | |
| 637 | // load RNA oligos: |
| 638 | query.bind(":molecule_type_id", int(ID::MoleculeType::RNA) + 1); |
| 639 | while (query.executeStep()) |
| 640 | { |
| 641 | Key id = query.getColumn("id").getInt64(); |
| 642 | String sequence = query.getColumn("identifier").getString(); |
| 643 | ID::IdentifiedOligo oligo(NASequence::fromString(sequence)); |
| 644 | if (have_meta_info) |
| 645 | { |
| 646 | handleQueryMetaInfo_(subquery_info, oligo, id); |
| 647 | } |
nothing calls this directly
no test coverage detected