OpenMS  2.8.0
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
Compomer Class Reference

Holds information on an edge connecting two features from a (putative) charge ladder. More...

#include <OpenMS/DATASTRUCTURES/Compomer.h>

Collaboration diagram for Compomer:
[legend]

Public Types

enum  SIDE { LEFT , RIGHT , BOTH }
 side of compomer (LEFT ^ subtract; RIGHT ^ add) More...
 
typedef std::map< String, AdductCompomerSide
 adducts and their abundance etc More...
 
typedef std::vector< CompomerSideCompomerComponents
 container for the two sides [0]=left, [1]=right More...
 

Public Member Functions

 Compomer ()
 Default Constructor. 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...
 
Compomeroperator= (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 SizegetID () const
 return Id which allows unique identification of this compomer More...
 
const CompomerComponentsgetComponent () const
 left and right adducts of this compomer More...
 
const IntgetNetCharge () 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 IntgetPositiveCharges () const
 summed positive charges of contained adducts More...
 
const IntgetNegativeCharges () 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_
 adducts of left and right side More...
 
Int net_charge_
 net charge (right - left) More...
 
double mass_
 net mass (right - left) More...
 
Int pos_charges_
 net charges on the right More...
 
Int neg_charges_
 net charges on the left More...
 
double log_p_
 log probability of compomer More...
 
double rt_shift_
 expected net RT shift of compomer (-shift_leftside + shift_rightside) More...
 
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...
 

Detailed Description

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.

Member Typedef Documentation

◆ CompomerComponents

typedef std::vector<CompomerSide> CompomerComponents

container for the two sides [0]=left, [1]=right

◆ CompomerSide

typedef std::map<String, Adduct> CompomerSide

adducts and their abundance etc

Member Enumeration Documentation

◆ SIDE

enum SIDE

side of compomer (LEFT ^ subtract; RIGHT ^ add)

Enumerator
LEFT 
RIGHT 
BOTH 

Constructor & Destructor Documentation

◆ Compomer() [1/3]

Compomer ( )

Default Constructor.

◆ Compomer() [2/3]

Compomer ( Int  net_charge,
double  mass,
double  log_p 
)

Constructor with net-charge and mass.

◆ Compomer() [3/3]

Compomer ( const Compomer p)

Copy C'tor.

Member Function Documentation

◆ add() [1/2]

void add ( const Adduct a,
UInt  side 
)

Add a.amount of Adduct.

Parameters
ato Compomer's
sideand update its properties

◆ add() [2/2]

void add ( const CompomerSide add_side,
UInt  side 
)

Adds add_side to this compomer.

◆ getAdductsAsString() [1/2]

String getAdductsAsString ( ) const

get adducts with their abundance as compact string for both sides

◆ getAdductsAsString() [2/2]

String getAdductsAsString ( UInt  side) const

get adducts with their abundance as compact string (amounts are absolute unless side=BOTH)

Parameters
sideUse LEFT for left, RIGHT for right

◆ getComponent()

const CompomerComponents& getComponent ( ) const

left and right adducts of this compomer

◆ getID()

const Size& getID ( ) const

return Id which allows unique identification of this compomer

◆ getLabels()

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).

◆ getLogP()

const double& getLogP ( ) const

return log probability

◆ getMass()

const double& getMass ( ) const

mass of all contained adducts

◆ getNegativeCharges()

const Int& getNegativeCharges ( ) const

summed negative charges of contained adducts

◆ getNetCharge()

const Int& getNetCharge ( ) const

net charge of compomer (i.e. difference between left and right side of compomer)

◆ getPositiveCharges()

const Int& getPositiveCharges ( ) const

summed positive charges of contained adducts

◆ getRTShift()

const double& getRTShift ( ) const

return log probability

◆ isConflicting()

bool isConflicting ( const Compomer cmp,
UInt  side_this,
UInt  side_other 
) const

indicates if these two compomers can coexist for one feature

Parameters
cmpThe other Compomer we compare to
side_thisIndicates which "side"(negative or positive adducts) we are looking at. Negative adducts belong to the left side of the ChargePair.
side_otherSee above.

◆ isSingleAdduct()

bool isSingleAdduct ( Adduct a,
const UInt  side 
) const

check if Compomer only contains a single adduct on side side

◆ operator=()

Compomer& operator= ( const Compomer source)

Assignment Operator.

◆ removeAdduct() [1/2]

Compomer removeAdduct ( const Adduct a) const

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

◆ removeAdduct() [2/2]

Compomer removeAdduct ( const Adduct a,
const UInt  side 
) const

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

◆ setID()

void setID ( const Size id)

set an Id which allows unique identification of a compomer

Friends And Related Function Documentation

◆ operator<

bool operator< ( const Compomer c1,
const Compomer c2 
)
friend

Sort compomer by (in order of importance): net-charge, mass, probability.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Compomer cmp 
)
friend

Print the contents of a Compomer to a stream.

◆ operator==

bool operator== ( const Compomer a,
const Compomer b 
)
friend

Comparator.

Member Data Documentation

◆ cmp_

CompomerComponents cmp_
private

adducts of left and right side

◆ id_

Size id_
private

◆ log_p_

double log_p_
private

log probability of compomer

◆ mass_

double mass_
private

net mass (right - left)

◆ neg_charges_

Int neg_charges_
private

net charges on the left

◆ net_charge_

Int net_charge_
private

net charge (right - left)

◆ pos_charges_

Int pos_charges_
private

net charges on the right

◆ rt_shift_

double rt_shift_
private

expected net RT shift of compomer (-shift_leftside + shift_rightside)