|
CycloBranch
|
The class representing a database of building blocks (bricks). More...
#include <cBricksDatabase.h>
Public Member Functions | |
| bool | nextCombination (vector< int > &combarray, int numberofbasicbricks, int maximumbricksincombination, double maximumcumulativemass, double neutralprecursormass) |
| Get next combination of bricks. More... | |
| bool | nextCombinationFast (vector< int > &combarray, vector< int > &combcounts, vector< double > &combmasses, double &mass, int numberofbasicbricks, int maximumbricksincombination, double maximumcumulativemass, double neutralprecursormass) |
| Get next combination of bricks. More... | |
| bool | nextCombinationFastLimited (vector< int > &combarray, vector< int > &combcounts, vector< int > &comblimits, vector< double > &combmasses, double &mass, int numberofbasicbricks, int maximumbricksincombination, double maximumcumulativemass, double neutralprecursormass) |
| Get next combination of bricks. More... | |
| cBricksDatabase () | |
| The constructor. | |
| int | loadFromPlainTextStream (ifstream &stream, string &errormessage, bool ignoreerrors, bool skiph2blocks) |
| Load the database of bricks from a plain text stream. More... | |
| void | storeToPlainTextStream (ofstream &stream) |
| Store the database of bricks into a plain text stream. More... | |
| int | size () |
| Get the number of bricks in the database. More... | |
| void | print () |
| Print the database of bricks. | |
| void | sortbyMass () |
| Sort the database of bricks by mass in ascending order. | |
| cBrick & | operator[] (int position) |
| Overloaded operator []. More... | |
| double | getMassOfComposition (vector< int > &combarray, int numberofbasicbricks) |
| Get the mass of a composition of bricks. More... | |
| string | getRealName (string &composition) |
| Get the real name of a peptide from a composition. More... | |
| string | getAcronymName (string &composition, bool useHTMLReferences) |
| Get the name of a peptide composed from acronyms of bricks. More... | |
| string | getTagName (string &composition) |
| Get a peptide sequence tag from a composition. More... | |
| string | getAcronymNameOfTPeptide (const string &tcomposition, bool useHTMLReferences) |
| Get the name of a branched peptide composed from acronyms of bricks. More... | |
| string | getTagNameOfTPeptide (string &tcomposition) |
| Get a peptide sequence tag of a branched peptide from a composition. More... | |
| void | clear () |
| Clear the vector of bricks. | |
| bool | replaceAcronymsByIDs (string &sequence, string &errormessage) |
| Replace acronyms of bricks by ids. More... | |
| void | push_back (cBrick &brick) |
| Push a new brick into the vector of bricks. More... | |
| void | removeLastBrick () |
| Remove the last brick from the vector of bricks if possible. | |
| string | calculateSummaryFromComposition (int brickid) |
| Calculate the summary formula of a composition. 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... | |
| bool | checkKetideBlocks (cBrick &brickseries, bool regularblocksorder) |
| Check if the numbers of H2 loss and H2O loss blocks are correct. More... | |
| double | getMassOfNeutralLosses (vector< int > &lossids) |
| Get the summary mass of neutral losses. More... | |
| string | getSummaryFormulaOfNeutralLosses (vector< int > &lossids) |
| Get the summary formula of neutral losses. More... | |
| void | getMapOfNeutralLosses (vector< int > &lossids, map< string, int > &summarymap) |
| Get the summary map of neutral losses. More... | |
The class representing a database of building blocks (bricks).
| string cBricksDatabase::calculateSummaryFromComposition | ( | int | brickid | ) |
Calculate the summary formula of a composition.
| brickid | brick id |
| string | summary formula |
| bool cBricksDatabase::checkKetideBlocks | ( | cBrick & | brickseries, |
| bool | regularblocksorder | ||
| ) |
Check if the numbers of H2 loss and H2O loss blocks are correct.
| brickseries | a tested combination of building blocks |
| regularblocksorder | check regular order of ketide blocks |
| bool | true when the numbers of blocks are correct |
| string cBricksDatabase::getAcronymName | ( | string & | composition, |
| bool | useHTMLReferences | ||
| ) |
Get the name of a peptide composed from acronyms of bricks.
| composition | reference to a string containing ids of bricks separated by '-' |
| useHTMLReferences | if true then each acronym is converted to a link to its reference (e.g., in ChemSpider) |
| string | name of the peptide |
| string cBricksDatabase::getAcronymNameOfTPeptide | ( | const string & | tcomposition, |
| bool | useHTMLReferences | ||
| ) |
Get the name of a branched peptide composed from acronyms of bricks.
| tcomposition | reference to a string containing ids of bricks separated by '-', the branch is specified by '(' and ')'; example: 1-2-3(4-5)6-7 |
| useHTMLReferences | if true then each acronym is converted to a link to its reference (e.g., in ChemSpider) |
| string | name of the peptide |
| void cBricksDatabase::getMapOfNeutralLosses | ( | vector< int > & | lossids, |
| map< string, int > & | summarymap | ||
| ) |
Get the summary map of neutral losses.
| lossids | an input vector of ids of neutral losses |
| summarymap | an output map of atoms |
| double cBricksDatabase::getMassOfComposition | ( | vector< int > & | combarray, |
| int | numberofbasicbricks | ||
| ) |
Get the mass of a composition of bricks.
| combarray | reference to an input integer vector of ids |
| numberofbasicbricks | number of basic building blocks |
| double | cumulative mass of the bricks in the combarray |
| double cBricksDatabase::getMassOfNeutralLosses | ( | vector< int > & | lossids | ) |
Get the summary mass of neutral losses.
| lossids | a vector of ids of neutral losses |
| double | mass |
| string cBricksDatabase::getRealName | ( | string & | composition | ) |
Get the real name of a peptide from a composition.
| composition | reference to a string containing ids of bricks separated by '-' |
| string | name of the peptide |
| string cBricksDatabase::getSummaryFormulaOfNeutralLosses | ( | vector< int > & | lossids | ) |
Get the summary formula of neutral losses.
| lossids | a vector of ids of neutral losses |
| string | formula |
| string cBricksDatabase::getTagName | ( | string & | composition | ) |
Get a peptide sequence tag from a composition.
| composition | reference to a string containing ids of bricks separated by '-' |
| string | sequence tag |
| string cBricksDatabase::getTagNameOfTPeptide | ( | string & | tcomposition | ) |
Get a peptide sequence tag of a branched peptide from a composition.
| tcomposition | reference to a string containing ids of bricks separated by '-', the branch is specified by '(' and ')'; example: 1-2-3(4-5)6-7 |
| string | sequence tag |
| void cBricksDatabase::load | ( | ifstream & | is | ) |
Load the structure from an input stream.
| is | an input stream |
| int cBricksDatabase::loadFromPlainTextStream | ( | ifstream & | stream, |
| string & | errormessage, | ||
| bool | ignoreerrors, | ||
| bool | skiph2blocks | ||
| ) |
Load the database of bricks from a plain text stream.
| stream | reference to an input file stream |
| errormessage | reference to a string where an error message might be stored |
| ignoreerrors | if true errors are ignored |
| skiph2blocks | ignore ketide 2H loss blocks |
| int | 0 when the database was successfully loaded, -1 when an error occurred (errormessage is filled up) |
| bool cBricksDatabase::nextCombination | ( | vector< int > & | combarray, |
| int | numberofbasicbricks, | ||
| int | maximumbricksincombination, | ||
| double | maximumcumulativemass, | ||
| double | neutralprecursormass | ||
| ) |
Get next combination of bricks.
| combarray | reference to an input/output vector of integers |
| numberofbasicbricks | initial number of bricks in a database |
| maximumbricksincombination | maximum number of combined bricks |
| maximumcumulativemass | maximum cummulative mass of combined bricks |
| neutralprecursormass | neutral precursor mass |
| bool | true when a valid vector is stored in combarray, false when all valid vectors were already generated |
| bool cBricksDatabase::nextCombinationFast | ( | vector< int > & | combarray, |
| vector< int > & | combcounts, | ||
| vector< double > & | combmasses, | ||
| double & | mass, | ||
| int | numberofbasicbricks, | ||
| int | maximumbricksincombination, | ||
| double | maximumcumulativemass, | ||
| double | neutralprecursormass | ||
| ) |
Get next combination of bricks.
| combarray | reference to an input/output vector of integers |
| combcounts | reference to an input/output vector containing counts of elements in combarray |
| combmasses | reference to an input vector containing masses of elements in combarray |
| mass | sum of masses of blocks |
| numberofbasicbricks | initial number of bricks in a database |
| maximumbricksincombination | maximum number of combined bricks |
| maximumcumulativemass | maximum cummulative mass of combined bricks |
| neutralprecursormass | neutral precursor mass |
| bool | true when a valid vector is stored in combarray, false when all valid vectors were already generated |
| bool cBricksDatabase::nextCombinationFastLimited | ( | vector< int > & | combarray, |
| vector< int > & | combcounts, | ||
| vector< int > & | comblimits, | ||
| vector< double > & | combmasses, | ||
| double & | mass, | ||
| int | numberofbasicbricks, | ||
| int | maximumbricksincombination, | ||
| double | maximumcumulativemass, | ||
| double | neutralprecursormass | ||
| ) |
Get next combination of bricks.
| combarray | reference to an input/output vector of integers |
| combcounts | reference to an input/output vector containing counts of elements in combarray |
| comblimits | reference to an input vector containing maximum allowed numbers of elements in combarray |
| combmasses | reference to an input vector containing masses of elements in combarray |
| mass | sum of masses of blocks |
| numberofbasicbricks | initial number of bricks in a database |
| maximumbricksincombination | maximum number of combined bricks |
| maximumcumulativemass | maximum cummulative mass of combined bricks |
| neutralprecursormass | neutral precursor mass |
| bool | true when a valid vector is stored in combarray, false when all valid vectors were already generated |
| cBrick & cBricksDatabase::operator[] | ( | int | position | ) |
Overloaded operator [].
| position | of the brick in the vector of bricks |
| cBrick | reference to a brick |
| void cBricksDatabase::push_back | ( | cBrick & | brick | ) |
Push a new brick into the vector of bricks.
| brick | an inserted brick |
| bool cBricksDatabase::replaceAcronymsByIDs | ( | string & | sequence, |
| string & | errormessage | ||
| ) |
Replace acronyms of bricks by ids.
| sequence | reference to an input/output string containing acronyms/ids of bricks |
| errormessage | reference to a string where an error message is stored when sequence contains an unknown building block |
| bool | true when the replacement was successful, false when an acronym of a brick is unknown |
| int cBricksDatabase::size | ( | ) |
Get the number of bricks in the database.
| int | number of bricks |
| void cBricksDatabase::store | ( | ofstream & | os | ) |
Store the structure into an output stream.
| os | an output stream |
| void cBricksDatabase::storeToPlainTextStream | ( | ofstream & | stream | ) |
Store the database of bricks into a plain text stream.
| stream | reference to an output file stream |