| 637 | |
| 638 | |
| 639 | void OMSFileStore::storeParentSequences_(const IdentificationData& id_data) |
| 640 | { |
| 641 | if (id_data.getParentSequences().empty()) return; |
| 642 | |
| 643 | if (!db_->tableExists("ID_MoleculeType")) createTableMoleculeType_(); |
| 644 | |
| 645 | createTable_( |
| 646 | "ID_ParentSequence", |
| 647 | "id INTEGER PRIMARY KEY NOT NULL, " \ |
| 648 | "accession TEXT UNIQUE NOT NULL, " \ |
| 649 | "molecule_type_id INTEGER NOT NULL, " \ |
| 650 | "sequence TEXT, " \ |
| 651 | "description TEXT, " \ |
| 652 | "coverage REAL, " \ |
| 653 | "is_decoy NUMERIC NOT NULL CHECK (is_decoy in (0, 1)) DEFAULT 0, " \ |
| 654 | "FOREIGN KEY (molecule_type_id) REFERENCES ID_MoleculeType (id)"); |
| 655 | |
| 656 | SQLite::Statement query(*db_, "INSERT INTO ID_ParentSequence VALUES (" \ |
| 657 | ":id, " \ |
| 658 | ":accession, " \ |
| 659 | ":molecule_type_id, " \ |
| 660 | ":sequence, " \ |
| 661 | ":description, " \ |
| 662 | ":coverage, " \ |
| 663 | ":is_decoy)"); |
| 664 | Key id = 1; |
| 665 | for (const ID::ParentSequence& parent : id_data.getParentSequences()) |
| 666 | { |
| 667 | query.bind(":id", id); |
| 668 | query.bind(":accession", parent.accession); |
| 669 | query.bind(":molecule_type_id", int(parent.molecule_type) + 1); |
| 670 | query.bind(":sequence", parent.sequence); |
| 671 | query.bind(":description", parent.description); |
| 672 | query.bind(":coverage", parent.coverage); |
| 673 | query.bind(":is_decoy", int(parent.is_decoy)); |
| 674 | execWithExceptionAndReset(query, 1, __LINE__, OPENMS_PRETTY_FUNCTION, "error inserting data"); |
| 675 | parent_sequence_keys_[&parent] = id; |
| 676 | ++id; |
| 677 | } |
| 678 | storeScoredProcessingResults_(id_data.getParentSequences(), "ID_ParentSequence", parent_sequence_keys_); |
| 679 | } |
| 680 | |
| 681 | |
| 682 | void OMSFileStore::storeParentGroupSets_(const IdentificationData& id_data) |
nothing calls this directly
no test coverage detected