OpenMS
Loading...
Searching...
No Matches
TargetedExperimentHelper.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Andreas Bertsch $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
16
23
24#include <boost/numeric/conversion/cast.hpp>
25#include <functional>
26
27namespace OpenMS
28{
29
36 namespace TargetedExperimentHelper
37 {
38
40 public CVTermList
41 {
44 std::vector<CVTermList> validations;
45 };
46
47 struct CV
48 {
49 CV(const String & new_id, const String & new_fullname, const String & new_version, const String & new_URI) :
50 id(new_id),
51 fullname(new_fullname),
52 version(new_version),
53 URI(new_URI)
54 {
55
56 }
57
62
63 bool operator==(const CV & cv) const
64 {
65 return id == cv.id &&
66 fullname == cv.fullname &&
67 version == cv.version &&
68 URI == cv.URI;
69 }
70
71 };
72
73 struct Protein :
74 public CVTermList
75 {
76 Protein() = default;
77 bool operator==(const Protein& rhs) const
78 {
79 return CVTermList::operator==(rhs) &&
80 id == rhs.id &&
81 sequence == rhs.sequence;
82 }
83
86
87 };
88
99 class OPENMS_DLLAPI RetentionTime :
101 {
102public:
103
104 enum class RTUnit : std::int8_t
105 {
106 SECOND = 0,
107 MINUTE,
108 UNKNOWN,
109 SIZE_OF_RTUNIT
110 };
111
112 enum class RTType : std::int8_t
113 {
114 LOCAL = 0,
115 NORMALIZED,
116 PREDICTED,
117 HPINS,
118 IRT,
119 UNKNOWN,
120 SIZE_OF_RTTYPE
121 };
122
125 software_ref(""),
126 retention_time_unit(RTUnit::SIZE_OF_RTUNIT),
127 retention_time_type(RTType::SIZE_OF_RTTYPE),
128 retention_time_set_(false),
129 retention_time_(0.0)
130 // retention_time_width(0.0),
131 // retention_time_lower(0.0),
132 // retention_time_upper(0.0)
133 {
134 }
135
136 RetentionTime(const RetentionTime &) = default;
137 RetentionTime(RetentionTime &&) noexcept = default;
138 virtual ~RetentionTime() = default;
139 RetentionTime & operator=(const RetentionTime &) & = default;
140 RetentionTime & operator=(RetentionTime &&) & = default;
141
142 bool operator==(const RetentionTime & rhs) const
143 {
144 return CVTermListInterface::operator==(rhs) &&
145 software_ref == rhs.software_ref &&
146 retention_time_unit == rhs.retention_time_unit &&
147 retention_time_type == rhs.retention_time_type &&
148 retention_time_set_ == rhs.retention_time_set_ &&
149 retention_time_ == rhs.retention_time_;
150 }
151
152 bool isRTset() const
153 {
154 return retention_time_set_;
155 }
156 void setRT(double rt)
157 {
158 retention_time_ = rt;
159 retention_time_set_ = true;
160 }
161 double getRT() const
162 {
163 OPENMS_PRECONDITION(isRTset(), "RT needs to be set")
164 return retention_time_;
165 }
166
170
171private:
172
175 // double retention_time_width;
176 // double retention_time_lower;
177 // double retention_time_upper;
178 };
179
185 class OPENMS_DLLAPI PeptideCompound :
186 public CVTermList
187 {
188public:
189 PeptideCompound() = default;
191 PeptideCompound(PeptideCompound &&) noexcept = default;
192 PeptideCompound & operator=(const PeptideCompound &) & = default;
193 PeptideCompound & operator=(PeptideCompound &&) & = default;
194
195 bool operator==(const PeptideCompound & rhs) const
196 {
197 return CVTermList::operator==(rhs) &&
198 rts == rhs.rts &&
199 id == rhs.id &&
200 charge_ == rhs.charge_ &&
201 charge_set_ == rhs.charge_set_;
202 }
203
205 void setChargeState(int charge)
206 {
207 charge_ = charge;
208 charge_set_ = true;
209 }
210
212 bool hasCharge() const
213 {
214 return charge_set_;
215 }
216
218 int getChargeState() const
219 {
220 OPENMS_PRECONDITION(charge_set_, "Cannot return charge which was never set")
221 return charge_;
222 }
223
225 void setDriftTime(double dt)
226 {
227 drift_time_ = dt;
228 }
229
231 double getDriftTime() const
232 {
233 return drift_time_;
234 }
235
237
239 bool hasRetentionTime() const
240 {
241 return (!rts.empty() && rts[0].isRTset());
242 }
243
248 double getRetentionTime() const
249 {
250 if (!hasRetentionTime())
251 {
252 throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
253 "No retention time information available");
254 }
255 return rts[0].getRT();
256 }
257
260 {
261 if (!hasRetentionTime())
262 {
263 throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
264 "No retention time information available");
265 }
266 return rts[0].retention_time_type;
267 }
268
271 {
272 if (!hasRetentionTime())
273 {
274 throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
275 "No retention time information available");
276 }
277 return rts[0].retention_time_unit;
278 }
280
282 std::vector<RetentionTime> rts;
283
284protected:
285 int charge_{0};
286 bool charge_set_{false};
287 double drift_time_{-1};
288 };
289
296 class OPENMS_DLLAPI Compound :
297 public PeptideCompound
298 {
299public:
300
302 theoretical_mass(0.0)
303 {
304 }
305
306 Compound(const Compound &) = default;
307 Compound(Compound &&) noexcept = default;
308 Compound & operator=(const Compound &) & = default;
309 Compound & operator=(Compound &&) & = default;
310
311 bool operator==(const Compound & rhs) const
312 {
313 return PeptideCompound::operator==(rhs) &&
314 molecular_formula == rhs.molecular_formula &&
315 smiles_string == rhs.smiles_string &&
316 theoretical_mass == rhs.theoretical_mass;
317 }
318
322
323protected:
324
325 };
326
333 class OPENMS_DLLAPI Peptide :
334 public PeptideCompound
335 {
336public:
339 {
344
347 location(-1),
348 unimod_id(-1)
349 {
350 }
351
352 };
353
354 Peptide() = default;
355 Peptide(const Peptide &) = default;
356 Peptide(Peptide &&) noexcept = default;
357 Peptide & operator=(const Peptide &) & = default;
358 Peptide & operator=(Peptide &&) & = default;
359
360 bool operator==(const Peptide & rhs) const
361 {
362 return PeptideCompound::operator==(rhs) &&
363 protein_refs == rhs.protein_refs &&
364 evidence == rhs.evidence &&
365 sequence == rhs.sequence &&
366 mods == rhs.mods &&
367 peptide_group_label_ == rhs.peptide_group_label_;
368 }
369
381 void setPeptideGroupLabel(const String & label)
382 {
383 peptide_group_label_ = label;
384 }
385
388 {
389 return peptide_group_label_;
390 }
392
393 std::vector<String> protein_refs;
396 std::vector<Modification> mods;
397
398protected:
400 };
401
402 struct OPENMS_DLLAPI Contact :
403 public CVTermList
404 {
406 CVTermList()
407 {
408 }
409
410 bool operator==(const Contact & rhs) const
411 {
412 return CVTermList::operator==(rhs) &&
413 id == rhs.id;
414 }
415
417 };
418
419 struct OPENMS_DLLAPI Publication :
420 public CVTermList
421 {
423 CVTermList()
424 {
425 }
426
427 bool operator==(const Publication & rhs) const
428 {
429 return CVTermList::operator==(rhs) &&
430 id == rhs.id;
431 }
432
434 };
435
436 struct OPENMS_DLLAPI Instrument :
437 public CVTermList
438 {
440 CVTermList()
441 {
442 }
443
444 bool operator==(const Instrument & rhs) const
445 {
446 return CVTermList::operator==(rhs) &&
447 id == rhs.id;
448 }
449
451 };
452
453 struct OPENMS_DLLAPI Prediction :
454 public CVTermList
455 {
457 CVTermList()
458 {
459 }
460
461 bool operator==(const Prediction & rhs) const
462 {
463 return CVTermList::operator==(rhs) &&
464 contact_ref == rhs.contact_ref &&
465 software_ref == rhs.software_ref;
466 }
467
470 };
471
478 struct OPENMS_DLLAPI Interpretation :
480 {
481
482 /*
483 enum ResidueType
484 {
485 Full = 0, // with N-terminus and C-terminus
486 Internal, // internal, without any termini
487 NTerminal, // only N-terminus
488 CTerminal, // only C-terminus
489 AIon, // MS:1001229 N-terminus up to the C-alpha/carbonyl carbon bond
490 BIon, // MS:1001224 N-terminus up to the peptide bond
491 CIon, // MS:1001231 N-terminus up to the amide/C-alpha bond
492 XIon, // MS:1001228 amide/C-alpha bond up to the C-terminus
493 YIon, // MS:1001220 peptide bond up to the C-terminus
494 ZIon, // MS:1001230 C-alpha/carbonyl carbon bond
495 Precursor, // MS:1001523 Precursor ion
496 BIonMinusH20, // MS:1001222 b ion without water
497 YIonMinusH20, // MS:1001223 y ion without water
498 BIonMinusNH3, // MS:1001232 b ion without ammonia
499 YIonMinusNH3, // MS:1001233 y ion without ammonia
500 NonIdentified, // MS:1001240 Non-identified ion
501 Unannotated, // no stored annotation
502 SizeOfResidueType
503 };
504 */
505
507
508 unsigned char ordinal;
509 unsigned char rank;
511
512 // Constructor
515 ordinal(0),
516 rank(0),
517 iontype(Residue::Unannotated) // Unannotated does not imply any MS OBO term
518 {
519 }
520
524 bool operator==(const Interpretation & rhs) const
525 {
526 return CVTermListInterface::operator==(rhs) &&
527 ordinal == rhs.ordinal &&
528 rank == rhs.rank &&
529 iontype == rhs.iontype;
530 }
531
532 bool operator!=(const Interpretation & rhs) const
533 {
534 return !(operator==(rhs));
535 }
537
538 };
539
546 struct OPENMS_DLLAPI TraMLProduct :
548 {
549 TraMLProduct() = default;
550 bool operator==(const TraMLProduct & rhs) const
551 {
552 return CVTermListInterface::operator==(rhs) &&
553 charge_ == rhs.charge_ &&
554 charge_set_ == rhs.charge_set_ &&
555 mz_ == rhs.mz_ &&
556 configuration_list_ == rhs.configuration_list_ &&
557 interpretation_list_ == rhs.interpretation_list_;
558 }
559
560 void setChargeState(int charge)
561 {
562 charge_ = charge;
563 charge_set_ = true;
564 }
565
567 bool hasCharge() const
568 {
569 return charge_set_;
570 }
571
572 int getChargeState() const
573 {
574 OPENMS_PRECONDITION(charge_set_, "Cannot return charge which was never set")
575 return charge_;
576 }
577
578 double getMZ() const
579 {
580 return mz_;
581 }
582
583 void setMZ(double mz)
584 {
585 mz_ = mz;
586 }
587
588 const std::vector<Configuration> & getConfigurationList() const
589 {
590 return configuration_list_;
591 }
592
593 void addConfiguration(const Configuration& configuration)
594 {
595 configuration_list_.push_back(configuration);
596 }
597
598 const std::vector<Interpretation> & getInterpretationList() const
599 {
600 return interpretation_list_;
601 }
602
603 void addInterpretation(const Interpretation& interpretation)
604 {
605 interpretation_list_.push_back(interpretation);
606 }
607
609 {
610 return interpretation_list_.clear();
611 }
612
613private:
614 int charge_{0};
615 bool charge_set_{false};
616 double mz_{0};
617 std::vector<Configuration> configuration_list_;
618 std::vector<Interpretation> interpretation_list_;
619 };
620
622 OPENMS_DLLAPI OpenMS::AASequence getAASequence(const Peptide& peptide);
623
625 OPENMS_DLLAPI void setModification(int location, int max_size, const String& modification, OpenMS::AASequence & aas);
626
627 }
628
630 template<typename T>
631 inline std::size_t hashCVTerms(const T& obj) noexcept
632 {
633 std::size_t seed = 0;
634 const auto& cv_terms = obj.getCVTerms();
635 for (const auto& [accession, terms] : cv_terms)
636 {
637 hash_combine(seed, fnv1a_hash_string(accession));
638 for (const auto& term : terms)
639 {
640 hash_combine(seed, fnv1a_hash_string(term.getAccession()));
641 hash_combine(seed, fnv1a_hash_string(term.getName()));
642 hash_combine(seed, fnv1a_hash_string(term.getCVIdentifierRef()));
643 if (term.hasValue())
644 {
645 hash_combine(seed, fnv1a_hash_string(term.getValue().toString()));
646 }
647 if (term.hasUnit())
648 {
649 hash_combine(seed, fnv1a_hash_string(term.getUnit().accession));
650 }
651 }
652 }
653 return seed;
654 }
655
656 // Convenience wrappers for backward compatibility
657 inline std::size_t hashCVTermList(const CVTermList& cvtl) noexcept { return hashCVTerms(cvtl); }
658 inline std::size_t hashCVTermListInterface(const CVTermListInterface& cvtli) noexcept { return hashCVTerms(cvtli); }
659
660} // namespace OpenMS
661
662// Hash function specializations for TargetedExperimentHelper classes
663// Placed in std namespace to allow use with std::unordered_map/set
664namespace std
665{
667 template<>
668 struct hash<OpenMS::TargetedExperimentHelper::CV>
669 {
670 std::size_t operator()(const OpenMS::TargetedExperimentHelper::CV& cv) const noexcept
671 {
672 std::size_t seed = 0;
677 return seed;
678 }
679 };
680
682 template<>
683 struct hash<OpenMS::TargetedExperimentHelper::Protein>
684 {
685 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Protein& protein) const noexcept
686 {
687 std::size_t seed = OpenMS::hashCVTermList(protein);
689 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(protein.sequence));
690 return seed;
691 }
692 };
693
695 template<>
696 struct hash<OpenMS::TargetedExperimentHelper::RetentionTime>
697 {
699 {
700 std::size_t seed = OpenMS::hashCVTermListInterface(rt);
701 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(rt.software_ref));
702 OpenMS::hash_combine(seed, OpenMS::hash_int(static_cast<std::int8_t>(rt.retention_time_unit)));
703 OpenMS::hash_combine(seed, OpenMS::hash_int(static_cast<std::int8_t>(rt.retention_time_type)));
704 OpenMS::hash_combine(seed, OpenMS::hash_int(rt.isRTset() ? 1 : 0));
705 if (rt.isRTset())
706 {
707 OpenMS::hash_combine(seed, OpenMS::hash_float(rt.getRT()));
708 }
709 return seed;
710 }
711 };
712
714 template<>
715 struct hash<OpenMS::TargetedExperimentHelper::PeptideCompound>
716 {
718 {
719 std::size_t seed = OpenMS::hashCVTermList(pc);
720 for (const auto& rt : pc.rts)
721 {
722 OpenMS::hash_combine(seed, std::hash<OpenMS::TargetedExperimentHelper::RetentionTime>{}(rt));
723 }
725 OpenMS::hash_combine(seed, OpenMS::hash_int(pc.hasCharge() ? 1 : 0));
726 if (pc.hasCharge())
727 {
728 OpenMS::hash_combine(seed, OpenMS::hash_int(pc.getChargeState()));
729 }
730 return seed;
731 }
732 };
733
735 template<>
736 struct hash<OpenMS::TargetedExperimentHelper::Compound>
737 {
738 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Compound& compound) const noexcept
739 {
740 std::size_t seed = std::hash<OpenMS::TargetedExperimentHelper::PeptideCompound>{}(compound);
741 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(compound.molecular_formula));
742 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(compound.smiles_string));
743 OpenMS::hash_combine(seed, OpenMS::hash_float(compound.theoretical_mass));
744 return seed;
745 }
746 };
747
749 template<>
750 struct hash<OpenMS::TargetedExperimentHelper::Peptide>
751 {
752 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Peptide& peptide) const noexcept
753 {
754 std::size_t seed = std::hash<OpenMS::TargetedExperimentHelper::PeptideCompound>{}(peptide);
755 for (const auto& ref : peptide.protein_refs)
756 {
758 }
759 OpenMS::hash_combine(seed, OpenMS::hashCVTermList(peptide.evidence));
760 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(peptide.sequence));
761 for (const auto& mod : peptide.mods)
762 {
764 OpenMS::hash_combine(seed, OpenMS::hash_float(mod.avg_mass_delta));
765 OpenMS::hash_combine(seed, OpenMS::hash_float(mod.mono_mass_delta));
766 OpenMS::hash_combine(seed, OpenMS::hash_int(mod.location));
767 OpenMS::hash_combine(seed, OpenMS::hash_int(mod.unimod_id));
768 }
769 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(peptide.getPeptideGroupLabel()));
770 return seed;
771 }
772 };
773
775 template<>
776 struct hash<OpenMS::TargetedExperimentHelper::Contact>
777 {
778 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Contact& contact) const noexcept
779 {
780 std::size_t seed = OpenMS::hashCVTermList(contact);
782 return seed;
783 }
784 };
785
787 template<>
788 struct hash<OpenMS::TargetedExperimentHelper::Publication>
789 {
790 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Publication& pub) const noexcept
791 {
792 std::size_t seed = OpenMS::hashCVTermList(pub);
794 return seed;
795 }
796 };
797
799 template<>
800 struct hash<OpenMS::TargetedExperimentHelper::Instrument>
801 {
802 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Instrument& inst) const noexcept
803 {
804 std::size_t seed = OpenMS::hashCVTermList(inst);
806 return seed;
807 }
808 };
809
811 template<>
812 struct hash<OpenMS::TargetedExperimentHelper::Prediction>
813 {
814 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Prediction& pred) const noexcept
815 {
816 std::size_t seed = OpenMS::hashCVTermList(pred);
817 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(pred.software_ref));
818 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(pred.contact_ref));
819 return seed;
820 }
821 };
822
824 template<>
825 struct hash<OpenMS::TargetedExperimentHelper::Interpretation>
826 {
827 std::size_t operator()(const OpenMS::TargetedExperimentHelper::Interpretation& interp) const noexcept
828 {
829 std::size_t seed = OpenMS::hashCVTermListInterface(interp);
830 OpenMS::hash_combine(seed, OpenMS::hash_int(interp.ordinal));
831 OpenMS::hash_combine(seed, OpenMS::hash_int(interp.rank));
832 OpenMS::hash_combine(seed, OpenMS::hash_int(static_cast<int>(interp.iontype)));
833 return seed;
834 }
835 };
836
838 template<>
839 struct hash<OpenMS::TargetedExperimentHelper::TraMLProduct>
840 {
841 std::size_t operator()(const OpenMS::TargetedExperimentHelper::TraMLProduct& product) const noexcept
842 {
843 std::size_t seed = OpenMS::hashCVTermListInterface(product);
844 OpenMS::hash_combine(seed, OpenMS::hash_int(product.hasCharge() ? 1 : 0));
845 if (product.hasCharge())
846 {
847 OpenMS::hash_combine(seed, OpenMS::hash_int(product.getChargeState()));
848 }
849 OpenMS::hash_combine(seed, OpenMS::hash_float(product.getMZ()));
850 // Hash configuration_list_ (required for consistency with operator==)
851 for (const auto& config : product.getConfigurationList())
852 {
854 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(config.contact_ref));
855 OpenMS::hash_combine(seed, OpenMS::fnv1a_hash_string(config.instrument_ref));
856 for (const auto& validation : config.validations)
857 {
859 }
860 }
861 for (const auto& interp : product.getInterpretationList())
862 {
863 OpenMS::hash_combine(seed, std::hash<OpenMS::TargetedExperimentHelper::Interpretation>{}(interp));
864 }
865 return seed;
866 }
867 };
868
869} // namespace std
870
Representation of a peptide/protein sequence.
Definition AASequence.h:88
Interface to the controlled vocabulary term list.
Definition CVTermListInterface.h:34
Representation of controlled vocabulary term list.
Definition CVTermList.h:29
bool operator==(const CVTermList &cv_term_list) const
equality operator
A method or algorithm argument contains illegal values.
Definition Exception.h:630
Representation of an amino acid residue.
Definition Residue.h:40
ResidueType
Definition Residue.h:152
A more convenient string class.
Definition String.h:34
Represents a compound (small molecule)
Definition TargetedExperimentHelper.h:298
String molecular_formula
Definition TargetedExperimentHelper.h:319
double theoretical_mass
Definition TargetedExperimentHelper.h:321
Compound(Compound &&) noexcept=default
String smiles_string
Definition TargetedExperimentHelper.h:320
Compound()
Definition TargetedExperimentHelper.h:301
Base class to represent either a peptide or a compound.
Definition TargetedExperimentHelper.h:187
std::vector< RetentionTime > rts
Definition TargetedExperimentHelper.h:282
bool hasRetentionTime() const
Check whether compound or peptide has an annotated retention time.
Definition TargetedExperimentHelper.h:239
double getRetentionTime() const
Gets compound or peptide retention time.
Definition TargetedExperimentHelper.h:248
PeptideCompound(const PeptideCompound &)=default
String id
Definition TargetedExperimentHelper.h:281
int getChargeState() const
Return the peptide or compound charge state.
Definition TargetedExperimentHelper.h:218
PeptideCompound(PeptideCompound &&) noexcept=default
void setChargeState(int charge)
Set the peptide or compound charge state.
Definition TargetedExperimentHelper.h:205
RetentionTime::RTType getRetentionTimeType() const
Get compound or peptide retentiontime type.
Definition TargetedExperimentHelper.h:259
bool hasCharge() const
Whether peptide or compound has set charge state.
Definition TargetedExperimentHelper.h:212
RetentionTime::RTUnit getRetentionTimeUnit() const
Get compound or peptide retentiontime unit (minute/seconds)
Definition TargetedExperimentHelper.h:270
double getDriftTime() const
Return the peptide or compound ion mobility drift time.
Definition TargetedExperimentHelper.h:231
void setDriftTime(double dt)
Set the peptide or compound ion mobility drift time.
Definition TargetedExperimentHelper.h:225
Represents a peptide (amino acid sequence)
Definition TargetedExperimentHelper.h:335
String getPeptideGroupLabel() const
Get the peptide group label.
Definition TargetedExperimentHelper.h:387
String sequence
Definition TargetedExperimentHelper.h:395
CVTermList evidence
Definition TargetedExperimentHelper.h:394
std::vector< Modification > mods
Definition TargetedExperimentHelper.h:396
std::vector< String > protein_refs
Definition TargetedExperimentHelper.h:393
void setPeptideGroupLabel(const String &label)
Set the peptide group label.
Definition TargetedExperimentHelper.h:381
Peptide(Peptide &&) noexcept=default
String peptide_group_label_
Definition TargetedExperimentHelper.h:399
This class stores a retention time structure that is used in TargetedExperiment (representing a TraML...
Definition TargetedExperimentHelper.h:101
double getRT() const
Definition TargetedExperimentHelper.h:161
String software_ref
Definition TargetedExperimentHelper.h:167
RetentionTime(RetentionTime &&) noexcept=default
bool retention_time_set_
Definition TargetedExperimentHelper.h:173
RetentionTime(const RetentionTime &)=default
RTUnit
Definition TargetedExperimentHelper.h:105
RTType
Definition TargetedExperimentHelper.h:113
RetentionTime()
Definition TargetedExperimentHelper.h:123
RTUnit retention_time_unit
Definition TargetedExperimentHelper.h:168
RTType retention_time_type
Definition TargetedExperimentHelper.h:169
double retention_time_
Definition TargetedExperimentHelper.h:174
bool isRTset() const
Definition TargetedExperimentHelper.h:152
void setRT(double rt)
Definition TargetedExperimentHelper.h:156
int32_t Int32
Signed integer type (32bit)
Definition Types.h:26
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition openms/include/OpenMS/CONCEPT/Macros.h:94
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::AASequence getAASequence(const Peptide &peptide)
helper function that converts a Peptide object to a AASequence object
void setModification(int location, int max_size, const String &modification, OpenMS::AASequence &aas)
helper function that sets a modification on a AASequence object
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
@ UNKNOWN
ion mobility format not yet determined.
std::size_t hashCVTermList(const CVTermList &cvtl) noexcept
Definition TargetedExperimentHelper.h:657
std::size_t hash_int(T value) noexcept
Hash for an integer type.
Definition HashUtils.h:107
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t hash_float(T value) noexcept
Hash for a floating point type (float or double).
Definition HashUtils.h:142
std::size_t fnv1a_hash_string(const std::string &s) noexcept
FNV-1a hash for a string.
Definition HashUtils.h:70
std::size_t hashCVTerms(const T &obj) noexcept
Helper template to hash any type with getCVTerms() method (CVTermList, CVTermListInterface)
Definition TargetedExperimentHelper.h:631
std::size_t hashCVTermListInterface(const CVTermListInterface &cvtli) noexcept
Definition TargetedExperimentHelper.h:658
STL namespace.
Definition TargetedExperimentHelper.h:48
String fullname
Definition TargetedExperimentHelper.h:59
bool operator==(const CV &cv) const
Definition TargetedExperimentHelper.h:63
String version
Definition TargetedExperimentHelper.h:60
String id
Definition TargetedExperimentHelper.h:58
CV(const String &new_id, const String &new_fullname, const String &new_version, const String &new_URI)
Definition TargetedExperimentHelper.h:49
String URI
Definition TargetedExperimentHelper.h:61
Definition TargetedExperimentHelper.h:41
String instrument_ref
Definition TargetedExperimentHelper.h:43
std::vector< CVTermList > validations
Definition TargetedExperimentHelper.h:44
String contact_ref
Definition TargetedExperimentHelper.h:42
Definition TargetedExperimentHelper.h:404
String id
Definition TargetedExperimentHelper.h:416
bool operator==(const Contact &rhs) const
Definition TargetedExperimentHelper.h:410
Contact()
Definition TargetedExperimentHelper.h:405
Definition TargetedExperimentHelper.h:438
bool operator==(const Instrument &rhs) const
Definition TargetedExperimentHelper.h:444
String id
Definition TargetedExperimentHelper.h:450
Instrument()
Definition TargetedExperimentHelper.h:439
Product ion interpretation.
Definition TargetedExperimentHelper.h:480
IonType iontype
which type of ion (b/y/z/ ...), see Residue::ResidueType
Definition TargetedExperimentHelper.h:510
bool operator!=(const Interpretation &rhs) const
Definition TargetedExperimentHelper.h:532
Interpretation()
Definition TargetedExperimentHelper.h:513
Residue::ResidueType IonType
Interpretation IonType.
Definition TargetedExperimentHelper.h:506
bool operator==(const Interpretation &rhs) const
Definition TargetedExperimentHelper.h:524
unsigned char ordinal
MS:1000903 : product ion series ordinal (e.g. 8 for a y8 ion)
Definition TargetedExperimentHelper.h:508
unsigned char rank
MS:1000926 : product interpretation rank (e.g. 1 for the most likely rank)
Definition TargetedExperimentHelper.h:509
Definition TargetedExperimentHelper.h:339
Int32 unimod_id
Definition TargetedExperimentHelper.h:343
double mono_mass_delta
Definition TargetedExperimentHelper.h:341
double avg_mass_delta
Definition TargetedExperimentHelper.h:340
Int32 location
Definition TargetedExperimentHelper.h:342
Modification()
Definition TargetedExperimentHelper.h:345
Definition TargetedExperimentHelper.h:455
String software_ref
Definition TargetedExperimentHelper.h:468
Prediction()
Definition TargetedExperimentHelper.h:456
String contact_ref
Definition TargetedExperimentHelper.h:469
bool operator==(const Prediction &rhs) const
Definition TargetedExperimentHelper.h:461
Definition TargetedExperimentHelper.h:75
String sequence
Definition TargetedExperimentHelper.h:85
String id
Definition TargetedExperimentHelper.h:84
bool operator==(const Protein &rhs) const
Definition TargetedExperimentHelper.h:77
Definition TargetedExperimentHelper.h:421
bool operator==(const Publication &rhs) const
Definition TargetedExperimentHelper.h:427
String id
Definition TargetedExperimentHelper.h:433
Publication()
Definition TargetedExperimentHelper.h:422
Represents a product ion.
Definition TargetedExperimentHelper.h:548
void resetInterpretations()
Definition TargetedExperimentHelper.h:608
void addConfiguration(const Configuration &configuration)
Definition TargetedExperimentHelper.h:593
void addInterpretation(const Interpretation &interpretation)
Definition TargetedExperimentHelper.h:603
const std::vector< Configuration > & getConfigurationList() const
Definition TargetedExperimentHelper.h:588
void setMZ(double mz)
Definition TargetedExperimentHelper.h:583
const std::vector< Interpretation > & getInterpretationList() const
Definition TargetedExperimentHelper.h:598
int getChargeState() const
Definition TargetedExperimentHelper.h:572
bool charge_set_
Whether product ion charge is set or not.
Definition TargetedExperimentHelper.h:615
void setChargeState(int charge)
Definition TargetedExperimentHelper.h:560
std::vector< Configuration > configuration_list_
Product ion configurations used.
Definition TargetedExperimentHelper.h:617
int charge_
Product ion charge.
Definition TargetedExperimentHelper.h:614
bool hasCharge() const
Whether product has set charge state.
Definition TargetedExperimentHelper.h:567
std::vector< Interpretation > interpretation_list_
Product ion interpretation.
Definition TargetedExperimentHelper.h:618
bool operator==(const TraMLProduct &rhs) const
Definition TargetedExperimentHelper.h:550
double mz_
Product ion m/z.
Definition TargetedExperimentHelper.h:616
double getMZ() const
Definition TargetedExperimentHelper.h:578
std::size_t operator()(const OpenMS::TargetedExperimentHelper::CV &cv) const noexcept
Definition TargetedExperimentHelper.h:670
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Compound &compound) const noexcept
Definition TargetedExperimentHelper.h:738
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Contact &contact) const noexcept
Definition TargetedExperimentHelper.h:778
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Instrument &inst) const noexcept
Definition TargetedExperimentHelper.h:802
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Interpretation &interp) const noexcept
Definition TargetedExperimentHelper.h:827
std::size_t operator()(const OpenMS::TargetedExperimentHelper::PeptideCompound &pc) const noexcept
Definition TargetedExperimentHelper.h:717
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Peptide &peptide) const noexcept
Definition TargetedExperimentHelper.h:752
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Prediction &pred) const noexcept
Definition TargetedExperimentHelper.h:814
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Protein &protein) const noexcept
Definition TargetedExperimentHelper.h:685
std::size_t operator()(const OpenMS::TargetedExperimentHelper::Publication &pub) const noexcept
Definition TargetedExperimentHelper.h:790
std::size_t operator()(const OpenMS::TargetedExperimentHelper::RetentionTime &rt) const noexcept
Definition TargetedExperimentHelper.h:698
std::size_t operator()(const OpenMS::TargetedExperimentHelper::TraMLProduct &product) const noexcept
Definition TargetedExperimentHelper.h:841