Holds information on an edge connecting two features from a (putative) charge ladder. More...
#include <OpenMS/DATASTRUCTURES/Compomer.h>
Public Types | |
enum | SIDE { LEFT, RIGHT, BOTH } |
side of compomer (LEFT ^ subtract; RIGHT ^ add) More... | |
typedef std::map< String, Adduct > | CompomerSide |
typedef std::vector< CompomerSide > | CompomerComponents |
adducts and their abundance etc More... | |
Public Member Functions | |
Compomer () | |
container for the two sides [0]=left, [1]=right More... | |
Compomer (Int net_charge, double mass, double log_p) | |
Constructor with net-charge and mass. More... | |
Compomer (const Compomer &p) | |
Copy C'tor. More... | |
Compomer & | operator= (const Compomer &source) |
Assignment Operator. More... | |
void | add (const Adduct &a, UInt side) |
Add a.amount of Adduct. More... | |
bool | isConflicting (const Compomer &cmp, UInt side_this, UInt side_other) const |
void | setID (const Size &id) |
set an Id which allows unique identification of a compomer More... | |
const Size & | getID () const |
return Id which allows unique identification of this compomer More... | |
const CompomerComponents & | getComponent () const |
left and right adducts of this compomer More... | |
const Int & | getNetCharge () const |
net charge of compomer (i.e. difference between left and right side of compomer) More... | |
const double & | getMass () const |
mass of all contained adducts More... | |
const Int & | getPositiveCharges () const |
summed positive charges of contained adducts More... | |
const Int & | getNegativeCharges () const |
summed negative charges of contained adducts More... | |
const double & | getLogP () const |
return log probability More... | |
const double & | getRTShift () const |
return log probability More... | |
String | getAdductsAsString () const |
get adducts with their abundance as compact string for both sides More... | |
String | getAdductsAsString (UInt side) const |
bool | isSingleAdduct (Adduct &a, const UInt side) const |
check if Compomer only contains a single adduct on side side More... | |
Compomer | removeAdduct (const Adduct &a) const |
Remove all adducts of type a . More... | |
Compomer | removeAdduct (const Adduct &a, const UInt side) const |
Remove all adducts of type a from side (LEFT or RIGHT) More... | |
StringList | getLabels (const UInt side) const |
Returns the adduct labels from side (LEFT or RIGHT) More... | |
void | add (const CompomerSide &add_side, UInt side) |
Adds add_side to this compomer. More... | |
Private Attributes | |
CompomerComponents | cmp_ |
Int | net_charge_ |
double | mass_ |
Int | pos_charges_ |
Int | neg_charges_ |
double | log_p_ |
double | rt_shift_ |
Size | id_ |
Friends | |
bool | operator< (const Compomer &c1, const Compomer &c2) |
Sort compomer by (in order of importance): net-charge, mass, probability. More... | |
std::ostream & | operator<< (std::ostream &os, const Compomer &cmp) |
Print the contents of a Compomer to a stream. More... | |
bool | operator== (const Compomer &a, const Compomer &b) |
Comparator. More... | |
Holds information on an edge connecting two features from a (putative) charge ladder.
A compomer is storing information on the adducts used on LEFT and RIGHT nodes (Features) that are connected by the edge (i.e. ChargePair) holding the compomer. Additionally meta information on the edge (net_charge, edge score, id) which is kept up-to-date when adducts are added to either side is stored.
typedef std::vector<CompomerSide> CompomerComponents |
adducts and their abundance etc
typedef std::map<String, Adduct> CompomerSide |
enum SIDE |
Compomer | ( | ) |
container for the two sides [0]=left, [1]=right
Default Constructor
void add | ( | const CompomerSide & | add_side, |
UInt | side | ||
) |
Adds add_side
to this compomer.
String getAdductsAsString | ( | ) | const |
get adducts with their abundance as compact string for both sides
get adducts with their abundance as compact string (amounts are absolute unless side=BOTH)
side | Use LEFT for left, RIGHT for right |
const CompomerComponents& getComponent | ( | ) | const |
left and right adducts of this compomer
const Size& getID | ( | ) | const |
return Id which allows unique identification of this compomer
StringList getLabels | ( | const UInt | side | ) | const |
Returns the adduct labels from side
(LEFT or RIGHT)
Get a list of labels for the side
(useful for assigning channels (light, heavy etc) to features).
const double& getLogP | ( | ) | const |
return log probability
const double& getMass | ( | ) | const |
mass of all contained adducts
const Int& getNegativeCharges | ( | ) | const |
summed negative charges of contained adducts
const Int& getNetCharge | ( | ) | const |
net charge of compomer (i.e. difference between left and right side of compomer)
const Int& getPositiveCharges | ( | ) | const |
summed positive charges of contained adducts
const double& getRTShift | ( | ) | const |
return log probability
indicates if these two compomers can coexist for one feature
cmp | The other Compomer we compare to |
side_this | Indicates which "side"(negative or positive adducts) we are looking at. Negative adducts belong to the left side of the ChargePair. |
side_other | See above. |
check if Compomer only contains a single adduct on side side
Remove all adducts of type a
.
Remove ALL instances of the given adduct, BUT use the given adducts parameters (charge, logp, mass etc) to update the compomers members
Remove all adducts of type a
from side
(LEFT or RIGHT)
remove ALL instances of the given adduct from the given side (LEFT or RIGHT), BUT use the given adducts parameters (charge, logp, mass etc) to update the compomers members
void setID | ( | const Size & | id | ) |
set an Id which allows unique identification of a compomer
Sort compomer by (in order of importance): net-charge, mass, probability.
|
friend |
Print the contents of a Compomer to a stream.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
OpenMS / TOPP release 2.3.0 | Documentation generated on Tue Jan 9 2018 18:22:07 using doxygen 1.8.13 |