Skip to content

Commit

Permalink
release 1.1.170
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Novak committed Feb 21, 2018
1 parent 50ca5e2 commit 587b546
Show file tree
Hide file tree
Showing 49 changed files with 2,770 additions and 789 deletions.
6 changes: 6 additions & 0 deletions CycloBranch/CycloBranch-Linux.pro
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ HEADERS += core/cAllocator.h \
gui/cFragmentIonsListWidget.h \
gui/cGraphWidget.h \
gui/cHTMLExportDialog.h \
gui/cImageWindow.h \
gui/cImageWindowWidget.h \
gui/cLinearWidget.h \
gui/cMainThread.h \
gui/cMainWindow.h \
Expand All @@ -53,6 +55,7 @@ HEADERS += core/cAllocator.h \
gui/cSequenceDatabaseWidget.h \
gui/cSpectrumDetailWidget.h \
gui/cSpectrumSceneWidget.h \
gui/cSummaryPeaksTableWidget.h \
parallel/cGraphReaderThread.h \
parallel/cSpectrumComparatorThread.h
SOURCES += core/cBrick.cpp \
Expand Down Expand Up @@ -86,6 +89,8 @@ SOURCES += core/cBrick.cpp \
gui/cFragmentIonsListWidget.cpp \
gui/cGraphWidget.cpp \
gui/cHTMLExportDialog.cpp \
gui/cImageWindow.cpp \
gui/cImageWindowWidget.cpp \
gui/cLinearWidget.cpp \
gui/cMainThread.cpp \
gui/cMainWindow.cpp \
Expand All @@ -94,6 +99,7 @@ SOURCES += core/cBrick.cpp \
gui/cSequenceDatabaseWidget.cpp \
gui/cSpectrumDetailWidget.cpp \
gui/cSpectrumSceneWidget.cpp \
gui/cSummaryPeaksTableWidget.cpp \
parallel/cGraphReaderThread.cpp \
parallel/cSpectrumComparatorThread.cpp \
main.cpp
6 changes: 6 additions & 0 deletions CycloBranch/CycloBranch-MacOSX.pro
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ HEADERS += core/cAllocator.h \
gui/cFragmentIonsListWidget.h \
gui/cGraphWidget.h \
gui/cHTMLExportDialog.h \
gui/cImageWindow.h \
gui/cImageWindowWidget.h \
gui/cLinearWidget.h \
gui/cMainThread.h \
gui/cMainWindow.h \
Expand All @@ -61,6 +63,7 @@ HEADERS += core/cAllocator.h \
gui/cSequenceDatabaseWidget.h \
gui/cSpectrumDetailWidget.h \
gui/cSpectrumSceneWidget.h \
gui/cSummaryPeaksTableWidget.h \
parallel/cGraphReaderThread.h \
parallel/cSpectrumComparatorThread.h
SOURCES += core/cBrick.cpp \
Expand Down Expand Up @@ -94,6 +97,8 @@ SOURCES += core/cBrick.cpp \
gui/cFragmentIonsListWidget.cpp \
gui/cGraphWidget.cpp \
gui/cHTMLExportDialog.cpp \
gui/cImageWindow.cpp \
gui/cImageWindowWidget.cpp \
gui/cLinearWidget.cpp \
gui/cMainThread.cpp \
gui/cMainWindow.cpp \
Expand All @@ -102,6 +107,7 @@ SOURCES += core/cBrick.cpp \
gui/cSequenceDatabaseWidget.cpp \
gui/cSpectrumDetailWidget.cpp \
gui/cSpectrumSceneWidget.cpp \
gui/cSummaryPeaksTableWidget.cpp \
parallel/cGraphReaderThread.cpp \
parallel/cSpectrumComparatorThread.cpp \
main.cpp
81 changes: 81 additions & 0 deletions CycloBranch/CycloBranch.vcxproj

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions CycloBranch/CycloBranch.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,33 @@
<ClCompile Include="core\cImzML.cpp">
<Filter>Source Files\core</Filter>
</ClCompile>
<ClCompile Include="gui\cSummaryPeaksTableWidget.cpp">
<Filter>Source Files\gui</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_cSummaryPeaksTableWidget.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_cSummaryPeaksTableWidget.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="gui\cImageWindow.cpp">
<Filter>Source Files\gui</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_cImageWindow.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_cImageWindow.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_cImageWindowWidget.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_cImageWindowWidget.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="gui\cImageWindowWidget.cpp">
<Filter>Source Files\gui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="gui\cAboutWidget.h">
Expand Down Expand Up @@ -394,6 +421,15 @@
<CustomBuild Include="gui\cHTMLExportDialog.h">
<Filter>Header Files\gui</Filter>
</CustomBuild>
<CustomBuild Include="gui\cSummaryPeaksTableWidget.h">
<Filter>Header Files\gui</Filter>
</CustomBuild>
<CustomBuild Include="gui\cImageWindow.h">
<Filter>Header Files\gui</Filter>
</CustomBuild>
<CustomBuild Include="gui\cImageWindowWidget.h">
<Filter>Header Files\gui</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClInclude Include="core\cBrick.h">
Expand Down
2 changes: 1 addition & 1 deletion CycloBranch/core/cBrick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void cBrick::clear() {
mass = 0;
composition = "";
artificial = false;
residuelosstype = water;
residuelosstype = h2o_loss;
}


Expand Down
15 changes: 12 additions & 3 deletions CycloBranch/core/cBrick.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ using namespace std;
\brief Residue loss types.
*/
enum eResidueLossType {
water = 0,
h2,
h2o2
h2o_loss = 0,
h2_loss
};


/**
\brief Precursor loss types.
*/
enum eKetidePrecursorType {
ketide_precursor_h2o = 0,
ketide_precursor_h2,
ketide_precursor_h2o2
};


Expand Down
45 changes: 23 additions & 22 deletions CycloBranch/core/cBricksDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bool cBricksDatabase::nextCombination(vector<int>& combarray, int numberofbasicb
combarray[pointer]++;

// set combarray[pointer] to the maximum value when outside of the mass range
mass = getMassOfComposition(combarray);
mass = getMassOfComposition(combarray, numberofbasicbricks);

if ((cyFlag == 0) && (combarray[pointer] <= numberofbasicbricks) && (((maximumcumulativemass > 0) && (mass > maximumcumulativemass)) || (mass > neutralprecursormass))) {
combarray[pointer] = numberofbasicbricks + 1;
Expand All @@ -82,7 +82,7 @@ bool cBricksDatabase::nextCombination(vector<int>& combarray, int numberofbasicb
}

// skip combinations outside of the mass range
mass = getMassOfComposition(combarray);
mass = getMassOfComposition(combarray, numberofbasicbricks);

while ((combarray[pointer] <= numberofbasicbricks) && (pointer < maximumbricksincombination - 1) && (((maximumcumulativemass > 0) && (mass > maximumcumulativemass)) || (mass > neutralprecursormass))) {
pointer++;
Expand All @@ -92,7 +92,7 @@ bool cBricksDatabase::nextCombination(vector<int>& combarray, int numberofbasicb
combarray[i] = combarray[pointer];
}

mass = getMassOfComposition(combarray);
mass = getMassOfComposition(combarray, numberofbasicbricks);
}

if ((combarray[pointer] > numberofbasicbricks) || ((maximumcumulativemass > 0) && (mass > maximumcumulativemass)) || (mass > neutralprecursormass)) {
Expand Down Expand Up @@ -128,7 +128,7 @@ int cBricksDatabase::loadFromPlainTextStream(ifstream &stream, string& errormess
size_t pos;
double mass;

#if POLYKETIDE_SIDEROPHORES == 1
#if OLIGOKETIDES == 1
regex rx;
string name;
#endif
Expand Down Expand Up @@ -165,17 +165,12 @@ int cBricksDatabase::loadFromPlainTextStream(ifstream &stream, string& errormess
break;
}

#if POLYKETIDE_SIDEROPHORES == 1
#if OLIGOKETIDES == 1
name = b.getName();

rx = "^\\(-2H\\) ";
if (regex_search(name, rx)) {
b.setResidueLossType(h2);
}

rx = "^\\(-2OH\\) ";
if (regex_search(name, rx)) {
b.setResidueLossType(h2o2);
b.setResidueLossType(h2_loss);
}
#endif

Expand Down Expand Up @@ -284,11 +279,11 @@ cBrick& cBricksDatabase::operator[](int position) {
}


double cBricksDatabase::getMassOfComposition(vector<int>& combarray) {
double cBricksDatabase::getMassOfComposition(vector<int>& combarray, int numberofbasicbricks) {
double mass = 0;
int i = 0;
while (i < (int)combarray.size()) {
if (combarray[i] > 0) {
if ((combarray[i] > 0) && (combarray[i] <= numberofbasicbricks)) {
mass += bricks[combarray[i] - 1].getMass();
}
i++;
Expand Down Expand Up @@ -554,31 +549,37 @@ void cBricksDatabase::load(ifstream& is) {
}


#if POLYKETIDE_SIDEROPHORES == 1
#if OLIGOKETIDES == 1


bool cBricksDatabase::checkPolyketideBlocks(cBrick& brickseries) {
bool cBricksDatabase::checkKetideBlocks(cBrick& brickseries) {
vector<int> intcomposition;
brickseries.explodeToIntComposition(intcomposition);

if (intcomposition.size() == 0) {
return false;
}

int hydrogens = 0;
int hydroxyls = 0;
int h2_blocks = 0;
int h2o_blocks = 0;
for (int i = 0; i < (int)intcomposition.size(); i++) {
if (bricks[intcomposition[i] - 1].getResidueLossType() == h2) {
hydrogens++;
if (bricks[intcomposition[i] - 1].getResidueLossType() == h2_loss) {
h2_blocks++;
}
if (bricks[intcomposition[i] - 1].getResidueLossType() == h2o2) {
hydroxyls++;
if (bricks[intcomposition[i] - 1].getResidueLossType() == h2o_loss) {
h2o_blocks++;
}
}

if ((hydrogens == hydroxyls) || (hydrogens == hydroxyls + 1) || (hydrogens + 1 == hydroxyls)) {
if ((h2_blocks == h2o_blocks) || (h2_blocks == h2o_blocks + 1) || (h2_blocks + 1 == h2o_blocks)) {
return true;
}

/*
if ((h2_blocks == 0) && (h2o_blocks == (int)intcomposition.size())) {
return true;
}
*/

return false;
}
Expand Down
9 changes: 5 additions & 4 deletions CycloBranch/core/cBricksDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ class cBricksDatabase {
/**
\brief Get the mass of a composition of bricks.
\param combarray reference to an input integer vector of ids
\param numberofbasicbricks number of basic building blocks
\retval double cumulative mass of the bricks in the \a combarray
*/
double getMassOfComposition(vector<int>& combarray);
double getMassOfComposition(vector<int>& combarray, int numberofbasicbricks);


/**
Expand Down Expand Up @@ -223,15 +224,15 @@ class cBricksDatabase {
void load(ifstream& is);


#if POLYKETIDE_SIDEROPHORES == 1
#if OLIGOKETIDES == 1


/**
\brief Check if the numbers of hydrogen and hydroxyl blocks are correct.
\brief Check if the numbers of H2 loss and H2O loss blocks are correct.
\param brickseries a tested combination of building blocks
\retval bool true when the numbers of blocks are correct
*/
bool checkPolyketideBlocks(cBrick& brickseries);
bool checkKetideBlocks(cBrick& brickseries);


#endif
Expand Down
Loading

0 comments on commit 587b546

Please sign in to comment.