CycloBranch
cCandidate Class Reference

The class representing a peptide sequence candidate. More...

#include <cCandidate.h>

Public Member Functions

 cCandidate ()
 The default constructor.
 
 cCandidate (vector< string > &composition, vector< nodeEdge > &path, eFragmentIonType startiontype, int startmodifID, int endmodifID, int middlemodifID, int middlepos)
 The constructor. More...
 
 cCandidate (vector< string > &composition, vector< nodeEdge > &path, eFragmentIonType startiontype, int startmodifID, int endmodifID, int middlemodifID, int branchstart, int branchend)
 The constructor. More...
 
void setCandidate (vector< string > &composition, vector< nodeEdge > &path, eFragmentIonType startiontype, int startmodifID, int endmodifID, int middlemodifID, int middlepos)
 Set a peptide sequence candidate. More...
 
void setCandidate (vector< string > &composition, vector< nodeEdge > &path, eFragmentIonType startiontype, int startmodifID, int endmodifID, int middlemodifID, int branchstart, int branchend)
 Set a peptide sequence candidate. More...
 
void clear ()
 Clear the candidate.
 
string & getComposition ()
 Access to the composition of the peptide sequence candidate. More...
 
void revertComposition ()
 Reverse the bricks composition of the candidate.
 
void prepareBranchedCandidates (cCandidateSet &result, ePeptideType peptidetype, bool *terminatecomputation)
 Prepare candidates of a branched or a branch-cyclic peptide. More...
 
string getTComposition ()
 Get a T-composition of a branched peptide. More...
 
string getRevertedTComposition (bool usebrackets)
 Get a reverted T-composition of a branched peptide. More...
 
string getAcronymsTComposition (cBricksDatabase &brickdatabase)
 Get a T-composition of a branched peptide composed from acronyms of bricks. More...
 
string getRealNameTComposition (cBricksDatabase &brickdatabase)
 Get a T-composition of a branched peptide composed from real names of bricks. More...
 
int getBranchSize ()
 Get a number of blocks forming a branch. More...
 
int getBranchStart ()
 Get starting position of a branch. More...
 
int getBranchEnd ()
 Get end position of a branch. More...
 
void getPermutationsOfBranches (vector< TRotationInfo > &tpermutations)
 Get permutations of branches a branched peptide. More...
 
double calculatePrecursorMassFromBricks (cBricksDatabase &brickdatabasewithcombinations, cParameters *parameters)
 Calculate the precursor mass of the peptide sequence candidate from bricks. More...
 
bool isEqualTo (cCandidate &candidate)
 Compare two candidates. More...
 
void getPermutations (cCandidateSet &permutations, bool *terminatecomputation)
 Get a set of candidates with permutations of bricks. More...
 
int getStartModifID ()
 Get id of a terminal modification (at the beginning of a spectrum). More...
 
void setStartModifID (int id)
 Set id of a terminal modification (at the beginning of a spectrum). More...
 
int getEndModifID ()
 Get id of a terminal modification (at the end of a spectrum). More...
 
void setEndModifID (int id)
 Set id of a terminal modification (at the end of a spectrum). More...
 
int getMiddleModifID ()
 Get id of a terminal modification of a branched peptide (in the middle of a spectrum). More...
 
void setMiddleModifID (int id)
 Set id of a terminal modification of a branched peptide (in the middle of a spectrum). More...
 
bool compare (cCandidate &candidate)
 Compare two candidates. More...
 
vector< nodeEdge > & getPath ()
 Get a path in the de novo graph corresponding to the peptide sequence candidate. More...
 
bool hasEqualTPermutations (cCandidate &candidate)
 compare TPermutations of two candidates. More...
 
bool hasOnlyArtificialBricks (cBricksDatabase &brickdatabasewithcombinations)
 Check whether the candidate is composed exclusively from artificial bricks. More...
 
bool hasFirstBrickArtificial (cBricksDatabase &brickdatabasewithcombinations)
 Check if the first brick is artificial. More...
 
bool hasLastBrickArtificial (cBricksDatabase &brickdatabasewithcombinations)
 Check if the last brick is artificial. More...
 
bool hasLastBrickInvalid (cBricksDatabase &brickdatabasewithcombinations)
 Check if the last brick is invalid. More...
 
void getRotations (vector< string > &rotations, bool includerevertedrotations)
 Get rotations of a cyclic peptide sequence. More...
 
void getBranchCyclicRotations (vector< cCandidate > &branchcyclicrotations, bool includerevertedrotations)
 Get branch-cyclic rotations of a branch-cyclic peptide sequence. More...
 
cSummaryFormula calculateSummaryFormulaFromBricks (cParameters &parameters, ePeptideType peptidetype, double precursormass=0)
 Calculate the summary formula of the peptide sequence candidate. More...
 
cSummaryFormulagetSummaryFormula ()
 Get the summary formula of the peptide sequence candidate. More...
 
void setSummaryFormula (cSummaryFormula &summary)
 Set the summary formula of the peptide sequence candidate. More...
 
void store (ofstream &os)
 Store the structure into an output stream. More...
 
void load (ifstream &is)
 Load the structure from an input stream. More...
 
void setName (string &name)
 Set the name of peptide. More...
 
string & getName ()
 Get the name of peptide. More...
 
void setAcronyms (cBricksDatabase &bricksdatabase)
 Set a vector of acronyms corresponding to a peptide sequence candidate. More...
 
void setBackboneAcronyms (cBricksDatabase &bricksdatabase)
 Set a vector of acronyms corresponding to a backbone of a peptide sequence candidate. More...
 
void setBranchAcronyms (cBricksDatabase &bricksdatabase)
 Set a vector of acronyms corresponding to a branch of a peptide sequence candidate. More...
 
vector< string > & getAcronyms ()
 Get a vector of acronyms corresponding to a peptide sequence candidate. More...
 
vector< string > & getBackboneAcronyms ()
 Get a vector of acronyms corresponding to a backbone of a peptide sequence candidate. More...
 
vector< string > & getBranchAcronyms ()
 Get a vector of acronyms corresponding to a branch of a peptide sequence candidate. More...
 
void setPath (cDeNovoGraph &graph, cParameters *parameters)
 Set a path in the de novo graph corresponding to the candidate. More...
 
string & getPathAsString ()
 Get a path in the de novo graph corresponding to the candidate as a string. More...
 
void setRealPeptideName (cBricksDatabase &bricksdatabase, ePeptideType peptidetype)
 Set a real peptide name. More...
 
void setAcronymPeptideNameWithHTMLReferences (cBricksDatabase &bricksdatabase, ePeptideType peptidetype)
 Set an acronym peptide name. More...
 
string & getRealPeptideName ()
 Get a real peptide name. More...
 
string & getAcronymPeptideNameWithHTMLReferences ()
 Get an acronym peptide name. More...
 
void setStartIonType (eFragmentIonType iontype)
 Set start ion type used in the de novo graph. More...
 
eFragmentIonType getStartIonType ()
 Get start ion type used in the de novo graph. More...
 
bool checkKetideSequence (cBricksDatabase &bricksdatabase, ePeptideType peptidetype, bool regularblocksorder)
 Check if the order of blocks is correct. More...
 
eResidueLossType getLeftResidueType (cBricksDatabase &bricksdatabase)
 Get the residue type of the left-most building block. More...
 
eResidueLossType getRightResidueType (cBricksDatabase &bricksdatabase)
 Get the residue type of the right-most building block. More...
 
bool checkKetideBlocks (cBricksDatabase &bricksdatabase, ePeptideType peptidetype, bool regularblocksorder)
 Check if the numbers of H2 loss and H2O loss blocks are correct. More...
 

Detailed Description

The class representing a peptide sequence candidate.

Constructor & Destructor Documentation

◆ cCandidate() [1/2]

cCandidate::cCandidate ( vector< string > &  composition,
vector< nodeEdge > &  path,
eFragmentIonType  startiontype,
int  startmodifID,
int  endmodifID,
int  middlemodifID,
int  middlepos 
)

The constructor.

Parameters
compositionreference to a vector of strings where each string is a sequence of ids of bricks separated by '-' (each string corresponds to an edge in the de novo graph)
pathreference to a path in the de novo graph which corresponds to a peptide sequence candidate
startiontypestart ion type in the de novo graph
startmodifIDid of a terminal modification (at the beginning of a spectrum)
endmodifIDid of a terminal modification (at the end of a spectrum)
middlemodifIDid of a terminal modification of a branched peptide (in the middle of a spectrum)
middleposposition in composition corresponding to a branch of a branched peptide

◆ cCandidate() [2/2]

cCandidate::cCandidate ( vector< string > &  composition,
vector< nodeEdge > &  path,
eFragmentIonType  startiontype,
int  startmodifID,
int  endmodifID,
int  middlemodifID,
int  branchstart,
int  branchend 
)

The constructor.

Parameters
compositionreference to a vector of strings where each string is a sequence of ids of bricks separated by '-' (each string corresponds to an edge in the de novo graph)
pathreference to a path in the de novo graph which corresponds to a peptide sequence candidate
startiontypestart ion type in the de novo graph
startmodifIDid of a terminal modification (at the beginning of a spectrum)
endmodifIDid of a terminal modification (at the end of a spectrum)
middlemodifIDid of a terminal modification of a branched peptide (in the middle of a spectrum)
branchstartposition of a brick where a branch of a branched peptide starts (it is assumed that all strings in composition are concatenated)
branchendposition of a brick where a branch of a branched peptide ends (it is assumed that all strings in composition are concatenated)

Member Function Documentation

◆ calculatePrecursorMassFromBricks()

double cCandidate::calculatePrecursorMassFromBricks ( cBricksDatabase brickdatabasewithcombinations,
cParameters parameters 
)

Calculate the precursor mass of the peptide sequence candidate from bricks.

Parameters
brickdatabasewithcombinationsreference to an input database of bricks with combinations of bricks
parametersa pointer to the parameters of the application
Return values
doubleprecursor mass of the candidate

◆ calculateSummaryFormulaFromBricks()

cSummaryFormula cCandidate::calculateSummaryFormulaFromBricks ( cParameters parameters,
ePeptideType  peptidetype,
double  precursormass = 0 
)

Calculate the summary formula of the peptide sequence candidate.

Parameters
parametersa reference to the parameters of the application
peptidetypethe type of peptide
precursormassexperimantal precursor mass
Return values
stringsummary formula

◆ checkKetideBlocks()

bool cCandidate::checkKetideBlocks ( cBricksDatabase bricksdatabase,
ePeptideType  peptidetype,
bool  regularblocksorder 
)

Check if the numbers of H2 loss and H2O loss blocks are correct.

Parameters
bricksdatabasea database of building blocks
peptidetypethe type of peptide
regularblocksordercheck regular order of ketide blocks
Return values
booltrue when the numbers of blocks are correct

◆ checkKetideSequence()

bool cCandidate::checkKetideSequence ( cBricksDatabase bricksdatabase,
ePeptideType  peptidetype,
bool  regularblocksorder 
)

Check if the order of blocks is correct.

Parameters
bricksdatabasea database of building blocks
peptidetypethe type of peptide
regularblocksordercheck regular order of ketide blocks
Return values
booltrue when the order of blocks is correct; false otherwise

◆ compare()

bool cCandidate::compare ( cCandidate candidate)

Compare two candidates.

Parameters
candidatereference to the other candidate
Return values
booltrue when the other candidate is greater

◆ getAcronymPeptideNameWithHTMLReferences()

string & cCandidate::getAcronymPeptideNameWithHTMLReferences ( )

Get an acronym peptide name.

Return values
stringreference to the acronym peptide name

◆ getAcronyms()

vector< string > & cCandidate::getAcronyms ( )

Get a vector of acronyms corresponding to a peptide sequence candidate.

Return values
vector<string>a vector of acronyms

◆ getAcronymsTComposition()

string cCandidate::getAcronymsTComposition ( cBricksDatabase brickdatabase)

Get a T-composition of a branched peptide composed from acronyms of bricks.

Parameters
brickdatabasereference to the database of bricks
Return values
stringcontaining acronyms of bricks separated by '-', the branch is specified by '(' and ')'

◆ getBackboneAcronyms()

vector< string > & cCandidate::getBackboneAcronyms ( )

Get a vector of acronyms corresponding to a backbone of a peptide sequence candidate.

Return values
vector<string>a vector of acronyms

◆ getBranchAcronyms()

vector< string > & cCandidate::getBranchAcronyms ( )

Get a vector of acronyms corresponding to a branch of a peptide sequence candidate.

Return values
vector<string>a vector of acronyms

◆ getBranchCyclicRotations()

void cCandidate::getBranchCyclicRotations ( vector< cCandidate > &  branchcyclicrotations,
bool  includerevertedrotations 
)

Get branch-cyclic rotations of a branch-cyclic peptide sequence.

Parameters
branchcyclicrotationsreference to an output vector containing branch-cyclic rotations of a sequence
includerevertedrotationsif true then reverted branch-cyclic rotations are also included

◆ getBranchEnd()

int cCandidate::getBranchEnd ( )

Get end position of a branch.

Return values
intend position of a branch

◆ getBranchSize()

int cCandidate::getBranchSize ( )

Get a number of blocks forming a branch.

Return values
intnumber of blocks

◆ getBranchStart()

int cCandidate::getBranchStart ( )

Get starting position of a branch.

Return values
intstarting position of a branch

◆ getComposition()

string & cCandidate::getComposition ( )

Access to the composition of the peptide sequence candidate.

Return values
referenceto a string of ids of bricks separated by '-'

◆ getEndModifID()

int cCandidate::getEndModifID ( )

Get id of a terminal modification (at the end of a spectrum).

Return values
intid of a terminal modification

◆ getLeftResidueType()

eResidueLossType cCandidate::getLeftResidueType ( cBricksDatabase bricksdatabase)

Get the residue type of the left-most building block.

Parameters
bricksdatabasea database of building blocks
Return values
eResidueLossTyperesidue loss type of the left-most building block

◆ getMiddleModifID()

int cCandidate::getMiddleModifID ( )

Get id of a terminal modification of a branched peptide (in the middle of a spectrum).

Return values
intid of a terminal modification

◆ getName()

string & cCandidate::getName ( )

Get the name of peptide.

Return values
stringname

◆ getPath()

vector< nodeEdge > & cCandidate::getPath ( )

Get a path in the de novo graph corresponding to the peptide sequence candidate.

Return values
vector<nodeEdge>vector of pairs node and edge

◆ getPathAsString()

string & cCandidate::getPathAsString ( )

Get a path in the de novo graph corresponding to the candidate as a string.

Return values
stringreference to a path corresponding to the spectrum

◆ getPermutations()

void cCandidate::getPermutations ( cCandidateSet permutations,
bool *  terminatecomputation 
)

Get a set of candidates with permutations of bricks.

Parameters
permutationsreference to an output set of candidates
terminatecomputationpointer to a variable determining that the computation must be stopped

◆ getPermutationsOfBranches()

void cCandidate::getPermutationsOfBranches ( vector< TRotationInfo > &  tpermutations)

Get permutations of branches a branched peptide.

Parameters
tpermutationsreference to an output vector of auxiliary structures where permutations will be stored

◆ getRealNameTComposition()

string cCandidate::getRealNameTComposition ( cBricksDatabase brickdatabase)

Get a T-composition of a branched peptide composed from real names of bricks.

Parameters
brickdatabasereference to the database of bricks
Return values
stringcontaining real names of bricks separated by '-', the branch is specified by '(' and ')'

◆ getRealPeptideName()

string & cCandidate::getRealPeptideName ( )

Get a real peptide name.

Return values
stringreference to the real peptide name

◆ getRevertedTComposition()

string cCandidate::getRevertedTComposition ( bool  usebrackets)

Get a reverted T-composition of a branched peptide.

Parameters
usebracketsif true then the branch is separated by '(' and ')' else '-' is used instead of brackets
Return values
stringcontaining ids of bricks separated by '-', the branch may be specified by '(' and ')'; example: 1-2-3(4-5)6-7

◆ getRightResidueType()

eResidueLossType cCandidate::getRightResidueType ( cBricksDatabase bricksdatabase)

Get the residue type of the right-most building block.

Parameters
bricksdatabasea database of building blocks
Return values
eResidueLossTyperesidue loss type of the right-most building block

◆ getRotations()

void cCandidate::getRotations ( vector< string > &  rotations,
bool  includerevertedrotations 
)

Get rotations of a cyclic peptide sequence.

Parameters
rotationsreference to an output vector containing rotations of a sequence
includerevertedrotationsif true then reverted rotations are also included

◆ getStartIonType()

eFragmentIonType cCandidate::getStartIonType ( )

Get start ion type used in the de novo graph.

Return values
eFragmentIonTypefragment ion type

◆ getStartModifID()

int cCandidate::getStartModifID ( )

Get id of a terminal modification (at the beginning of a spectrum).

Return values
intid of a terminal modification

◆ getSummaryFormula()

cSummaryFormula & cCandidate::getSummaryFormula ( )

Get the summary formula of the peptide sequence candidate.

Return values
cSummaryFormulasummary formula

◆ getTComposition()

string cCandidate::getTComposition ( )

Get a T-composition of a branched peptide.

Return values
stringcontaining ids of bricks separated by '-', the branch is specified by '(' and ')'; example: 1-2-3(4-5)6-7

◆ hasEqualTPermutations()

bool cCandidate::hasEqualTPermutations ( cCandidate candidate)

compare TPermutations of two candidates.

Parameters
candidatereference to the second candidate
Return values
truewhen candidates have equal TPermutations

◆ hasFirstBrickArtificial()

bool cCandidate::hasFirstBrickArtificial ( cBricksDatabase brickdatabasewithcombinations)

Check if the first brick is artificial.

Parameters
brickdatabasewithcombinationsreference to an input database of bricks with combinations of bricks
Return values
booltrue if the first brick is artificial, false otherwise

◆ hasLastBrickArtificial()

bool cCandidate::hasLastBrickArtificial ( cBricksDatabase brickdatabasewithcombinations)

Check if the last brick is artificial.

Parameters
brickdatabasewithcombinationsreference to an input database of bricks with combinations of bricks
Return values
booltrue if the last brick is artificial, false otherwise

◆ hasLastBrickInvalid()

bool cCandidate::hasLastBrickInvalid ( cBricksDatabase brickdatabasewithcombinations)

Check if the last brick is invalid.

Parameters
brickdatabasewithcombinationsreference to an input database of bricks with combinations of bricks
Return values
booltrue if the last brick is invalid, false otherwise

◆ hasOnlyArtificialBricks()

bool cCandidate::hasOnlyArtificialBricks ( cBricksDatabase brickdatabasewithcombinations)

Check whether the candidate is composed exclusively from artificial bricks.

Parameters
brickdatabasewithcombinationsreference to an input database of bricks with combinations of bricks
Return values
booltrue when the candidate is composed exclusively from artificial bricks; false when the candidate constains a regular brick

◆ isEqualTo()

bool cCandidate::isEqualTo ( cCandidate candidate)

Compare two candidates.

Parameters
candidatereference to the other candidate
Return values
booltrue when the candidates are equal

◆ load()

void cCandidate::load ( ifstream &  is)

Load the structure from an input stream.

Parameters
isan input stream

◆ prepareBranchedCandidates()

void cCandidate::prepareBranchedCandidates ( cCandidateSet result,
ePeptideType  peptidetype,
bool *  terminatecomputation 
)

Prepare candidates of a branched or a branch-cyclic peptide.

Parameters
resultreference to an output set of possible peptide sequence candidates
peptidetypea type of an analyzed peptide
terminatecomputationpointer to a variable determining that the computation must be stopped

◆ setAcronymPeptideNameWithHTMLReferences()

void cCandidate::setAcronymPeptideNameWithHTMLReferences ( cBricksDatabase bricksdatabase,
ePeptideType  peptidetype 
)

Set an acronym peptide name.

Parameters
bricksdatabasethe database of building blocks
peptidetypethe type of peptide

◆ setAcronyms()

void cCandidate::setAcronyms ( cBricksDatabase bricksdatabase)

Set a vector of acronyms corresponding to a peptide sequence candidate.

Parameters
bricksdatabasea database of building blocks

◆ setBackboneAcronyms()

void cCandidate::setBackboneAcronyms ( cBricksDatabase bricksdatabase)

Set a vector of acronyms corresponding to a backbone of a peptide sequence candidate.

Parameters
bricksdatabasea database of building blocks

◆ setBranchAcronyms()

void cCandidate::setBranchAcronyms ( cBricksDatabase bricksdatabase)

Set a vector of acronyms corresponding to a branch of a peptide sequence candidate.

Parameters
bricksdatabasea database of building blocks

◆ setCandidate() [1/2]

void cCandidate::setCandidate ( vector< string > &  composition,
vector< nodeEdge > &  path,
eFragmentIonType  startiontype,
int  startmodifID,
int  endmodifID,
int  middlemodifID,
int  branchstart,
int  branchend 
)

Set a peptide sequence candidate.

Parameters
compositionreference to a vector of strings where each string is a sequence of ids of bricks separated by '-' (each string corresponds to an edge in the de novo graph)
pathreference to a path in the de novo graph which corresponds to a peptide sequence candidate
startiontypestart ion type in the de novo graph
startmodifIDid of a terminal modification (at the beginning of a spectrum)
endmodifIDid of a terminal modification (at the end of a spectrum)
middlemodifIDid of a terminal modification of a branched peptide (in the middle of a spectrum)
branchstartposition of a brick where a branch of a branched peptide starts (it is assumed that all strings in composition are concatenated)
branchendposition of a brick where a branch of a branched peptide ends (it is assumed that all strings in composition are concatenated)

◆ setCandidate() [2/2]

void cCandidate::setCandidate ( vector< string > &  composition,
vector< nodeEdge > &  path,
eFragmentIonType  startiontype,
int  startmodifID,
int  endmodifID,
int  middlemodifID,
int  middlepos 
)

Set a peptide sequence candidate.

Parameters
compositionreference to a vector of strings where each string is a sequence of ids of bricks separated by '-' (each string corresponds to an edge in the de novo graph)
pathreference to a path in the de novo graph which corresponds to a peptide sequence candidate
startiontypestart ion type in the de novo graph
startmodifIDid of a terminal modification (at the beginning of a spectrum)
endmodifIDid of a terminal modification (at the end of a spectrum)
middlemodifIDid of a terminal modification of a branched peptide (in the middle of a spectrum)
middleposposition in composition corresponding to a branch of a branched peptide

◆ setEndModifID()

void cCandidate::setEndModifID ( int  id)

Set id of a terminal modification (at the end of a spectrum).

Parameters
idof a terminal modification

◆ setMiddleModifID()

void cCandidate::setMiddleModifID ( int  id)

Set id of a terminal modification of a branched peptide (in the middle of a spectrum).

Parameters
idof a terminal modification

◆ setName()

void cCandidate::setName ( string &  name)

Set the name of peptide.

Parameters
namename

◆ setPath()

void cCandidate::setPath ( cDeNovoGraph graph,
cParameters parameters 
)

Set a path in the de novo graph corresponding to the candidate.

Parameters
graphreference to the de novo graph
parametersparameters of the application

◆ setRealPeptideName()

void cCandidate::setRealPeptideName ( cBricksDatabase bricksdatabase,
ePeptideType  peptidetype 
)

Set a real peptide name.

Parameters
bricksdatabasethe database of building blocks
peptidetypethe type of peptide

◆ setStartIonType()

void cCandidate::setStartIonType ( eFragmentIonType  iontype)

Set start ion type used in the de novo graph.

Parameters
iontypefragment ion type

◆ setStartModifID()

void cCandidate::setStartModifID ( int  id)

Set id of a terminal modification (at the beginning of a spectrum).

Parameters
idof a terminal modification

◆ setSummaryFormula()

void cCandidate::setSummaryFormula ( cSummaryFormula summary)

Set the summary formula of the peptide sequence candidate.

Parameters
summarysummary formula

◆ store()

void cCandidate::store ( ofstream &  os)

Store the structure into an output stream.

Parameters
osan output stream

The documentation for this class was generated from the following files: