| OpenMS 2.5.0

DBSearchParam.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hendrik Weisser $
32 // $Authors: Hendrik Weisser $
33 // --------------------------------------------------------------------------
34
35 #pragma once
36
37 #include <OpenMS/CHEMISTRY/DigestionEnzyme.h>
38 #include <OpenMS/METADATA/ID/MetaData.h>
39
40 namespace OpenMS
41 {
42 namespace IdentificationDataInternal
43 {
46 struct DBSearchParam: public MetaInfoInterface
47 {
48 enum MoleculeType molecule_type;
49 enum MassType mass_type;
50
51 String database;
52 String database_version;
53 String taxonomy;
54
55 std::set<Int> charges;
56
57 std::set<String> fixed_mods;
58 std::set<String> variable_mods;
59
60 double precursor_mass_tolerance;
61 double fragment_mass_tolerance;
62 bool precursor_tolerance_ppm;
63 bool fragment_tolerance_ppm;
64
65 // allow for either "DigestionEnzymeProtein" or "DigestionEnzymeRNA":
66 const DigestionEnzyme* digestion_enzyme;
67 Size missed_cleavages;
68 Size min_length;
69 Size max_length;
70
71 DBSearchParam():
72 molecule_type(MoleculeType::PROTEIN),
73 mass_type(MassType::MONOISOTOPIC),
74 precursor_mass_tolerance(0.0), fragment_mass_tolerance(0.0),
75 precursor_tolerance_ppm(false), fragment_tolerance_ppm(false),
76 digestion_enzyme(0), missed_cleavages(0), min_length(0), max_length(0)
77 {
78 }
79
80 DBSearchParam(const DBSearchParam& other) = default;
81
82 bool operator<(const DBSearchParam& other) const
83 {
84 return (std::tie(molecule_type, mass_type, database,
85 database_version, taxonomy, charges, fixed_mods,
86 variable_mods, fragment_mass_tolerance,
87 precursor_mass_tolerance, fragment_tolerance_ppm,
88 precursor_tolerance_ppm, digestion_enzyme,
89 missed_cleavages, min_length, max_length) <
90 std::tie(other.molecule_type, other.mass_type,
91 other.database, other.database_version, other.taxonomy,
92 other.charges, other.fixed_mods, other.variable_mods,
93 other.fragment_mass_tolerance,
94 other.precursor_mass_tolerance,
95 other.fragment_tolerance_ppm,
96 other.precursor_tolerance_ppm,
97 other.digestion_enzyme, other.missed_cleavages,
98 other.min_length, other.max_length));
99 }
100
101 bool operator==(const DBSearchParam& other) const
102 {
103 return (std::tie(molecule_type, mass_type, database,
104 database_version, taxonomy, charges, fixed_mods,
105 variable_mods, fragment_mass_tolerance,
106 precursor_mass_tolerance, fragment_tolerance_ppm,
107 precursor_tolerance_ppm, digestion_enzyme,
108 missed_cleavages, min_length, max_length) ==
109 std::tie(other.molecule_type, other.mass_type,
110 other.database, other.database_version, other.taxonomy,
111 other.charges, other.fixed_mods, other.variable_mods,
112 other.fragment_mass_tolerance,
113 other.precursor_mass_tolerance,
114 other.fragment_tolerance_ppm,
115 other.precursor_tolerance_ppm,
116 other.digestion_enzyme, other.missed_cleavages,
117 other.min_length, other.max_length));
118 }
119 };
120
121 typedef std::set<DBSearchParam> DBSearchParams;
122 typedef IteratorWrapper<DBSearchParams::iterator> SearchParamRef;
123 typedef std::map<ProcessingStepRef, SearchParamRef> DBSearchSteps;
124
125 }
126 }
OpenMS::IdentificationDataInternal::DBSearchParam::precursor_tolerance_ppm
bool precursor_tolerance_ppm
Definition: DBSearchParam.h:62
OpenMS::IdentificationDataInternal::DBSearchParam::operator<
bool operator<(const DBSearchParam &other) const
Definition: DBSearchParam.h:82
OpenMS::IdentificationDataInternal::MONOISOTOPIC
Definition: MetaData.h:74
DigestionEnzyme.h
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::IdentificationDataInternal::DBSearchParams
std::set< DBSearchParam > DBSearchParams
Definition: DBSearchParam.h:121
OpenMS::IdentificationDataInternal::DBSearchParam::DBSearchParam
DBSearchParam()
Definition: DBSearchParam.h:71
OpenMS::IdentificationDataInternal::SearchParamRef
IteratorWrapper< DBSearchParams::iterator > SearchParamRef
Definition: DBSearchParam.h:122
OpenMS::IdentificationDataInternal::DBSearchParam::variable_mods
std::set< String > variable_mods
Definition: DBSearchParam.h:58
OpenMS::IdentificationDataInternal::DBSearchParam
Parameters specific to a database search step.
Definition: DBSearchParam.h:46
OpenMS::IdentificationDataInternal::DBSearchParam::fragment_mass_tolerance
double fragment_mass_tolerance
Definition: DBSearchParam.h:61
OpenMS::IdentificationDataInternal::PROTEIN
Definition: MetaData.h:65
OpenMS::IdentificationDataInternal::DBSearchParam::molecule_type
enum MoleculeType molecule_type
Definition: DBSearchParam.h:48
OpenMS::DigestionEnzyme
Abstract base class for digestion enzymes.
Definition: DigestionEnzyme.h:52
OpenMS::IdentificationDataInternal::IteratorWrapper
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition: MetaData.h:43
OpenMS::IdentificationDataInternal::DBSearchParam::taxonomy
String taxonomy
Definition: DBSearchParam.h:53
OpenMS::IdentificationDataInternal::DBSearchParam::precursor_mass_tolerance
double precursor_mass_tolerance
Definition: DBSearchParam.h:60
OpenMS::IdentificationDataInternal::DBSearchParam::fixed_mods
std::set< String > fixed_mods
Definition: DBSearchParam.h:57
MetaData.h
OpenMS::IdentificationDataInternal::MassType
MassType
Definition: MetaData.h:72
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::IdentificationDataInternal::DBSearchParam::missed_cleavages
Size missed_cleavages
Definition: DBSearchParam.h:67
OpenMS::IdentificationDataInternal::DBSearchParam::database_version
String database_version
Definition: DBSearchParam.h:52
OpenMS::IdentificationDataInternal::DBSearchParam::mass_type
enum MassType mass_type
Definition: DBSearchParam.h:49
OpenMS::IdentificationDataInternal::DBSearchParam::operator==
bool operator==(const DBSearchParam &other) const
Definition: DBSearchParam.h:101
OpenMS::IdentificationDataInternal::DBSearchParam::min_length
Size min_length
Definition: DBSearchParam.h:68
OpenMS::IdentificationDataInternal::DBSearchParam::charges
std::set< Int > charges
Definition: DBSearchParam.h:55
OpenMS::IdentificationDataInternal::DBSearchParam::fragment_tolerance_ppm
bool fragment_tolerance_ppm
Definition: DBSearchParam.h:63
OpenMS::IdentificationDataInternal::DBSearchParam::database
String database
Definition: DBSearchParam.h:51
OpenMS::IdentificationDataInternal::DBSearchSteps
std::map< ProcessingStepRef, SearchParamRef > DBSearchSteps
Definition: DBSearchParam.h:123
OpenMS::IdentificationDataInternal::DBSearchParam::max_length
Size max_length
Definition: DBSearchParam.h:69
OpenMS::MetaInfoInterface
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:60
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::IdentificationDataInternal::DBSearchParam::digestion_enzyme
const DigestionEnzyme * digestion_enzyme
Definition: DBSearchParam.h:66
OpenMS::IdentificationDataInternal::MoleculeType
MoleculeType
Definition: MetaData.h:63