OpenMS
ChargePair.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/CONCEPT/Types.h>
13 #include <OpenMS/OpenMSConfig.h>
14 
15 #include <iosfwd>
16 #include <vector>
17 
18 namespace OpenMS
19 {
20 
31  class OPENMS_DLLAPI ChargePair
32  {
33 
34 public:
36 
37  ChargePair();
39 
41  ChargePair(const Size& index0,
42  const Size& index1,
43  const Int& charge0,
44  const Int& charge1,
45  const Compomer& compomer,
46  const double& mass_diff,
47  const bool active);
48 
50  ChargePair(const ChargePair& rhs);
51 
54 
56  virtual ~ChargePair() = default;
57 
59 
60  //@name Accessors
62  Int getCharge(UInt pairID) const;
64 
66  void setCharge(UInt pairID, Int e);
67 
69  Size getElementIndex(UInt pairID) const;
70 
72  void setElementIndex(UInt pairID, Size e);
73 
75  const Compomer& getCompomer() const;
76 
78  void setCompomer(const Compomer& compomer);
79 
81  double getMassDiff() const;
82 
84  void setMassDiff(double mass_diff);
85 
87  double getEdgeScore() const;
88 
90  void setEdgeScore(double score);
91 
93  bool isActive() const;
94 
95  void setActive(const bool active);
96 
98 
100  virtual bool operator==(const ChargePair& i) const;
101 
103  virtual bool operator!=(const ChargePair& i) const;
104 
105 protected:
106 
118  double mass_diff_;
120  double score_;
123  };
124 
126  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const ChargePair& cons);
127 
128 } // namespace OpenMS
129 
Representation of a (putative) link between two Features, which stem from the same compound but have ...
Definition: ChargePair.h:32
const Compomer & getCompomer() const
Returns the Id of the compomer that explains the mass difference.
double mass_diff_
mass difference (after explanation by compomer)
Definition: ChargePair.h:118
virtual bool operator==(const ChargePair &i) const
Equality operator.
bool isActive() const
is this pair realized?
void setCompomer(const Compomer &compomer)
Set the compomer id.
void setMassDiff(double mass_diff)
Sets the mass difference.
double getMassDiff() const
Returns the mass difference.
ChargePair(const ChargePair &rhs)
Copy constructor.
virtual ~ChargePair()=default
Destructor.
Size getElementIndex(UInt pairID) const
Returns the element index (for element 0 or 1)
Size feature1_index_
Int of the second element within the FeatureMap.
Definition: ChargePair.h:110
bool is_active_
was this pair realized by ILP?
Definition: ChargePair.h:122
Size feature0_index_
Int of the first element within the FeatureMap.
Definition: ChargePair.h:108
void setActive(const bool active)
Compomer compomer_
Compomer that explains the mass difference.
Definition: ChargePair.h:116
ChargePair & operator=(const ChargePair &rhs)
Assignment operator.
ChargePair(const Size &index0, const Size &index1, const Int &charge0, const Int &charge1, const Compomer &compomer, const double &mass_diff, const bool active)
Constructor from map index, element index and Feature.
void setCharge(UInt pairID, Int e)
Set the charge (for element 0 or 1)
virtual bool operator!=(const ChargePair &i) const
Equality operator.
void setElementIndex(UInt pairID, Size e)
Set the element index (for element 0 or 1)
Int feature0_charge_
Assumed charge of the first feature.
Definition: ChargePair.h:112
double getEdgeScore() const
Returns the ILP edge score.
void setEdgeScore(double score)
Sets the ILP edge score.
Int feature1_charge_
Assumed charge of the second feature.
Definition: ChargePair.h:114
double score_
Score of this edge used in ILP.
Definition: ChargePair.h:120
Holds information on an edge connecting two features from a (putative) charge ladder.
Definition: Compomer.h:33
int Int
Signed integer type.
Definition: Types.h:76
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)