7#ifndef _CDENOVOGRAPHNODE_H
8#define _CDENOVOGRAPHNODE_H
10#include <unordered_set>
41 void store(ofstream& os);
48 void load(ifstream& is);
193 return std::hash<int>()(e.targetnode) ^ std::hash<int>()(e.brickid) ^ std::hash<int>()((int)(e.sourceion)) ^ std::hash<int>()((int)(e.targetion));
234 unordered_set<cEdge, hash_cEdge> tempedges;
236 map<eFragmentIonType, bool> ionannotation;
bool compareEdgesByTargetNodeIntensityDesc(const cEdge &a, const cEdge &b)
Compare edges by target node intensity.
Definition: cDeNovoGraphNode.cpp:31
bool compareEdgesByPPMError(const cEdge &a, const cEdge &b)
Compare edges by ppm error.
Definition: cDeNovoGraphNode.cpp:26
bool operator==(nodeEdge const &a, nodeEdge const &b)
Overloaded operator ==.
Definition: cDeNovoGraphNode.cpp:16
Basic definitions of fragment ions occurring in the mass spectra.
eFragmentIonType
The types of supported fragment ions.
Definition: cFragmentIons.h:944
The class representing a node in the de novo graph.
Definition: cDeNovoGraphNode.h:229
bool checkIonAnnotation(eFragmentIonType iontype)
Check ion annotation.
Definition: cDeNovoGraphNode.cpp:130
void clearEdges()
Clear edges.
Definition: cDeNovoGraphNode.cpp:120
cEdge & operator[](int position)
Overloaded operator [].
Definition: cDeNovoGraphNode.cpp:110
void createVectorOfEdges()
Create a vector of edges from an unordered set of temporary edges.
Definition: cDeNovoGraphNode.cpp:96
void addIonAnnotation(eFragmentIonType iontype)
Add ion annotation.
Definition: cDeNovoGraphNode.cpp:125
void setMZRatio(double mzratio)
Set the mz ratio of the node.
Definition: cDeNovoGraphNode.cpp:61
double getIntensity()
Get the intensity of the node.
Definition: cDeNovoGraphNode.cpp:66
void sortEdgesByTargetNodeIntensity()
Sort a vector of edges by target node intensity.
Definition: cDeNovoGraphNode.cpp:91
int size()
Get the number of edges.
Definition: cDeNovoGraphNode.cpp:105
double getMZRatio()
Get the mz ratio of the node.
Definition: cDeNovoGraphNode.cpp:56
void insertTempEdge(cEdge &e)
Insert an edge into a temporary unordered set.
Definition: cDeNovoGraphNode.cpp:76
void insertEdge(cEdge &e)
Insert an edge into a vector of edges.
Definition: cDeNovoGraphNode.cpp:81
cDeNovoGraphNode()
The constructor.
Definition: cDeNovoGraphNode.cpp:36
void setIntensity(double intensity)
Set the intensity of the node.
Definition: cDeNovoGraphNode.cpp:71
void removeEdge(int position)
Remove an edge.
Definition: cDeNovoGraphNode.cpp:115
void clear()
Clear the class.
Definition: cDeNovoGraphNode.cpp:41
void sortEdgesByPPMError()
Sort a vector of edges by ppm error.
Definition: cDeNovoGraphNode.cpp:86
The structure representing an outgoing edge from a node.
Definition: cDeNovoGraphNode.h:65
double massdifference
A mass difference.
Definition: cDeNovoGraphNode.h:88
double targetintensity
Intensity of the target node.
Definition: cDeNovoGraphNode.h:106
int endmodifID
Id of a terminal modification (at the end of a spectrum).
Definition: cDeNovoGraphNode.h:136
int targetcharge
Charge of the target node.
Definition: cDeNovoGraphNode.h:100
eFragmentIonType sourceion
Source ion name.
Definition: cDeNovoGraphNode.h:142
int targetnode
Id of a target node.
Definition: cDeNovoGraphNode.h:70
double ppmerror
Error in ppm.
Definition: cDeNovoGraphNode.h:82
string composition
ids of bricks separated by '-'.
Definition: cDeNovoGraphNode.h:112
int startmodifID
Id of a terminal modification (at the beginning of a spectrum).
Definition: cDeNovoGraphNode.h:124
int middlemodifID
Id of a terminal modification of a branched peptide (in the middle of a spectrum).
Definition: cDeNovoGraphNode.h:130
string summary
summary formula as a string
Definition: cDeNovoGraphNode.h:118
int sourcecharge
Charge of the source node.
Definition: cDeNovoGraphNode.h:94
void clear()
Clear the structure.
Definition: cDeNovoGraphNode.h:162
cEdge()
The constructor.
Definition: cDeNovoGraphNode.h:154
int brickid
Id of a brick.
Definition: cDeNovoGraphNode.h:76
eFragmentIonType targetion
Target ion name.
Definition: cDeNovoGraphNode.h:148
The structure defining a hash function of cEdge.
Definition: cDeNovoGraphNode.h:185
size_t operator()(const cEdge &e) const
Hash an edge.
Definition: cDeNovoGraphNode.h:192
An auxiliary structure to store relationship between a node and an edge.
Definition: cDeNovoGraphNode.h:23
int nodeid
Id of a node.
Definition: cDeNovoGraphNode.h:28
void store(ofstream &os)
Store the structure into an output stream.
Definition: cDeNovoGraphNode.cpp:4
int edgeid
Id of an edge.
Definition: cDeNovoGraphNode.h:34
void load(ifstream &is)
Load the structure from an input stream.
Definition: cDeNovoGraphNode.cpp:10