![]() |
OpenMS
|
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 } |
Enumeration for specifying which side of the compomer to operate on. More... | |
typedef std::map< String, Adduct > | CompomerSide |
Type definition for one side of a compomer (maps adduct labels to Adduct objects) More... | |
typedef std::vector< CompomerSide > | CompomerComponents |
Container for both sides of a compomer. More... | |
Public Member Functions | |
Compomer () | |
Default Constructor. More... | |
Compomer (Int net_charge, double mass, double log_p) | |
Constructor with net-charge, mass, and probability. More... | |
Compomer (const Compomer &p) | |
Copy constructor. More... | |
Compomer & | operator= (const Compomer &source) |
Assignment Operator. More... | |
void | add (const Adduct &a, UInt side) |
Add an adduct to a specific side of the compomer. More... | |
bool | isConflicting (const Compomer &cmp, UInt side_this, UInt side_other) const |
Determines if two compomers conflict with each other. More... | |
void | setID (const Size &id) |
Set a unique identifier for this compomer. More... | |
const Size & | getID () const |
Get the unique identifier of this compomer. More... | |
const CompomerComponents & | getComponent () const |
Get both sides (left and right) of this compomer. More... | |
const Int & | getNetCharge () const |
Get the net charge of this compomer. More... | |
const double & | getMass () const |
Get the total mass difference represented by this compomer. More... | |
const Int & | getPositiveCharges () const |
Get the sum of positive charges in this compomer. More... | |
const Int & | getNegativeCharges () const |
Get the sum of negative charges in this compomer. More... | |
const double & | getLogP () const |
Get the log probability of this adduct combination. More... | |
const double & | getRTShift () const |
Get the expected retention time shift caused by this compomer. More... | |
String | getAdductsAsString () const |
Get a string representation of all adducts in this compomer. More... | |
String | getAdductsAsString (UInt side) const |
Get a string representation of adducts on a specific side. More... | |
bool | isSingleAdduct (Adduct &a, const UInt side) const |
Check if the compomer contains only a single adduct on the specified 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) |
Add a complete set of adducts to a specific side of the 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_ |
Sum of positive charges. More... | |
Int | neg_charges_ |
Sum of negative charges. More... | |
double | log_p_ |
Log probability of this adduct combination. More... | |
double | rt_shift_ |
Expected net RT shift (-shift_leftside + shift_rightside) More... | |
Size | id_ |
Unique identifier for this compomer. More... | |
Friends | |
bool | operator< (const Compomer &c1, const Compomer &c2) |
Comparison operator for sorting compomers. More... | |
std::ostream & | operator<< (std::ostream &os, const Compomer &cmp) |
Output stream operator for printing compomer contents. More... | |
bool | operator== (const Compomer &a, const Compomer &b) |
Equality comparison operator. More... | |
Holds information on an edge connecting two features from a (putative) charge ladder.
A Compomer represents the chemical composition difference between two mass spectrometry features. It stores information about the adducts (ions, molecules, or atoms) that explain the mass and charge differences between these features.
The Compomer has two sides:
This model allows representing the relationship between features that correspond to the same analyte but with different adduct compositions or charge states.
The Compomer maintains metadata such as:
This class is used extensively in the feature decharging and adduct annotation processes.
typedef std::vector<CompomerSide> CompomerComponents |
Container for both sides of a compomer.
Vector with exactly two elements:
typedef std::map<String, Adduct> CompomerSide |
Type definition for one side of a compomer (maps adduct labels to Adduct objects)
enum SIDE |
Compomer | ( | ) |
Default Constructor.
Initializes an empty compomer with zero net charge, mass, and probability.
Constructor with net-charge, mass, and probability.
net_charge | Net charge of the compomer (right side - left side) |
mass | Mass difference represented by the compomer |
log_p | Log probability of this adduct combination |
Add an adduct to a specific side of the compomer.
Adds the specified amount of the adduct to the given side and updates the compomer's properties (net charge, mass, etc.).
a | The adduct to add |
side | Which side to add the adduct to (0=LEFT, 1=RIGHT) |
void add | ( | const CompomerSide & | add_side, |
UInt | side | ||
) |
Add a complete set of adducts to a specific side of the compomer.
add_side | The set of adducts to add |
side | Which side to add the adducts to (LEFT or RIGHT) |
String getAdductsAsString | ( | ) | const |
Get a string representation of all adducts in this compomer.
Get a string representation of adducts on a specific side.
side | Which side to get adducts for (LEFT, RIGHT, or BOTH) |
const CompomerComponents& getComponent | ( | ) | const |
Get both sides (left and right) of this compomer.
const Size& getID | ( | ) | const |
Get the unique identifier 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 |
Get the log probability of this adduct combination.
Higher values indicate more likely combinations.
const double& getMass | ( | ) | const |
Get the total mass difference represented by this compomer.
const Int& getNegativeCharges | ( | ) | const |
Get the sum of negative charges in this compomer.
const Int& getNetCharge | ( | ) | const |
Get the net charge of this compomer.
The net charge is calculated as the difference between the right and left sides.
const Int& getPositiveCharges | ( | ) | const |
Get the sum of positive charges in this compomer.
const double& getRTShift | ( | ) | const |
Get the expected retention time shift caused by this compomer.
Determines if two compomers conflict with each other.
Checks if these two compomers can coexist for one feature by examining if they have conflicting adduct compositions on the specified sides.
cmp | The other Compomer to compare against |
side_this | Which side of this compomer to check (0=LEFT, 1=RIGHT) |
side_other | Which side of the other compomer to check (0=LEFT, 1=RIGHT) |
Check if the compomer contains only a single adduct on the specified side.
a | Output parameter that will contain the adduct if found |
side | Which side to check (LEFT or RIGHT) |
Assignment Operator.
source | Source compomer to assign from |
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 a unique identifier for this compomer.
id | The unique ID to assign |
Comparison operator for sorting compomers.
Sorts compomers by (in order of importance):
c1 | First compomer to compare |
c2 | Second compomer to compare |
|
friend |
Output stream operator for printing compomer contents.
os | Output stream to write to |
cmp | Compomer to print |
Equality comparison operator.
a | First compomer to compare |
b | Second compomer to compare |
|
private |
Adducts of left and right side.
|
private |
Unique identifier for this compomer.
|
private |
Log probability of this adduct combination.
|
private |
Net mass (right - left)
|
private |
Sum of negative charges.
|
private |
Net charge (right - left)
|
private |
Sum of positive charges.
|
private |
Expected net RT shift (-shift_leftside + shift_rightside)