| 833 | |
| 834 | |
| 835 | void OMSFileStore::storeIdentifiedSequences_(const IdentificationData& id_data) |
| 836 | { |
| 837 | if (id_data.getIdentifiedPeptides().empty() && |
| 838 | id_data.getIdentifiedOligos().empty()) return; |
| 839 | |
| 840 | if (!db_->tableExists("ID_IdentifiedMolecule")) |
| 841 | { |
| 842 | createTableIdentifiedMolecule_(); |
| 843 | } |
| 844 | auto& query = *prepared_queries_["ID_IdentifiedMolecule"]; |
| 845 | |
| 846 | bool any_parent_matches = false; |
| 847 | // identified compounds get stored earlier and use the same key range as peptides/oligos: |
| 848 | Key id = id_data.getIdentifiedCompounds().size() + 1; |
| 849 | // store peptides: |
| 850 | query.bind(":molecule_type_id", int(ID::MoleculeType::PROTEIN) + 1); |
| 851 | for (const ID::IdentifiedPeptide& peptide : id_data.getIdentifiedPeptides()) |
| 852 | { |
| 853 | if (!peptide.parent_matches.empty()) any_parent_matches = true; |
| 854 | query.bind(":id", id); |
| 855 | query.bind(":identifier", peptide.sequence.toString()); |
| 856 | execWithExceptionAndReset(query, 1, __LINE__, OPENMS_PRETTY_FUNCTION, "error inserting data"); |
| 857 | |
| 858 | identified_peptide_keys_[&peptide] = id; |
| 859 | ++id; |
| 860 | } |
| 861 | storeScoredProcessingResults_(id_data.getIdentifiedPeptides(), "ID_IdentifiedMolecule", |
| 862 | identified_peptide_keys_); |
| 863 | // store RNA oligos: |
| 864 | query.bind(":molecule_type_id", int(ID::MoleculeType::RNA) + 1); |
| 865 | for (const ID::IdentifiedOligo& oligo : id_data.getIdentifiedOligos()) |
| 866 | { |
| 867 | if (!oligo.parent_matches.empty()) any_parent_matches = true; |
| 868 | query.bind(":id", id); // use address as primary key |
| 869 | query.bind(":identifier", oligo.sequence.toString()); |
| 870 | execWithExceptionAndReset(query, 1, __LINE__, OPENMS_PRETTY_FUNCTION, "error inserting data"); |
| 871 | |
| 872 | identified_oligo_keys_[&oligo] = id; |
| 873 | ++id; |
| 874 | } |
| 875 | storeScoredProcessingResults_(id_data.getIdentifiedOligos(), "ID_IdentifiedMolecule", |
| 876 | identified_oligo_keys_); |
| 877 | |
| 878 | if (any_parent_matches) |
| 879 | { |
| 880 | createTableParentMatches_(); |
| 881 | for (const ID::IdentifiedPeptide& peptide : id_data.getIdentifiedPeptides()) |
| 882 | { |
| 883 | if (!peptide.parent_matches.empty()) |
| 884 | { |
| 885 | storeParentMatches_(peptide.parent_matches, identified_peptide_keys_[&peptide]); |
| 886 | } |
| 887 | } |
| 888 | for (const ID::IdentifiedOligo& oligo : id_data.getIdentifiedOligos()) |
| 889 | { |
| 890 | if (!oligo.parent_matches.empty()) |
| 891 | { |
| 892 | storeParentMatches_(oligo.parent_matches, identified_oligo_keys_[&oligo]); |
nothing calls this directly
no test coverage detected