diff --git a/CycloBranch/CycloBranch-Linux.pro b/CycloBranch/CycloBranch-Linux.pro index 688dc44..a20b6c1 100644 --- a/CycloBranch/CycloBranch-Linux.pro +++ b/CycloBranch/CycloBranch-Linux.pro @@ -6,7 +6,7 @@ TEMPLATE = app TARGET = CycloBranch QT += core gui widgets printsupport svg INCLUDEPATH += . core gui parallel -QMAKE_CXXFLAGS += -std=c++0x -DLINUX -m64 +QMAKE_CXXFLAGS += -std=c++11 -DLINUX -m64 QMAKE_LIBS += -lboost_regex -lxerces-c OBJECTS_DIR = build/ MOC_DIR = moc/ @@ -21,6 +21,7 @@ HEADERS += core/cBrick.h \ core/cDeNovoGraphNode.h \ core/cFragmentIons.h \ core/cImzML.h \ + core/cIsotopePatternCache.h \ core/cMzML.h \ core/cParameters.h \ core/cPeak.h \ @@ -78,6 +79,7 @@ SOURCES += core/cBrick.cpp \ core/cDeNovoGraphNode.cpp \ core/cFragmentIons.cpp \ core/cImzML.cpp \ + core/cIsotopePatternCache.cpp \ core/cMzML.cpp \ core/cParameters.cpp \ core/cPeak.cpp \ diff --git a/CycloBranch/CycloBranch-MacOSX.pro b/CycloBranch/CycloBranch-MacOSX.pro index 9a4098b..93d7c56 100644 --- a/CycloBranch/CycloBranch-MacOSX.pro +++ b/CycloBranch/CycloBranch-MacOSX.pro @@ -6,7 +6,7 @@ TEMPLATE = app TARGET = CycloBranch QT += core gui widgets printsupport svg INCLUDEPATH += . core gui parallel /usr/local/opt/boost/include /usr/local/opt/xerces-c/include -QMAKE_CXXFLAGS += -std=c++0x -DMACOSX -m64 +QMAKE_CXXFLAGS += -std=c++11 -DMACOSX -m64 QMAKE_LIBS += -lboost_regex -lxerces-c QMAKE_LIBDIR = /usr/local/opt/boost/lib /usr/local/opt/xerces-c/lib OBJECTS_DIR = build/ @@ -23,6 +23,7 @@ HEADERS += core/cBrick.h \ core/cDeNovoGraphNode.h \ core/cFragmentIons.h \ core/cImzML.h \ + core/cIsotopePatternCache.h \ core/cMzML.h \ core/cParameters.h \ core/cPeak.h \ @@ -80,6 +81,7 @@ SOURCES += core/cBrick.cpp \ core/cDeNovoGraphNode.cpp \ core/cFragmentIons.cpp \ core/cImzML.cpp \ + core/cIsotopePatternCache.cpp \ core/cMzML.cpp \ core/cParameters.cpp \ core/cPeak.cpp \ diff --git a/CycloBranch/CycloBranch.desktop b/CycloBranch/CycloBranch.desktop index c2b747b..4e97d0a 100644 --- a/CycloBranch/CycloBranch.desktop +++ b/CycloBranch/CycloBranch.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Comment=A tool for de novo sequencing of nonribosomal peptides from accurate product ion mass spectra. +Comment=CycloBranch Exec=CycloBranch Icon=/usr/share/cyclobranch/images/cb.png Name=CycloBranch diff --git a/CycloBranch/CycloBranch.vcxproj b/CycloBranch/CycloBranch.vcxproj index 2284b2c..06d0753 100644 --- a/CycloBranch/CycloBranch.vcxproj +++ b/CycloBranch/CycloBranch.vcxproj @@ -155,6 +155,7 @@ + @@ -529,6 +530,7 @@ + diff --git a/CycloBranch/CycloBranch.vcxproj.filters b/CycloBranch/CycloBranch.vcxproj.filters index 1a2084b..763bc4e 100644 --- a/CycloBranch/CycloBranch.vcxproj.filters +++ b/CycloBranch/CycloBranch.vcxproj.filters @@ -452,6 +452,9 @@ Source Files\gui + + Source Files\core + @@ -630,6 +633,9 @@ Header Files\core + + Header Files\core + diff --git a/CycloBranch/core/cBrick.cpp b/CycloBranch/core/cBrick.cpp index 21c21ed..7e124c4 100644 --- a/CycloBranch/core/cBrick.cpp +++ b/CycloBranch/core/cBrick.cpp @@ -1,5 +1,7 @@ #include "core/cBrick.h" +#include "core/cSummaryFormula.h" + int getNumberOfBricks(const string& composition) { if (composition.size() == 0) { @@ -26,6 +28,7 @@ void cBrick::clear() { acronyms.clear(); references.clear(); summary = ""; + summarymap.clear(); mass = 0; composition = ""; artificial = false; @@ -54,6 +57,11 @@ string& cBrick::getSummary() { } +map& cBrick::getSummaryMap() { + return summarymap; +} + + vector& cBrick::getAcronyms() { return acronyms; } @@ -106,6 +114,12 @@ void cBrick::setSummary(const string& summary) { } +void cBrick::createSummaryMap() { + summarymap.clear(); + addStringFormulaToMap(summary, summarymap); +} + + void cBrick::setAcronyms(const string& acronyms) { this->acronyms.clear(); string s = ""; @@ -360,6 +374,7 @@ void cBrick::store(ofstream& os) { storeStringVector(acronyms, os); storeStringVector(references, os); storeString(summary, os); + storeStringIntMap(summarymap, os); os.write((char *)&mass, sizeof(double)); storeString(composition, os); os.write((char *)&artificial, sizeof(bool)); @@ -372,6 +387,7 @@ void cBrick::load(ifstream& is) { loadStringVector(acronyms, is); loadStringVector(references, is); loadString(summary, is); + loadStringIntMap(summarymap, is); is.read((char *)&mass, sizeof(double)); loadString(composition, is); is.read((char *)&artificial, sizeof(bool)); diff --git a/CycloBranch/core/cBrick.h b/CycloBranch/core/cBrick.h index 3eb7f0b..4e413d9 100644 --- a/CycloBranch/core/cBrick.h +++ b/CycloBranch/core/cBrick.h @@ -12,6 +12,7 @@ #include #include #include +#include #include "core/utilities.h" using namespace std; @@ -42,6 +43,7 @@ class cBrick { vector acronyms; vector references; string summary; + map summarymap; double mass; string composition; bool artificial; @@ -89,6 +91,13 @@ class cBrick { string& getSummary(); + /** + \brief Access to a map which stores a summary molecular formula of the brick. + \retval map reference to a map + */ + map& getSummaryMap(); + + /** \brief Access to a vector of strings which stores acronyms of all izomers corresponding to the brick. \retval reference to a vector of strings @@ -142,10 +151,16 @@ class cBrick { /** \brief Set the summary molecular formula of the brick. \param summary reference to a string - */ + */ void setSummary(const string& summary); + /** + \brief Create an internal map of atoms from the summary formula. + */ + void createSummaryMap(); + + /** \brief Set acronyms of all izomers corresponding to the brick. \param acronyms reference to a string where the acronyms are separated by '/' diff --git a/CycloBranch/core/cBricksDatabase.cpp b/CycloBranch/core/cBricksDatabase.cpp index fae0107..3a421e1 100644 --- a/CycloBranch/core/cBricksDatabase.cpp +++ b/CycloBranch/core/cBricksDatabase.cpp @@ -1,6 +1,5 @@ #include "core/cBricksDatabase.h" - #include "gui/cMainThread.h" @@ -184,6 +183,7 @@ int cBricksDatabase::loadFromPlainTextStream(ifstream &stream, string& errormess pos = s.find('\t'); if (pos != string::npos) { b.setSummary(s.substr(0, pos)); + b.createSummaryMap(); s = s.substr(pos + 1); } else { diff --git a/CycloBranch/core/cCandidate.cpp b/CycloBranch/core/cCandidate.cpp index 336f7ed..51c2e89 100644 --- a/CycloBranch/core/cCandidate.cpp +++ b/CycloBranch/core/cCandidate.cpp @@ -885,7 +885,7 @@ bool cCandidate::compare(cCandidate& candidate) { } -vector cCandidate::getPath() { +vector& cCandidate::getPath() { return path; } diff --git a/CycloBranch/core/cCandidate.h b/CycloBranch/core/cCandidate.h index ad978ef..623085e 100644 --- a/CycloBranch/core/cCandidate.h +++ b/CycloBranch/core/cCandidate.h @@ -391,7 +391,7 @@ class cCandidate { \brief Get a path in the de novo graph corresponding to the peptide sequence candidate. \retval vector vector of pairs node and edge */ - vector getPath(); + vector& getPath(); /** diff --git a/CycloBranch/core/cDeNovoGraph.cpp b/CycloBranch/core/cDeNovoGraph.cpp index 05045c8..b767c5e 100644 --- a/CycloBranch/core/cDeNovoGraph.cpp +++ b/CycloBranch/core/cDeNovoGraph.cpp @@ -162,13 +162,17 @@ int cDeNovoGraph::createGraph(bool& terminatecomputation) { sortedpeaklist.removeChargeVariants(parameters->precursorcharge, parameters->fragmentmasserrortolerance); *os << "Number of nodes after deconvolution: " << sortedpeaklist.size() << endl; - // remove dehydrated peaks - sortedpeaklist.removeNeutralLoss(- H2O, parameters->precursorcharge, parameters->fragmentmasserrortolerance); - *os << "Number of nodes when dehydrated ions are removed: " << sortedpeaklist.size() << endl; + //if (!parameters->generateisotopepattern) { - // remove deamidated peaks - sortedpeaklist.removeNeutralLoss(- NH3, parameters->precursorcharge, parameters->fragmentmasserrortolerance); - *os << "Number of nodes when deamidated ions are removed: " << sortedpeaklist.size() << endl; + // remove dehydrated peaks + sortedpeaklist.removeNeutralLoss(-H2O, parameters->precursorcharge, parameters->fragmentmasserrortolerance); + *os << "Number of nodes when dehydrated ions are removed: " << sortedpeaklist.size() << endl; + + // remove deamidated peaks + sortedpeaklist.removeNeutralLoss(-NH3, parameters->precursorcharge, parameters->fragmentmasserrortolerance); + *os << "Number of nodes when deamidated ions are removed: " << sortedpeaklist.size() << endl; + + //} double negativeshift = (parameters->precursorcharge > 0)?0:-2*(H - e); string negativeshiftsummary = (parameters->precursorcharge > 0)?"":"H-2+-2"; diff --git a/CycloBranch/core/cDeNovoGraphNode.cpp b/CycloBranch/core/cDeNovoGraphNode.cpp index b7dc72c..8b806bd 100644 --- a/CycloBranch/core/cDeNovoGraphNode.cpp +++ b/CycloBranch/core/cDeNovoGraphNode.cpp @@ -13,6 +13,11 @@ void nodeEdge::load(ifstream& is) { } +bool operator == (nodeEdge const& a, nodeEdge const& b) { + return (a.nodeid == b.nodeid) && (a.edgeid == b.edgeid); +} + + bool operator == (cEdge const& a, cEdge const& b) { return (a.targetnode == b.targetnode) && (a.brickid == b.brickid) && (a.sourceion == b.sourceion) && (a.targetion == b.targetion); } diff --git a/CycloBranch/core/cDeNovoGraphNode.h b/CycloBranch/core/cDeNovoGraphNode.h index 14a1ba8..e0c7364 100644 --- a/CycloBranch/core/cDeNovoGraphNode.h +++ b/CycloBranch/core/cDeNovoGraphNode.h @@ -50,6 +50,15 @@ struct nodeEdge { }; +/** + \brief Overloaded operator ==. + \param a first nodeEdge + \param b second nodeEdge + \retval bool true when nodeEdges are equal +*/ +bool operator == (nodeEdge const& a, nodeEdge const& b); + + /** \brief The structure representing an outgoing edge from a node. */ diff --git a/CycloBranch/core/cFragmentIons.cpp b/CycloBranch/core/cFragmentIons.cpp index b2401af..dfc777d 100644 --- a/CycloBranch/core/cFragmentIons.cpp +++ b/CycloBranch/core/cFragmentIons.cpp @@ -1444,6 +1444,7 @@ double uncharge(double mzratio, int charge) { void fragmentDescription::store(ofstream& os) { storeString(name, os); storeString(summary, os); + storeStringIntMap(summarymap, os); os.write((char *)&massdifference, sizeof(double)); os.write((char *)&nterminal, sizeof(bool)); os.write((char *)&cterminal, sizeof(bool)); @@ -1456,6 +1457,7 @@ void fragmentDescription::store(ofstream& os) { void fragmentDescription::load(ifstream& is) { loadString(name, is); loadString(summary, is); + loadStringIntMap(summarymap, is); is.read((char *)&massdifference, sizeof(double)); is.read((char *)&nterminal, sizeof(bool)); is.read((char *)&cterminal, sizeof(bool)); @@ -1506,6 +1508,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[a_ion].name = "A"; fragmentions[a_ion].massdifference = A_ION + nterminusshift + adductshift; fragmentions[a_ion].parent = b_ion; // ok + fragmentions[a_ion].summary = "C-1O-1H+" + nterminusshiftsummary + adductshiftsummary; // initialize A-H2O ion fragmentions[a_ion_dehydrated].nterminal = true; @@ -1513,6 +1516,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[a_ion_dehydrated].name = "A*"; fragmentions[a_ion_dehydrated].massdifference = A_ION - H2O + nterminusshift + adductshift; fragmentions[a_ion_dehydrated].parent = a_ion; + fragmentions[a_ion_dehydrated].summary = fragmentions[a_ion].summary + "H-2O-1"; // initialize A-NH3 ion fragmentions[a_ion_deamidated].nterminal = true; @@ -1520,13 +1524,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[a_ion_deamidated].name = "Ax"; fragmentions[a_ion_deamidated].massdifference = A_ION - NH3 + nterminusshift + adductshift; fragmentions[a_ion_deamidated].parent = a_ion; + fragmentions[a_ion_deamidated].summary = fragmentions[a_ion].summary + "N-1H-3"; + + // initialize A-H2O-H2O ion + fragmentions[a_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[a_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[a_ion_dehydrated_dehydrated].name = "A**"; + fragmentions[a_ion_dehydrated_dehydrated].massdifference = A_ION - H2O - H2O + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_dehydrated].parent = a_ion; + fragmentions[a_ion_dehydrated_dehydrated].summary = fragmentions[a_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize A-NH3-NH3 ion + fragmentions[a_ion_deamidated_deamidated].nterminal = true; + fragmentions[a_ion_deamidated_deamidated].cterminal = false; + fragmentions[a_ion_deamidated_deamidated].name = "Axx"; + fragmentions[a_ion_deamidated_deamidated].massdifference = A_ION - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_deamidated_deamidated].parent = a_ion; + fragmentions[a_ion_deamidated_deamidated].summary = fragmentions[a_ion].summary + "N-1H-3" + "N-1H-3"; // initialize A-H2O-NH3 ion - fragmentions[a_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[a_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[a_ion_dehydrated_and_deamidated].name = "A*x"; - fragmentions[a_ion_dehydrated_and_deamidated].massdifference = A_ION - H2O - NH3 + nterminusshift + adductshift; - fragmentions[a_ion_dehydrated_and_deamidated].parent = a_ion; + fragmentions[a_ion_dehydrated_deamidated].nterminal = true; + fragmentions[a_ion_dehydrated_deamidated].cterminal = false; + fragmentions[a_ion_dehydrated_deamidated].name = "A*x"; + fragmentions[a_ion_dehydrated_deamidated].massdifference = A_ION - H2O - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_deamidated].parent = a_ion; + fragmentions[a_ion_dehydrated_deamidated].summary = fragmentions[a_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize A-H2O-H2O-H2O ion + fragmentions[a_ion_dehydrated_dehydrated_dehydrated].nterminal = true; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated].name = "A***"; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated].massdifference = A_ION - H2O - H2O - H2O + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated].parent = a_ion; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[a_ion].summary + "H-6O-3"; + + // initialize A-NH3-NH3-NH3 ion + fragmentions[a_ion_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[a_ion_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[a_ion_deamidated_deamidated_deamidated].name = "Axxx"; + fragmentions[a_ion_deamidated_deamidated_deamidated].massdifference = A_ION - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_deamidated_deamidated_deamidated].parent = a_ion; + fragmentions[a_ion_deamidated_deamidated_deamidated].summary = fragmentions[a_ion].summary + "N-3H-9"; + + // initialize A-H2O-H2O-NH3 ion + fragmentions[a_ion_dehydrated_dehydrated_deamidated].nterminal = true; + fragmentions[a_ion_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[a_ion_dehydrated_dehydrated_deamidated].name = "A**x"; + fragmentions[a_ion_dehydrated_dehydrated_deamidated].massdifference = A_ION - H2O - H2O - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_dehydrated_deamidated].parent = a_ion; + fragmentions[a_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[a_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize A-H2O-NH3-NH3 ion + fragmentions[a_ion_dehydrated_deamidated_deamidated].nterminal = true; + fragmentions[a_ion_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[a_ion_dehydrated_deamidated_deamidated].name = "A*xx"; + fragmentions[a_ion_dehydrated_deamidated_deamidated].massdifference = A_ION - H2O - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_deamidated_deamidated].parent = a_ion; + fragmentions[a_ion_dehydrated_deamidated_deamidated].summary = fragmentions[a_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize A-H2O-H2O-H2O-H2O ion + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = true; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "A****"; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = A_ION - H2O - H2O - H2O - H2O + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = a_ion; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[a_ion].summary + "H-8O-4"; + + // initialize A-NH3-NH3-NH3-NH3 ion + fragmentions[a_ion_deamidated_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[a_ion_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[a_ion_deamidated_deamidated_deamidated_deamidated].name = "Axxxx"; + fragmentions[a_ion_deamidated_deamidated_deamidated_deamidated].massdifference = A_ION - NH3 - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_deamidated_deamidated_deamidated_deamidated].parent = a_ion; + fragmentions[a_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[a_ion].summary + "N-4H-12"; + + // initialize A-H2O-H2O-H2O-NH3 ion + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = true; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "A***x"; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = A_ION - H2O - H2O - H2O - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = a_ion; + fragmentions[a_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[a_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize A-H2O-H2O-NH3-NH3 ion + fragmentions[a_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = true; + fragmentions[a_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[a_ion_dehydrated_dehydrated_deamidated_deamidated].name = "A**xx"; + fragmentions[a_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = A_ION - H2O - H2O - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_dehydrated_deamidated_deamidated].parent = a_ion; + fragmentions[a_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[a_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize A-H2O-NH3-NH3-NH3 ion + fragmentions[a_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[a_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[a_ion_dehydrated_deamidated_deamidated_deamidated].name = "A*xxx"; + fragmentions[a_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = A_ION - H2O - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[a_ion_dehydrated_deamidated_deamidated_deamidated].parent = a_ion; + fragmentions[a_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[a_ion].summary + "H-2O-1" + "N-3H-9"; // initialize B-ion fragmentions[b_ion].nterminal = true; @@ -1542,6 +1636,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[b_ion_dehydrated].name = "B*"; fragmentions[b_ion_dehydrated].massdifference = B_ION - H2O + nterminusshift + adductshift; fragmentions[b_ion_dehydrated].parent = b_ion; + fragmentions[b_ion_dehydrated].summary = fragmentions[b_ion].summary + "H-2O-1"; // initialize B-NH3 ion fragmentions[b_ion_deamidated].nterminal = true; @@ -1549,13 +1644,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[b_ion_deamidated].name = "Bx"; fragmentions[b_ion_deamidated].massdifference = B_ION - NH3 + nterminusshift + adductshift; fragmentions[b_ion_deamidated].parent = b_ion; + fragmentions[b_ion_deamidated].summary = fragmentions[b_ion].summary + "N-1H-3"; + + // initialize B-H2O-H2O ion + fragmentions[b_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[b_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[b_ion_dehydrated_dehydrated].name = "B**"; + fragmentions[b_ion_dehydrated_dehydrated].massdifference = B_ION - H2O - H2O + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_dehydrated].parent = b_ion; + fragmentions[b_ion_dehydrated_dehydrated].summary = fragmentions[b_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize B-NH3-NH3 ion + fragmentions[b_ion_deamidated_deamidated].nterminal = true; + fragmentions[b_ion_deamidated_deamidated].cterminal = false; + fragmentions[b_ion_deamidated_deamidated].name = "Bxx"; + fragmentions[b_ion_deamidated_deamidated].massdifference = B_ION - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_deamidated_deamidated].parent = b_ion; + fragmentions[b_ion_deamidated_deamidated].summary = fragmentions[b_ion].summary + "N-1H-3" + "N-1H-3"; // initialize B-H2O-NH3 ion - fragmentions[b_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[b_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[b_ion_dehydrated_and_deamidated].name = "B*x"; - fragmentions[b_ion_dehydrated_and_deamidated].massdifference = B_ION - H2O - NH3 + nterminusshift + adductshift; - fragmentions[b_ion_dehydrated_and_deamidated].parent = b_ion; + fragmentions[b_ion_dehydrated_deamidated].nterminal = true; + fragmentions[b_ion_dehydrated_deamidated].cterminal = false; + fragmentions[b_ion_dehydrated_deamidated].name = "B*x"; + fragmentions[b_ion_dehydrated_deamidated].massdifference = B_ION - H2O - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_deamidated].parent = b_ion; + fragmentions[b_ion_dehydrated_deamidated].summary = fragmentions[b_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize B-H2O-H2O-H2O ion + fragmentions[b_ion_dehydrated_dehydrated_dehydrated].nterminal = true; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated].name = "B***"; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated].massdifference = B_ION - H2O - H2O - H2O + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated].parent = b_ion; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[b_ion].summary + "H-6O-3"; + + // initialize B-NH3-NH3-NH3 ion + fragmentions[b_ion_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[b_ion_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[b_ion_deamidated_deamidated_deamidated].name = "Bxxx"; + fragmentions[b_ion_deamidated_deamidated_deamidated].massdifference = B_ION - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_deamidated_deamidated_deamidated].parent = b_ion; + fragmentions[b_ion_deamidated_deamidated_deamidated].summary = fragmentions[b_ion].summary + "N-3H-9"; + + // initialize B-H2O-H2O-NH3 ion + fragmentions[b_ion_dehydrated_dehydrated_deamidated].nterminal = true; + fragmentions[b_ion_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[b_ion_dehydrated_dehydrated_deamidated].name = "B**x"; + fragmentions[b_ion_dehydrated_dehydrated_deamidated].massdifference = B_ION - H2O - H2O - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_dehydrated_deamidated].parent = b_ion; + fragmentions[b_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[b_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize B-H2O-NH3-NH3 ion + fragmentions[b_ion_dehydrated_deamidated_deamidated].nterminal = true; + fragmentions[b_ion_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[b_ion_dehydrated_deamidated_deamidated].name = "B*xx"; + fragmentions[b_ion_dehydrated_deamidated_deamidated].massdifference = B_ION - H2O - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_deamidated_deamidated].parent = b_ion; + fragmentions[b_ion_dehydrated_deamidated_deamidated].summary = fragmentions[b_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize B-H2O-H2O-H2O-H2O ion + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = true; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "B****"; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = B_ION - H2O - H2O - H2O - H2O + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = b_ion; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[b_ion].summary + "H-8O-4"; + + // initialize B-NH3-NH3-NH3-NH3 ion + fragmentions[b_ion_deamidated_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[b_ion_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[b_ion_deamidated_deamidated_deamidated_deamidated].name = "Bxxxx"; + fragmentions[b_ion_deamidated_deamidated_deamidated_deamidated].massdifference = B_ION - NH3 - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_deamidated_deamidated_deamidated_deamidated].parent = b_ion; + fragmentions[b_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[b_ion].summary + "N-4H-12"; + + // initialize B-H2O-H2O-H2O-NH3 ion + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = true; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "B***x"; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = B_ION - H2O - H2O - H2O - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = b_ion; + fragmentions[b_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[b_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize B-H2O-H2O-NH3-NH3 ion + fragmentions[b_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = true; + fragmentions[b_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[b_ion_dehydrated_dehydrated_deamidated_deamidated].name = "B**xx"; + fragmentions[b_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = B_ION - H2O - H2O - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_dehydrated_deamidated_deamidated].parent = b_ion; + fragmentions[b_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[b_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize B-H2O-NH3-NH3-NH3 ion + fragmentions[b_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[b_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[b_ion_dehydrated_deamidated_deamidated_deamidated].name = "B*xxx"; + fragmentions[b_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = B_ION - H2O - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[b_ion_dehydrated_deamidated_deamidated_deamidated].parent = b_ion; + fragmentions[b_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[b_ion].summary + "H-2O-1" + "N-3H-9"; // initialize C-ion fragmentions[c_ion].nterminal = true; @@ -1563,6 +1748,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[c_ion].name = "C"; fragmentions[c_ion].massdifference = C_ION + nterminusshift + adductshift; fragmentions[c_ion].parent = c_ion; + fragmentions[c_ion].summary = "NH3H+" + nterminusshiftsummary + adductshiftsummary; // initialize C-H2O ion fragmentions[c_ion_dehydrated].nterminal = true; @@ -1570,6 +1756,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[c_ion_dehydrated].name = "C*"; fragmentions[c_ion_dehydrated].massdifference = C_ION - H2O + nterminusshift + adductshift; fragmentions[c_ion_dehydrated].parent = c_ion; + fragmentions[c_ion_dehydrated].summary = fragmentions[c_ion].summary + "H-2O-1"; // initialize C-NH3 ion fragmentions[c_ion_deamidated].nterminal = true; @@ -1577,13 +1764,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[c_ion_deamidated].name = "Cx"; fragmentions[c_ion_deamidated].massdifference = C_ION - NH3 + nterminusshift + adductshift; fragmentions[c_ion_deamidated].parent = c_ion; + fragmentions[c_ion_deamidated].summary = fragmentions[c_ion].summary + "N-1H-3"; + + // initialize C-H2O-H2O ion + fragmentions[c_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[c_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[c_ion_dehydrated_dehydrated].name = "C**"; + fragmentions[c_ion_dehydrated_dehydrated].massdifference = C_ION - H2O - H2O + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_dehydrated].parent = c_ion; + fragmentions[c_ion_dehydrated_dehydrated].summary = fragmentions[c_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize C-NH3-NH3 ion + fragmentions[c_ion_deamidated_deamidated].nterminal = true; + fragmentions[c_ion_deamidated_deamidated].cterminal = false; + fragmentions[c_ion_deamidated_deamidated].name = "Cxx"; + fragmentions[c_ion_deamidated_deamidated].massdifference = C_ION - H2O - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_deamidated_deamidated].parent = c_ion; + fragmentions[c_ion_deamidated_deamidated].summary = fragmentions[c_ion].summary + "N-1H-3" + "N-1H-3"; // initialize C-H2O-NH3 ion - fragmentions[c_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[c_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[c_ion_dehydrated_and_deamidated].name = "C*x"; - fragmentions[c_ion_dehydrated_and_deamidated].massdifference = C_ION - H2O - NH3 + nterminusshift + adductshift; - fragmentions[c_ion_dehydrated_and_deamidated].parent = c_ion; + fragmentions[c_ion_dehydrated_deamidated].nterminal = true; + fragmentions[c_ion_dehydrated_deamidated].cterminal = false; + fragmentions[c_ion_dehydrated_deamidated].name = "C*x"; + fragmentions[c_ion_dehydrated_deamidated].massdifference = C_ION - H2O - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_deamidated].parent = c_ion; + fragmentions[c_ion_dehydrated_deamidated].summary = fragmentions[c_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize C-H2O-H2O-H2O ion + fragmentions[c_ion_dehydrated_dehydrated_dehydrated].nterminal = true; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated].name = "C***"; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated].massdifference = C_ION - H2O - H2O - H2O + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated].parent = c_ion; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[c_ion].summary + "H-6O-3"; + + // initialize C-NH3-NH3-NH3 ion + fragmentions[c_ion_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[c_ion_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[c_ion_deamidated_deamidated_deamidated].name = "Cxxx"; + fragmentions[c_ion_deamidated_deamidated_deamidated].massdifference = C_ION - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_deamidated_deamidated_deamidated].parent = c_ion; + fragmentions[c_ion_deamidated_deamidated_deamidated].summary = fragmentions[c_ion].summary + "N-3H-9"; + + // initialize C-H2O-H2O-NH3 ion + fragmentions[c_ion_dehydrated_dehydrated_deamidated].nterminal = true; + fragmentions[c_ion_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[c_ion_dehydrated_dehydrated_deamidated].name = "C**x"; + fragmentions[c_ion_dehydrated_dehydrated_deamidated].massdifference = C_ION - H2O - H2O - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_dehydrated_deamidated].parent = c_ion; + fragmentions[c_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[c_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize C-H2O-NH3-NH3 ion + fragmentions[c_ion_dehydrated_deamidated_deamidated].nterminal = true; + fragmentions[c_ion_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[c_ion_dehydrated_deamidated_deamidated].name = "C*xx"; + fragmentions[c_ion_dehydrated_deamidated_deamidated].massdifference = C_ION - H2O - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_deamidated_deamidated].parent = c_ion; + fragmentions[c_ion_dehydrated_deamidated_deamidated].summary = fragmentions[c_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize C-H2O-H2O-H2O-H2O ion + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = true; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "C****"; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = C_ION - H2O - H2O - H2O - H2O + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = c_ion; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[c_ion].summary + "H-8O-4"; + + // initialize C-NH3-NH3-NH3-NH3 ion + fragmentions[c_ion_deamidated_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[c_ion_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[c_ion_deamidated_deamidated_deamidated_deamidated].name = "Cxxxx"; + fragmentions[c_ion_deamidated_deamidated_deamidated_deamidated].massdifference = C_ION - NH3 - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_deamidated_deamidated_deamidated_deamidated].parent = c_ion; + fragmentions[c_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[c_ion].summary + "N-4H-12"; + + // initialize C-H2O-H2O-H2O-NH3 ion + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = true; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "C***x"; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = C_ION - H2O - H2O - H2O - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = c_ion; + fragmentions[c_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[c_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize C-H2O-H2O-NH3-NH3 ion + fragmentions[c_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = true; + fragmentions[c_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[c_ion_dehydrated_dehydrated_deamidated_deamidated].name = "C**xx"; + fragmentions[c_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = C_ION - H2O - H2O - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_dehydrated_deamidated_deamidated].parent = c_ion; + fragmentions[c_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[c_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize C-H2O-NH3-NH3-NH3 ion + fragmentions[c_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = true; + fragmentions[c_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[c_ion_dehydrated_deamidated_deamidated_deamidated].name = "C*xxx"; + fragmentions[c_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = C_ION - H2O - NH3 - NH3 - NH3 + nterminusshift + adductshift; + fragmentions[c_ion_dehydrated_deamidated_deamidated_deamidated].parent = c_ion; + fragmentions[c_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[c_ion].summary + "H-2O-1" + "N-3H-9"; // initialize X ion fragmentions[x_ion].nterminal = false; @@ -1591,6 +1868,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[x_ion].name = "X"; fragmentions[x_ion].massdifference = X_ION + cterminusshift + adductshift; fragmentions[x_ion].parent = x_ion; + fragmentions[x_ion].summary = "CO2H+" + cterminusshiftsummary + adductshiftsummary; // initialize X-H2O ion fragmentions[x_ion_dehydrated].nterminal = false; @@ -1598,6 +1876,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[x_ion_dehydrated].name = "X*"; fragmentions[x_ion_dehydrated].massdifference = X_ION - H2O + cterminusshift + adductshift; fragmentions[x_ion_dehydrated].parent = x_ion; + fragmentions[x_ion_dehydrated].summary = fragmentions[x_ion].summary + "H-2O-1"; // initialize X-NH3 ion fragmentions[x_ion_deamidated].nterminal = false; @@ -1605,13 +1884,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[x_ion_deamidated].name = "Xx"; fragmentions[x_ion_deamidated].massdifference = X_ION - NH3 + cterminusshift + adductshift; fragmentions[x_ion_deamidated].parent = x_ion; + fragmentions[x_ion_deamidated].summary = fragmentions[x_ion].summary + "N-1H-3"; + + // initialize X-H2O-H2O ion + fragmentions[x_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[x_ion_dehydrated_dehydrated].cterminal = true; + fragmentions[x_ion_dehydrated_dehydrated].name = "X**"; + fragmentions[x_ion_dehydrated_dehydrated].massdifference = X_ION - H2O - H2O + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_dehydrated].parent = x_ion; + fragmentions[x_ion_dehydrated_dehydrated].summary = fragmentions[x_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize X-NH3-NH3 ion + fragmentions[x_ion_deamidated_deamidated].nterminal = false; + fragmentions[x_ion_deamidated_deamidated].cterminal = true; + fragmentions[x_ion_deamidated_deamidated].name = "Xxx"; + fragmentions[x_ion_deamidated_deamidated].massdifference = X_ION - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_deamidated_deamidated].parent = x_ion; + fragmentions[x_ion_deamidated_deamidated].summary = fragmentions[x_ion].summary + "N-1H-3" + "N-1H-3"; // initialize X-H2O-NH3 ion - fragmentions[x_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[x_ion_dehydrated_and_deamidated].cterminal = true; - fragmentions[x_ion_dehydrated_and_deamidated].name = "X*x"; - fragmentions[x_ion_dehydrated_and_deamidated].massdifference = X_ION - H2O - NH3 + cterminusshift + adductshift; - fragmentions[x_ion_dehydrated_and_deamidated].parent = x_ion; + fragmentions[x_ion_dehydrated_deamidated].nterminal = false; + fragmentions[x_ion_dehydrated_deamidated].cterminal = true; + fragmentions[x_ion_dehydrated_deamidated].name = "X*x"; + fragmentions[x_ion_dehydrated_deamidated].massdifference = X_ION - H2O - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_deamidated].parent = x_ion; + fragmentions[x_ion_dehydrated_deamidated].summary = fragmentions[x_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize X-H2O-H2O-H2O ion + fragmentions[x_ion_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated].cterminal = true; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated].name = "X***"; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated].massdifference = X_ION - H2O - H2O - H2O + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated].parent = x_ion; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[x_ion].summary + "H-6O-3"; + + // initialize X-NH3-NH3-NH3 ion + fragmentions[x_ion_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[x_ion_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[x_ion_deamidated_deamidated_deamidated].name = "Xxxx"; + fragmentions[x_ion_deamidated_deamidated_deamidated].massdifference = X_ION - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_deamidated_deamidated_deamidated].parent = x_ion; + fragmentions[x_ion_deamidated_deamidated_deamidated].summary = fragmentions[x_ion].summary + "N-3H-9"; + + // initialize X-H2O-H2O-NH3 ion + fragmentions[x_ion_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[x_ion_dehydrated_dehydrated_deamidated].cterminal = true; + fragmentions[x_ion_dehydrated_dehydrated_deamidated].name = "X**x"; + fragmentions[x_ion_dehydrated_dehydrated_deamidated].massdifference = X_ION - H2O - H2O - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_dehydrated_deamidated].parent = x_ion; + fragmentions[x_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[x_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize X-H2O-NH3-NH3 ion + fragmentions[x_ion_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[x_ion_dehydrated_deamidated_deamidated].cterminal = true; + fragmentions[x_ion_dehydrated_deamidated_deamidated].name = "X*xx"; + fragmentions[x_ion_dehydrated_deamidated_deamidated].massdifference = X_ION - H2O - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_deamidated_deamidated].parent = x_ion; + fragmentions[x_ion_dehydrated_deamidated_deamidated].summary = fragmentions[x_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize X-H2O-H2O-H2O-H2O ion + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = true; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "X****"; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = X_ION - H2O - H2O - H2O - H2O + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = x_ion; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[x_ion].summary + "H-8O-4"; + + // initialize X-NH3-NH3-NH3-NH3 ion + fragmentions[x_ion_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[x_ion_deamidated_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[x_ion_deamidated_deamidated_deamidated_deamidated].name = "Xxxxx"; + fragmentions[x_ion_deamidated_deamidated_deamidated_deamidated].massdifference = X_ION - NH3 - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_deamidated_deamidated_deamidated_deamidated].parent = x_ion; + fragmentions[x_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[x_ion].summary + "N-4H-12"; + + // initialize X-H2O-H2O-H2O-NH3 ion + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = true; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "X***x"; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = X_ION - H2O - H2O - H2O - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = x_ion; + fragmentions[x_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[x_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize X-H2O-H2O-NH3-NH3 ion + fragmentions[x_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[x_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = true; + fragmentions[x_ion_dehydrated_dehydrated_deamidated_deamidated].name = "X**xx"; + fragmentions[x_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = X_ION - H2O - H2O - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_dehydrated_deamidated_deamidated].parent = x_ion; + fragmentions[x_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[x_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize X-H2O-NH3-NH3-NH3 ion + fragmentions[x_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[x_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[x_ion_dehydrated_deamidated_deamidated_deamidated].name = "X*xxx"; + fragmentions[x_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = X_ION - H2O - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[x_ion_dehydrated_deamidated_deamidated_deamidated].parent = x_ion; + fragmentions[x_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[x_ion].summary + "H-2O-1" + "N-3H-9"; // initialize Y ion fragmentions[y_ion].nterminal = false; @@ -1627,6 +1996,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[y_ion_dehydrated].name = "Y*"; fragmentions[y_ion_dehydrated].massdifference = Y_ION - H2O + cterminusshift + adductshift; fragmentions[y_ion_dehydrated].parent = y_ion; + fragmentions[y_ion_dehydrated].summary = fragmentions[y_ion].summary + "H-2O-1"; // initialize Y-NH3 ion fragmentions[y_ion_deamidated].nterminal = false; @@ -1634,13 +2004,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[y_ion_deamidated].name = "Yx"; fragmentions[y_ion_deamidated].massdifference = Y_ION - NH3 + cterminusshift + adductshift; fragmentions[y_ion_deamidated].parent = y_ion; + fragmentions[y_ion_deamidated].summary = fragmentions[y_ion].summary + "N-1H-3"; + + // initialize Y-H2O-H2O ion + fragmentions[y_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[y_ion_dehydrated_dehydrated].cterminal = true; + fragmentions[y_ion_dehydrated_dehydrated].name = "Y**"; + fragmentions[y_ion_dehydrated_dehydrated].massdifference = Y_ION - H2O - H2O + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_dehydrated].parent = y_ion; + fragmentions[y_ion_dehydrated_dehydrated].summary = fragmentions[y_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize Y-NH3-NH3 ion + fragmentions[y_ion_deamidated_deamidated].nterminal = false; + fragmentions[y_ion_deamidated_deamidated].cterminal = true; + fragmentions[y_ion_deamidated_deamidated].name = "Yxx"; + fragmentions[y_ion_deamidated_deamidated].massdifference = Y_ION - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_deamidated_deamidated].parent = y_ion; + fragmentions[y_ion_deamidated_deamidated].summary = fragmentions[y_ion].summary + "N-1H-3" + "N-1H-3"; // initialize Y-H2O-NH3 ion - fragmentions[y_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[y_ion_dehydrated_and_deamidated].cterminal = true; - fragmentions[y_ion_dehydrated_and_deamidated].name = "Y*x"; - fragmentions[y_ion_dehydrated_and_deamidated].massdifference = Y_ION - H2O - NH3 + cterminusshift + adductshift; - fragmentions[y_ion_dehydrated_and_deamidated].parent = y_ion; + fragmentions[y_ion_dehydrated_deamidated].nterminal = false; + fragmentions[y_ion_dehydrated_deamidated].cterminal = true; + fragmentions[y_ion_dehydrated_deamidated].name = "Y*x"; + fragmentions[y_ion_dehydrated_deamidated].massdifference = Y_ION - H2O - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_deamidated].parent = y_ion; + fragmentions[y_ion_dehydrated_deamidated].summary = fragmentions[y_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize Y-H2O-H2O-H2O ion + fragmentions[y_ion_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated].cterminal = true; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated].name = "Y***"; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated].massdifference = Y_ION - H2O - H2O - H2O + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated].parent = y_ion; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[y_ion].summary + "H-6O-3"; + + // initialize Y-NH3-NH3-NH3 ion + fragmentions[y_ion_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[y_ion_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[y_ion_deamidated_deamidated_deamidated].name = "Yxxx"; + fragmentions[y_ion_deamidated_deamidated_deamidated].massdifference = Y_ION - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_deamidated_deamidated_deamidated].parent = y_ion; + fragmentions[y_ion_deamidated_deamidated_deamidated].summary = fragmentions[y_ion].summary + "N-3H-9"; + + // initialize Y-H2O-H2O-NH3 ion + fragmentions[y_ion_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[y_ion_dehydrated_dehydrated_deamidated].cterminal = true; + fragmentions[y_ion_dehydrated_dehydrated_deamidated].name = "Y**x"; + fragmentions[y_ion_dehydrated_dehydrated_deamidated].massdifference = Y_ION - H2O - H2O - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_dehydrated_deamidated].parent = y_ion; + fragmentions[y_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[y_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize Y-H2O-NH3-NH3 ion + fragmentions[y_ion_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[y_ion_dehydrated_deamidated_deamidated].cterminal = true; + fragmentions[y_ion_dehydrated_deamidated_deamidated].name = "Y*xx"; + fragmentions[y_ion_dehydrated_deamidated_deamidated].massdifference = Y_ION - H2O - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_deamidated_deamidated].parent = y_ion; + fragmentions[y_ion_dehydrated_deamidated_deamidated].summary = fragmentions[y_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize Y-H2O-H2O-H2O-H2O ion + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = true; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "Y****"; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = Y_ION - H2O - H2O - H2O - H2O + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = y_ion; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[y_ion].summary + "H-8O-4"; + + // initialize Y-NH3-NH3-NH3-NH3 ion + fragmentions[y_ion_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[y_ion_deamidated_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[y_ion_deamidated_deamidated_deamidated_deamidated].name = "Yxxxx"; + fragmentions[y_ion_deamidated_deamidated_deamidated_deamidated].massdifference = Y_ION - NH3 - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_deamidated_deamidated_deamidated_deamidated].parent = y_ion; + fragmentions[y_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[y_ion].summary + "N-4H-12"; + + // initialize Y-H2O-H2O-H2O-NH3 ion + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = true; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "Y***x"; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = Y_ION - H2O - H2O - H2O - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = y_ion; + fragmentions[y_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[y_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize Y-H2O-H2O-NH3-NH3 ion + fragmentions[y_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[y_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = true; + fragmentions[y_ion_dehydrated_dehydrated_deamidated_deamidated].name = "Y**xx"; + fragmentions[y_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = Y_ION - H2O - H2O - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_dehydrated_deamidated_deamidated].parent = y_ion; + fragmentions[y_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[y_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize Y-H2O-NH3-NH3-NH3 ion + fragmentions[y_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[y_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[y_ion_dehydrated_deamidated_deamidated_deamidated].name = "Y*xxx"; + fragmentions[y_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = Y_ION - H2O - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[y_ion_dehydrated_deamidated_deamidated_deamidated].parent = y_ion; + fragmentions[y_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[y_ion].summary + "H-2O-1" + "N-3H-9"; // initialize Z ion fragmentions[z_ion].nterminal = false; @@ -1648,6 +2108,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[z_ion].name = "Z"; fragmentions[z_ion].massdifference = Z_ION + cterminusshift + adductshift; fragmentions[z_ion].parent = z_ion; + fragmentions[z_ion].summary = "ON-1+" + cterminusshiftsummary + adductshiftsummary; // initialize Z-H2O ion fragmentions[z_ion_dehydrated].nterminal = false; @@ -1655,6 +2116,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[z_ion_dehydrated].name = "Z*"; fragmentions[z_ion_dehydrated].massdifference = Z_ION - H2O + cterminusshift + adductshift; fragmentions[z_ion_dehydrated].parent = z_ion; + fragmentions[z_ion_dehydrated].summary = fragmentions[z_ion].summary + "H-2O-1"; // initialize Z-NH3 ion fragmentions[z_ion_deamidated].nterminal = false; @@ -1662,13 +2124,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[z_ion_deamidated].name = "Zx"; fragmentions[z_ion_deamidated].massdifference = Z_ION - NH3 + cterminusshift + adductshift; fragmentions[z_ion_deamidated].parent = z_ion; + fragmentions[z_ion_deamidated].summary = fragmentions[z_ion].summary + "N-1H-3"; + + // initialize Z-H2O-H2O ion + fragmentions[z_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[z_ion_dehydrated_dehydrated].cterminal = true; + fragmentions[z_ion_dehydrated_dehydrated].name = "Z**"; + fragmentions[z_ion_dehydrated_dehydrated].massdifference = Z_ION - H2O - H2O + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_dehydrated].parent = z_ion; + fragmentions[z_ion_dehydrated_dehydrated].summary = fragmentions[z_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize Z-NH3-NH3 ion + fragmentions[z_ion_deamidated_deamidated].nterminal = false; + fragmentions[z_ion_deamidated_deamidated].cterminal = true; + fragmentions[z_ion_deamidated_deamidated].name = "Zxx"; + fragmentions[z_ion_deamidated_deamidated].massdifference = Z_ION - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_deamidated_deamidated].parent = z_ion; + fragmentions[z_ion_deamidated_deamidated].summary = fragmentions[z_ion].summary + "N-1H-3" + "N-1H-3"; // initialize Z-H2O-NH3 ion - fragmentions[z_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[z_ion_dehydrated_and_deamidated].cterminal = true; - fragmentions[z_ion_dehydrated_and_deamidated].name = "Z*x"; - fragmentions[z_ion_dehydrated_and_deamidated].massdifference = Z_ION - H2O - NH3 + cterminusshift + adductshift; - fragmentions[z_ion_dehydrated_and_deamidated].parent = z_ion; + fragmentions[z_ion_dehydrated_deamidated].nterminal = false; + fragmentions[z_ion_dehydrated_deamidated].cterminal = true; + fragmentions[z_ion_dehydrated_deamidated].name = "Z*x"; + fragmentions[z_ion_dehydrated_deamidated].massdifference = Z_ION - H2O - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_deamidated].parent = z_ion; + fragmentions[z_ion_dehydrated_deamidated].summary = fragmentions[z_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize Z-H2O-H2O-H2O ion + fragmentions[z_ion_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated].cterminal = true; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated].name = "Z***"; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated].massdifference = Z_ION - H2O - H2O - H2O + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated].parent = z_ion; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[z_ion].summary + "H-6O-3"; + + // initialize Z-NH3-NH3-NH3 ion + fragmentions[z_ion_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[z_ion_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[z_ion_deamidated_deamidated_deamidated].name = "Zxxx"; + fragmentions[z_ion_deamidated_deamidated_deamidated].massdifference = Z_ION - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_deamidated_deamidated_deamidated].parent = z_ion; + fragmentions[z_ion_deamidated_deamidated_deamidated].summary = fragmentions[z_ion].summary + "N-3H-9"; + + // initialize Z-H2O-H2O-NH3 ion + fragmentions[z_ion_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[z_ion_dehydrated_dehydrated_deamidated].cterminal = true; + fragmentions[z_ion_dehydrated_dehydrated_deamidated].name = "Z**x"; + fragmentions[z_ion_dehydrated_dehydrated_deamidated].massdifference = Z_ION - H2O - H2O - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_dehydrated_deamidated].parent = z_ion; + fragmentions[z_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[z_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize Z-H2O-NH3-NH3 ion + fragmentions[z_ion_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[z_ion_dehydrated_deamidated_deamidated].cterminal = true; + fragmentions[z_ion_dehydrated_deamidated_deamidated].name = "Z*xx"; + fragmentions[z_ion_dehydrated_deamidated_deamidated].massdifference = Z_ION - H2O - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_deamidated_deamidated].parent = z_ion; + fragmentions[z_ion_dehydrated_deamidated_deamidated].summary = fragmentions[z_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize Z-H2O-H2O-H2O-H2O ion + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = true; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "Z****"; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = Z_ION - H2O - H2O - H2O - H2O + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = z_ion; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[z_ion].summary + "H-8O-4"; + + // initialize Z-NH3-NH3-NH3-NH3 ion + fragmentions[z_ion_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[z_ion_deamidated_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[z_ion_deamidated_deamidated_deamidated_deamidated].name = "Zxxxx"; + fragmentions[z_ion_deamidated_deamidated_deamidated_deamidated].massdifference = Z_ION - NH3 - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_deamidated_deamidated_deamidated_deamidated].parent = z_ion; + fragmentions[z_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[z_ion].summary + "N-4H-12"; + + // initialize Z-H2O-H2O-H2O-NH3 ion + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = true; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "Z***x"; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = Z_ION - H2O - H2O - H2O - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = z_ion; + fragmentions[z_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[z_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize Z-H2O-H2O-NH3-NH3 ion + fragmentions[z_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[z_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = true; + fragmentions[z_ion_dehydrated_dehydrated_deamidated_deamidated].name = "Z**xx"; + fragmentions[z_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = Z_ION - H2O - H2O - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_dehydrated_deamidated_deamidated].parent = z_ion; + fragmentions[z_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[z_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize Z-H2O-NH3-NH3-NH3 ion + fragmentions[z_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[z_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = true; + fragmentions[z_ion_dehydrated_deamidated_deamidated_deamidated].name = "Z*xxx"; + fragmentions[z_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = Z_ION - H2O - NH3 - NH3 - NH3 + cterminusshift + adductshift; + fragmentions[z_ion_dehydrated_deamidated_deamidated_deamidated].parent = z_ion; + fragmentions[z_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[z_ion].summary + "H-2O-1" + "N-3H-9"; // initialize precursor ion fragmentions[precursor_ion].nterminal = false; @@ -1684,6 +2236,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[precursor_ion_dehydrated].name = "[M+zH]+ *"; fragmentions[precursor_ion_dehydrated].massdifference = PRECURSOR_ION - H2O + nterminusshift + cterminusshift + adductshift; fragmentions[precursor_ion_dehydrated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated].summary = fragmentions[precursor_ion].summary + "H-2O-1"; // initialize precursor ion - NH3 fragmentions[precursor_ion_deamidated].nterminal = false; @@ -1691,13 +2244,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[precursor_ion_deamidated].name = "[M+zH]+ x"; fragmentions[precursor_ion_deamidated].massdifference = PRECURSOR_ION - NH3 + nterminusshift + cterminusshift + adductshift; fragmentions[precursor_ion_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_deamidated].summary = fragmentions[precursor_ion].summary + "N-1H-3"; + + // initialize precursor ion - H2O - H2O + fragmentions[precursor_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated].name = "[M+zH]+ **"; + fragmentions[precursor_ion_dehydrated_dehydrated].massdifference = PRECURSOR_ION - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_dehydrated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize precursor ion - NH3 - NH3 + fragmentions[precursor_ion_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_deamidated_deamidated].name = "[M+zH]+ xx"; + fragmentions[precursor_ion_deamidated_deamidated].massdifference = PRECURSOR_ION - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "N-1H-3" + "N-1H-3"; // initialize precursor ion - H2O - NH3 - fragmentions[precursor_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[precursor_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[precursor_ion_dehydrated_and_deamidated].name = "[M+zH]+ *x"; - fragmentions[precursor_ion_dehydrated_and_deamidated].massdifference = PRECURSOR_ION - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[precursor_ion_dehydrated_and_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_dehydrated_deamidated].name = "[M+zH]+ *x"; + fragmentions[precursor_ion_dehydrated_deamidated].massdifference = PRECURSOR_ION - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize precursor ion - H2O - H2O - H2O + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ***"; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION - H2O - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "H-6O-3"; + + // initialize precursor ion - NH3 - NH3 - NH3 + fragmentions[precursor_ion_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_deamidated_deamidated_deamidated].name = "[M+zH]+ xxx"; + fragmentions[precursor_ion_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_deamidated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "N-3H-9"; + + // initialize precursor ion - H2O - H2O - NH3 + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated].name = "[M+zH]+ **x"; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION - H2O - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize precursor ion - H2O - NH3 - NH3 + fragmentions[precursor_ion_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated].name = "[M+zH]+ *xx"; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION - H2O - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize precursor ion - H2O - H2O - H2O - H2O + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ****"; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION - H2O - H2O - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "H-8O-4"; + + // initialize precursor ion - NH3 - NH3 - NH3 - NH3 + fragmentions[precursor_ion_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_deamidated_deamidated_deamidated_deamidated].name = "[M+zH]+ xxxx"; + fragmentions[precursor_ion_deamidated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - NH3 - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_deamidated_deamidated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "N-4H-12"; + + // initialize precursor ion - H2O - H2O - H2O - NH3 + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "[M+zH]+ ***x"; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION - H2O - H2O - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize precursor ion - H2O - H2O - NH3 - NH3 + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated_deamidated].name = "[M+zH]+ **xx"; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION - H2O - H2O - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize precursor ion - H2O - NH3 - NH3 - NH3 + fragmentions[precursor_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated_deamidated].name = "[M+zH]+ *xxx"; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - H2O - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "H-2O-1" + "N-3H-9"; // initialize precursor ion - CO fragmentions[precursor_ion_co_loss].nterminal = false; @@ -1705,27 +2348,239 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[precursor_ion_co_loss].name = "[M+zH]+ -CO"; fragmentions[precursor_ion_co_loss].massdifference = PRECURSOR_ION - CO + nterminusshift + cterminusshift + adductshift; fragmentions[precursor_ion_co_loss].parent = precursor_ion; + fragmentions[precursor_ion_co_loss].summary = fragmentions[precursor_ion].summary + "C-1O-1"; // initialize precursor ion - CO - H2O - fragmentions[precursor_ion_co_loss_and_dehydrated].nterminal = false; - fragmentions[precursor_ion_co_loss_and_dehydrated].cterminal = false; - fragmentions[precursor_ion_co_loss_and_dehydrated].name = "[M+zH]+ *-CO"; - fragmentions[precursor_ion_co_loss_and_dehydrated].massdifference = PRECURSOR_ION - CO - H2O + nterminusshift + cterminusshift + adductshift; - fragmentions[precursor_ion_co_loss_and_dehydrated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated].name = "[M+zH]+ *-CO"; + fragmentions[precursor_ion_co_loss_dehydrated].massdifference = PRECURSOR_ION - CO - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-2O-1"; // initialize precursor ion - CO - NH3 - fragmentions[precursor_ion_co_loss_and_deamidated].nterminal = false; - fragmentions[precursor_ion_co_loss_and_deamidated].cterminal = false; - fragmentions[precursor_ion_co_loss_and_deamidated].name = "[M+zH]+ x-CO"; - fragmentions[precursor_ion_co_loss_and_deamidated].massdifference = PRECURSOR_ION - CO - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[precursor_ion_co_loss_and_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_deamidated].name = "[M+zH]+ x-CO"; + fragmentions[precursor_ion_co_loss_deamidated].massdifference = PRECURSOR_ION - CO - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize precursor ion - CO - H2O - H2O + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated].massdifference = PRECURSOR_ION - CO - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize precursor ion - CO - NH3 - NH3 + fragmentions[precursor_ion_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO"; + fragmentions[precursor_ion_co_loss_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_deamidated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize precursor ion - CO - H2O - NH3 - fragmentions[precursor_ion_co_loss_and_dehydrated_and_deamidated].nterminal = false; - fragmentions[precursor_ion_co_loss_and_dehydrated_and_deamidated].cterminal = false; - fragmentions[precursor_ion_co_loss_and_dehydrated_and_deamidated].name = "[M+zH]+ *x-CO"; - fragmentions[precursor_ion_co_loss_and_dehydrated_and_deamidated].massdifference = PRECURSOR_ION - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[precursor_ion_co_loss_and_dehydrated_and_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated].massdifference = PRECURSOR_ION - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; + + // initialize precursor ion - CO - H2O - H2O - H2O + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ***-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION - CO - H2O - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-6O-3"; + + // initialize precursor ion - CO - NH3 - NH3 - NH3 + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated].name = "[M+zH]+ xxx-CO"; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "N-3H-9"; + + // initialize precursor ion - CO - H2O - H2O - NH3 + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated].name = "[M+zH]+ **x-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION - CO - H2O - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-4O-2" + "N-1H-3"; + + // initialize precursor ion - CO - H2O - NH3 - NH3 + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated].name = "[M+zH]+ *xx-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - H2O - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-2O-1" + "N-2H-6"; + + // initialize precursor ion - CO - H2O - H2O - H2O - H2O + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ****-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION - CO - H2O - H2O - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-8O-4"; + + // initialize precursor ion - CO - NH3 - NH3 - NH3 - NH3 + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].name = "[M+zH]+ xxxx-CO"; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - NH3 - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "N-4H-12"; + + // initialize precursor ion - CO - H2O - H2O - H2O - NH3 + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].name = "[M+zH]+ ***x-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION - CO - H2O - H2O - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-6O-3" + "N-1H-3"; + + // initialize precursor ion - CO - H2O - H2O - NH3 - NH3 + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].name = "[M+zH]+ **xx-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - H2O - H2O - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-4O-2" + "N-2H-6"; + + // initialize precursor ion - CO - H2O - NH3 - NH3 - NH3 + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].name = "[M+zH]+ *xxx-CO"; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - H2O - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-1O-1" + "H-2O-1" + "N-3H-9"; + + // initialize precursor ion - CO - CO + fragmentions[precursor_ion_co_loss_co_loss].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss].name = "[M+zH]+ -CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss].massdifference = PRECURSOR_ION - CO - CO + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_co_loss].summary = fragmentions[precursor_ion].summary + "C-2O-2"; + + // initialize precursor ion - CO - CO - H2O + fragmentions[precursor_ion_co_loss_co_loss_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated].name = "[M+zH]+ *-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated].massdifference = PRECURSOR_ION - CO - CO - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-2O-1"; + + // initialize precursor ion - CO - CO - NH3 + fragmentions[precursor_ion_co_loss_co_loss_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated].name = "[M+zH]+ x-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_deamidated].massdifference = PRECURSOR_ION - CO - CO - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "N-1H-3"; + + // initialize precursor ion - CO - CO - H2O - H2O + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated].massdifference = PRECURSOR_ION - CO - CO - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-2O-1" + "H-2O-1"; + + // initialize precursor ion - CO - CO - NH3 - NH3 + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - CO - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "N-1H-3" + "N-1H-3"; + + // initialize precursor ion - CO - CO - H2O - NH3 + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated].massdifference = PRECURSOR_ION - CO - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-2O-1" + "N-1H-3"; + + // initialize precursor ion - CO - CO - H2O - H2O - H2O + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ***-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION - CO - CO - H2O - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-6O-3"; + + // initialize precursor ion - CO - CO - NH3 - NH3 - NH3 + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].name = "[M+zH]+ xxx-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - CO - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "N-3H-9"; + + // initialize precursor ion - CO - CO - H2O - H2O - NH3 + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].name = "[M+zH]+ **x-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION - CO - CO - H2O - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-4O-2" + "N-1H-3"; + + // initialize precursor ion - CO - CO - H2O - NH3 - NH3 + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].name = "[M+zH]+ *xx-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - CO - H2O - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].parent = precursor_ion_co_loss; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-2O-1" + "N-2H-6"; + + // initialize precursor ion - CO - CO - H2O - H2O - H2O - H2O + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ****-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION - CO - CO - H2O - H2O - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-8O-4"; + + // initialize precursor ion - CO - CO - NH3 - NH3 - NH3 - NH3 + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].name = "[M+zH]+ xxxx-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - CO - NH3 - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "N-4H-12"; + + // initialize precursor ion - CO - CO - H2O - H2O - H2O - NH3 + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].name = "[M+zH]+ ***x-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION - CO - CO - H2O - H2O - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-6O-3" + "N-1H-3"; + + // initialize precursor ion - CO - CO - H2O - H2O - NH3 - NH3 + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].name = "[M+zH]+ **xx-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - CO - H2O - H2O - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-4O-2" + "N-2H-6"; + + // initialize precursor ion - CO - CO - H2O - NH3 - NH3 - NH3 + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].name = "[M+zH]+ *xxx-CO-CO"; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION - CO - CO - H2O - NH3 - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].parent = precursor_ion; + fragmentions[precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[precursor_ion].summary + "C-2O-2" + "H-2O-1" + "N-3H-9"; // initialize cyclic precursor ion fragmentions[cyclic_precursor_ion].nterminal = false; @@ -1733,6 +2588,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_precursor_ion].name = "[M+zH]+"; fragmentions[cyclic_precursor_ion].massdifference = PRECURSOR_ION_CYCLIC + adductshift; fragmentions[cyclic_precursor_ion].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion].summary = "H+" + adductshiftsummary; // initialize cyclic precursor ion - H2O fragmentions[cyclic_precursor_ion_dehydrated].nterminal = false; @@ -1740,6 +2596,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_precursor_ion_dehydrated].name = "[M+zH]+ *"; fragmentions[cyclic_precursor_ion_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - H2O + adductshift; fragmentions[cyclic_precursor_ion_dehydrated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "H-2O-1"; // initialize cyclic precursor ion - NH3 fragmentions[cyclic_precursor_ion_deamidated].nterminal = false; @@ -1747,13 +2604,103 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_precursor_ion_deamidated].name = "[M+zH]+ x"; fragmentions[cyclic_precursor_ion_deamidated].massdifference = PRECURSOR_ION_CYCLIC - NH3 + adductshift; fragmentions[cyclic_precursor_ion_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "N-1H-3"; + + // initialize cyclic precursor ion - H2O - H2O + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated].name = "[M+zH]+ **"; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize cyclic precursor ion - NH3 - NH3 + fragmentions[cyclic_precursor_ion_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_deamidated_deamidated].name = "[M+zH]+ xx"; + fragmentions[cyclic_precursor_ion_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_deamidated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "N-1H-3" + "N-1H-3"; // initialize cyclic precursor ion - H2O - NH3 - fragmentions[cyclic_precursor_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[cyclic_precursor_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[cyclic_precursor_ion_dehydrated_and_deamidated].name = "[M+zH]+ *x"; - fragmentions[cyclic_precursor_ion_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_CYCLIC - H2O - NH3 + adductshift; - fragmentions[cyclic_precursor_ion_dehydrated_and_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated].name = "[M+zH]+ *x"; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "H-2O-1" + "N-1H-3"; + + // initialize cyclic precursor ion - H2O - H2O - H2O + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ***"; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - H2O - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "H-6O-3"; + + // initialize cyclic precursor ion - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated].name = "[M+zH]+ xxx"; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "N-3H-9"; + + // initialize cyclic precursor ion - H2O - H2O - NH3 + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated].name = "[M+zH]+ **x"; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - H2O - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "H-4O-2" + "N-1H-3"; + + // initialize cyclic precursor ion - H2O - NH3 - NH3 + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated].name = "[M+zH]+ *xx"; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - H2O - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "H-2O-1" + "N-2H-6"; + + // initialize cyclic precursor ion - H2O - H2O - H2O - H2O + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ****"; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - H2O - H2O - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "H-8O-4"; + + // initialize cyclic precursor ion - NH3 - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated_deamidated].name = "[M+zH]+ xxxx"; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - NH3 - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "N-4H-12"; + + // initialize cyclic precursor ion - H2O - H2O - H2O - NH3 + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].name = "[M+zH]+ ***x"; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - H2O - H2O - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "H-6O-3" + "N-1H-3"; + + // initialize cyclic precursor ion - H2O - H2O - NH3 - NH3 + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated_deamidated].name = "[M+zH]+ **xx"; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - H2O - H2O - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "H-4O-2" + "N-2H-6"; + + // initialize cyclic precursor ion - H2O - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated_deamidated].name = "[M+zH]+ *xxx"; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - H2O - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "H-2O-1" + "N-3H-9"; // initialize cyclic precursor ion - CO fragmentions[cyclic_precursor_ion_co_loss].nterminal = false; @@ -1761,27 +2708,239 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_precursor_ion_co_loss].name = "[M+zH]+ -CO"; fragmentions[cyclic_precursor_ion_co_loss].massdifference = PRECURSOR_ION_CYCLIC - CO + adductshift; fragmentions[cyclic_precursor_ion_co_loss].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_co_loss].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1"; // initialize cyclic precursor ion - CO - H2O - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated].nterminal = false; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated].cterminal = false; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated].name = "[M+zH]+ *-CO"; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O + adductshift; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated].name = "[M+zH]+ *-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-2O-1"; // initialize cyclic precursor ion - CO - NH3 - fragmentions[cyclic_precursor_ion_co_loss_and_deamidated].nterminal = false; - fragmentions[cyclic_precursor_ion_co_loss_and_deamidated].cterminal = false; - fragmentions[cyclic_precursor_ion_co_loss_and_deamidated].name = "[M+zH]+ x-CO"; - fragmentions[cyclic_precursor_ion_co_loss_and_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - NH3 + adductshift; - fragmentions[cyclic_precursor_ion_co_loss_and_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated].name = "[M+zH]+ x-CO"; + fragmentions[cyclic_precursor_ion_co_loss_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - H2O - H2O + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize cyclic precursor ion - CO - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO"; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize cyclic precursor ion - CO - H2O - NH3 - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated].nterminal = false; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated].cterminal = false; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated].name = "[M+zH]+ *x-CO"; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - NH3 + adductshift; - fragmentions[cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - H2O - H2O - H2O + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ***-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-6O-3"; + + // initialize cyclic precursor ion - CO - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated].name = "[M+zH]+ xxx-CO"; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "N-3H-9"; + + // initialize cyclic precursor ion - CO - H2O - H2O - NH3 + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated].name = "[M+zH]+ **x-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-4O-2" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - H2O - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated].name = "[M+zH]+ *xx-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-2O-1" + "N-2H-6"; + + // initialize cyclic precursor ion - CO - H2O - H2O - H2O - H2O + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ****-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - H2O - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-8O-4"; + + // initialize cyclic precursor ion - CO - NH3 - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].name = "[M+zH]+ xxxx-CO"; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - NH3 - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "N-4H-12"; + + // initialize cyclic precursor ion - CO - H2O - H2O - H2O - NH3 + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].name = "[M+zH]+ ***x-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - H2O - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-6O-3" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - H2O - H2O - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].name = "[M+zH]+ **xx-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - H2O - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-4O-2" + "N-2H-6"; + + // initialize cyclic precursor ion - CO - H2O - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].name = "[M+zH]+ *xxx-CO"; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - H2O - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-1O-1" + "H-2O-1" + "N-3H-9"; + + // initialize cyclic precursor ion - CO - CO + fragmentions[cyclic_precursor_ion_co_loss_co_loss].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss].name = "[M+zH]+ -CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss].massdifference = PRECURSOR_ION_CYCLIC - CO - CO + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss].parent = cyclic_precursor_ion; + fragmentions[cyclic_precursor_ion_co_loss_co_loss].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2"; + + // initialize cyclic precursor ion - CO - CO - H2O + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated].name = "[M+zH]+ *-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-2O-1"; + + // initialize cyclic precursor ion - CO - CO - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated].name = "[M+zH]+ x-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - CO - H2O - H2O + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-2O-1" + "H-2O-1"; + + // initialize cyclic precursor ion - CO - CO - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "N-1H-3" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - CO - H2O - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-2O-1" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - CO - H2O - H2O - H2O + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ***-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-6O-3"; + + // initialize cyclic precursor ion - CO - CO - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].name = "[M+zH]+ xxx-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "N-3H-9"; + + // initialize cyclic precursor ion - CO - CO - H2O - H2O - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].name = "[M+zH]+ **x-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-4O-2" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - CO - H2O - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].name = "[M+zH]+ *xx-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-2O-1" + "N-2H-6"; + + // initialize cyclic precursor ion - CO - CO - H2O - H2O - H2O - H2O + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].name = "[M+zH]+ ****-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - H2O - H2O - H2O + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-8O-4"; + + // initialize cyclic precursor ion - CO - CO - NH3 - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].name = "[M+zH]+ xxxx-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - NH3 - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "N-4H-12"; + + // initialize cyclic precursor ion - CO - CO - H2O - H2O - H2O - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].name = "[M+zH]+ ***x-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - H2O - H2O - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-6O-3" + "N-1H-3"; + + // initialize cyclic precursor ion - CO - CO - H2O - H2O - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].name = "[M+zH]+ **xx-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - H2O - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-4O-2" + "N-2H-6"; + + // initialize cyclic precursor ion - CO - CO - H2O - NH3 - NH3 - NH3 + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].name = "[M+zH]+ *xxx-CO-CO"; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].massdifference = PRECURSOR_ION_CYCLIC - CO - CO - H2O - NH3 - NH3 - NH3 + adductshift; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].parent = cyclic_precursor_ion_co_loss; + fragmentions[cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated].summary = fragmentions[cyclic_precursor_ion].summary + "C-2O-2" + "H-2O-1" + "N-3H-9"; // initialize ion [M+H]+ fragmentions[ms_Hplus].nterminal = true; @@ -2003,6 +3162,16 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[ms_3M2Fe7H].multiplier = 3; fragmentions[ms_3M2Fe7H].summary = "Fe2H-6H-1+-1"; + // initialize ion [M+NH4]+ + fragmentions[ms_NH4plus].nterminal = true; + fragmentions[ms_NH4plus].cterminal = true; + fragmentions[ms_NH4plus].name = "[M+NH4]+"; + fragmentions[ms_NH4plus].massdifference = H + NH3 - e; + fragmentions[ms_NH4plus].parent = ms_NH4plus; + fragmentions[ms_NH4plus].positive = true; + fragmentions[ms_NH4plus].multiplier = 1; + fragmentions[ms_NH4plus].summary = "NH4+"; + // initialize ion Li+ fragmentions[ms_liplus].nterminal = true; fragmentions[ms_liplus].cterminal = true; @@ -2093,6 +3262,46 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[ms_MAl4H].multiplier = 1; fragmentions[ms_MAl4H].summary = "AlH-3H-1+-1"; + // initialize ion [M+Si-3H]+ + fragmentions[ms_MSi3H].nterminal = true; + fragmentions[ms_MSi3H].cterminal = true; + fragmentions[ms_MSi3H].name = "[M+Si-3H]+"; + fragmentions[ms_MSi3H].massdifference = Si - 4 * H + H - e; + fragmentions[ms_MSi3H].parent = ms_MSi3H; + fragmentions[ms_MSi3H].positive = true; + fragmentions[ms_MSi3H].multiplier = 1; + fragmentions[ms_MSi3H].summary = "SiH-4H+"; + + // initialize ion [M+Si-4H+Na]+ + fragmentions[ms_MSi4HNa].nterminal = true; + fragmentions[ms_MSi4HNa].cterminal = true; + fragmentions[ms_MSi4HNa].name = "[M+Si-4H+Na]+"; + fragmentions[ms_MSi4HNa].massdifference = Si - 4 * H + Na - e; + fragmentions[ms_MSi4HNa].parent = ms_MSi4HNa; + fragmentions[ms_MSi4HNa].positive = true; + fragmentions[ms_MSi4HNa].multiplier = 1; + fragmentions[ms_MSi4HNa].summary = "SiH-4Na+"; + + // initialize ion [M+Si-4H+K]+ + fragmentions[ms_MSi4HK].nterminal = true; + fragmentions[ms_MSi4HK].cterminal = true; + fragmentions[ms_MSi4HK].name = "[M+Si-4H+K]+"; + fragmentions[ms_MSi4HK].massdifference = Si - 4 * H + K - e; + fragmentions[ms_MSi4HK].parent = ms_MSi4HK; + fragmentions[ms_MSi4HK].positive = true; + fragmentions[ms_MSi4HK].multiplier = 1; + fragmentions[ms_MSi4HK].summary = "SiH-4K+"; + + // initialize ion [M+Si-5H]- + fragmentions[ms_MSi5H].nterminal = true; + fragmentions[ms_MSi5H].cterminal = true; + fragmentions[ms_MSi5H].name = "[M+Si-5H]-"; + fragmentions[ms_MSi5H].massdifference = Si - 4 * H - H + e; + fragmentions[ms_MSi5H].parent = ms_MSi5H; + fragmentions[ms_MSi5H].positive = false; + fragmentions[ms_MSi5H].multiplier = 1; + fragmentions[ms_MSi5H].summary = "SiH-4H-1+-1"; + // initialize ion [M+Ca-H]+ fragmentions[ms_MCaH].nterminal = true; fragmentions[ms_MCaH].cterminal = true; @@ -2453,22 +3662,13 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[ms_MGa4H].multiplier = 1; fragmentions[ms_MGa4H].summary = "GaH-3H-1+-1"; - // initialize ion [M+NH4]+ - fragmentions[ms_NH4plus].nterminal = true; - fragmentions[ms_NH4plus].cterminal = true; - fragmentions[ms_NH4plus].name = "[M+NH4]+"; - fragmentions[ms_NH4plus].massdifference = H + NH3 - e; - fragmentions[ms_NH4plus].parent = ms_NH4plus; - fragmentions[ms_NH4plus].positive = true; - fragmentions[ms_NH4plus].multiplier = 1; - fragmentions[ms_NH4plus].summary = "NH4+"; - // initialize l0h ion fragmentions[l0h_ion].nterminal = true; fragmentions[l0h_ion].cterminal = false; fragmentions[l0h_ion].name = "LB-2H"; fragmentions[l0h_ion].massdifference = L0H_ION + adductshift; fragmentions[l0h_ion].parent = l0h_ion; + fragmentions[l0h_ion].summary = "H-2H+" + adductshiftsummary; // initialize l0h-H2O ion fragmentions[l0h_ion_dehydrated].nterminal = true; @@ -2476,6 +3676,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l0h_ion_dehydrated].name = "LB*-2H"; fragmentions[l0h_ion_dehydrated].massdifference = L0H_ION - H2O + adductshift; fragmentions[l0h_ion_dehydrated].parent = l0h_ion; + fragmentions[l0h_ion_dehydrated].summary = fragmentions[l0h_ion].summary + "H-2O-1"; // initialize l0h-NH3 ion fragmentions[l0h_ion_deamidated].nterminal = true; @@ -2483,13 +3684,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l0h_ion_deamidated].name = "LBx-2H"; fragmentions[l0h_ion_deamidated].massdifference = L0H_ION - NH3 + adductshift; fragmentions[l0h_ion_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_deamidated].summary = fragmentions[l0h_ion].summary + "N-1H-3"; + + // initialize l0h-H2O-H2O ion + fragmentions[l0h_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[l0h_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[l0h_ion_dehydrated_dehydrated].name = "LB**-2H"; + fragmentions[l0h_ion_dehydrated_dehydrated].massdifference = L0H_ION - H2O - H2O + adductshift; + fragmentions[l0h_ion_dehydrated_dehydrated].parent = l0h_ion; + fragmentions[l0h_ion_dehydrated_dehydrated].summary = fragmentions[l0h_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize l0h-NH3-NH3 ion + fragmentions[l0h_ion_deamidated_deamidated].nterminal = true; + fragmentions[l0h_ion_deamidated_deamidated].cterminal = false; + fragmentions[l0h_ion_deamidated_deamidated].name = "LBxx-2H"; + fragmentions[l0h_ion_deamidated_deamidated].massdifference = L0H_ION - NH3 - NH3 + adductshift; + fragmentions[l0h_ion_deamidated_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_deamidated_deamidated].summary = fragmentions[l0h_ion].summary + "N-1H-3" + "N-1H-3"; // initialize l0h-H2O-NH3 ion - fragmentions[l0h_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[l0h_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[l0h_ion_dehydrated_and_deamidated].name = "LB*x-2H"; - fragmentions[l0h_ion_dehydrated_and_deamidated].massdifference = L0H_ION - H2O - NH3 + adductshift; - fragmentions[l0h_ion_dehydrated_and_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_dehydrated_deamidated].nterminal = true; + fragmentions[l0h_ion_dehydrated_deamidated].cterminal = false; + fragmentions[l0h_ion_dehydrated_deamidated].name = "LB*x-2H"; + fragmentions[l0h_ion_dehydrated_deamidated].massdifference = L0H_ION - H2O - NH3 + adductshift; + fragmentions[l0h_ion_dehydrated_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_dehydrated_deamidated].summary = fragmentions[l0h_ion].summary + "H-2O-1" + "N-1H-3"; // initialize l0h-CO ion fragmentions[l0h_ion_co_loss].nterminal = true; @@ -2497,6 +3716,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l0h_ion_co_loss].name = "LB-2H-CO"; fragmentions[l0h_ion_co_loss].massdifference = L0H_ION - CO + adductshift; fragmentions[l0h_ion_co_loss].parent = l0h_ion; + fragmentions[l0h_ion_co_loss].summary = fragmentions[l0h_ion].summary + "C-1O-1"; // initialize l0h-CO-H2O ion fragmentions[l0h_ion_co_loss_dehydrated].nterminal = true; @@ -2504,6 +3724,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l0h_ion_co_loss_dehydrated].name = "LB*-2H-CO"; fragmentions[l0h_ion_co_loss_dehydrated].massdifference = L0H_ION - CO - H2O + adductshift; fragmentions[l0h_ion_co_loss_dehydrated].parent = l0h_ion; + fragmentions[l0h_ion_co_loss_dehydrated].summary = fragmentions[l0h_ion].summary + "C-1O-1" + "H-2O-1"; // initialize l0h-CO-NH3 ion fragmentions[l0h_ion_co_loss_deamidated].nterminal = true; @@ -2511,13 +3732,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l0h_ion_co_loss_deamidated].name = "LBx-2H-CO"; fragmentions[l0h_ion_co_loss_deamidated].massdifference = L0H_ION - CO - NH3 + adductshift; fragmentions[l0h_ion_co_loss_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_co_loss_deamidated].summary = fragmentions[l0h_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize l0h-CO-H2O-H2O ion + fragmentions[l0h_ion_co_loss_dehydrated_dehydrated].nterminal = true; + fragmentions[l0h_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[l0h_ion_co_loss_dehydrated_dehydrated].name = "LB**-2H-CO"; + fragmentions[l0h_ion_co_loss_dehydrated_dehydrated].massdifference = L0H_ION - CO - H2O - H2O + adductshift; + fragmentions[l0h_ion_co_loss_dehydrated_dehydrated].parent = l0h_ion; + fragmentions[l0h_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[l0h_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize l0h-CO-NH3-NH3 ion + fragmentions[l0h_ion_co_loss_deamidated_deamidated].nterminal = true; + fragmentions[l0h_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[l0h_ion_co_loss_deamidated_deamidated].name = "LBxx-2H-CO"; + fragmentions[l0h_ion_co_loss_deamidated_deamidated].massdifference = L0H_ION - CO - NH3 - NH3 + adductshift; + fragmentions[l0h_ion_co_loss_deamidated_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_co_loss_deamidated_deamidated].summary = fragmentions[l0h_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize l0h-CO-H2O-NH3 ion - fragmentions[l0h_ion_co_loss_dehydrated_and_deamidated].nterminal = true; - fragmentions[l0h_ion_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[l0h_ion_co_loss_dehydrated_and_deamidated].name = "LB*x-2H-CO"; - fragmentions[l0h_ion_co_loss_dehydrated_and_deamidated].massdifference = L0H_ION - CO - H2O - NH3 + adductshift; - fragmentions[l0h_ion_co_loss_dehydrated_and_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_co_loss_dehydrated_deamidated].nterminal = true; + fragmentions[l0h_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[l0h_ion_co_loss_dehydrated_deamidated].name = "LB*x-2H-CO"; + fragmentions[l0h_ion_co_loss_dehydrated_deamidated].massdifference = L0H_ION - CO - H2O - NH3 + adductshift; + fragmentions[l0h_ion_co_loss_dehydrated_deamidated].parent = l0h_ion; + fragmentions[l0h_ion_co_loss_dehydrated_deamidated].summary = fragmentions[l0h_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize l1h ion fragmentions[l1h_ion].nterminal = true; @@ -2533,6 +3772,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1h_ion_dehydrated].name = "LB*"; fragmentions[l1h_ion_dehydrated].massdifference = L1H_ION - H2O + adductshift; fragmentions[l1h_ion_dehydrated].parent = l1h_ion; + fragmentions[l1h_ion_dehydrated].summary = fragmentions[l1h_ion].summary + "H-2O-1"; // initialize l1h-NH3 ion fragmentions[l1h_ion_deamidated].nterminal = true; @@ -2540,13 +3780,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1h_ion_deamidated].name = "LBx"; fragmentions[l1h_ion_deamidated].massdifference = L1H_ION - NH3 + adductshift; fragmentions[l1h_ion_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_deamidated].summary = fragmentions[l1h_ion].summary + "N-1H-3"; + + // initialize l1h-H2O-H2O ion + fragmentions[l1h_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[l1h_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[l1h_ion_dehydrated_dehydrated].name = "LB**"; + fragmentions[l1h_ion_dehydrated_dehydrated].massdifference = L1H_ION - H2O - H2O + adductshift; + fragmentions[l1h_ion_dehydrated_dehydrated].parent = l1h_ion; + fragmentions[l1h_ion_dehydrated_dehydrated].summary = fragmentions[l1h_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize l1h-NH3-NH3 ion + fragmentions[l1h_ion_deamidated_deamidated].nterminal = true; + fragmentions[l1h_ion_deamidated_deamidated].cterminal = false; + fragmentions[l1h_ion_deamidated_deamidated].name = "LBxx"; + fragmentions[l1h_ion_deamidated_deamidated].massdifference = L1H_ION - NH3 - NH3 + adductshift; + fragmentions[l1h_ion_deamidated_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_deamidated_deamidated].summary = fragmentions[l1h_ion].summary + "N-1H-3" + "N-1H-3"; // initialize l1h-H2O-NH3 ion - fragmentions[l1h_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[l1h_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[l1h_ion_dehydrated_and_deamidated].name = "LB*x"; - fragmentions[l1h_ion_dehydrated_and_deamidated].massdifference = L1H_ION - H2O - NH3 + adductshift; - fragmentions[l1h_ion_dehydrated_and_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_dehydrated_deamidated].nterminal = true; + fragmentions[l1h_ion_dehydrated_deamidated].cterminal = false; + fragmentions[l1h_ion_dehydrated_deamidated].name = "LB*x"; + fragmentions[l1h_ion_dehydrated_deamidated].massdifference = L1H_ION - H2O - NH3 + adductshift; + fragmentions[l1h_ion_dehydrated_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_dehydrated_deamidated].summary = fragmentions[l1h_ion].summary + "H-2O-1" + "N-1H-3"; // initialize l1h-CO ion fragmentions[l1h_ion_co_loss].nterminal = true; @@ -2554,6 +3812,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1h_ion_co_loss].name = "LB-CO"; fragmentions[l1h_ion_co_loss].massdifference = L1H_ION - CO + adductshift; fragmentions[l1h_ion_co_loss].parent = l1h_ion; + fragmentions[l1h_ion_co_loss].summary = fragmentions[l1h_ion].summary + "C-1O-1"; // initialize l1h-CO-H2O ion fragmentions[l1h_ion_co_loss_dehydrated].nterminal = true; @@ -2561,6 +3820,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1h_ion_co_loss_dehydrated].name = "LB*-CO"; fragmentions[l1h_ion_co_loss_dehydrated].massdifference = L1H_ION - CO - H2O + adductshift; fragmentions[l1h_ion_co_loss_dehydrated].parent = l1h_ion; + fragmentions[l1h_ion_co_loss_dehydrated].summary = fragmentions[l1h_ion].summary + "C-1O-1" + "H-2O-1"; // initialize l1h-CO-NH3 ion fragmentions[l1h_ion_co_loss_deamidated].nterminal = true; @@ -2568,13 +3828,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1h_ion_co_loss_deamidated].name = "LBx-CO"; fragmentions[l1h_ion_co_loss_deamidated].massdifference = L1H_ION - CO - NH3 + adductshift; fragmentions[l1h_ion_co_loss_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_co_loss_deamidated].summary = fragmentions[l1h_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize l1h-CO-H2O-H2O ion + fragmentions[l1h_ion_co_loss_dehydrated_dehydrated].nterminal = true; + fragmentions[l1h_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[l1h_ion_co_loss_dehydrated_dehydrated].name = "LB**-CO"; + fragmentions[l1h_ion_co_loss_dehydrated_dehydrated].massdifference = L1H_ION - CO - H2O - H2O + adductshift; + fragmentions[l1h_ion_co_loss_dehydrated_dehydrated].parent = l1h_ion; + fragmentions[l1h_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[l1h_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize l1h-CO-NH3-NH3 ion + fragmentions[l1h_ion_co_loss_deamidated_deamidated].nterminal = true; + fragmentions[l1h_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[l1h_ion_co_loss_deamidated_deamidated].name = "LBxx-CO"; + fragmentions[l1h_ion_co_loss_deamidated_deamidated].massdifference = L1H_ION - CO - NH3 - NH3 + adductshift; + fragmentions[l1h_ion_co_loss_deamidated_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_co_loss_deamidated_deamidated].summary = fragmentions[l1h_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize l1h-CO-H2O-NH3 ion - fragmentions[l1h_ion_co_loss_dehydrated_and_deamidated].nterminal = true; - fragmentions[l1h_ion_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[l1h_ion_co_loss_dehydrated_and_deamidated].name = "LB*x-CO"; - fragmentions[l1h_ion_co_loss_dehydrated_and_deamidated].massdifference = L1H_ION - CO - H2O - NH3 + adductshift; - fragmentions[l1h_ion_co_loss_dehydrated_and_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_co_loss_dehydrated_deamidated].nterminal = true; + fragmentions[l1h_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[l1h_ion_co_loss_dehydrated_deamidated].name = "LB*x-CO"; + fragmentions[l1h_ion_co_loss_dehydrated_deamidated].massdifference = L1H_ION - CO - H2O - NH3 + adductshift; + fragmentions[l1h_ion_co_loss_dehydrated_deamidated].parent = l1h_ion; + fragmentions[l1h_ion_co_loss_dehydrated_deamidated].summary = fragmentions[l1h_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize l2h ion fragmentions[l2h_ion].nterminal = true; @@ -2590,6 +3868,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2h_ion_dehydrated].name = "LB*+2H"; fragmentions[l2h_ion_dehydrated].massdifference = L2H_ION - H2O + adductshift; fragmentions[l2h_ion_dehydrated].parent = l2h_ion; + fragmentions[l2h_ion_dehydrated].summary = fragmentions[l2h_ion].summary + "H-2O-1"; // initialize l2h-NH3 ion fragmentions[l2h_ion_deamidated].nterminal = true; @@ -2597,13 +3876,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2h_ion_deamidated].name = "LBx+2H"; fragmentions[l2h_ion_deamidated].massdifference = L2H_ION - NH3 + adductshift; fragmentions[l2h_ion_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_deamidated].summary = fragmentions[l2h_ion].summary + "N-1H-3"; + + // initialize l2h-H2O-H2O ion + fragmentions[l2h_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[l2h_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[l2h_ion_dehydrated_dehydrated].name = "LB**+2H"; + fragmentions[l2h_ion_dehydrated_dehydrated].massdifference = L2H_ION - H2O - H2O + adductshift; + fragmentions[l2h_ion_dehydrated_dehydrated].parent = l2h_ion; + fragmentions[l2h_ion_dehydrated_dehydrated].summary = fragmentions[l2h_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize l2h-NH3-NH3 ion + fragmentions[l2h_ion_deamidated_deamidated].nterminal = true; + fragmentions[l2h_ion_deamidated_deamidated].cterminal = false; + fragmentions[l2h_ion_deamidated_deamidated].name = "LBxx+2H"; + fragmentions[l2h_ion_deamidated_deamidated].massdifference = L2H_ION - NH3 - NH3 + adductshift; + fragmentions[l2h_ion_deamidated_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_deamidated_deamidated].summary = fragmentions[l2h_ion].summary + "N-1H-3" + "N-1H-3"; // initialize l2h-H2O-NH3 ion - fragmentions[l2h_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[l2h_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[l2h_ion_dehydrated_and_deamidated].name = "LB*x+2H"; - fragmentions[l2h_ion_dehydrated_and_deamidated].massdifference = L2H_ION - H2O - NH3 + adductshift; - fragmentions[l2h_ion_dehydrated_and_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_dehydrated_deamidated].nterminal = true; + fragmentions[l2h_ion_dehydrated_deamidated].cterminal = false; + fragmentions[l2h_ion_dehydrated_deamidated].name = "LB*x+2H"; + fragmentions[l2h_ion_dehydrated_deamidated].massdifference = L2H_ION - H2O - NH3 + adductshift; + fragmentions[l2h_ion_dehydrated_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_dehydrated_deamidated].summary = fragmentions[l2h_ion].summary + "H-2O-1" + "N-1H-3"; // initialize l2h-CO ion fragmentions[l2h_ion_co_loss].nterminal = true; @@ -2611,6 +3908,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2h_ion_co_loss].name = "LB+2H-CO"; fragmentions[l2h_ion_co_loss].massdifference = L2H_ION - CO + adductshift; fragmentions[l2h_ion_co_loss].parent = l2h_ion; + fragmentions[l2h_ion_co_loss].summary = fragmentions[l2h_ion].summary + "C-1O-1"; // initialize l2h-CO-H2O ion fragmentions[l2h_ion_co_loss_dehydrated].nterminal = true; @@ -2618,6 +3916,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2h_ion_co_loss_dehydrated].name = "LB*+2H-CO"; fragmentions[l2h_ion_co_loss_dehydrated].massdifference = L2H_ION - CO - H2O + adductshift; fragmentions[l2h_ion_co_loss_dehydrated].parent = l2h_ion; + fragmentions[l2h_ion_co_loss_dehydrated].summary = fragmentions[l2h_ion].summary + "C-1O-1" + "H-2O-1"; // initialize l2h-CO-NH3 ion fragmentions[l2h_ion_co_loss_deamidated].nterminal = true; @@ -2625,13 +3924,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2h_ion_co_loss_deamidated].name = "LBx+2H-CO"; fragmentions[l2h_ion_co_loss_deamidated].massdifference = L2H_ION - CO - NH3 + adductshift; fragmentions[l2h_ion_co_loss_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_co_loss_deamidated].summary = fragmentions[l2h_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize l2h-CO-H2O-H2O ion + fragmentions[l2h_ion_co_loss_dehydrated_dehydrated].nterminal = true; + fragmentions[l2h_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[l2h_ion_co_loss_dehydrated_dehydrated].name = "LB**+2H-CO"; + fragmentions[l2h_ion_co_loss_dehydrated_dehydrated].massdifference = L2H_ION - CO - H2O - H2O + adductshift; + fragmentions[l2h_ion_co_loss_dehydrated_dehydrated].parent = l2h_ion; + fragmentions[l2h_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[l2h_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize l2h-CO-NH3-NH3 ion + fragmentions[l2h_ion_co_loss_deamidated_deamidated].nterminal = true; + fragmentions[l2h_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[l2h_ion_co_loss_deamidated_deamidated].name = "LBxx+2H-CO"; + fragmentions[l2h_ion_co_loss_deamidated_deamidated].massdifference = L2H_ION - CO - NH3 - NH3 + adductshift; + fragmentions[l2h_ion_co_loss_deamidated_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_co_loss_deamidated_deamidated].summary = fragmentions[l2h_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize l2h-CO-H2O-NH3 ion - fragmentions[l2h_ion_co_loss_dehydrated_and_deamidated].nterminal = true; - fragmentions[l2h_ion_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[l2h_ion_co_loss_dehydrated_and_deamidated].name = "LB*x+2H-CO"; - fragmentions[l2h_ion_co_loss_dehydrated_and_deamidated].massdifference = L2H_ION - CO - H2O - NH3 + adductshift; - fragmentions[l2h_ion_co_loss_dehydrated_and_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_co_loss_dehydrated_deamidated].nterminal = true; + fragmentions[l2h_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[l2h_ion_co_loss_dehydrated_deamidated].name = "LB*x+2H-CO"; + fragmentions[l2h_ion_co_loss_dehydrated_deamidated].massdifference = L2H_ION - CO - H2O - NH3 + adductshift; + fragmentions[l2h_ion_co_loss_dehydrated_deamidated].parent = l2h_ion; + fragmentions[l2h_ion_co_loss_dehydrated_deamidated].summary = fragmentions[l2h_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize r1h ion fragmentions[r1h_ion].nterminal = true; @@ -2639,6 +3956,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1h_ion].name = "RB"; fragmentions[r1h_ion].massdifference = R1H_ION + adductshift; fragmentions[r1h_ion].parent = r1h_ion; + fragmentions[r1h_ion].summary = "H+" + adductshiftsummary; // initialize r1h-H2O ion fragmentions[r1h_ion_dehydrated].nterminal = true; @@ -2646,6 +3964,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1h_ion_dehydrated].name = "RB*"; fragmentions[r1h_ion_dehydrated].massdifference = R1H_ION - H2O + adductshift; fragmentions[r1h_ion_dehydrated].parent = r1h_ion; + fragmentions[r1h_ion_dehydrated].summary = fragmentions[r1h_ion].summary + "H-2O-1"; // initialize r1h-NH3 ion fragmentions[r1h_ion_deamidated].nterminal = true; @@ -2653,13 +3972,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1h_ion_deamidated].name = "RBx"; fragmentions[r1h_ion_deamidated].massdifference = R1H_ION - NH3 + adductshift; fragmentions[r1h_ion_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_deamidated].summary = fragmentions[r1h_ion].summary + "N-1H-3"; + + // initialize r1h-H2O-H2O ion + fragmentions[r1h_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[r1h_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[r1h_ion_dehydrated_dehydrated].name = "RB**"; + fragmentions[r1h_ion_dehydrated_dehydrated].massdifference = R1H_ION - H2O - H2O + adductshift; + fragmentions[r1h_ion_dehydrated_dehydrated].parent = r1h_ion; + fragmentions[r1h_ion_dehydrated_dehydrated].summary = fragmentions[r1h_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize r1h-NH3-NH3 ion + fragmentions[r1h_ion_deamidated_deamidated].nterminal = true; + fragmentions[r1h_ion_deamidated_deamidated].cterminal = false; + fragmentions[r1h_ion_deamidated_deamidated].name = "RBxx"; + fragmentions[r1h_ion_deamidated_deamidated].massdifference = R1H_ION - NH3 - NH3 + adductshift; + fragmentions[r1h_ion_deamidated_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_deamidated_deamidated].summary = fragmentions[r1h_ion].summary + "N-1H-3" + "N-1H-3"; // initialize r1h-H2O-NH3 ion - fragmentions[r1h_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[r1h_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[r1h_ion_dehydrated_and_deamidated].name = "RB*x"; - fragmentions[r1h_ion_dehydrated_and_deamidated].massdifference = R1H_ION - H2O - NH3 + adductshift; - fragmentions[r1h_ion_dehydrated_and_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_dehydrated_deamidated].nterminal = true; + fragmentions[r1h_ion_dehydrated_deamidated].cterminal = false; + fragmentions[r1h_ion_dehydrated_deamidated].name = "RB*x"; + fragmentions[r1h_ion_dehydrated_deamidated].massdifference = R1H_ION - H2O - NH3 + adductshift; + fragmentions[r1h_ion_dehydrated_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_dehydrated_deamidated].summary = fragmentions[r1h_ion].summary + "H-2O-1" + "N-1H-3"; // initialize r1h-CO ion fragmentions[r1h_ion_co_loss].nterminal = true; @@ -2667,6 +4004,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1h_ion_co_loss].name = "RB-CO"; fragmentions[r1h_ion_co_loss].massdifference = R1H_ION - CO + adductshift; fragmentions[r1h_ion_co_loss].parent = r1h_ion; + fragmentions[r1h_ion_co_loss].summary = fragmentions[r1h_ion].summary + "C-1O-1"; // initialize r1h-CO-H2O ion fragmentions[r1h_ion_co_loss_dehydrated].nterminal = true; @@ -2674,6 +4012,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1h_ion_co_loss_dehydrated].name = "RB*-CO"; fragmentions[r1h_ion_co_loss_dehydrated].massdifference = R1H_ION - CO - H2O + adductshift; fragmentions[r1h_ion_co_loss_dehydrated].parent = r1h_ion; + fragmentions[r1h_ion_co_loss_dehydrated].summary = fragmentions[r1h_ion].summary + "C-1O-1" + "H-2O-1"; // initialize r1h-CO-NH3 ion fragmentions[r1h_ion_co_loss_deamidated].nterminal = true; @@ -2681,13 +4020,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1h_ion_co_loss_deamidated].name = "RBx-CO"; fragmentions[r1h_ion_co_loss_deamidated].massdifference = R1H_ION - CO - NH3 + adductshift; fragmentions[r1h_ion_co_loss_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_co_loss_deamidated].summary = fragmentions[r1h_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize r1h-CO-H2O-H2O ion + fragmentions[r1h_ion_co_loss_dehydrated_dehydrated].nterminal = true; + fragmentions[r1h_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[r1h_ion_co_loss_dehydrated_dehydrated].name = "RB**-CO"; + fragmentions[r1h_ion_co_loss_dehydrated_dehydrated].massdifference = R1H_ION - CO - H2O - H2O + adductshift; + fragmentions[r1h_ion_co_loss_dehydrated_dehydrated].parent = r1h_ion; + fragmentions[r1h_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[r1h_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize r1h-CO-NH3-NH3 ion + fragmentions[r1h_ion_co_loss_deamidated_deamidated].nterminal = true; + fragmentions[r1h_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[r1h_ion_co_loss_deamidated_deamidated].name = "RBxx-CO"; + fragmentions[r1h_ion_co_loss_deamidated_deamidated].massdifference = R1H_ION - CO - NH3 - NH3 + adductshift; + fragmentions[r1h_ion_co_loss_deamidated_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_co_loss_deamidated_deamidated].summary = fragmentions[r1h_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize r1h-CO-H2O-NH3 ion - fragmentions[r1h_ion_co_loss_dehydrated_and_deamidated].nterminal = true; - fragmentions[r1h_ion_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[r1h_ion_co_loss_dehydrated_and_deamidated].name = "RB*x-CO"; - fragmentions[r1h_ion_co_loss_dehydrated_and_deamidated].massdifference = R1H_ION - CO - H2O - NH3 + adductshift; - fragmentions[r1h_ion_co_loss_dehydrated_and_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_co_loss_dehydrated_deamidated].nterminal = true; + fragmentions[r1h_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[r1h_ion_co_loss_dehydrated_deamidated].name = "RB*x-CO"; + fragmentions[r1h_ion_co_loss_dehydrated_deamidated].massdifference = R1H_ION - CO - H2O - NH3 + adductshift; + fragmentions[r1h_ion_co_loss_dehydrated_deamidated].parent = r1h_ion; + fragmentions[r1h_ion_co_loss_dehydrated_deamidated].summary = fragmentions[r1h_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize r2h ion fragmentions[r2h_ion].nterminal = true; @@ -2695,6 +4052,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2h_ion].name = "RB+2H"; fragmentions[r2h_ion].massdifference = R2H_ION + adductshift; fragmentions[r2h_ion].parent = r2h_ion; + fragmentions[r2h_ion].summary = "H2H+" + adductshiftsummary; // initialize r2h-H2O ion fragmentions[r2h_ion_dehydrated].nterminal = true; @@ -2702,6 +4060,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2h_ion_dehydrated].name = "RB*+2H"; fragmentions[r2h_ion_dehydrated].massdifference = R2H_ION - H2O + adductshift; fragmentions[r2h_ion_dehydrated].parent = r2h_ion; + fragmentions[r2h_ion_dehydrated].summary = fragmentions[r2h_ion].summary + "H-2O-1"; // initialize r2h-NH3 ion fragmentions[r2h_ion_deamidated].nterminal = true; @@ -2709,13 +4068,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2h_ion_deamidated].name = "RBx+2H"; fragmentions[r2h_ion_deamidated].massdifference = R2H_ION - NH3 + adductshift; fragmentions[r2h_ion_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_deamidated].summary = fragmentions[r2h_ion].summary + "N-1H-3"; + + // initialize r2h-H2O-H2O ion + fragmentions[r2h_ion_dehydrated_dehydrated].nterminal = true; + fragmentions[r2h_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[r2h_ion_dehydrated_dehydrated].name = "RB**+2H"; + fragmentions[r2h_ion_dehydrated_dehydrated].massdifference = R2H_ION - H2O - H2O + adductshift; + fragmentions[r2h_ion_dehydrated_dehydrated].parent = r2h_ion; + fragmentions[r2h_ion_dehydrated_dehydrated].summary = fragmentions[r2h_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize r2h-NH3-NH3 ion + fragmentions[r2h_ion_deamidated_deamidated].nterminal = true; + fragmentions[r2h_ion_deamidated_deamidated].cterminal = false; + fragmentions[r2h_ion_deamidated_deamidated].name = "RBxx+2H"; + fragmentions[r2h_ion_deamidated_deamidated].massdifference = R2H_ION - NH3 - NH3 + adductshift; + fragmentions[r2h_ion_deamidated_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_deamidated_deamidated].summary = fragmentions[r2h_ion].summary + "N-1H-3" + "N-1H-3"; // initialize r2h-H2O-NH3 ion - fragmentions[r2h_ion_dehydrated_and_deamidated].nterminal = true; - fragmentions[r2h_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[r2h_ion_dehydrated_and_deamidated].name = "RB*x+2H"; - fragmentions[r2h_ion_dehydrated_and_deamidated].massdifference = R2H_ION - H2O - NH3 + adductshift; - fragmentions[r2h_ion_dehydrated_and_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_dehydrated_deamidated].nterminal = true; + fragmentions[r2h_ion_dehydrated_deamidated].cterminal = false; + fragmentions[r2h_ion_dehydrated_deamidated].name = "RB*x+2H"; + fragmentions[r2h_ion_dehydrated_deamidated].massdifference = R2H_ION - H2O - NH3 + adductshift; + fragmentions[r2h_ion_dehydrated_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_dehydrated_deamidated].summary = fragmentions[r2h_ion].summary + "H-2O-1" + "N-1H-3"; // initialize r2h-CO ion fragmentions[r2h_ion_co_loss].nterminal = true; @@ -2723,6 +4100,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2h_ion_co_loss].name = "RB+2H-CO"; fragmentions[r2h_ion_co_loss].massdifference = R2H_ION - CO + adductshift; fragmentions[r2h_ion_co_loss].parent = r2h_ion; + fragmentions[r2h_ion_co_loss].summary = fragmentions[r2h_ion].summary + "C-1O-1"; // initialize r2h-CO-H2O ion fragmentions[r2h_ion_co_loss_dehydrated].nterminal = true; @@ -2730,6 +4108,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2h_ion_co_loss_dehydrated].name = "RB*+2H-CO"; fragmentions[r2h_ion_co_loss_dehydrated].massdifference = R2H_ION - CO - H2O + adductshift; fragmentions[r2h_ion_co_loss_dehydrated].parent = r2h_ion; + fragmentions[r2h_ion_co_loss_dehydrated].summary = fragmentions[r2h_ion].summary + "C-1O-1" + "H-2O-1"; // initialize r2h-CO-NH3 ion fragmentions[r2h_ion_co_loss_deamidated].nterminal = true; @@ -2737,13 +4116,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2h_ion_co_loss_deamidated].name = "RBx+2H-CO"; fragmentions[r2h_ion_co_loss_deamidated].massdifference = R2H_ION - CO - NH3 + adductshift; fragmentions[r2h_ion_co_loss_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_co_loss_deamidated].summary = fragmentions[r2h_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize r2h-CO-H2O-H2O ion + fragmentions[r2h_ion_co_loss_dehydrated_dehydrated].nterminal = true; + fragmentions[r2h_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[r2h_ion_co_loss_dehydrated_dehydrated].name = "RB**+2H-CO"; + fragmentions[r2h_ion_co_loss_dehydrated_dehydrated].massdifference = R2H_ION - CO - H2O - H2O + adductshift; + fragmentions[r2h_ion_co_loss_dehydrated_dehydrated].parent = r2h_ion; + fragmentions[r2h_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[r2h_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize r2h-CO-NH3-NH3 ion + fragmentions[r2h_ion_co_loss_deamidated_deamidated].nterminal = true; + fragmentions[r2h_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[r2h_ion_co_loss_deamidated_deamidated].name = "RBxx+2H-CO"; + fragmentions[r2h_ion_co_loss_deamidated_deamidated].massdifference = R2H_ION - CO - NH3 - NH3 + adductshift; + fragmentions[r2h_ion_co_loss_deamidated_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_co_loss_deamidated_deamidated].summary = fragmentions[r2h_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize r2h-CO-H2O-NH3 ion - fragmentions[r2h_ion_co_loss_dehydrated_and_deamidated].nterminal = true; - fragmentions[r2h_ion_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[r2h_ion_co_loss_dehydrated_and_deamidated].name = "RB*x+2H-CO"; - fragmentions[r2h_ion_co_loss_dehydrated_and_deamidated].massdifference = R2H_ION - CO - H2O - NH3 + adductshift; - fragmentions[r2h_ion_co_loss_dehydrated_and_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_co_loss_dehydrated_deamidated].nterminal = true; + fragmentions[r2h_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[r2h_ion_co_loss_dehydrated_deamidated].name = "RB*x+2H-CO"; + fragmentions[r2h_ion_co_loss_dehydrated_deamidated].massdifference = R2H_ION - CO - H2O - NH3 + adductshift; + fragmentions[r2h_ion_co_loss_dehydrated_deamidated].parent = r2h_ion; + fragmentions[r2h_ion_co_loss_dehydrated_deamidated].summary = fragmentions[r2h_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize l1oh ion fragmentions[l1oh_ion].nterminal = false; @@ -2759,6 +4156,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1oh_ion_dehydrated].name = "LY*-2H"; fragmentions[l1oh_ion_dehydrated].massdifference = L1OH_ION - H2O + adductshift; fragmentions[l1oh_ion_dehydrated].parent = l1oh_ion; + fragmentions[l1oh_ion_dehydrated].summary = fragmentions[l1oh_ion].summary + "H-2O-1"; // initialize l1oh-NH3 ion fragmentions[l1oh_ion_deamidated].nterminal = false; @@ -2766,13 +4164,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1oh_ion_deamidated].name = "LYx-2H"; fragmentions[l1oh_ion_deamidated].massdifference = L1OH_ION - NH3 + adductshift; fragmentions[l1oh_ion_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_deamidated].summary = fragmentions[l1oh_ion].summary + "N-1H-3"; + + // initialize l1oh-H2O-H2O ion + fragmentions[l1oh_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[l1oh_ion_dehydrated_dehydrated].cterminal = true; + fragmentions[l1oh_ion_dehydrated_dehydrated].name = "LY**-2H"; + fragmentions[l1oh_ion_dehydrated_dehydrated].massdifference = L1OH_ION - H2O - H2O + adductshift; + fragmentions[l1oh_ion_dehydrated_dehydrated].parent = l1oh_ion; + fragmentions[l1oh_ion_dehydrated_dehydrated].summary = fragmentions[l1oh_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize l1oh-NH3-NH3 ion + fragmentions[l1oh_ion_deamidated_deamidated].nterminal = false; + fragmentions[l1oh_ion_deamidated_deamidated].cterminal = true; + fragmentions[l1oh_ion_deamidated_deamidated].name = "LYxx-2H"; + fragmentions[l1oh_ion_deamidated_deamidated].massdifference = L1OH_ION - NH3 - NH3 + adductshift; + fragmentions[l1oh_ion_deamidated_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_deamidated_deamidated].summary = fragmentions[l1oh_ion].summary + "N-1H-3" + "N-1H-3"; // initialize l1oh-H2O-NH3 ion - fragmentions[l1oh_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[l1oh_ion_dehydrated_and_deamidated].cterminal = true; - fragmentions[l1oh_ion_dehydrated_and_deamidated].name = "LY*x-2H"; - fragmentions[l1oh_ion_dehydrated_and_deamidated].massdifference = L1OH_ION - H2O - NH3 + adductshift; - fragmentions[l1oh_ion_dehydrated_and_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_dehydrated_deamidated].nterminal = false; + fragmentions[l1oh_ion_dehydrated_deamidated].cterminal = true; + fragmentions[l1oh_ion_dehydrated_deamidated].name = "LY*x-2H"; + fragmentions[l1oh_ion_dehydrated_deamidated].massdifference = L1OH_ION - H2O - NH3 + adductshift; + fragmentions[l1oh_ion_dehydrated_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_dehydrated_deamidated].summary = fragmentions[l1oh_ion].summary + "H-2O-1" + "N-1H-3"; // initialize l1oh-CO ion fragmentions[l1oh_ion_co_loss].nterminal = false; @@ -2780,6 +4196,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1oh_ion_co_loss].name = "LY-2H-CO"; fragmentions[l1oh_ion_co_loss].massdifference = L1OH_ION - CO + adductshift; fragmentions[l1oh_ion_co_loss].parent = l1oh_ion; + fragmentions[l1oh_ion_co_loss].summary = fragmentions[l1oh_ion].summary + "C-1O-1"; // initialize l1oh-CO-H2O ion fragmentions[l1oh_ion_co_loss_dehydrated].nterminal = false; @@ -2787,6 +4204,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1oh_ion_co_loss_dehydrated].name = "LY*-2H-CO"; fragmentions[l1oh_ion_co_loss_dehydrated].massdifference = L1OH_ION - CO - H2O + adductshift; fragmentions[l1oh_ion_co_loss_dehydrated].parent = l1oh_ion; + fragmentions[l1oh_ion_co_loss_dehydrated].summary = fragmentions[l1oh_ion].summary + "C-1O-1" + "H-2O-1"; // initialize l1oh-CO-NH3 ion fragmentions[l1oh_ion_co_loss_deamidated].nterminal = false; @@ -2794,13 +4212,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l1oh_ion_co_loss_deamidated].name = "LYx-2H-CO"; fragmentions[l1oh_ion_co_loss_deamidated].massdifference = L1OH_ION - CO - NH3 + adductshift; fragmentions[l1oh_ion_co_loss_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_co_loss_deamidated].summary = fragmentions[l1oh_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize l1oh-CO-H2O-H2O ion + fragmentions[l1oh_ion_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[l1oh_ion_co_loss_dehydrated_dehydrated].cterminal = true; + fragmentions[l1oh_ion_co_loss_dehydrated_dehydrated].name = "LY**-2H-CO"; + fragmentions[l1oh_ion_co_loss_dehydrated_dehydrated].massdifference = L1OH_ION - CO - H2O - H2O + adductshift; + fragmentions[l1oh_ion_co_loss_dehydrated_dehydrated].parent = l1oh_ion; + fragmentions[l1oh_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[l1oh_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize l1oh-CO-NH3-NH3 ion + fragmentions[l1oh_ion_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[l1oh_ion_co_loss_deamidated_deamidated].cterminal = true; + fragmentions[l1oh_ion_co_loss_deamidated_deamidated].name = "LYxx-2H-CO"; + fragmentions[l1oh_ion_co_loss_deamidated_deamidated].massdifference = L1OH_ION - CO - NH3 - NH3 + adductshift; + fragmentions[l1oh_ion_co_loss_deamidated_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_co_loss_deamidated_deamidated].summary = fragmentions[l1oh_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize l1oh-CO-H2O-NH3 ion - fragmentions[l1oh_ion_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[l1oh_ion_co_loss_dehydrated_and_deamidated].cterminal = true; - fragmentions[l1oh_ion_co_loss_dehydrated_and_deamidated].name = "LY*x-2H-CO"; - fragmentions[l1oh_ion_co_loss_dehydrated_and_deamidated].massdifference = L1OH_ION - CO - H2O - NH3 + adductshift; - fragmentions[l1oh_ion_co_loss_dehydrated_and_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[l1oh_ion_co_loss_dehydrated_deamidated].cterminal = true; + fragmentions[l1oh_ion_co_loss_dehydrated_deamidated].name = "LY*x-2H-CO"; + fragmentions[l1oh_ion_co_loss_dehydrated_deamidated].massdifference = L1OH_ION - CO - H2O - NH3 + adductshift; + fragmentions[l1oh_ion_co_loss_dehydrated_deamidated].parent = l1oh_ion; + fragmentions[l1oh_ion_co_loss_dehydrated_deamidated].summary = fragmentions[l1oh_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize l2oh ion fragmentions[l2oh_ion].nterminal = false; @@ -2816,6 +4252,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2oh_ion_dehydrated].name = "LY*"; fragmentions[l2oh_ion_dehydrated].massdifference = L2OH_ION - H2O + adductshift; fragmentions[l2oh_ion_dehydrated].parent = l2oh_ion; + fragmentions[l2oh_ion_dehydrated].summary = fragmentions[l2oh_ion].summary + "H-2O-1"; // initialize l2oh-NH3 ion fragmentions[l2oh_ion_deamidated].nterminal = false; @@ -2823,13 +4260,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2oh_ion_deamidated].name = "LYx"; fragmentions[l2oh_ion_deamidated].massdifference = L2OH_ION - NH3 + adductshift; fragmentions[l2oh_ion_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_deamidated].summary = fragmentions[l2oh_ion].summary + "N-1H-3"; + + // initialize l2oh-H2O-H2O ion + fragmentions[l2oh_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[l2oh_ion_dehydrated_dehydrated].cterminal = true; + fragmentions[l2oh_ion_dehydrated_dehydrated].name = "LY**"; + fragmentions[l2oh_ion_dehydrated_dehydrated].massdifference = L2OH_ION - H2O - H2O + adductshift; + fragmentions[l2oh_ion_dehydrated_dehydrated].parent = l2oh_ion; + fragmentions[l2oh_ion_dehydrated_dehydrated].summary = fragmentions[l2oh_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize l2oh-NH3-NH3 ion + fragmentions[l2oh_ion_deamidated_deamidated].nterminal = false; + fragmentions[l2oh_ion_deamidated_deamidated].cterminal = true; + fragmentions[l2oh_ion_deamidated_deamidated].name = "LYxx"; + fragmentions[l2oh_ion_deamidated_deamidated].massdifference = L2OH_ION - NH3 - NH3 + adductshift; + fragmentions[l2oh_ion_deamidated_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_deamidated_deamidated].summary = fragmentions[l2oh_ion].summary + "N-1H-3" + "N-1H-3"; // initialize l2oh-H2O-NH3 ion - fragmentions[l2oh_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[l2oh_ion_dehydrated_and_deamidated].cterminal = true; - fragmentions[l2oh_ion_dehydrated_and_deamidated].name = "LY*x"; - fragmentions[l2oh_ion_dehydrated_and_deamidated].massdifference = L2OH_ION - H2O - NH3 + adductshift; - fragmentions[l2oh_ion_dehydrated_and_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_dehydrated_deamidated].nterminal = false; + fragmentions[l2oh_ion_dehydrated_deamidated].cterminal = true; + fragmentions[l2oh_ion_dehydrated_deamidated].name = "LY*x"; + fragmentions[l2oh_ion_dehydrated_deamidated].massdifference = L2OH_ION - H2O - NH3 + adductshift; + fragmentions[l2oh_ion_dehydrated_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_dehydrated_deamidated].summary = fragmentions[l2oh_ion].summary + "H-2O-1" + "N-1H-3"; // initialize l2oh-CO ion fragmentions[l2oh_ion_co_loss].nterminal = false; @@ -2837,6 +4292,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2oh_ion_co_loss].name = "LY-CO"; fragmentions[l2oh_ion_co_loss].massdifference = L2OH_ION - CO + adductshift; fragmentions[l2oh_ion_co_loss].parent = l2oh_ion; + fragmentions[l2oh_ion_co_loss].summary = fragmentions[l2oh_ion].summary + "C-1O-1"; // initialize l2oh-CO-H2O ion fragmentions[l2oh_ion_co_loss_dehydrated].nterminal = false; @@ -2844,6 +4300,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2oh_ion_co_loss_dehydrated].name = "LY*-CO"; fragmentions[l2oh_ion_co_loss_dehydrated].massdifference = L2OH_ION - CO - H2O + adductshift; fragmentions[l2oh_ion_co_loss_dehydrated].parent = l2oh_ion; + fragmentions[l2oh_ion_co_loss_dehydrated].summary = fragmentions[l2oh_ion].summary + "C-1O-1" + "H-2O-1"; // initialize l2oh-CO-NH3 ion fragmentions[l2oh_ion_co_loss_deamidated].nterminal = false; @@ -2851,13 +4308,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[l2oh_ion_co_loss_deamidated].name = "LYx-CO"; fragmentions[l2oh_ion_co_loss_deamidated].massdifference = L2OH_ION - CO - NH3 + adductshift; fragmentions[l2oh_ion_co_loss_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_co_loss_deamidated].summary = fragmentions[l2oh_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize l2oh-CO-H2O-H2O ion + fragmentions[l2oh_ion_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[l2oh_ion_co_loss_dehydrated_dehydrated].cterminal = true; + fragmentions[l2oh_ion_co_loss_dehydrated_dehydrated].name = "LY**-CO"; + fragmentions[l2oh_ion_co_loss_dehydrated_dehydrated].massdifference = L2OH_ION - CO - H2O - H2O + adductshift; + fragmentions[l2oh_ion_co_loss_dehydrated_dehydrated].parent = l2oh_ion; + fragmentions[l2oh_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[l2oh_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize l2oh-CO-NH3-NH3 ion + fragmentions[l2oh_ion_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[l2oh_ion_co_loss_deamidated_deamidated].cterminal = true; + fragmentions[l2oh_ion_co_loss_deamidated_deamidated].name = "LYxx-CO"; + fragmentions[l2oh_ion_co_loss_deamidated_deamidated].massdifference = L2OH_ION - CO - NH3 - NH3 + adductshift; + fragmentions[l2oh_ion_co_loss_deamidated_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_co_loss_deamidated_deamidated].summary = fragmentions[l2oh_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize l2oh-CO-H2O-NH3 ion - fragmentions[l2oh_ion_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[l2oh_ion_co_loss_dehydrated_and_deamidated].cterminal = true; - fragmentions[l2oh_ion_co_loss_dehydrated_and_deamidated].name = "LY*x-CO"; - fragmentions[l2oh_ion_co_loss_dehydrated_and_deamidated].massdifference = L2OH_ION - CO - H2O - NH3 + adductshift; - fragmentions[l2oh_ion_co_loss_dehydrated_and_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[l2oh_ion_co_loss_dehydrated_deamidated].cterminal = true; + fragmentions[l2oh_ion_co_loss_dehydrated_deamidated].name = "LY*x-CO"; + fragmentions[l2oh_ion_co_loss_dehydrated_deamidated].massdifference = L2OH_ION - CO - H2O - NH3 + adductshift; + fragmentions[l2oh_ion_co_loss_dehydrated_deamidated].parent = l2oh_ion; + fragmentions[l2oh_ion_co_loss_dehydrated_deamidated].summary = fragmentions[l2oh_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize r1oh ion fragmentions[r1oh_ion].nterminal = false; @@ -2865,6 +4340,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1oh_ion].name = "RY-2H"; fragmentions[r1oh_ion].massdifference = R1OH_ION + adductshift; fragmentions[r1oh_ion].parent = r1oh_ion; + fragmentions[r1oh_ion].summary = "OH+" + adductshiftsummary; // initialize r1oh-H2O ion fragmentions[r1oh_ion_dehydrated].nterminal = false; @@ -2872,6 +4348,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1oh_ion_dehydrated].name = "RY*-2H"; fragmentions[r1oh_ion_dehydrated].massdifference = R1OH_ION - H2O + adductshift; fragmentions[r1oh_ion_dehydrated].parent = r1oh_ion; + fragmentions[r1oh_ion_dehydrated].summary = fragmentions[r1oh_ion].summary + "H-2O-1"; // initialize r1oh-NH3 ion fragmentions[r1oh_ion_deamidated].nterminal = false; @@ -2879,13 +4356,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1oh_ion_deamidated].name = "RYx-2H"; fragmentions[r1oh_ion_deamidated].massdifference = R1OH_ION - NH3 + adductshift; fragmentions[r1oh_ion_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_deamidated].summary = fragmentions[r1oh_ion].summary + "N-1H-3"; + + // initialize r1oh-H2O-H2O ion + fragmentions[r1oh_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[r1oh_ion_dehydrated_dehydrated].cterminal = true; + fragmentions[r1oh_ion_dehydrated_dehydrated].name = "RY**-2H"; + fragmentions[r1oh_ion_dehydrated_dehydrated].massdifference = R1OH_ION - H2O - H2O + adductshift; + fragmentions[r1oh_ion_dehydrated_dehydrated].parent = r1oh_ion; + fragmentions[r1oh_ion_dehydrated_dehydrated].summary = fragmentions[r1oh_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize r1oh-NH3-NH3 ion + fragmentions[r1oh_ion_deamidated_deamidated].nterminal = false; + fragmentions[r1oh_ion_deamidated_deamidated].cterminal = true; + fragmentions[r1oh_ion_deamidated_deamidated].name = "RYxx-2H"; + fragmentions[r1oh_ion_deamidated_deamidated].massdifference = R1OH_ION - NH3 - NH3 + adductshift; + fragmentions[r1oh_ion_deamidated_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_deamidated_deamidated].summary = fragmentions[r1oh_ion].summary + "N-1H-3" + "N-1H-3"; // initialize r1oh-H2O-NH3 ion - fragmentions[r1oh_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[r1oh_ion_dehydrated_and_deamidated].cterminal = true; - fragmentions[r1oh_ion_dehydrated_and_deamidated].name = "RY*x-2H"; - fragmentions[r1oh_ion_dehydrated_and_deamidated].massdifference = R1OH_ION - H2O - NH3 + adductshift; - fragmentions[r1oh_ion_dehydrated_and_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_dehydrated_deamidated].nterminal = false; + fragmentions[r1oh_ion_dehydrated_deamidated].cterminal = true; + fragmentions[r1oh_ion_dehydrated_deamidated].name = "RY*x-2H"; + fragmentions[r1oh_ion_dehydrated_deamidated].massdifference = R1OH_ION - H2O - NH3 + adductshift; + fragmentions[r1oh_ion_dehydrated_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_dehydrated_deamidated].summary = fragmentions[r1oh_ion].summary + "H-2O-1" + "N-1H-3"; // initialize r1oh-CO ion fragmentions[r1oh_ion_co_loss].nterminal = false; @@ -2893,6 +4388,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1oh_ion_co_loss].name = "RY-2H-CO"; fragmentions[r1oh_ion_co_loss].massdifference = R1OH_ION - CO + adductshift; fragmentions[r1oh_ion_co_loss].parent = r1oh_ion; + fragmentions[r1oh_ion_co_loss].summary = fragmentions[r1oh_ion].summary + "C-1O-1"; // initialize r1oh-CO-H2O ion fragmentions[r1oh_ion_co_loss_dehydrated].nterminal = false; @@ -2900,6 +4396,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1oh_ion_co_loss_dehydrated].name = "RY*-2H-CO"; fragmentions[r1oh_ion_co_loss_dehydrated].massdifference = R1OH_ION - CO - H2O + adductshift; fragmentions[r1oh_ion_co_loss_dehydrated].parent = r1oh_ion; + fragmentions[r1oh_ion_co_loss_dehydrated].summary = fragmentions[r1oh_ion].summary + "C-1O-1" + "H-2O-1"; // initialize r1oh-CO-NH3 ion fragmentions[r1oh_ion_co_loss_deamidated].nterminal = false; @@ -2907,13 +4404,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r1oh_ion_co_loss_deamidated].name = "RYx-2H-CO"; fragmentions[r1oh_ion_co_loss_deamidated].massdifference = R1OH_ION - CO - NH3 + adductshift; fragmentions[r1oh_ion_co_loss_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_co_loss_deamidated].summary = fragmentions[r1oh_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize r1oh-CO-H2O-H2O ion + fragmentions[r1oh_ion_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[r1oh_ion_co_loss_dehydrated_dehydrated].cterminal = true; + fragmentions[r1oh_ion_co_loss_dehydrated_dehydrated].name = "RY**-2H-CO"; + fragmentions[r1oh_ion_co_loss_dehydrated_dehydrated].massdifference = R1OH_ION - CO - H2O - H2O + adductshift; + fragmentions[r1oh_ion_co_loss_dehydrated_dehydrated].parent = r1oh_ion; + fragmentions[r1oh_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[r1oh_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize r1oh-CO-NH3-NH3 ion + fragmentions[r1oh_ion_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[r1oh_ion_co_loss_deamidated_deamidated].cterminal = true; + fragmentions[r1oh_ion_co_loss_deamidated_deamidated].name = "RYxx-2H-CO"; + fragmentions[r1oh_ion_co_loss_deamidated_deamidated].massdifference = R1OH_ION - CO - NH3 - NH3 + adductshift; + fragmentions[r1oh_ion_co_loss_deamidated_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_co_loss_deamidated_deamidated].summary = fragmentions[r1oh_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize r1oh-CO-H2O-NH3 ion - fragmentions[r1oh_ion_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[r1oh_ion_co_loss_dehydrated_and_deamidated].cterminal = true; - fragmentions[r1oh_ion_co_loss_dehydrated_and_deamidated].name = "RY*x-2H-CO"; - fragmentions[r1oh_ion_co_loss_dehydrated_and_deamidated].massdifference = R1OH_ION - CO - H2O - NH3 + adductshift; - fragmentions[r1oh_ion_co_loss_dehydrated_and_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[r1oh_ion_co_loss_dehydrated_deamidated].cterminal = true; + fragmentions[r1oh_ion_co_loss_dehydrated_deamidated].name = "RY*x-2H-CO"; + fragmentions[r1oh_ion_co_loss_dehydrated_deamidated].massdifference = R1OH_ION - CO - H2O - NH3 + adductshift; + fragmentions[r1oh_ion_co_loss_dehydrated_deamidated].parent = r1oh_ion; + fragmentions[r1oh_ion_co_loss_dehydrated_deamidated].summary = fragmentions[r1oh_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize r2oh ion fragmentions[r2oh_ion].nterminal = false; @@ -2921,6 +4436,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2oh_ion].name = "RY"; fragmentions[r2oh_ion].massdifference = R2OH_ION + adductshift; fragmentions[r2oh_ion].parent = r2oh_ion; + fragmentions[r2oh_ion].summary = "H2OH+" + adductshiftsummary; // initialize r2oh-H2O ion fragmentions[r2oh_ion_dehydrated].nterminal = false; @@ -2928,6 +4444,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2oh_ion_dehydrated].name = "RY*"; fragmentions[r2oh_ion_dehydrated].massdifference = R2OH_ION - H2O + adductshift; fragmentions[r2oh_ion_dehydrated].parent = r2oh_ion; + fragmentions[r2oh_ion_dehydrated].summary = fragmentions[r2oh_ion].summary + "H-2O-1"; // initialize r2oh-NH3 ion fragmentions[r2oh_ion_deamidated].nterminal = false; @@ -2935,13 +4452,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2oh_ion_deamidated].name = "RYx"; fragmentions[r2oh_ion_deamidated].massdifference = R2OH_ION - NH3 + adductshift; fragmentions[r2oh_ion_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_deamidated].summary = fragmentions[r2oh_ion].summary + "N-1H-3"; + + // initialize r2oh-H2O-H2O ion + fragmentions[r2oh_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[r2oh_ion_dehydrated_dehydrated].cterminal = true; + fragmentions[r2oh_ion_dehydrated_dehydrated].name = "RY**"; + fragmentions[r2oh_ion_dehydrated_dehydrated].massdifference = R2OH_ION - H2O - H2O + adductshift; + fragmentions[r2oh_ion_dehydrated_dehydrated].parent = r2oh_ion; + fragmentions[r2oh_ion_dehydrated_dehydrated].summary = fragmentions[r2oh_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize r2oh-NH3-NH3 ion + fragmentions[r2oh_ion_deamidated_deamidated].nterminal = false; + fragmentions[r2oh_ion_deamidated_deamidated].cterminal = true; + fragmentions[r2oh_ion_deamidated_deamidated].name = "RYxx"; + fragmentions[r2oh_ion_deamidated_deamidated].massdifference = R2OH_ION - NH3 - NH3 + adductshift; + fragmentions[r2oh_ion_deamidated_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_deamidated_deamidated].summary = fragmentions[r2oh_ion].summary + "N-1H-3" + "N-1H-3"; // initialize r2oh-H2O-NH3 ion - fragmentions[r2oh_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[r2oh_ion_dehydrated_and_deamidated].cterminal = true; - fragmentions[r2oh_ion_dehydrated_and_deamidated].name = "RY*x"; - fragmentions[r2oh_ion_dehydrated_and_deamidated].massdifference = R2OH_ION - H2O - NH3 + adductshift; - fragmentions[r2oh_ion_dehydrated_and_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_dehydrated_deamidated].nterminal = false; + fragmentions[r2oh_ion_dehydrated_deamidated].cterminal = true; + fragmentions[r2oh_ion_dehydrated_deamidated].name = "RY*x"; + fragmentions[r2oh_ion_dehydrated_deamidated].massdifference = R2OH_ION - H2O - NH3 + adductshift; + fragmentions[r2oh_ion_dehydrated_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_dehydrated_deamidated].summary = fragmentions[r2oh_ion].summary + "H-2O-1" + "N-1H-3"; // initialize r2oh-CO ion fragmentions[r2oh_ion_co_loss].nterminal = false; @@ -2949,6 +4484,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2oh_ion_co_loss].name = "RY-CO"; fragmentions[r2oh_ion_co_loss].massdifference = R2OH_ION - CO + adductshift; fragmentions[r2oh_ion_co_loss].parent = r2oh_ion; + fragmentions[r2oh_ion_co_loss].summary = fragmentions[r2oh_ion].summary + "C-1O-1"; // initialize r2oh-CO-H2O ion fragmentions[r2oh_ion_co_loss_dehydrated].nterminal = false; @@ -2956,6 +4492,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2oh_ion_co_loss_dehydrated].name = "RY*-CO"; fragmentions[r2oh_ion_co_loss_dehydrated].massdifference = R2OH_ION - CO - H2O + adductshift; fragmentions[r2oh_ion_co_loss_dehydrated].parent = r2oh_ion; + fragmentions[r2oh_ion_co_loss_dehydrated].summary = fragmentions[r2oh_ion].summary + "C-1O-1" + "H-2O-1"; // initialize r2oh-CO-NH3 ion fragmentions[r2oh_ion_co_loss_deamidated].nterminal = false; @@ -2963,13 +4500,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[r2oh_ion_co_loss_deamidated].name = "RYx-CO"; fragmentions[r2oh_ion_co_loss_deamidated].massdifference = R2OH_ION - CO - NH3 + adductshift; fragmentions[r2oh_ion_co_loss_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_co_loss_deamidated].summary = fragmentions[r2oh_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize r2oh-CO-H2O-H2O ion + fragmentions[r2oh_ion_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[r2oh_ion_co_loss_dehydrated_dehydrated].cterminal = true; + fragmentions[r2oh_ion_co_loss_dehydrated_dehydrated].name = "RY**-CO"; + fragmentions[r2oh_ion_co_loss_dehydrated_dehydrated].massdifference = R2OH_ION - CO - H2O - H2O + adductshift; + fragmentions[r2oh_ion_co_loss_dehydrated_dehydrated].parent = r2oh_ion; + fragmentions[r2oh_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[r2oh_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize r2oh-CO-NH3-NH3 ion + fragmentions[r2oh_ion_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[r2oh_ion_co_loss_deamidated_deamidated].cterminal = true; + fragmentions[r2oh_ion_co_loss_deamidated_deamidated].name = "RYxx-CO"; + fragmentions[r2oh_ion_co_loss_deamidated_deamidated].massdifference = R2OH_ION - CO - NH3 - NH3 + adductshift; + fragmentions[r2oh_ion_co_loss_deamidated_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_co_loss_deamidated_deamidated].summary = fragmentions[r2oh_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize r2oh-CO-H2O-NH3 ion - fragmentions[r2oh_ion_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[r2oh_ion_co_loss_dehydrated_and_deamidated].cterminal = true; - fragmentions[r2oh_ion_co_loss_dehydrated_and_deamidated].name = "RY*x-CO"; - fragmentions[r2oh_ion_co_loss_dehydrated_and_deamidated].massdifference = R2OH_ION - CO - H2O - NH3 + adductshift; - fragmentions[r2oh_ion_co_loss_dehydrated_and_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[r2oh_ion_co_loss_dehydrated_deamidated].cterminal = true; + fragmentions[r2oh_ion_co_loss_dehydrated_deamidated].name = "RY*x-CO"; + fragmentions[r2oh_ion_co_loss_dehydrated_deamidated].massdifference = R2OH_ION - CO - H2O - NH3 + adductshift; + fragmentions[r2oh_ion_co_loss_dehydrated_deamidated].parent = r2oh_ion; + fragmentions[r2oh_ion_co_loss_dehydrated_deamidated].summary = fragmentions[r2oh_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-H) fragmentions[linear_polyketide_precursor_ion_h_h].nterminal = false; @@ -2985,6 +4540,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated].name = "[M+zH]+ * (H-...-H)"; fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - H2O + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated].parent = linear_polyketide_precursor_ion_h_h; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "H-2O-1"; // initialize linear polyketide precursor ion (H-...-H) - NH3 fragmentions[linear_polyketide_precursor_ion_h_h_deamidated].nterminal = false; @@ -2992,13 +4548,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_h_deamidated].name = "[M+zH]+ x (H-...-H)"; fragmentions[linear_polyketide_precursor_ion_h_h_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - NH3 + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_h_deamidated].parent = linear_polyketide_precursor_ion_h_h; + fragmentions[linear_polyketide_precursor_ion_h_h_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "N-1H-3"; + + // initialize linear polyketide precursor ion (H-...-H) - H2O - H2O + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_dehydrated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_dehydrated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_dehydrated].name = "[M+zH]+ ** (H-...-H)"; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_dehydrated].parent = linear_polyketide_precursor_ion_h_h; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "H-2O-1" + "H-2O-1"; + + // initialize linear polyketide precursor ion (H-...-H) - NH3 - NH3 + fragmentions[linear_polyketide_precursor_ion_h_h_deamidated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_deamidated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_deamidated_deamidated].name = "[M+zH]+ xx (H-...-H)"; + fragmentions[linear_polyketide_precursor_ion_h_h_deamidated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_h_deamidated_deamidated].parent = linear_polyketide_precursor_ion_h_h; + fragmentions[linear_polyketide_precursor_ion_h_h_deamidated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "N-1H-3" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-H) - H2O - NH3 - fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_and_deamidated].nterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_and_deamidated].cterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_and_deamidated].name = "[M+zH]+ *x (H-...-H)"; - fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_and_deamidated].parent = linear_polyketide_precursor_ion_h_h; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_deamidated].name = "[M+zH]+ *x (H-...-H)"; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_deamidated].parent = linear_polyketide_precursor_ion_h_h; + fragmentions[linear_polyketide_precursor_ion_h_h_dehydrated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "H-2O-1" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-H) - CO fragmentions[linear_polyketide_precursor_ion_h_h_co_loss].nterminal = false; @@ -3006,6 +4580,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_h_co_loss].name = "[M+zH]+ -CO (H-...-H)"; fragmentions[linear_polyketide_precursor_ion_h_h_co_loss].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - CO + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_h_co_loss].parent = linear_polyketide_precursor_ion_h_h_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "C-1O-1"; // initialize linear polyketide precursor ion (H-...-H) - CO - H2O fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated].nterminal = false; @@ -3013,6 +4588,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated].name = "[M+zH]+ *-CO (H-...-H)"; fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - CO - H2O + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated].parent = linear_polyketide_precursor_ion_h_h_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "C-1O-1" + "H-2O-1"; // initialize linear polyketide precursor ion (H-...-H) - CO - NH3 fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated].nterminal = false; @@ -3020,13 +4596,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated].name = "[M+zH]+ x-CO (H-...-H)"; fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - CO - NH3 + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated].parent = linear_polyketide_precursor_ion_h_h_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "C-1O-1" + "N-1H-3"; + + // initialize linear polyketide precursor ion (H-...-H) - CO - H2O - H2O + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO (H-...-H)"; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - CO - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_dehydrated].parent = linear_polyketide_precursor_ion_h_h_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize linear polyketide precursor ion (H-...-H) - CO - NH3 - NH3 + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO (H-...-H)"; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - CO - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated_deamidated].parent = linear_polyketide_precursor_ion_h_h_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_deamidated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-H) - CO - H2O - NH3 - fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_and_deamidated].name = "[M+zH]+ *x-CO (H-...-H)"; - fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_and_deamidated].parent = linear_polyketide_precursor_ion_h_h_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO (H-...-H)"; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_H - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated].parent = linear_polyketide_precursor_ion_h_h_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_h].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-OH) fragmentions[linear_polyketide_precursor_ion_h_oh].nterminal = false; @@ -3042,6 +4636,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated].name = "[M+zH]+ * (H-...-OH)"; fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - H2O + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated].parent = linear_polyketide_precursor_ion_h_oh; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "H-2O-1"; // initialize linear polyketide precursor ion (H-...-OH) - NH3 fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated].nterminal = false; @@ -3049,13 +4644,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated].name = "[M+zH]+ x (H-...-OH)"; fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - NH3 + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated].parent = linear_polyketide_precursor_ion_h_oh; + fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "N-1H-3"; + + // initialize linear polyketide precursor ion (H-...-OH) - H2O - H2O + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_dehydrated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_dehydrated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_dehydrated].name = "[M+zH]+ ** (H-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_dehydrated].parent = linear_polyketide_precursor_ion_h_oh; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "H-2O-1" + "H-2O-1"; + + // initialize linear polyketide precursor ion (H-...-OH) - NH3 - NH3 + fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated_deamidated].name = "[M+zH]+ xx (H-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated_deamidated].parent = linear_polyketide_precursor_ion_h_oh; + fragmentions[linear_polyketide_precursor_ion_h_oh_deamidated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "N-1H-3" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-OH) - H2O - NH3 - fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_and_deamidated].nterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_and_deamidated].cterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_and_deamidated].name = "[M+zH]+ *x (H-...-OH)"; - fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_and_deamidated].parent = linear_polyketide_precursor_ion_h_oh; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_deamidated].name = "[M+zH]+ *x (H-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_deamidated].parent = linear_polyketide_precursor_ion_h_oh; + fragmentions[linear_polyketide_precursor_ion_h_oh_dehydrated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "H-2O-1" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-OH) - CO fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss].nterminal = false; @@ -3063,6 +4676,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss].name = "[M+zH]+ -CO (H-...-OH)"; fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - CO + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss].parent = linear_polyketide_precursor_ion_h_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "C-1O-1"; // initialize linear polyketide precursor ion (H-...-OH) - CO - H2O fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated].nterminal = false; @@ -3070,6 +4684,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated].name = "[M+zH]+ *-CO (H-...-OH)"; fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - CO - H2O + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated].parent = linear_polyketide_precursor_ion_h_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "C-1O-1" + "H-2O-1"; // initialize linear polyketide precursor ion (H-...-OH) - CO - NH3 fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated].nterminal = false; @@ -3077,13 +4692,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated].name = "[M+zH]+ x-CO (H-...-OH)"; fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - CO - NH3 + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated].parent = linear_polyketide_precursor_ion_h_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "C-1O-1" + "N-1H-3"; + + // initialize linear polyketide precursor ion (H-...-OH) - CO - H2O - H2O + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO (H-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - CO - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_dehydrated].parent = linear_polyketide_precursor_ion_h_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize linear polyketide precursor ion (H-...-OH) - CO - NH3 - NH3 + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO (H-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - CO - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated_deamidated].parent = linear_polyketide_precursor_ion_h_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_deamidated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize linear polyketide precursor ion (H-...-OH) - CO - H2O - NH3 - fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_and_deamidated].name = "[M+zH]+ *x-CO (H-...-OH)"; - fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_and_deamidated].parent = linear_polyketide_precursor_ion_h_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO (H-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_H_OH - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated].parent = linear_polyketide_precursor_ion_h_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_h_oh].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize linear polyketide precursor ion (HO-...-OH) fragmentions[linear_polyketide_precursor_ion_oh_oh].nterminal = false; @@ -3099,6 +4732,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated].name = "[M+zH]+ * (HO-...-OH)"; fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - H2O + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated].parent = linear_polyketide_precursor_ion_oh_oh; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "H-2O-1"; // initialize linear polyketide precursor ion (HO-...-OH) - NH3 fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated].nterminal = false; @@ -3106,13 +4740,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated].name = "[M+zH]+ x (HO-...-OH)"; fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - NH3 + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated].parent = linear_polyketide_precursor_ion_oh_oh; + fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "N-1H-3"; + + // initialize linear polyketide precursor ion (HO-...-OH) - H2O - H2O + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_dehydrated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_dehydrated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_dehydrated].name = "[M+zH]+ ** (HO-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_dehydrated].parent = linear_polyketide_precursor_ion_oh_oh; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "H-2O-1" + "H-2O-1"; + + // initialize linear polyketide precursor ion (HO-...-OH) - NH3 - NH3 + fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated_deamidated].name = "[M+zH]+ xx (HO-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated_deamidated].parent = linear_polyketide_precursor_ion_oh_oh; + fragmentions[linear_polyketide_precursor_ion_oh_oh_deamidated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "N-1H-3" + "N-1H-3"; // initialize linear polyketide precursor ion (HO-...-OH) - H2O - NH3 - fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_and_deamidated].nterminal = false; - fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_and_deamidated].cterminal = false; - fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_and_deamidated].name = "[M+zH]+ *x (HO-...-OH)"; - fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_and_deamidated].parent = linear_polyketide_precursor_ion_oh_oh; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_deamidated].name = "[M+zH]+ *x (HO-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_deamidated].parent = linear_polyketide_precursor_ion_oh_oh; + fragmentions[linear_polyketide_precursor_ion_oh_oh_dehydrated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "H-2O-1" + "N-1H-3"; // initialize linear polyketide precursor ion (HO-...-OH) - CO fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss].nterminal = false; @@ -3120,6 +4772,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss].name = "[M+zH]+ -CO (HO-...-OH)"; fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - CO + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss].parent = linear_polyketide_precursor_ion_oh_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "C-1O-1"; // initialize linear polyketide precursor ion (HO-...-OH) - CO - H2O fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated].nterminal = false; @@ -3127,6 +4780,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated].name = "[M+zH]+ *-CO (HO-...-OH)"; fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - CO - H2O + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated].parent = linear_polyketide_precursor_ion_oh_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "C-1O-1" + "H-2O-1"; // initialize linear polyketide precursor ion (HO-...-OH) - CO - NH3 fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated].nterminal = false; @@ -3134,13 +4788,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated].name = "[M+zH]+ x-CO (HO-...-OH)"; fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - CO - NH3 + nterminusshift + cterminusshift + adductshift; fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated].parent = linear_polyketide_precursor_ion_oh_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "C-1O-1" + "N-1H-3"; + + // initialize linear polyketide precursor ion (HO-...-OH) - CO - H2O - H2O + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO (HO-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_dehydrated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - CO - H2O - H2O + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_dehydrated].parent = linear_polyketide_precursor_ion_oh_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_dehydrated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize linear polyketide precursor ion (HO-...-OH) - CO - NH3 - NH3 + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO (HO-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - CO - NH3 - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated_deamidated].parent = linear_polyketide_precursor_ion_oh_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize linear polyketide precursor ion (HO-...-OH) - CO - H2O - NH3 - fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_and_deamidated].name = "[M+zH]+ *x-CO (HO-...-OH)"; - fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_and_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; - fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_and_deamidated].parent = linear_polyketide_precursor_ion_oh_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO (HO-...-OH)"; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated].massdifference = PRECURSOR_ION_LINEAR_POLYKETIDE_OH_OH - CO - H2O - NH3 + nterminusshift + cterminusshift + adductshift; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated].parent = linear_polyketide_precursor_ion_oh_oh_co_loss; + fragmentions[linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated].summary = fragmentions[linear_polyketide_precursor_ion_oh_oh].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; // initialize cyclic polyketide precursor ion fragmentions[cyclic_polyketide_precursor_ion].nterminal = false; @@ -3156,6 +4828,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_polyketide_precursor_ion_dehydrated].name = "[M+zH]+ *"; fragmentions[cyclic_polyketide_precursor_ion_dehydrated].massdifference = H - e - H2O + adductshift; fragmentions[cyclic_polyketide_precursor_ion_dehydrated].parent = cyclic_polyketide_precursor_ion; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "H-2O-1"; // initialize cyclic polyketide precursor ion - NH3 fragmentions[cyclic_polyketide_precursor_ion_deamidated].nterminal = false; @@ -3163,13 +4836,31 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_polyketide_precursor_ion_deamidated].name = "[M+zH]+ x"; fragmentions[cyclic_polyketide_precursor_ion_deamidated].massdifference = H - e - NH3 + adductshift; fragmentions[cyclic_polyketide_precursor_ion_deamidated].parent = cyclic_polyketide_precursor_ion; + fragmentions[cyclic_polyketide_precursor_ion_deamidated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "N-1H-3"; + + // initialize cyclic polyketide precursor ion - H2O - H2O + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_dehydrated].name = "[M+zH]+ **"; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_dehydrated].massdifference = H - e - H2O - H2O + adductshift; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_dehydrated].parent = cyclic_polyketide_precursor_ion; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_dehydrated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "H-2O-1" + "H-2O-1"; + + // initialize cyclic polyketide precursor ion - NH3 - NH3 + fragmentions[cyclic_polyketide_precursor_ion_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_deamidated_deamidated].name = "[M+zH]+ xx"; + fragmentions[cyclic_polyketide_precursor_ion_deamidated_deamidated].massdifference = H - e - NH3 - NH3 + adductshift; + fragmentions[cyclic_polyketide_precursor_ion_deamidated_deamidated].parent = cyclic_polyketide_precursor_ion; + fragmentions[cyclic_polyketide_precursor_ion_deamidated_deamidated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "N-1H-3" + "N-1H-3"; // initialize cyclic polyketide precursor ion - H2O - NH3 - fragmentions[cyclic_polyketide_precursor_ion_dehydrated_and_deamidated].nterminal = false; - fragmentions[cyclic_polyketide_precursor_ion_dehydrated_and_deamidated].cterminal = false; - fragmentions[cyclic_polyketide_precursor_ion_dehydrated_and_deamidated].name = "[M+zH]+ *x"; - fragmentions[cyclic_polyketide_precursor_ion_dehydrated_and_deamidated].massdifference = H - e - H2O - NH3 + adductshift; - fragmentions[cyclic_polyketide_precursor_ion_dehydrated_and_deamidated].parent = cyclic_polyketide_precursor_ion; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_deamidated].name = "[M+zH]+ *x"; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_deamidated].massdifference = H - e - H2O - NH3 + adductshift; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_deamidated].parent = cyclic_polyketide_precursor_ion; + fragmentions[cyclic_polyketide_precursor_ion_dehydrated_deamidated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "H-2O-1" + "N-1H-3"; // initialize cyclic polyketide precursor ion - CO fragmentions[cyclic_polyketide_precursor_ion_co_loss].nterminal = false; @@ -3177,6 +4868,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_polyketide_precursor_ion_co_loss].name = "[M+zH]+ -CO"; fragmentions[cyclic_polyketide_precursor_ion_co_loss].massdifference = H - e - CO + adductshift; fragmentions[cyclic_polyketide_precursor_ion_co_loss].parent = cyclic_polyketide_precursor_ion_co_loss; + fragmentions[cyclic_polyketide_precursor_ion_co_loss].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "C-1O-1"; // initialize cyclic polyketide precursor ion - CO - H2O fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated].nterminal = false; @@ -3184,6 +4876,7 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated].name = "[M+zH]+ *-CO"; fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated].massdifference = H - e - CO - H2O + adductshift; fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated].parent = cyclic_polyketide_precursor_ion_co_loss; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "C-1O-1" + "H-2O-1"; // initialize cyclic polyketide precursor ion - CO - NH3 fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated].nterminal = false; @@ -3191,20 +4884,37 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated].name = "[M+zH]+ x-CO"; fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated].massdifference = H - e - CO - NH3 + adductshift; fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated].parent = cyclic_polyketide_precursor_ion_co_loss; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "C-1O-1" + "N-1H-3"; + + // initialize cyclic polyketide precursor ion - CO - H2O - H2O + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_dehydrated].nterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_dehydrated].cterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_dehydrated].name = "[M+zH]+ **-CO"; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_dehydrated].massdifference = H - e - CO - H2O - H2O + adductshift; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_dehydrated].parent = cyclic_polyketide_precursor_ion_co_loss; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_dehydrated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "C-1O-1" + "H-2O-1" + "H-2O-1"; + + // initialize cyclic polyketide precursor ion - CO - NH3 - NH3 + fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated_deamidated].nterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated_deamidated].cterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated_deamidated].name = "[M+zH]+ xx-CO"; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated_deamidated].massdifference = H - e - CO - NH3 - NH3 + adductshift; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated_deamidated].parent = cyclic_polyketide_precursor_ion_co_loss; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_deamidated_deamidated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "C-1O-1" + "N-1H-3" + "N-1H-3"; // initialize cyclic polyketide precursor ion - CO - H2O - NH3 - fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_and_deamidated].nterminal = false; - fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_and_deamidated].cterminal = false; - fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_and_deamidated].name = "[M+zH]+ *x-CO"; - fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_and_deamidated].massdifference = H - e - CO - H2O - NH3 + adductshift; - fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_and_deamidated].parent = cyclic_polyketide_precursor_ion_co_loss; - - // initialize B-2H ion - //fragmentions[b_ion_2H_loss].nterminal = true; - //fragmentions[b_ion_2H_loss].cterminal = false; - //fragmentions[b_ion_2H_loss].name = "-2HB"; - //fragmentions[b_ion_2H_loss].massdifference = B_ION - 2 * H; - + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated].nterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated].cterminal = false; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated].name = "[M+zH]+ *x-CO"; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated].massdifference = H - e - CO - H2O - NH3 + adductshift; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated].parent = cyclic_polyketide_precursor_ion_co_loss; + fragmentions[cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated].summary = fragmentions[cyclic_polyketide_precursor_ion].summary + "C-1O-1" + "H-2O-1" + "N-1H-3"; + + // initialize maps of atoms + for (auto& it : fragmentions) { + it.second.summarymap.clear(); + addStringFormulaToMap(it.second.summary, it.second.summarymap); + } } diff --git a/CycloBranch/core/cFragmentIons.h b/CycloBranch/core/cFragmentIons.h index 336bb2d..1df22c8 100644 --- a/CycloBranch/core/cFragmentIons.h +++ b/CycloBranch/core/cFragmentIons.h @@ -945,43 +945,183 @@ enum eFragmentIonType { a_ion = 1, a_ion_dehydrated, a_ion_deamidated, - a_ion_dehydrated_and_deamidated, + a_ion_dehydrated_dehydrated, + a_ion_deamidated_deamidated, + a_ion_dehydrated_deamidated, + a_ion_dehydrated_dehydrated_dehydrated, + a_ion_deamidated_deamidated_deamidated, + a_ion_dehydrated_dehydrated_deamidated, + a_ion_dehydrated_deamidated_deamidated, + a_ion_dehydrated_dehydrated_dehydrated_dehydrated, + a_ion_deamidated_deamidated_deamidated_deamidated, + a_ion_dehydrated_dehydrated_dehydrated_deamidated, + a_ion_dehydrated_dehydrated_deamidated_deamidated, + a_ion_dehydrated_deamidated_deamidated_deamidated, b_ion, b_ion_dehydrated, b_ion_deamidated, - b_ion_dehydrated_and_deamidated, + b_ion_dehydrated_dehydrated, + b_ion_deamidated_deamidated, + b_ion_dehydrated_deamidated, + b_ion_dehydrated_dehydrated_dehydrated, + b_ion_deamidated_deamidated_deamidated, + b_ion_dehydrated_dehydrated_deamidated, + b_ion_dehydrated_deamidated_deamidated, + b_ion_dehydrated_dehydrated_dehydrated_dehydrated, + b_ion_deamidated_deamidated_deamidated_deamidated, + b_ion_dehydrated_dehydrated_dehydrated_deamidated, + b_ion_dehydrated_dehydrated_deamidated_deamidated, + b_ion_dehydrated_deamidated_deamidated_deamidated, c_ion, c_ion_dehydrated, c_ion_deamidated, - c_ion_dehydrated_and_deamidated, + c_ion_dehydrated_dehydrated, + c_ion_deamidated_deamidated, + c_ion_dehydrated_deamidated, + c_ion_dehydrated_dehydrated_dehydrated, + c_ion_deamidated_deamidated_deamidated, + c_ion_dehydrated_dehydrated_deamidated, + c_ion_dehydrated_deamidated_deamidated, + c_ion_dehydrated_dehydrated_dehydrated_dehydrated, + c_ion_deamidated_deamidated_deamidated_deamidated, + c_ion_dehydrated_dehydrated_dehydrated_deamidated, + c_ion_dehydrated_dehydrated_deamidated_deamidated, + c_ion_dehydrated_deamidated_deamidated_deamidated, x_ion, x_ion_dehydrated, x_ion_deamidated, - x_ion_dehydrated_and_deamidated, + x_ion_dehydrated_dehydrated, + x_ion_deamidated_deamidated, + x_ion_dehydrated_deamidated, + x_ion_dehydrated_dehydrated_dehydrated, + x_ion_deamidated_deamidated_deamidated, + x_ion_dehydrated_dehydrated_deamidated, + x_ion_dehydrated_deamidated_deamidated, + x_ion_dehydrated_dehydrated_dehydrated_dehydrated, + x_ion_deamidated_deamidated_deamidated_deamidated, + x_ion_dehydrated_dehydrated_dehydrated_deamidated, + x_ion_dehydrated_dehydrated_deamidated_deamidated, + x_ion_dehydrated_deamidated_deamidated_deamidated, y_ion, y_ion_dehydrated, y_ion_deamidated, - y_ion_dehydrated_and_deamidated, + y_ion_dehydrated_dehydrated, + y_ion_deamidated_deamidated, + y_ion_dehydrated_deamidated, + y_ion_dehydrated_dehydrated_dehydrated, + y_ion_deamidated_deamidated_deamidated, + y_ion_dehydrated_dehydrated_deamidated, + y_ion_dehydrated_deamidated_deamidated, + y_ion_dehydrated_dehydrated_dehydrated_dehydrated, + y_ion_deamidated_deamidated_deamidated_deamidated, + y_ion_dehydrated_dehydrated_dehydrated_deamidated, + y_ion_dehydrated_dehydrated_deamidated_deamidated, + y_ion_dehydrated_deamidated_deamidated_deamidated, z_ion, z_ion_dehydrated, z_ion_deamidated, - z_ion_dehydrated_and_deamidated, + z_ion_dehydrated_dehydrated, + z_ion_deamidated_deamidated, + z_ion_dehydrated_deamidated, + z_ion_dehydrated_dehydrated_dehydrated, + z_ion_deamidated_deamidated_deamidated, + z_ion_dehydrated_dehydrated_deamidated, + z_ion_dehydrated_deamidated_deamidated, + z_ion_dehydrated_dehydrated_dehydrated_dehydrated, + z_ion_deamidated_deamidated_deamidated_deamidated, + z_ion_dehydrated_dehydrated_dehydrated_deamidated, + z_ion_dehydrated_dehydrated_deamidated_deamidated, + z_ion_dehydrated_deamidated_deamidated_deamidated, precursor_ion, precursor_ion_dehydrated, precursor_ion_deamidated, - precursor_ion_dehydrated_and_deamidated, + precursor_ion_dehydrated_dehydrated, + precursor_ion_deamidated_deamidated, + precursor_ion_dehydrated_deamidated, + precursor_ion_dehydrated_dehydrated_dehydrated, + precursor_ion_deamidated_deamidated_deamidated, + precursor_ion_dehydrated_dehydrated_deamidated, + precursor_ion_dehydrated_deamidated_deamidated, + precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated, + precursor_ion_deamidated_deamidated_deamidated_deamidated, + precursor_ion_dehydrated_dehydrated_dehydrated_deamidated, + precursor_ion_dehydrated_dehydrated_deamidated_deamidated, + precursor_ion_dehydrated_deamidated_deamidated_deamidated, precursor_ion_co_loss, - precursor_ion_co_loss_and_dehydrated, - precursor_ion_co_loss_and_deamidated, - precursor_ion_co_loss_and_dehydrated_and_deamidated, + precursor_ion_co_loss_dehydrated, + precursor_ion_co_loss_deamidated, + precursor_ion_co_loss_dehydrated_dehydrated, + precursor_ion_co_loss_deamidated_deamidated, + precursor_ion_co_loss_dehydrated_deamidated, + precursor_ion_co_loss_dehydrated_dehydrated_dehydrated, + precursor_ion_co_loss_deamidated_deamidated_deamidated, + precursor_ion_co_loss_dehydrated_dehydrated_deamidated, + precursor_ion_co_loss_dehydrated_deamidated_deamidated, + precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated, + precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated, + precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated, + precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated, + precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated, + precursor_ion_co_loss_co_loss, + precursor_ion_co_loss_co_loss_dehydrated, + precursor_ion_co_loss_co_loss_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_dehydrated, + precursor_ion_co_loss_co_loss_deamidated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated, + precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated, + precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated, + precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated, cyclic_precursor_ion, cyclic_precursor_ion_dehydrated, cyclic_precursor_ion_deamidated, - cyclic_precursor_ion_dehydrated_and_deamidated, + cyclic_precursor_ion_dehydrated_dehydrated, + cyclic_precursor_ion_deamidated_deamidated, + cyclic_precursor_ion_dehydrated_deamidated, + cyclic_precursor_ion_dehydrated_dehydrated_dehydrated, + cyclic_precursor_ion_deamidated_deamidated_deamidated, + cyclic_precursor_ion_dehydrated_dehydrated_deamidated, + cyclic_precursor_ion_dehydrated_deamidated_deamidated, + cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_dehydrated, + cyclic_precursor_ion_deamidated_deamidated_deamidated_deamidated, + cyclic_precursor_ion_dehydrated_dehydrated_dehydrated_deamidated, + cyclic_precursor_ion_dehydrated_dehydrated_deamidated_deamidated, + cyclic_precursor_ion_dehydrated_deamidated_deamidated_deamidated, cyclic_precursor_ion_co_loss, - cyclic_precursor_ion_co_loss_and_dehydrated, - cyclic_precursor_ion_co_loss_and_deamidated, - cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated, + cyclic_precursor_ion_co_loss_dehydrated, + cyclic_precursor_ion_co_loss_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_dehydrated, + cyclic_precursor_ion_co_loss_deamidated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated, + cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_dehydrated, + cyclic_precursor_ion_co_loss_deamidated_deamidated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_dehydrated_dehydrated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_dehydrated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_dehydrated_deamidated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_co_loss, + cyclic_precursor_ion_co_loss_co_loss_dehydrated, + cyclic_precursor_ion_co_loss_co_loss_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated, + cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated, + cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_dehydrated, + cyclic_precursor_ion_co_loss_co_loss_deamidated_deamidated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_dehydrated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_dehydrated_deamidated_deamidated, + cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated, ms_Hplus, ms_Naplus, ms_Kplus, @@ -1004,6 +1144,7 @@ enum eFragmentIonType { ms_2MFe4H, ms_3MFe4H, ms_3M2Fe7H, + ms_NH4plus, ms_liplus, ms_MMgH, ms_MMg2HNa, @@ -1013,6 +1154,10 @@ enum eFragmentIonType { ms_MAl3HNa, ms_MAl3HK, ms_MAl4H, + ms_MSi3H, + ms_MSi4HNa, + ms_MSi4HK, + ms_MSi5H, ms_MCaH, ms_MCa2HNa, ms_MCa2HK, @@ -1049,111 +1194,162 @@ enum eFragmentIonType { ms_MGa3HNa, ms_MGa3HK, ms_MGa4H, - ms_NH4plus, l0h_ion, l0h_ion_dehydrated, l0h_ion_deamidated, - l0h_ion_dehydrated_and_deamidated, + l0h_ion_dehydrated_dehydrated, + l0h_ion_deamidated_deamidated, + l0h_ion_dehydrated_deamidated, l0h_ion_co_loss, l0h_ion_co_loss_dehydrated, l0h_ion_co_loss_deamidated, - l0h_ion_co_loss_dehydrated_and_deamidated, + l0h_ion_co_loss_dehydrated_dehydrated, + l0h_ion_co_loss_deamidated_deamidated, + l0h_ion_co_loss_dehydrated_deamidated, l1h_ion, l1h_ion_dehydrated, l1h_ion_deamidated, - l1h_ion_dehydrated_and_deamidated, + l1h_ion_dehydrated_dehydrated, + l1h_ion_deamidated_deamidated, + l1h_ion_dehydrated_deamidated, l1h_ion_co_loss, l1h_ion_co_loss_dehydrated, l1h_ion_co_loss_deamidated, - l1h_ion_co_loss_dehydrated_and_deamidated, + l1h_ion_co_loss_dehydrated_dehydrated, + l1h_ion_co_loss_deamidated_deamidated, + l1h_ion_co_loss_dehydrated_deamidated, l2h_ion, l2h_ion_dehydrated, l2h_ion_deamidated, - l2h_ion_dehydrated_and_deamidated, + l2h_ion_dehydrated_dehydrated, + l2h_ion_deamidated_deamidated, + l2h_ion_dehydrated_deamidated, l2h_ion_co_loss, l2h_ion_co_loss_dehydrated, l2h_ion_co_loss_deamidated, - l2h_ion_co_loss_dehydrated_and_deamidated, + l2h_ion_co_loss_dehydrated_dehydrated, + l2h_ion_co_loss_deamidated_deamidated, + l2h_ion_co_loss_dehydrated_deamidated, r1h_ion, r1h_ion_dehydrated, r1h_ion_deamidated, - r1h_ion_dehydrated_and_deamidated, + r1h_ion_dehydrated_dehydrated, + r1h_ion_deamidated_deamidated, + r1h_ion_dehydrated_deamidated, r1h_ion_co_loss, r1h_ion_co_loss_dehydrated, r1h_ion_co_loss_deamidated, - r1h_ion_co_loss_dehydrated_and_deamidated, + r1h_ion_co_loss_dehydrated_dehydrated, + r1h_ion_co_loss_deamidated_deamidated, + r1h_ion_co_loss_dehydrated_deamidated, r2h_ion, r2h_ion_dehydrated, r2h_ion_deamidated, - r2h_ion_dehydrated_and_deamidated, + r2h_ion_dehydrated_dehydrated, + r2h_ion_deamidated_deamidated, + r2h_ion_dehydrated_deamidated, r2h_ion_co_loss, r2h_ion_co_loss_dehydrated, r2h_ion_co_loss_deamidated, - r2h_ion_co_loss_dehydrated_and_deamidated, + r2h_ion_co_loss_dehydrated_dehydrated, + r2h_ion_co_loss_deamidated_deamidated, + r2h_ion_co_loss_dehydrated_deamidated, l1oh_ion, l1oh_ion_dehydrated, l1oh_ion_deamidated, - l1oh_ion_dehydrated_and_deamidated, + l1oh_ion_dehydrated_dehydrated, + l1oh_ion_deamidated_deamidated, + l1oh_ion_dehydrated_deamidated, l1oh_ion_co_loss, l1oh_ion_co_loss_dehydrated, l1oh_ion_co_loss_deamidated, - l1oh_ion_co_loss_dehydrated_and_deamidated, + l1oh_ion_co_loss_dehydrated_dehydrated, + l1oh_ion_co_loss_deamidated_deamidated, + l1oh_ion_co_loss_dehydrated_deamidated, l2oh_ion, l2oh_ion_dehydrated, l2oh_ion_deamidated, - l2oh_ion_dehydrated_and_deamidated, + l2oh_ion_dehydrated_dehydrated, + l2oh_ion_deamidated_deamidated, + l2oh_ion_dehydrated_deamidated, l2oh_ion_co_loss, l2oh_ion_co_loss_dehydrated, l2oh_ion_co_loss_deamidated, - l2oh_ion_co_loss_dehydrated_and_deamidated, + l2oh_ion_co_loss_dehydrated_dehydrated, + l2oh_ion_co_loss_deamidated_deamidated, + l2oh_ion_co_loss_dehydrated_deamidated, r1oh_ion, r1oh_ion_dehydrated, r1oh_ion_deamidated, - r1oh_ion_dehydrated_and_deamidated, + r1oh_ion_dehydrated_dehydrated, + r1oh_ion_deamidated_deamidated, + r1oh_ion_dehydrated_deamidated, r1oh_ion_co_loss, r1oh_ion_co_loss_dehydrated, r1oh_ion_co_loss_deamidated, - r1oh_ion_co_loss_dehydrated_and_deamidated, + r1oh_ion_co_loss_dehydrated_dehydrated, + r1oh_ion_co_loss_deamidated_deamidated, + r1oh_ion_co_loss_dehydrated_deamidated, r2oh_ion, r2oh_ion_dehydrated, r2oh_ion_deamidated, - r2oh_ion_dehydrated_and_deamidated, + r2oh_ion_dehydrated_dehydrated, + r2oh_ion_deamidated_deamidated, + r2oh_ion_dehydrated_deamidated, r2oh_ion_co_loss, r2oh_ion_co_loss_dehydrated, r2oh_ion_co_loss_deamidated, - r2oh_ion_co_loss_dehydrated_and_deamidated, + r2oh_ion_co_loss_dehydrated_dehydrated, + r2oh_ion_co_loss_deamidated_deamidated, + r2oh_ion_co_loss_dehydrated_deamidated, linear_polyketide_precursor_ion_h_h, linear_polyketide_precursor_ion_h_h_dehydrated, linear_polyketide_precursor_ion_h_h_deamidated, - linear_polyketide_precursor_ion_h_h_dehydrated_and_deamidated, + linear_polyketide_precursor_ion_h_h_dehydrated_dehydrated, + linear_polyketide_precursor_ion_h_h_deamidated_deamidated, + linear_polyketide_precursor_ion_h_h_dehydrated_deamidated, linear_polyketide_precursor_ion_h_h_co_loss, linear_polyketide_precursor_ion_h_h_co_loss_dehydrated, linear_polyketide_precursor_ion_h_h_co_loss_deamidated, - linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_and_deamidated, + linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_dehydrated, + linear_polyketide_precursor_ion_h_h_co_loss_deamidated_deamidated, + linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated, linear_polyketide_precursor_ion_h_oh, linear_polyketide_precursor_ion_h_oh_dehydrated, linear_polyketide_precursor_ion_h_oh_deamidated, - linear_polyketide_precursor_ion_h_oh_dehydrated_and_deamidated, + linear_polyketide_precursor_ion_h_oh_dehydrated_dehydrated, + linear_polyketide_precursor_ion_h_oh_deamidated_deamidated, + linear_polyketide_precursor_ion_h_oh_dehydrated_deamidated, linear_polyketide_precursor_ion_h_oh_co_loss, linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated, linear_polyketide_precursor_ion_h_oh_co_loss_deamidated, - linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_and_deamidated, + linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_dehydrated, + linear_polyketide_precursor_ion_h_oh_co_loss_deamidated_deamidated, + linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated, linear_polyketide_precursor_ion_oh_oh, linear_polyketide_precursor_ion_oh_oh_dehydrated, linear_polyketide_precursor_ion_oh_oh_deamidated, - linear_polyketide_precursor_ion_oh_oh_dehydrated_and_deamidated, + linear_polyketide_precursor_ion_oh_oh_dehydrated_dehydrated, + linear_polyketide_precursor_ion_oh_oh_deamidated_deamidated, + linear_polyketide_precursor_ion_oh_oh_dehydrated_deamidated, linear_polyketide_precursor_ion_oh_oh_co_loss, linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated, linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated, - linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_and_deamidated, + linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_dehydrated, + linear_polyketide_precursor_ion_oh_oh_co_loss_deamidated_deamidated, + linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated, cyclic_polyketide_precursor_ion, cyclic_polyketide_precursor_ion_dehydrated, cyclic_polyketide_precursor_ion_deamidated, - cyclic_polyketide_precursor_ion_dehydrated_and_deamidated, + cyclic_polyketide_precursor_ion_dehydrated_dehydrated, + cyclic_polyketide_precursor_ion_deamidated_deamidated, + cyclic_polyketide_precursor_ion_dehydrated_deamidated, cyclic_polyketide_precursor_ion_co_loss, cyclic_polyketide_precursor_ion_co_loss_dehydrated, cyclic_polyketide_precursor_ion_co_loss_deamidated, - cyclic_polyketide_precursor_ion_co_loss_dehydrated_and_deamidated, + cyclic_polyketide_precursor_ion_co_loss_dehydrated_dehydrated, + cyclic_polyketide_precursor_ion_co_loss_deamidated_deamidated, + cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated, fragmentIonTypeEnd }; @@ -1181,6 +1377,12 @@ struct fragmentDescription { string summary; + /** + \brief A map of atoms corresponding to the summary formula. + */ + map summarymap; + + /** \brief Mass difference of the fragment. */ @@ -1231,6 +1433,7 @@ struct fragmentDescription { void clear() { name = ""; summary = ""; + summarymap.clear(); massdifference = 0; nterminal = false; cterminal = false; @@ -1240,29 +1443,6 @@ struct fragmentDescription { } - /** - \brief The constructor. - \param name name of the fragment - \param massdifference mass difference of the fragment - \param summary summary formula of the fragment - \param nterminal true when the fragment is N-terminal - \param cterminal true when the fragment is C-terminal - \param positive true when the fragment is charged positively; false when the fragment is charged negatively - \param multiplier the multiplier (n) of M in [nM + H]+ - \param parent parent fragment type - */ - fragmentDescription(string name, double massdifference, string summary, bool nterminal, bool cterminal, eFragmentIonType parent = fragmentIonTypeEnd, bool positive = true, int multiplier = 1) { - this->name = name; - this->massdifference = massdifference; - this->summary = summary; - this->nterminal = nterminal; - this->cterminal = cterminal; - this->parent = parent; - this->positive = positive; - this->multiplier = multiplier; - } - - /** \brief Store the structure into an output stream. \param os an output stream diff --git a/CycloBranch/core/cImzML.cpp b/CycloBranch/core/cImzML.cpp index 2ee647d..7db3821 100644 --- a/CycloBranch/core/cImzML.cpp +++ b/CycloBranch/core/cImzML.cpp @@ -21,7 +21,7 @@ cImzML::~cImzML() { } -int cImzML::parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& pixelsize, eVendorType& vendor) { +int cImzML::parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& defaultpixelsizex, int& defaultpixelsizey, eVendorType& vendor) { parser->parse(filename.c_str()); document = parser->getDocument(); @@ -36,7 +36,8 @@ int cImzML::parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& pix use_64bit_float_intensity_precision = false; defaultmaxx = 1; defaultmaxy = 1; - pixelsize = 1; + defaultpixelsizex = 1; + defaultpixelsizey = 1; vendor = unknownvendor; // childrens of mzML @@ -332,9 +333,14 @@ int cImzML::parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& pix defaultmaxy = stoi(value); } - // pixel size + // pixel size x if (accession.compare("IMS:1000046") == 0) { - pixelsize = stoi(value); + defaultpixelsizex = stoi(value); + } + + // pixel size y + if (accession.compare("IMS:1000047") == 0) { + defaultpixelsizey = stoi(value); } } @@ -582,6 +588,15 @@ int cImzML::parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& pix } + if (defaultpixelsizey == 1) { + defaultpixelsizey = defaultpixelsizex; + } + + if (vendor == bruker) { + defaultpixelsizex = sqrt(defaultpixelsizex); + defaultpixelsizey = sqrt(defaultpixelsizey); + } + return 0; } diff --git a/CycloBranch/core/cImzML.h b/CycloBranch/core/cImzML.h index 768f9fb..c9c3c3d 100644 --- a/CycloBranch/core/cImzML.h +++ b/CycloBranch/core/cImzML.h @@ -122,11 +122,12 @@ class cImzML { \param filename imzml filename \param defaultmaxx max count of pixel x - parsed from imzML file \param defaultmaxy max count of pixel y - parsed from imzML file - \param pixelsize pixel size + \param defaultpixelsizex pixel size x - parsed from imzML file + \param defaultpixelsizey pixel size y - parsed from imzML file \param vendor vendor type \retval 0 = success; 1 = failed (zlib compression detected) */ - int parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& pixelsize, eVendorType& vendor); + int parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& defaultpixelsizex, int& defaultpixelsizey, eVendorType& vendor); /** diff --git a/CycloBranch/core/cIsotopePatternCache.cpp b/CycloBranch/core/cIsotopePatternCache.cpp new file mode 100644 index 0000000..d46cdc8 --- /dev/null +++ b/CycloBranch/core/cIsotopePatternCache.cpp @@ -0,0 +1,55 @@ +#include "core/cIsotopePatternCache.h" + + +cIsotopePatternCache::cIsotopePatternCache(int size) { + clear(); + maxnumberofitems = max(size, 1); +} + + +cIsotopePatternCache::~cIsotopePatternCache() { +} + + +bool cIsotopePatternCache::get(string& formula, cPeaksList& isotopepattern) { + auto found = cache_map.find(formula); + + // pattern is not in the cache + if (found == cache_map.end()) { + return false; + } + + // read the pattern from the list + isotopepattern = found->second->second; + + // pattern is at the end of the list + if (found->second == prev(cache_list.end())) { + return true; + } + + // move the used pattern to the end of the list (LRU cache) + cache_list.splice(cache_list.end(), cache_list, found->second); + found->second = prev(cache_list.end()); + + return true; +} + + +void cIsotopePatternCache::put(string& formula, cPeaksList& isotopepattern) { + // remove the least recently used item from the map and from the head of the list + if ((int)cache_map.size() >= maxnumberofitems) { + cache_map.erase(cache_list.front().first); + cache_list.pop_front(); + } + + // insert new item into the map and at the tail of the list + cache_list.push_back(make_pair(formula, isotopepattern)); + cache_map.insert(make_pair(formula, prev(cache_list.end()))); +} + + +void cIsotopePatternCache::clear() { + cache_map.clear(); + cache_list.clear(); +} + diff --git a/CycloBranch/core/cIsotopePatternCache.h b/CycloBranch/core/cIsotopePatternCache.h new file mode 100644 index 0000000..7b4fe26 --- /dev/null +++ b/CycloBranch/core/cIsotopePatternCache.h @@ -0,0 +1,70 @@ +/** + \file cIsotopePatternCache.h + \brief Isotope pattern cache (LRU cache is implemented). +*/ + + +#ifndef _CISOTOPEPATTERNCACHE_H +#define _CISOTOPEPATTERNCACHE_H + + +#include +#include +#include +#include "core/utilities.h" +#include "core/cPeaksList.h" + + +/** + \brief Isotope pattern cache (LRU cache is implemented). +*/ +class cIsotopePatternCache : public QMutex { + + unordered_map >::iterator > cache_map; + list > cache_list; + + int maxnumberofitems; + +public: + + + /** + \brief The constructor. + \param size maximum number of cached items + */ + cIsotopePatternCache(int size = 10000); + + + /** + \brief The destructor. + */ + ~cIsotopePatternCache(); + + + /** + \brief Get the isotope pattern corresponding to the formula from the cache. + \param formula input summary formula + \param isotopepattern output isotope pattern + \retval bool true if the isotope pattern was found; false otherwise. + */ + bool get(string& formula, cPeaksList& isotopepattern); + + + /** + \brief Put the isotope pattern corresponding to the formula into the cache. + \param formula input summary formula + \param isotopepattern input isotope pattern + */ + void put(string& formula, cPeaksList& isotopepattern); + + + /** + \brief Clear the cache. + */ + void clear(); + +}; + + +#endif + diff --git a/CycloBranch/core/cParameters.cpp b/CycloBranch/core/cParameters.cpp index 0831f17..1d1447d 100644 --- a/CycloBranch/core/cParameters.cpp +++ b/CycloBranch/core/cParameters.cpp @@ -41,14 +41,14 @@ void cParameters::clear() { mode = denovoengine; scoretype = matched_peaks; clearhitswithoutparent = false; - generateisotopepattern = true; + generateisotopepattern = false; minimumpatternsize = 1; cyclicnterminus = false; cycliccterminus = false; enablescrambling = false; similaritysearch = false; regularblocksorder = false; - hitsreported = 1000; + hitsreported = 100; sequencetag = ""; originalsequencetag = ""; searchedsequence = ""; @@ -65,11 +65,12 @@ void cParameters::clear() { fragmentionsfortheoreticalspectra.clear(); peakidtodesc.clear(); - peakdesctoid.clear(); + isotopeformulaidtodesc.clear(); defaultmaxx = 1; defaultmaxy = 1; - pixelsize = 1; + defaultpixelsizex = 1; + defaultpixelsizey = 1; vendor = unknownvendor; } @@ -418,7 +419,7 @@ int cParameters::checkAndPrepare(bool& terminatecomputation) { } break; case imzML: - errtype = peaklistseries.loadFromIMZMLStream(peaklistfilename, peakliststream, fwhm, defaultmaxx, defaultmaxy, pixelsize, vendor, os, terminatecomputation); + errtype = peaklistseries.loadFromIMZMLStream(peaklistfilename, peakliststream, fwhm, defaultmaxx, defaultmaxy, defaultpixelsizex, defaultpixelsizey, vendor, os, terminatecomputation); if (errtype == -1) { error = true; errormessage = "Aborted by user.\n"; @@ -933,30 +934,19 @@ void cParameters::store(ofstream& os) { os.write((char *)&fragmentionsfortheoreticalspectra[i], sizeof(eFragmentIonType)); } - size = (int)peakidtodesc.size(); - os.write((char *)&size, sizeof(int)); - for (auto it = peakidtodesc.begin(); it != peakidtodesc.end(); ++it) { - os.write((char *)&it->first, sizeof(int)); - storeString(it->second, os); - } - - size = (int)peakdesctoid.size(); - os.write((char *)&size, sizeof(int)); - for (auto it = peakdesctoid.begin(); it != peakdesctoid.end(); ++it) { - s = it->first; - storeString(s, os); - os.write((char *)&it->second, sizeof(int)); - } + storeStringVector(peakidtodesc, os); + storeStringVector(isotopeformulaidtodesc, os); os.write((char *)&defaultmaxx, sizeof(int)); os.write((char *)&defaultmaxy, sizeof(int)); - os.write((char *)&pixelsize, sizeof(int)); + os.write((char *)&defaultpixelsizex, sizeof(int)); + os.write((char *)&defaultpixelsizey, sizeof(int)); os.write((char *)&vendor, sizeof(eVendorType)); } void cParameters::load(ifstream& is) { - int size, value; + int size; string s; os = 0; @@ -1039,25 +1029,13 @@ void cParameters::load(ifstream& is) { is.read((char *)&fragmentionsfortheoreticalspectra[i], sizeof(eFragmentIonType)); } - is.read((char *)&size, sizeof(int)); - peakidtodesc.clear(); - for (int i = 0; i < size; i++) { - is.read((char *)&value, sizeof(int)); - loadString(s, is); - peakidtodesc[value] = s; - } - - is.read((char *)&size, sizeof(int)); - peakdesctoid.clear(); - for (int i = 0; i < size; i++) { - loadString(s, is); - is.read((char *)&value, sizeof(int)); - peakdesctoid[s] = value; - } + loadStringVector(peakidtodesc, is); + loadStringVector(isotopeformulaidtodesc, is); is.read((char *)&defaultmaxx, sizeof(int)); is.read((char *)&defaultmaxy, sizeof(int)); - is.read((char *)&pixelsize, sizeof(int)); + is.read((char *)&defaultpixelsizex, sizeof(int)); + is.read((char *)&defaultpixelsizey, sizeof(int)); is.read((char *)&vendor, sizeof(eVendorType)); } diff --git a/CycloBranch/core/cParameters.h b/CycloBranch/core/cParameters.h index 0f444d1..ec2cfde 100644 --- a/CycloBranch/core/cParameters.h +++ b/CycloBranch/core/cParameters.h @@ -355,15 +355,15 @@ class cParameters { /** - \brief A map of peak ids to descriptions. + \brief A vector of peak descriptions. */ - map peakidtodesc; + vector peakidtodesc; /** - \brief A map of peak descriptions to ids. + \brief A vector of isotope formula descriptions. */ - map peakdesctoid; + vector isotopeformulaidtodesc; /** @@ -379,9 +379,15 @@ class cParameters { /** - \brief Pixel size. + \brief Pixel size x - parsed from imzML file. */ - int pixelsize; + int defaultpixelsizex; + + + /** + \brief Pixel size y - parsed from imzML file. + */ + int defaultpixelsizey; /** diff --git a/CycloBranch/core/cPeak.cpp b/CycloBranch/core/cPeak.cpp index 8e6f574..7ae0d27 100644 --- a/CycloBranch/core/cPeak.cpp +++ b/CycloBranch/core/cPeak.cpp @@ -6,7 +6,46 @@ cPeak::cPeak() { } +cPeak::cPeak(const cPeak& peak) { + *this = peak; +} + + +cPeak& cPeak::operator=(const cPeak& peak) { + formula = peak.formula; + isotopeformula = peak.isotopeformula; + isotopeformulaid = peak.isotopeformulaid; + mzratio = peak.mzratio; + relativeintensity = peak.relativeintensity; + absoluteintensity = peak.absoluteintensity; + description = peak.description; + descriptionid = peak.descriptionid; + matchedmz = peak.matchedmz; + matchedrelativeintensity = peak.matchedrelativeintensity; + matchedabsoluteintensity = peak.matchedabsoluteintensity; + matchedppm = peak.matchedppm; + iontype = peak.iontype; + matched = peak.matched; + matchedid = peak.matchedid; + charge = peak.charge; + isotope = peak.isotope; + removeme = peak.removeme; + scrambled = peak.scrambled; + decoy = peak.decoy; + orderid = peak.orderid; + + rotationid = peak.rotationid; + seriesid = peak.seriesid; + groupid = peak.groupid; + + return *this; +} + + void cPeak::clear() { + formula.clear(); + isotopeformula = ""; + isotopeformulaid = -1; mzratio = 0; relativeintensity = 0; absoluteintensity = 0; @@ -39,6 +78,9 @@ bool cPeak::empty() { void cPeak::store(ofstream& os) { + formula.store(os); + storeString(isotopeformula, os); + os.write((char *)&isotopeformulaid, sizeof(int)); os.write((char *)&mzratio, sizeof(double)); os.write((char *)&relativeintensity, sizeof(double)); os.write((char *)&absoluteintensity, sizeof(double)); @@ -64,6 +106,9 @@ void cPeak::store(ofstream& os) { void cPeak::load(ifstream& is) { + formula.load(is); + loadString(isotopeformula, is); + is.read((char *)&isotopeformulaid, sizeof(int)); is.read((char *)&mzratio, sizeof(double)); is.read((char *)&relativeintensity, sizeof(double)); is.read((char *)&absoluteintensity, sizeof(double)); diff --git a/CycloBranch/core/cPeak.h b/CycloBranch/core/cPeak.h index 9105eb1..dc428d0 100644 --- a/CycloBranch/core/cPeak.h +++ b/CycloBranch/core/cPeak.h @@ -10,6 +10,7 @@ #include #include #include "core/cFragmentIons.h" +#include "core/cSummaryFormula.h" using namespace std; @@ -35,6 +36,21 @@ enum eScoreType { */ struct cPeak { + /** + \brief Summary formlula. + */ + cSummaryFormula formula; + + /** + \brief Isotope summary formula. + */ + string isotopeformula; + + /** + \brief Id of isotope summary formula. + */ + int isotopeformulaid; + /** \brief MZ ratio. */ @@ -163,10 +179,24 @@ struct cPeak { /** \brief The constructor. - */ + */ cPeak(); + /** + \brief The copy constructor. + \param peak reference to cPeak + */ + cPeak(const cPeak& peak); + + + /** + \brief Overloaded operator=. + \param peak reference to cPeak + */ + cPeak& operator=(const cPeak& peak); + + /** \brief Clear the structure. */ diff --git a/CycloBranch/core/cPeakListSeries.cpp b/CycloBranch/core/cPeakListSeries.cpp index 8f9e45e..0b66ee3 100644 --- a/CycloBranch/core/cPeakListSeries.cpp +++ b/CycloBranch/core/cPeakListSeries.cpp @@ -248,11 +248,11 @@ int cPeakListSeries::loadFromMZMLStream(string& mzmlfilename, ifstream &mzmlstre } -int cPeakListSeries::loadFromIMZMLStream(string& imzmlfilename, ifstream &ibdstream, double fwhm, int& defaultmaxx, int& defaultmaxy, int& pixelsize, eVendorType& vendor, cMainThread* os, bool& terminatecomputation) { +int cPeakListSeries::loadFromIMZMLStream(string& imzmlfilename, ifstream &ibdstream, double fwhm, int& defaultmaxx, int& defaultmaxy, int& defaultpixelsizex, int& defaultpixelsizey, eVendorType& vendor, cMainThread* os, bool& terminatecomputation) { *os << "Loading the imzML file... "; cImzML imzml; - if (imzml.parse(imzmlfilename, defaultmaxx, defaultmaxy, pixelsize, vendor)) { + if (imzml.parse(imzmlfilename, defaultmaxx, defaultmaxy, defaultpixelsizex, defaultpixelsizey, vendor)) { return -3; } diff --git a/CycloBranch/core/cPeakListSeries.h b/CycloBranch/core/cPeakListSeries.h index aa547c7..bfa3e3b 100644 --- a/CycloBranch/core/cPeakListSeries.h +++ b/CycloBranch/core/cPeakListSeries.h @@ -113,13 +113,14 @@ class cPeakListSeries { \param fwhm FWHM \param defaultmaxx max count of pixel x - parsed from imzML file \param defaultmaxy max count of pixel y - parsed from imzML file - \param pixelsize pixel size + \param defaultpixelsizex pixel size x - parsed from imzML file + \param defaultpixelsizey pixel size y - parsed from imzML file \param vendor vendor type \param os pointer to the main thread of the application (output stream) \param terminatecomputation reference to a variable determining that the computation must be stopped \retval int 0 = success; -1 = aborted by user, -2 = error */ - int loadFromIMZMLStream(string& imzmlfilename, ifstream &ibdstream, double fwhm, int& defaultmaxx, int& defaultmaxy, int& pixelsize, eVendorType& vendor, cMainThread* os, bool& terminatecomputation); + int loadFromIMZMLStream(string& imzmlfilename, ifstream &ibdstream, double fwhm, int& defaultmaxx, int& defaultmaxy, int& defaultpixelsizex, int& defaultpixelsizey, eVendorType& vendor, cMainThread* os, bool& terminatecomputation); /** diff --git a/CycloBranch/core/cPeaksList.cpp b/CycloBranch/core/cPeaksList.cpp index 5bdf794..0a9d338 100644 --- a/CycloBranch/core/cPeaksList.cpp +++ b/CycloBranch/core/cPeaksList.cpp @@ -47,11 +47,6 @@ void cPeaksList::clear() { void cPeaksList::attach(cPeaksList& peaklist) { peaks.insert(peaks.end(), peaklist.peaks.begin(), peaklist.peaks.end()); - /* - for (int i = 0; i < (int)peaklist.peaks.size(); i++) { - peaks.push_back(peaklist.peaks[i]); - } - */ } @@ -522,34 +517,6 @@ int cPeaksList::find(double mzratio, double fragmentmasserrortolerance) { } -void cPeaksList::findObsolete(double mzratio) { - int left, right, middle; - - left = 0; - right = (int)peaks.size() - 1; - while (left <= right) { - middle = (left + right) / 2; - if (abs(mzratio - peaks[middle].mzratio) < 0.00000001) { - while ((middle > 0) && (abs(mzratio - peaks[middle - 1].mzratio) < 0.00000001)) { - middle--; - } - while ((middle < (int)peaks.size()) && (abs(mzratio - peaks[middle].mzratio) < 0.00000001)) { - peaks[middle].removeme = true; - middle++; - } - return; - } - if (mzratio < peaks[middle].mzratio) { - right = middle - 1; - } - else { - left = middle + 1; - } - } - -} - - void cPeaksList::remove(int position) { if (position < (int)peaks.size()) { peaks.erase(peaks.begin() + position); @@ -589,7 +556,6 @@ void cPeaksList::removeChargeVariants(int maximumcharge, double fragmentmasserro } removeObsolete(); - } @@ -790,9 +756,11 @@ void cPeaksList::setTitle(string& title) { } -void cPeaksList::reducePeakDescriptions(map& peakidtodesc, map& peakdesctoid) { +void cPeaksList::reducePeakDescriptions(unordered_map& peakdesctoid) { + //static int test = 0; int descid; for (int i = 0; i < (int)peaks.size(); i++) { + //test++; if (peakdesctoid.count(peaks[i].description) > 0) { peaks[i].descriptionid = peakdesctoid[peaks[i].description]; } @@ -800,10 +768,29 @@ void cPeaksList::reducePeakDescriptions(map& peakidtodesc, map& isotopeformuladesctoid) { + //static int test = 0; + int descid; + for (int i = 0; i < (int)peaks.size(); i++) { + //test++; + if (isotopeformuladesctoid.count(peaks[i].isotopeformula) > 0) { + peaks[i].isotopeformulaid = isotopeformuladesctoid[peaks[i].isotopeformula]; + } + else { + descid = (int)isotopeformuladesctoid.size(); + peaks[i].isotopeformulaid = descid; + isotopeformuladesctoid.insert(make_pair(peaks[i].isotopeformula, descid)); + } + peaks[i].isotopeformula.clear(); + } + //cout << "isotope: " << test << " " << isotopeformuladesctoid.size() << endl; } diff --git a/CycloBranch/core/cPeaksList.h b/CycloBranch/core/cPeaksList.h index f4f7e96..9a007d9 100644 --- a/CycloBranch/core/cPeaksList.h +++ b/CycloBranch/core/cPeaksList.h @@ -274,13 +274,6 @@ class cPeaksList { int find(double mzratio, double fragmentmasserrortolerance); - /** - \brief Find all peaks having a specified \a mzratio and mark them with the flag \a removeme == true. - \param mzratio mz ratio of peaks which will be marked - */ - void findObsolete(double mzratio); - - /** \brief Remove a peak. \param position position of a peak @@ -397,10 +390,16 @@ class cPeaksList { /** \brief Reduce redundant descriptions of peaks. - \param peakidtodesc map of peak ids to descriptions \param peakdesctoid map of peak descriptions to ids */ - void reducePeakDescriptions(map& peakidtodesc, map& peakdesctoid); + void reducePeakDescriptions(unordered_map& peakdesctoid); + + + /** + \brief Reduce redundant descriptions of isotope formulas. + \param isotopeformuladesctoid map of isotope formula descriptions to ids + */ + void reduceIsotopeFormulaDescriptions(unordered_map& isotopeformuladesctoid); /** diff --git a/CycloBranch/core/cSequence.cpp b/CycloBranch/core/cSequence.cpp index b27e535..192e978 100644 --- a/CycloBranch/core/cSequence.cpp +++ b/CycloBranch/core/cSequence.cpp @@ -189,6 +189,17 @@ string cSequence::getNameWithReferenceAsHTMLString() { } } + // PAMDB (undocumented) + if (!correctreference) { + rx = "^PAMDB[0-9]+$"; + if (regex_search(reference, rx)) { + s += ""; + s += name; + s += ""; + correctreference = true; + } + } + } catch (regex_error& /*e*/) { // nothing to do diff --git a/CycloBranch/core/cSummaryFormula.cpp b/CycloBranch/core/cSummaryFormula.cpp index cf0066a..932f835 100644 --- a/CycloBranch/core/cSummaryFormula.cpp +++ b/CycloBranch/core/cSummaryFormula.cpp @@ -4,34 +4,51 @@ #include "core/cBricksDatabase.h" -void cSummaryFormula::explodeSummary(map& atoms, string& summary) { - if ((int)summary.size() == 0) { +void reduceMapToStringFormula(map& atoms, string& formula) { + formula = ""; + for (auto it = atoms.begin(); it != atoms.end(); ++it) { + if (it->second != 0) { + formula += it->first; + if (it->second != 1) { + formula += to_string(it->second); + } + } + } +} + + +void addStringFormulaToMap(string& formula, map& atoms) { + if ((int)formula.size() == 0) { return; } + map::iterator it; + string tmps; - tmps = summary[0]; + tmps = formula[0]; int tmpc = 0; bool minus = false; - for (int i = 1; i < (int)summary.size(); i++) { + for (int i = 1; i < (int)formula.size(); i++) { - if (((summary[i] >= 'A') && (summary[i] <= 'Z')) || (summary[i] == '+')) { + if (((formula[i] >= 'A') && (formula[i] <= 'Z')) || (formula[i] == '+')) { if (periodictablemap.count(tmps) > 0) { if (tmpc == 0) { - if (atoms.count(tmps) == 0) { + it = atoms.find(tmps); + if (it == atoms.end()) { atoms[tmps] = 1; } else { - atoms[tmps] += 1; + it->second += 1; } } else { - if (atoms.count(tmps) == 0) { - atoms[tmps] = minus?-tmpc:tmpc; + it = atoms.find(tmps); + if (it == atoms.end()) { + atoms[tmps] = minus ? -tmpc : tmpc; } else { - atoms[tmps] += minus?-tmpc:tmpc; + it->second += minus ? -tmpc : tmpc; } } } @@ -39,21 +56,21 @@ void cSummaryFormula::explodeSummary(map& atoms, string& summary) { return; } - tmps = summary[i]; + tmps = formula[i]; tmpc = 0; minus = false; } - if ((summary[i] >= 'a') && (summary[i] <= 'z')) { - tmps += summary[i]; + if ((formula[i] >= 'a') && (formula[i] <= 'z')) { + tmps += formula[i]; } - if ((summary[i] >= '0') && (summary[i] <= '9')) { + if ((formula[i] >= '0') && (formula[i] <= '9')) { tmpc *= 10; - tmpc += summary[i] - '0'; + tmpc += formula[i] - '0'; } - if (summary[i] == '-') { + if (formula[i] == '-') { minus = true; } @@ -62,25 +79,66 @@ void cSummaryFormula::explodeSummary(map& atoms, string& summary) { // the last element if (periodictablemap.count(tmps) > 0) { if (tmpc == 0) { - if (atoms.count(tmps) == 0) { + it = atoms.find(tmps); + if (it == atoms.end()) { atoms[tmps] = 1; } else { - atoms[tmps] += 1; + it->second += 1; } } else { - if (atoms.count(tmps) == 0) { - atoms[tmps] = minus?-tmpc:tmpc; + it = atoms.find(tmps); + if (it == atoms.end()) { + atoms[tmps] = minus ? -tmpc : tmpc; } else { - atoms[tmps] += minus?-tmpc:tmpc; + it->second += minus ? -tmpc : tmpc; } } } } +void mergeMaps(map& source, map& target) { + map::iterator it2; + for (auto& it : source) { + it2 = target.find(it.first); + if (it2 == target.end()) { + target[it.first] = it.second; + } + else { + it2->second += it.second; + } + } +} + + +void rechargeMap(int charge, map& atoms) { + if (charge == 1) { + return; + } + + map::iterator it; + + it = atoms.find("H"); + if (it == atoms.end()) { + atoms["H"] = charge - 1; + } + else { + it->second += charge - 1; + } + + it = atoms.find("+"); + if (it == atoms.end()) { + atoms["+"] = charge - 1; + } + else { + it->second += charge - 1; + } +} + + void cSummaryFormula::combineAtoms(cPeakListSeries& peaklistseries, cPeaksList& isotopeprofile, int depth, double mass, double intensity, int charge, string description, double minimumabsoluteintensity) { if (depth < peaklistseries.size()) { for (int i = 0; i < peaklistseries[depth].size(); i++) { @@ -245,6 +303,33 @@ string cSummaryFormula::getSummary() { } +string cSummaryFormula::getFancySummary(int charge) { + int size = (int)formula.size(); + string tmpformula; + + if (size == 0) { + return tmpformula; + } + + for (int i = 0; i < size; i++) { + if ((formula[i] >= 'A') && (formula[i] <= 'Z')) { + tmpformula = formula.substr(i); + break; + } + } + + if (charge > 0) { + tmpformula += " " + to_string(charge) + "+"; + } + + if (charge < 0) { + tmpformula += " " + to_string(abs(charge)) + "-"; + } + + return tmpformula; +} + + bool cSummaryFormula::isPartial() { return partial; } @@ -263,23 +348,23 @@ void cSummaryFormula::addFormula(string& formula, bool remove) { map atoms; atoms.clear(); - explodeSummary(atoms, formula); + addStringFormulaToMap(formula, atoms); + if (remove) { for (auto it = atoms.begin(); it != atoms.end(); ++it) { it->second = -it->second; } } - explodeSummary(atoms, this->formula); - this->formula = ""; - for (auto it = atoms.begin(); it != atoms.end(); ++it) { - if (it->second != 0) { - this->formula += it->first; - if (it->second != 1) { - this->formula += to_string(it->second); - } - } - } + addStringFormulaToMap(this->formula, atoms); + + reduceMapToStringFormula(atoms, this->formula); +} + + +void cSummaryFormula::setFromMap(map& atoms, bool partial) { + reduceMapToStringFormula(atoms, this->formula); + this->partial = partial; } @@ -334,6 +419,20 @@ bool cSummaryFormula::isValid(string& errormessage) { } +bool cSummaryFormula::isEmpty() { + return (formula.size() == 0); +} + + +bool cSummaryFormula::hasAllElementsPositive() { + // start from the position 2 to keep negatively charged ions but to remove incorrect ions e.g. "+-1C3H-1" + if (formula.find("-", 2) == string::npos) { + return true; + } + return false; +} + + double cSummaryFormula::getMass() { if ((int)formula.size() == 0) { return 0; @@ -400,9 +499,9 @@ double cSummaryFormula::getMass() { } -cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool positive) { +cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool positive, bool writedescription) { map atoms; - explodeSummary(atoms, formula); + addStringFormulaToMap(formula, atoms); cBricksDatabase bricksdatabase; cBricksDatabase bricksprobabilities; @@ -458,7 +557,9 @@ cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool posi cPeak peak; peak.mzratio = bricksdatabase.getMassOfComposition(combarray, numberofbasicbricks) + periodictablemap[atom]*(atomcount - maximumbricksincombination); peak.absoluteintensity = getIntensity(bricksprobabilities, combarray, mostintenseid, atomcount - maximumbricksincombination, (int)atomisotopes.size()); - getIsotopeSummary(peak.description, bricksdatabase, combarray, mostintenseid, atomcount - maximumbricksincombination, (int)atomisotopes.size(), positive); + if (writedescription) { + getIsotopeSummary(peak.description, bricksdatabase, combarray, mostintenseid, atomcount - maximumbricksincombination, (int)atomisotopes.size(), positive); + } peaklist.add(peak); } while (bricksdatabase.nextCombination(combarray, numberofbasicbricks, maximumbricksincombination, 0, 0)); diff --git a/CycloBranch/core/cSummaryFormula.h b/CycloBranch/core/cSummaryFormula.h index 22c50e1..17676d8 100644 --- a/CycloBranch/core/cSummaryFormula.h +++ b/CycloBranch/core/cSummaryFormula.h @@ -21,6 +21,38 @@ class cPeakListSeries; class cBricksDatabase; +/** + \brief Reduce a map of atoms to a string. + \param atoms an input map of atoms + \param formula an output string formula +*/ +void reduceMapToStringFormula(map& atoms, string& formula); + + +/** + \brief Explode and add a summary formula string to a map. + \param formula an input string formula + \param atoms an input/output map of atoms +*/ +void addStringFormulaToMap(string& formula, map& atoms); + + +/** + \brief Merge two maps of atoms into a target map. + \param source a source map + \param target a target map +*/ +void mergeMaps(map& source, map& target); + + +/** + \brief Change the charge from 1+ to another charge in a map. + \param charge new charge + \param atoms an input/output map of atoms +*/ +void rechargeMap(int charge, map& atoms); + + /** \brief The representation of a summary formula. */ @@ -30,8 +62,6 @@ class cSummaryFormula { string formula; - void explodeSummary(map& atoms, string& summary); - void combineAtoms(cPeakListSeries& peaklistseries, cPeaksList& isotopeprofile, int depth, double mass, double intensity, int charge, string description, double minimumabsoluteintensity); double getIntensity(cBricksDatabase& bricksprobabilities, vector& combarray, int mostintenseid, int mostintenseatomscount, int isotopecount); @@ -73,11 +103,19 @@ class cSummaryFormula { /** \brief Get the summary formula as a string. - \retval string formula as a string + \retval string formula as a string */ string getSummary(); + /** + \brief Get the fancy summary formula as a string. + \param charge peak charge + \retval string formula as a string + */ + string getFancySummary(int charge); + + /** \brief Check if the formula is incomplete or not. \retval bool true when the formula is incomplete, false when the formula is complete @@ -99,6 +137,14 @@ class cSummaryFormula { */ void addFormula(string& formula, bool remove = false); + + /** + \brief Set the string formula from a map of atoms. + \param atoms an input map of atoms + \param partial true if the formula is incomplete + */ + void setFromMap(map& atoms, bool partial); + /** \brief Check the syntax of a chemical formula. @@ -108,6 +154,20 @@ class cSummaryFormula { bool isValid(string& errormessage); + /** + \brief Check if the formula is empty. + \retval bool true if the formula is empty; false otherwise + */ + bool isEmpty(); + + + /** + \brief Check if the formula has the numbers of all elements positive. + \retval bool true if the formula has the numbers of all elements positive + */ + bool hasAllElementsPositive(); + + /** \brief Get mass of the formula. \retval double mass of the formula @@ -120,9 +180,10 @@ class cSummaryFormula { \param fwhm FWHM \param charge charge \param positive true if the charge is positive charge, false if the charge is negative + \param writedescription if true then string descriptions of peaks are filled \retval cPeaksList isotopic pattern of the formula */ - cPeaksList getIsotopePattern(double fwhm, int charge, bool positive); + cPeaksList getIsotopePattern(double fwhm, int charge, bool positive, bool writedescription); /** diff --git a/CycloBranch/core/cTheoreticalSpectrum.cpp b/CycloBranch/core/cTheoreticalSpectrum.cpp index bc3b4a5..e33978d 100644 --- a/CycloBranch/core/cTheoreticalSpectrum.cpp +++ b/CycloBranch/core/cTheoreticalSpectrum.cpp @@ -1,5 +1,6 @@ #include "core/cTheoreticalSpectrum.h" #include "core/cDeNovoGraph.h" +#include "core/cIsotopePatternCache.h" #include "gui/cMainThread.h" @@ -168,15 +169,32 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr set usedmodifications; usedmodifications.insert(0); + map atoms, tempmap; + atoms.clear(); + + bool disablesummary = false; + if ((parameters->mode == denovoengine) && (parameters->blindedges == 2)) { + for (int i = 0; i < (int)intcomposition.size(); i++) { + if (bricksdatabasewithcombinations[intcomposition[i] - 1].isArtificial()) { + disablesummary = true; + break; + } + } + } + peak.isotope = false; switch (parameters->peptidetype) { case linear: peak.mzratio = parameters->searchedmodifications[candidate.getStartModifID()].massdifference + parameters->searchedmodifications[candidate.getEndModifID()].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(parameters->searchedmodifications[candidate.getStartModifID()].summary, atoms); + addStringFormulaToMap(parameters->searchedmodifications[candidate.getEndModifID()].summary, atoms); + } peak.seriesid = 0; starttype = (int)precursor_ion; - endtype = (int)precursor_ion_co_loss_and_dehydrated_and_deamidated; + endtype = (int)precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated; usedmodifications.insert(candidate.getStartModifID()); usedmodifications.insert(candidate.getEndModifID()); break; @@ -184,26 +202,38 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr peak.mzratio = 0; peak.seriesid = (int)intcomposition.size() - 1; starttype = (int)cyclic_precursor_ion; - endtype = (int)cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated; + endtype = (int)cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated; break; case branched: peak.mzratio = parameters->searchedmodifications[candidate.getStartModifID()].massdifference + parameters->searchedmodifications[candidate.getEndModifID()].massdifference + parameters->searchedmodifications[candidate.getMiddleModifID()].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(parameters->searchedmodifications[candidate.getStartModifID()].summary, atoms); + addStringFormulaToMap(parameters->searchedmodifications[candidate.getEndModifID()].summary, atoms); + addStringFormulaToMap(parameters->searchedmodifications[candidate.getMiddleModifID()].summary, atoms); + } peak.seriesid = 0; starttype = (int)precursor_ion; - endtype = (int)precursor_ion_co_loss_and_dehydrated_and_deamidated; + endtype = (int)precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated; usedmodifications.insert(candidate.getStartModifID()); usedmodifications.insert(candidate.getEndModifID()); usedmodifications.insert(candidate.getMiddleModifID()); break; case branchcyclic: peak.mzratio = parameters->searchedmodifications[candidate.getMiddleModifID()].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(parameters->searchedmodifications[candidate.getMiddleModifID()].summary, atoms); + } peak.seriesid = 0; starttype = (int)cyclic_precursor_ion; - endtype = (int)cyclic_precursor_ion_co_loss_and_dehydrated_and_deamidated; + endtype = (int)cyclic_precursor_ion_co_loss_co_loss_dehydrated_deamidated_deamidated_deamidated; usedmodifications.insert(candidate.getMiddleModifID()); break; case linearpolyketide: peak.mzratio = parameters->searchedmodifications[candidate.getStartModifID()].massdifference + parameters->searchedmodifications[candidate.getEndModifID()].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(parameters->searchedmodifications[candidate.getStartModifID()].summary, atoms); + addStringFormulaToMap(parameters->searchedmodifications[candidate.getEndModifID()].summary, atoms); + } peak.seriesid = 0; usedmodifications.insert(candidate.getStartModifID()); usedmodifications.insert(candidate.getEndModifID()); @@ -212,7 +242,7 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr peak.mzratio = 0; peak.seriesid = (int)intcomposition.size() - 1; starttype = (int)cyclic_polyketide_precursor_ion; - endtype = (int)cyclic_polyketide_precursor_ion_co_loss_dehydrated_and_deamidated; + endtype = (int)cyclic_polyketide_precursor_ion_co_loss_dehydrated_deamidated; break; case other: break; @@ -222,6 +252,9 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr for (int i = 0; i < (int)intcomposition.size(); i++) { peak.mzratio += bricksdatabasewithcombinations[intcomposition[i] - 1].getMass(); + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + mergeMaps(bricksdatabasewithcombinations[intcomposition[i] - 1].getSummaryMap(), atoms); + } } if (parameters->peptidetype == linearpolyketide) { @@ -247,17 +280,17 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr if (bestmatch == 1) { starttype = (int)linear_polyketide_precursor_ion_oh_oh; - endtype = (int)linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_and_deamidated; + endtype = (int)linear_polyketide_precursor_ion_oh_oh_co_loss_dehydrated_deamidated; } if (bestmatch == 2) { starttype = (int)linear_polyketide_precursor_ion_h_oh; - endtype = (int)linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_and_deamidated; + endtype = (int)linear_polyketide_precursor_ion_h_oh_co_loss_dehydrated_deamidated; } if (bestmatch == 3) { starttype = (int)linear_polyketide_precursor_ion_h_h; - endtype = (int)linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_and_deamidated; + endtype = (int)linear_polyketide_precursor_ion_h_h_co_loss_dehydrated_deamidated; } } @@ -267,6 +300,16 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr for (int k = 1; k <= abs(parameters->precursorcharge); k++) { peak.mzratio = tempratio + parameters->fragmentdefinitions[(eFragmentIonType)i].massdifference - parameters->searchedmodifications[*j].massdifference; peak.iontype = (eFragmentIonType)i; + peak.mzratio = charge(uncharge(peak.mzratio, 1), (parameters->precursorcharge > 0) ? k : -k); + peak.charge = (parameters->precursorcharge > 0) ? k : -k; + + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + tempmap = atoms; + mergeMaps(parameters->fragmentdefinitions[(eFragmentIonType)i].summarymap, tempmap); + rechargeMap(peak.charge, tempmap); + peak.formula.setFromMap(tempmap, false); + peak.formula.addFormula(parameters->searchedmodifications[*j].summary, true); + } if (writedescription) { string str; @@ -337,11 +380,26 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr } } - peak.mzratio = charge(uncharge(peak.mzratio, 1), (parameters->precursorcharge > 0)?k:-k); - peak.charge = (parameters->precursorcharge > 0)?k:-k; - - addPeakToList(peak, theoreticalpeaksrealsize); - addMetalPeaks(peak, parameters->metaladducts, theoreticalpeaksrealsize, k, writedescription); + if (writedescription) { + if (peak.formula.hasAllElementsPositive()) { + addPeakToList(peak, theoreticalpeaksrealsize); + if (!parameters->generateisotopepattern) { + addMetalPeaks(peak, parameters->metaladducts, theoreticalpeaksrealsize, k, writedescription); + } + } + } + else { + if (parameters->generateisotopepattern) { + if (peak.formula.hasAllElementsPositive()) { + addPeakToList(peak, theoreticalpeaksrealsize); + } + } + else { + addPeakToList(peak, theoreticalpeaksrealsize); + addMetalPeaks(peak, parameters->metaladducts, theoreticalpeaksrealsize, k, writedescription); + } + } + } } } @@ -349,38 +407,41 @@ void cTheoreticalSpectrum::generatePrecursorIon(vector& intcomposition, cBr void cTheoreticalSpectrum::generateScrambledIons(cBricksDatabase& bricksdatabase, bool writedescription, int& theoreticalpeaksrealsize) { - unordered_set scrambledsequences, commonsequences; - vector intcomposition; - scrambledsequences.clear(); - //int minimumsizeofscrambledsequences = 2; cBrick b; - b.setComposition(candidate.getComposition(), false); vector stringcomposition; b.explodeToStringComposition(stringcomposition); - if (stringcomposition.size() > 32) { - // max 2^32 subsequences is tested + vector intcomposition; + + if (stringcomposition.size() > 30) { + // max 2^30 subsequences is tested return; } + unordered_set scrambledsequences; + scrambledsequences.clear(); + int numberofbricks = (int)stringcomposition.size(); + int stop = (1 << numberofbricks) - 1; + string subseq; - bool single; + int brickscount; + // generate all possible combinations of blocks - for (int i = 1; i < (int)pow(2, numberofbricks) - 1; i++) { + for (int i = 1; i < stop; i++) { subseq = ""; - single = true; + brickscount = 0; for (int j = 0; j < numberofbricks; j++) { if ((i >> j) % 2 == 1) { - if ((int)subseq.size() > 0) { + if (brickscount > 0) { subseq += "-"; - single = false; } subseq += stringcomposition[j]; + brickscount++; } } - if (!single) { + if ((brickscount > 1) && (brickscount < numberofbricks - 1)) { scrambledsequences.insert(subseq); } } @@ -388,28 +449,87 @@ void cTheoreticalSpectrum::generateScrambledIons(cBricksDatabase& bricksdatabase // select and normalize scrambled sequences selectAndNormalizeScrambledSequences(scrambledsequences); + unordered_set theoreticalmzratios; + for (int i = 0; i < theoreticalpeaksrealsize; i++) { + theoreticalmzratios.insert((unsigned long long)(theoreticalpeaks[i].mzratio*(double)1000000)); + } + cPeaksList scrambledpeaks; scrambledpeaks.resize(5000); int scrambledspeaksrealsize = 0; + cPeak peak; + map atoms; + + double tempmzratio; + map tempmap; + bool tempmapready, disablesummary; + // generate scrambled peaks from sequences - for (int i = 0; i < (int)parameters->fragmentionsfortheoreticalspectra.size(); i++) { - for (auto it = scrambledsequences.begin(); it != scrambledsequences.end(); ++it) { - b.setComposition((string &)*it, false); - intcomposition.clear(); - b.explodeToIntComposition(intcomposition); - cPeak peak; - peak.iontype = (eFragmentIonType)parameters->fragmentionsfortheoreticalspectra[i]; - peak.mzratio = parameters->fragmentdefinitions[peak.iontype].massdifference; - peak.removeme = false; - peak.scrambled = true; + for (auto it = scrambledsequences.begin(); it != scrambledsequences.end(); ++it) { + + b.setComposition((string &)*it, false); + intcomposition.clear(); + b.explodeToIntComposition(intcomposition); + + tempmzratio = 0; + for (int i = 0; i < (int)intcomposition.size(); i++) { + tempmzratio += bricksdatabase[intcomposition[i] - 1].getMass(); + } + + disablesummary = false; + if ((parameters->mode == denovoengine) && (parameters->blindedges == 2)) { for (int i = 0; i < (int)intcomposition.size(); i++) { - peak.mzratio += bricksdatabase[intcomposition[i] - 1].getMass(); + if (bricksdatabase[intcomposition[i] - 1].isArtificial()) { + disablesummary = true; + break; + } } + } + + tempmapready = false; + for (int i = 0; i < (int)parameters->fragmentionsfortheoreticalspectra.size(); i++) { + + peak.clear(); + peak.iontype = (eFragmentIonType)parameters->fragmentionsfortheoreticalspectra[i]; + peak.mzratio = parameters->fragmentdefinitions[peak.iontype].massdifference; + peak.mzratio += tempmzratio; + + peak.charge = 1; if (parameters->precursorcharge < 0) { peak.mzratio = charge(uncharge(peak.mzratio, 1), -1); + peak.charge = -1; + } + + // skip scrambled peaks whose m/z ratios collide with common fragment ions + if (theoreticalmzratios.find((unsigned long long)(peak.mzratio*(double)1000000)) != theoreticalmzratios.end()) { + continue; + } + + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + + if (!tempmapready) { + tempmap.clear(); + + for (int j = 0; j < (int)intcomposition.size(); j++) { + mergeMaps(bricksdatabase[intcomposition[j] - 1].getSummaryMap(), tempmap); + } + + tempmapready = true; + } + + atoms = tempmap; + mergeMaps(parameters->fragmentdefinitions[peak.iontype].summarymap, atoms); + + if (peak.charge == -1) { + rechargeMap(-1, atoms); + } + + peak.formula.setFromMap(atoms, false); } + + peak.scrambled = true; if (writedescription) { @@ -425,13 +545,15 @@ void cTheoreticalSpectrum::generateScrambledIons(cBricksDatabase& bricksdatabase if (parameters->fragmentdefinitions[peak.iontype].name.size() > 1) { peak.description += parameters->fragmentdefinitions[peak.iontype].name.substr(1, parameters->fragmentdefinitions[peak.iontype].name.length() - 1); } + addAdductToDescription(peak.description, parameters->metaladducts); peak.description += ": "; - for (int i = 0; i < (int)intcomposition.size(); i++) { - peak.description += "[" + bricksdatabase[intcomposition[i] - 1].getAcronymsAsString() + "]"; - if (i < (int)intcomposition.size() - 1) { + for (int j = 0; j < (int)intcomposition.size(); j++) { + peak.description += "[" + bricksdatabase[intcomposition[j] - 1].getAcronymsAsString() + "]"; + if (j < (int)intcomposition.size() - 1) { peak.description += '-'; } } + } if (scrambledpeaks.size() > scrambledspeaksrealsize) { @@ -441,20 +563,34 @@ void cTheoreticalSpectrum::generateScrambledIons(cBricksDatabase& bricksdatabase scrambledpeaks.add(peak); } scrambledspeaksrealsize++; + } + } - scrambledpeaks.resize(scrambledspeaksrealsize); - // find and erase all scrambled peaks whose mz ratios collide with common fragment ions - scrambledpeaks.sortbyMass(); - for (int i = 0; i < theoreticalpeaksrealsize; i++) { - scrambledpeaks.findObsolete(theoreticalpeaks[i].mzratio); - } - scrambledpeaks.removeObsolete(); + scrambledpeaks.resize(scrambledspeaksrealsize); // attach scrambled peaks to common peaks for (int i = 0; i < (int)scrambledpeaks.size(); i++) { - addPeakToList(scrambledpeaks[i], theoreticalpeaksrealsize); + if (writedescription) { + if (scrambledpeaks[i].formula.hasAllElementsPositive()) { + addPeakToList(scrambledpeaks[i], theoreticalpeaksrealsize); + if (!parameters->generateisotopepattern) { + addMetalPeaks(scrambledpeaks[i], parameters->metaladducts, theoreticalpeaksrealsize, 1, writedescription); + } + } + } + else { + if (parameters->generateisotopepattern) { + if (scrambledpeaks[i].formula.hasAllElementsPositive()) { + addPeakToList(scrambledpeaks[i], theoreticalpeaksrealsize); + } + } + else { + addPeakToList(scrambledpeaks[i], theoreticalpeaksrealsize); + addMetalPeaks(scrambledpeaks[i], parameters->metaladducts, theoreticalpeaksrealsize, 1, writedescription); + } + } } } @@ -472,9 +608,14 @@ void cTheoreticalSpectrum::selectAndNormalizeScrambledSequences(unordered_setminimumpatternsize; + int minimumenvelopepeaks = (parameters->mode == dereplication)?parameters->minimumpatternsize:1; int groupid = theoreticalpeaks[0].groupid; int start = 0; @@ -721,7 +1189,7 @@ void cTheoreticalSpectrum::removeUnmatchedIsotopePatterns(cPeaksList& theoretica } // copy unmatched theoretical peaks in matched envelopes into the output - if (!theoreticalpeaks[j].decoy && (theoreticalpeaks[j].matched == 0)) { + if (storeunmatchedpeaks && !theoreticalpeaks[j].decoy && (theoreticalpeaks[j].matched == 0)) { if (theoreticalpeaks[j].relativeintensity*maximumexperimentalintensity / 100.0 >= parameters->minimumrelativeintensitythreshold) { outputtheoreticalpeaks.add(theoreticalpeaks[j]); } @@ -773,7 +1241,7 @@ void cTheoreticalSpectrum::removeUnmatchedIsotopePatterns(cPeaksList& theoretica theoreticalpeaks[j].matchedid = -1; } - if (!theoreticalpeaks[j].decoy && (theoreticalpeaks[j].matched == 0)) { + if (storeunmatchedpeaks && !theoreticalpeaks[j].decoy && (theoreticalpeaks[j].matched == 0)) { if (theoreticalpeaks[j].relativeintensity*maximumexperimentalintensity / 100.0 >= parameters->minimumrelativeintensitythreshold) { outputtheoreticalpeaks.add(theoreticalpeaks[j]); } @@ -1160,6 +1628,66 @@ double cTheoreticalSpectrum::getAngleDistance(cPeaksList& theoreticalpeaks, int } +void cTheoreticalSpectrum::generateFragmentIsotopePatterns(int& theoreticalpeaksrealsize, bool writedescription) { + cPeaksList tmppeaklist = theoreticalpeaks; + int tmppeaklistsize = theoreticalpeaksrealsize; + + //static long long misses = 0; + //static long long all = 0; + + cPeaksList isotopepattern; + int isotopepatternsize; + + cPeak tmppeak; + theoreticalpeaksrealsize = 0; + for (int i = 0; i < tmppeaklistsize; i++) { + if (!tmppeaklist[i].formula.isEmpty()) { + isotopepattern.clear(); + string hashedformula = to_string(tmppeaklist[i].charge) + "@" + tmppeaklist[i].formula.getSummary(); + + isotopepatterncache.lock(); + bool hit = isotopepatterncache.get(hashedformula, isotopepattern); + isotopepatterncache.unlock(); + + if (!hit) { + isotopepattern = tmppeaklist[i].formula.getIsotopePattern(parameters->fwhm, abs(tmppeaklist[i].charge), (tmppeaklist[i].charge < 0) ? false : true, writedescription); + + isotopepatterncache.lock(); + isotopepatterncache.put(hashedformula, isotopepattern); + isotopepatterncache.unlock(); + + //misses++; + } + isotopepatternsize = isotopepattern.size(); + + //all++; + //if (all % 100000 == 0) { + // cout << "all: " << all << " misses:" << misses << " hits:" << all - misses << " misses-to-all ratio:" << (double)misses/(double)all*100.0 << "%" << endl; + //} + + for (int j = 0; j < isotopepatternsize; j++) { + tmppeak = tmppeaklist[i]; + tmppeak.mzratio = isotopepattern[j].mzratio; + tmppeak.relativeintensity = isotopepattern[j].relativeintensity; + tmppeak.absoluteintensity = isotopepattern[j].absoluteintensity; + tmppeak.groupid = i; + if (writedescription) { + tmppeak.isotopeformula = isotopepattern[j].description; + } + addPeakToList(tmppeak, theoreticalpeaksrealsize); + } + } + else { + tmppeak = tmppeaklist[i]; + tmppeak.relativeintensity = 100; + tmppeak.absoluteintensity = 100; + tmppeak.groupid = i; + addPeakToList(tmppeak, theoreticalpeaksrealsize); + } + } +} + + cTheoreticalSpectrum::cTheoreticalSpectrum() { clear(); } @@ -1241,18 +1769,7 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat } if (writedescription) { - valid = false; - if (parameters->searchedsequence.size() > 0) { - for (int i = 0; i < (int)trotations.size(); i++) { - if (regex_search(trotations[i].tcomposition, searchedsequence) && - (parameters->searchedmodifications[trotations[i].startmodifID].name.compare(parameters->searchedsequenceNtermmodif) == 0) && - (parameters->searchedmodifications[trotations[i].middlemodifID].name.compare(parameters->searchedsequenceTmodif) == 0) && - (parameters->searchedmodifications[trotations[i].endmodifID].name.compare(parameters->searchedsequenceCtermmodif) == 0)) { - valid = true; - break; - } - } - } + setValidSequence(searchedsequence); } } catch (regex_error& /*e*/) { @@ -1282,12 +1799,23 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat generatePrecursorIon(trotations[0].bricks, bricksdatabasewithcombinations, theoreticalpeaksrealsize, writedescription); + if (parameters->generateisotopepattern) { + generateFragmentIsotopePatterns(theoreticalpeaksrealsize, writedescription); + } + + // search the theoretical peaks in the experimental peak list experimentalpeaks = sortedpeaklist; experimentalmatches.clear(); searchForPeakPairs(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, parameters->fragmentmasserrortolerance); + if (parameters->generateisotopepattern) { + cPeaksList unmatchedpeaksinmatchedpatterns; + removeUnmatchedIsotopePatterns(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, unmatchedpeaksinmatchedpatterns, false); + } + + // coverage of series vector > > series; series.resize(trotations.size()); @@ -1335,11 +1863,16 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat theoreticalpeaks[*it].matchedppm = ppmError(experimentalpeaks[i].mzratio, theoreticalpeaks[*it].mzratio); } - experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype,theoreticalpeaks[*it].iontype); + experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype, theoreticalpeaks[*it].iontype); } } + if (parameters->generateisotopepattern) { + normalizeTheoreticalIntensities(theoreticalpeaks, theoreticalpeaksrealsize); + } + + if (writedescription) { theoreticalpeaks.fillOrderIDs(); @@ -1391,12 +1924,7 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab } if (writedescription) { - valid = false; - if ((parameters->searchedsequence.size() > 0) && regex_search(candidate.getComposition(), searchedsequence) && - (parameters->searchedmodifications[candidate.getStartModifID()].name.compare(parameters->searchedsequenceNtermmodif) == 0) && - (parameters->searchedmodifications[candidate.getEndModifID()].name.compare(parameters->searchedsequenceCtermmodif) == 0)) { - valid = true; - } + setValidSequence(searchedsequence); } } catch (regex_error& /*e*/) { @@ -1420,12 +1948,23 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab generatePrecursorIon(intcomposition, bricksdatabasewithcombinations, theoreticalpeaksrealsize, writedescription); + if (parameters->generateisotopepattern) { + generateFragmentIsotopePatterns(theoreticalpeaksrealsize, writedescription); + } + + // search the theoretical peaks in the experimental peak list experimentalpeaks = sortedpeaklist; experimentalmatches.clear(); searchForPeakPairs(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, parameters->fragmentmasserrortolerance); + if (parameters->generateisotopepattern) { + cPeaksList unmatchedpeaksinmatchedpatterns; + removeUnmatchedIsotopePatterns(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, unmatchedpeaksinmatchedpatterns, false); + } + + // coverage of series map > series; for (int i = 0; i < (int)parameters->fragmentionsfortheoreticalspectra.size(); i++) { @@ -1468,11 +2007,16 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab theoreticalpeaks[*it].matchedppm = ppmError(experimentalpeaks[i].mzratio, theoreticalpeaks[*it].mzratio); } - experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype,theoreticalpeaks[*it].iontype); + experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype, theoreticalpeaks[*it].iontype); } } + if (parameters->generateisotopepattern) { + normalizeTheoreticalIntensities(theoreticalpeaks, theoreticalpeaksrealsize); + } + + if (writedescription) { theoreticalpeaks.fillOrderIDs(); @@ -1532,33 +2076,8 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab } if (writedescription) { - - valid = false; - - if (parameters->searchedsequence.size() > 0) { - for (int i = 0; i < (int)rotations.size(); i++) { - if (regex_search(rotations[i], searchedsequence)) { - validposition = i; - - if (validposition == 0) { - reversevalidposition = r; - } - else if (validposition == r) { - reversevalidposition = 0; - } - else { - reversevalidposition = 2*r - validposition; - } - - break; - } - } + setValidSequence(searchedsequence); - if (validposition != -1) { - valid = true; - } - } - bool enableshiftoflabels = false; if (!enableshiftoflabels || (validposition == -1)) { validposition = 0; @@ -1624,12 +2143,23 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab generatePrecursorIon(intcomposition, bricksdatabasewithcombinations, theoreticalpeaksrealsize, writedescription); + if (parameters->generateisotopepattern) { + generateFragmentIsotopePatterns(theoreticalpeaksrealsize, writedescription); + } + + // search the theoretical peaks in the experimental peak list experimentalpeaks = sortedpeaklist; experimentalmatches.clear(); searchForPeakPairs(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, parameters->fragmentmasserrortolerance); + if (parameters->generateisotopepattern) { + cPeaksList unmatchedpeaksinmatchedpatterns; + removeUnmatchedIsotopePatterns(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, unmatchedpeaksinmatchedpatterns, false); + } + + // coverage of series vector > > series; series.resize(rotations.size()); @@ -1684,10 +2214,8 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab theoreticalpeaks[j].matched--; theoreticalpeaks[j].matchedid = -1; - } else { - matchesscrambled = false; for (auto it = experimentalmatches[res].begin(); it != experimentalmatches[res].end(); ++it) { if ((theoreticalpeaks[*it].matched > 0) && theoreticalpeaks[*it].scrambled) { @@ -1733,7 +2261,7 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab if (experimentalpeaks[i].iontype != fragmentIonTypeEnd) { if (theoreticalpeaks[*it].scrambled == experimentalpeaks[i].scrambled) { - experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype,theoreticalpeaks[*it].iontype); + experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype, theoreticalpeaks[*it].iontype); } else { if (experimentalpeaks[i].scrambled && !theoreticalpeaks[*it].scrambled) { @@ -1750,6 +2278,11 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab } + if (parameters->generateisotopepattern) { + normalizeTheoreticalIntensities(theoreticalpeaks, theoreticalpeaksrealsize); + } + + if (writedescription) { theoreticalpeaks.fillOrderIDs(); @@ -1902,32 +2435,7 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick } if (writedescription) { - valid = false; - if (parameters->searchedsequence.size() > 0) { - for (int i = 0; i < (int)branchcyclicrotations.size(); i++) { - if (regex_search(branchcyclicrotations[i].getComposition(), searchedsequence)) { - validposition = i; - - if (validposition == 0) { - reversevalidposition = r; - } - else if (validposition == r) { - reversevalidposition = 0; - } - else { - reversevalidposition = 2*r - validposition; - } - } - - for (int j = 0; j < (int)trotationsofbranchcyclicrotations[i].size(); j++) { - if (regex_search(trotationsofbranchcyclicrotations[i][j].tcomposition, searchedsequence) && - (parameters->searchedmodifications[trotationsofbranchcyclicrotations[i][j].middlemodifID].name.compare(parameters->searchedsequenceTmodif) == 0)) { - valid = true; - break; - } - } - } - } + setValidSequence(searchedsequence); bool enableshiftoflabels = true; if (!enableshiftoflabels || (validposition == -1)) { @@ -2002,12 +2510,23 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick generatePrecursorIon(trotationsofbranchcyclicrotations[0][0].bricks, bricksdatabasewithcombinations, theoreticalpeaksrealsize, writedescription); + if (parameters->generateisotopepattern) { + generateFragmentIsotopePatterns(theoreticalpeaksrealsize, writedescription); + } + + // search the theoretical peaks in the experimental peak list experimentalpeaks = sortedpeaklist; experimentalmatches.clear(); searchForPeakPairs(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, parameters->fragmentmasserrortolerance); + if (parameters->generateisotopepattern) { + cPeaksList unmatchedpeaksinmatchedpatterns; + removeUnmatchedIsotopePatterns(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, unmatchedpeaksinmatchedpatterns, false); + } + + // coverage of series vector > > > series; series.resize(branchcyclicrotations.size()); @@ -2064,11 +2583,16 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick theoreticalpeaks[*it].matchedppm = ppmError(experimentalpeaks[i].mzratio, theoreticalpeaks[*it].mzratio); } - experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype,theoreticalpeaks[*it].iontype); + experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype, theoreticalpeaks[*it].iontype); } } + if (parameters->generateisotopepattern) { + normalizeTheoreticalIntensities(theoreticalpeaks, theoreticalpeaksrealsize); + } + + if (writedescription) { theoreticalpeaks.fillOrderIDs(); @@ -2157,18 +2681,7 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB } if (writedescription) { - valid = false; - if ((parameters->searchedsequence.size() > 0) && - ((regex_search(candidate.getComposition(), searchedsequence) && - (parameters->searchedmodifications[candidate.getStartModifID()].name.compare(parameters->searchedsequenceNtermmodif) == 0) && - (parameters->searchedmodifications[candidate.getEndModifID()].name.compare(parameters->searchedsequenceCtermmodif) == 0)) - || - (regex_search(revertedcandidate.getComposition(), searchedsequence) && - (parameters->searchedmodifications[revertedcandidate.getStartModifID()].name.compare(parameters->searchedsequenceNtermmodif) == 0) && - (parameters->searchedmodifications[revertedcandidate.getEndModifID()].name.compare(parameters->searchedsequenceCtermmodif) == 0))) - ) { - valid = true; - } + setValidSequence(searchedsequence); } } catch (regex_error& /*e*/) { @@ -2195,12 +2708,23 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB generatePrecursorIon(intcomposition, bricksdatabasewithcombinations, theoreticalpeaksrealsize, writedescription); + if (parameters->generateisotopepattern) { + generateFragmentIsotopePatterns(theoreticalpeaksrealsize, writedescription); + } + + // search the theoretical peaks in the experimental peak list experimentalpeaks = sortedpeaklist; experimentalmatches.clear(); searchForPeakPairs(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, parameters->fragmentmasserrortolerance); + if (parameters->generateisotopepattern) { + cPeaksList unmatchedpeaksinmatchedpatterns; + removeUnmatchedIsotopePatterns(theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, unmatchedpeaksinmatchedpatterns, false); + } + + // coverage of series map > series; for (int i = 0; i < (int)parameters->fragmentionsfortheoreticalspectra.size(); i++) { @@ -2243,11 +2767,16 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB theoreticalpeaks[*it].matchedppm = ppmError(experimentalpeaks[i].mzratio, theoreticalpeaks[*it].mzratio); } - experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype,theoreticalpeaks[*it].iontype); + experimentalpeaks[i].iontype = selectHigherPriorityIonTypeCID(experimentalpeaks[i].iontype, theoreticalpeaks[*it].iontype); } } + if (parameters->generateisotopepattern) { + normalizeTheoreticalIntensities(theoreticalpeaks, theoreticalpeaksrealsize); + } + + if (writedescription) { theoreticalpeaks.fillOrderIDs(); @@ -2420,7 +2949,7 @@ void cTheoreticalSpectrum::generateFineMSSpectrum() { } description += " " + parameters->sequencedatabase[i].getNameWithReferenceAsHTMLString() + " ("; - cPeaksList isotopepattern = chargedformula.getIsotopePattern(parameters->fwhm, k + 1, parameters->fragmentdefinitions[parameters->fragmentionsfortheoreticalspectra[j]].positive); + cPeaksList isotopepattern = chargedformula.getIsotopePattern(parameters->fwhm, k + 1, parameters->fragmentdefinitions[parameters->fragmentionsfortheoreticalspectra[j]].positive, true); for (int m = 0; m < isotopepattern.size(); m++) { isotopepattern[m].description = description + isotopepattern[m].description + "): "; isotopepattern[m].groupid = groupid; @@ -2454,7 +2983,7 @@ void cTheoreticalSpectrum::compareMSSpectrum(cPeaksList& peaklist, cTheoreticalS removeUnmatchedMetalIsotopes(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); } else { - removeUnmatchedIsotopePatterns(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, unmatchedpeaksinmatchedpatterns); + removeUnmatchedIsotopePatterns(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, unmatchedpeaksinmatchedpatterns, true); targetscores.clear(); decoyscores.clear(); calculateEnvelopeScores(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); @@ -2542,12 +3071,30 @@ void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& pea double tempratio; string tempdescription; + map atoms, tempmap; + atoms.clear(); + + bool disablesummary = false; + if ((parameters->mode == denovoengine) && (parameters->blindedges == 2) && bricksdatabase[intcomposition[0] - 1].isArtificial()) { + disablesummary = true; + } + peak.mzratio = parameters->fragmentdefinitions[fragmentiontype].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + mergeMaps(parameters->fragmentdefinitions[fragmentiontype].summarymap, atoms); + } + if ((peptidetype == linear) || (peptidetype == linearpolyketide)) { peak.mzratio += searchedmodifications[candidate.getStartModifID()].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(searchedmodifications[candidate.getStartModifID()].summary, atoms); + } } if ((peptidetype == branched) || (peptidetype == branchcyclic)) { peak.mzratio += searchedmodifications[trotation->startmodifID].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(searchedmodifications[trotation->startmodifID].summary, atoms); + } } peak.iontype = fragmentiontype; @@ -2583,10 +3130,22 @@ void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& pea for (int i = 0; i < (int)intcomposition.size() - 1; i++) { peak.mzratio += bricksdatabase[intcomposition[i] - 1].getMass(); + if ((parameters->mode == denovoengine) && (parameters->blindedges == 2) && bricksdatabase[intcomposition[i] - 1].isArtificial()) { + peak.formula.clear(); + atoms.clear(); + disablesummary = true; + } + + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + mergeMaps(bricksdatabase[intcomposition[i] - 1].getSummaryMap(), atoms); + } if ((peptidetype == branched) || (peptidetype == branchcyclic)) { if (i == trotation->middlebranchstart) { peak.mzratio += searchedmodifications[trotation->middlemodifID].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(searchedmodifications[trotation->middlemodifID].summary, atoms); + } } if ((i >= trotation->middlebranchstart) && (i < trotation->middlebranchend)) { @@ -2705,7 +3264,7 @@ void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& pea if (peak.mzratio > 0) { - tempratio = peak.mzratio; + tempratio = peak.mzratio; if (writedescription) { tempdescription = peak.description; } @@ -2713,6 +3272,11 @@ void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& pea peak.mzratio = charge(uncharge(tempratio, 1), (parameters->precursorcharge > 0)?j:-j); peak.charge = (parameters->precursorcharge > 0)?j:-j; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + tempmap = atoms; + rechargeMap(peak.charge, tempmap); + peak.formula.setFromMap(tempmap, false); + } if (writedescription) { if (parameters->precursorcharge > 0) { peak.description = to_string(j) + "+ " + tempdescription; @@ -2722,8 +3286,25 @@ void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& pea } } - addPeakToList(peak, peaklistrealsize); - addMetalPeaks(peak, parameters->metaladducts, peaklistrealsize, j, writedescription); + if (writedescription) { + if (peak.formula.hasAllElementsPositive()) { + addPeakToList(peak, peaklistrealsize); + if (!parameters->generateisotopepattern) { + addMetalPeaks(peak, parameters->metaladducts, peaklistrealsize, j, writedescription); + } + } + } + else { + if (parameters->generateisotopepattern) { + if (peak.formula.hasAllElementsPositive()) { + addPeakToList(peak, peaklistrealsize); + } + } + else { + addPeakToList(peak, peaklistrealsize); + addMetalPeaks(peak, parameters->metaladducts, peaklistrealsize, j, writedescription); + } + } } peak.mzratio = tempratio; @@ -2743,12 +3324,30 @@ void cTheoreticalSpectrum::generateCTerminalFragmentIons(int maxcharge, int& pea double tempratio; string tempdescription; + map atoms, tempmap; + atoms.clear(); + + bool disablesummary = false; + if ((parameters->mode == denovoengine) && (parameters->blindedges == 2) && bricksdatabase[intcomposition[intcomposition.size() - 1] - 1].isArtificial()) { + disablesummary = true; + } + peak.mzratio = parameters->fragmentdefinitions[fragmentiontype].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + mergeMaps(parameters->fragmentdefinitions[fragmentiontype].summarymap, atoms); + } + if ((peptidetype == linear) || (peptidetype == linearpolyketide)) { peak.mzratio += searchedmodifications[candidate.getEndModifID()].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(searchedmodifications[candidate.getEndModifID()].summary, atoms); + } } if ((peptidetype == branched) || (peptidetype == branchcyclic)) { peak.mzratio += searchedmodifications[trotation->endmodifID].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(searchedmodifications[trotation->endmodifID].summary, atoms); + } } peak.iontype = fragmentiontype; @@ -2784,11 +3383,24 @@ void cTheoreticalSpectrum::generateCTerminalFragmentIons(int maxcharge, int& pea int order = -1; for (int i = (int)intcomposition.size() - 1; i > 0; i--) { peak.mzratio += bricksdatabase[intcomposition[i] - 1].getMass(); + + if ((parameters->mode == denovoengine) && (parameters->blindedges == 2) && bricksdatabase[intcomposition[i] - 1].isArtificial()) { + peak.formula.clear(); + atoms.clear(); + disablesummary = true; + } + + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + mergeMaps(bricksdatabase[intcomposition[i] - 1].getSummaryMap(), atoms); + } order++; if ((peptidetype == branched) || (peptidetype == branchcyclic)) { if (i == trotation->middlebranchend) { peak.mzratio += searchedmodifications[trotation->middlemodifID].massdifference; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + addStringFormulaToMap(searchedmodifications[trotation->middlemodifID].summary, atoms); + } } if ((i > trotation->middlebranchstart) && (i <= trotation->middlebranchend)) { @@ -2891,6 +3503,11 @@ void cTheoreticalSpectrum::generateCTerminalFragmentIons(int maxcharge, int& pea peak.mzratio = charge(uncharge(tempratio, 1), (parameters->precursorcharge > 0)?j:-j); peak.charge = (parameters->precursorcharge > 0)?j:-j; + if (!disablesummary && (parameters->generateisotopepattern || writedescription)) { + tempmap = atoms; + rechargeMap(peak.charge, tempmap); + peak.formula.setFromMap(tempmap, false); + } if (writedescription) { if (parameters->precursorcharge > 0) { peak.description = to_string(j) + "+ " + tempdescription; @@ -2900,8 +3517,25 @@ void cTheoreticalSpectrum::generateCTerminalFragmentIons(int maxcharge, int& pea } } - addPeakToList(peak, peaklistrealsize); - addMetalPeaks(peak, parameters->metaladducts, peaklistrealsize, j, writedescription); + if (writedescription) { + if (peak.formula.hasAllElementsPositive()) { + addPeakToList(peak, peaklistrealsize); + if (!parameters->generateisotopepattern) { + addMetalPeaks(peak, parameters->metaladducts, peaklistrealsize, j, writedescription); + } + } + } + else { + if (parameters->generateisotopepattern) { + if (peak.formula.hasAllElementsPositive()) { + addPeakToList(peak, peaklistrealsize); + } + } + else { + addPeakToList(peak, peaklistrealsize); + addMetalPeaks(peak, parameters->metaladducts, peaklistrealsize, j, writedescription); + } + } } peak.mzratio = tempratio; @@ -2976,6 +3610,141 @@ int cTheoreticalSpectrum::getReverseValidPosition() { } +void cTheoreticalSpectrum::setValidSequence(regex& searchedsequence) { + valid = false; + + if (parameters->searchedsequence.size() == 0) { + return; + } + + cCandidate revertedcandidate; + vector rotations; + vector trotations; + vector branchcyclicrotations; + vector > trotationsofbranchcyclicrotations; + int r, numberofbricks; + + switch (parameters->peptidetype) { + case linear: + if (regex_search(candidate.getComposition(), searchedsequence) && + (parameters->searchedmodifications[candidate.getStartModifID()].name.compare(parameters->searchedsequenceNtermmodif) == 0) && + (parameters->searchedmodifications[candidate.getEndModifID()].name.compare(parameters->searchedsequenceCtermmodif) == 0)) { + valid = true; + } + break; + case cyclic: + case cyclicpolyketide: + candidate.getRotations(rotations, true); + r = (int)rotations.size() / 2; + + for (int i = 0; i < (int)rotations.size(); i++) { + if (regex_search(rotations[i], searchedsequence)) { + validposition = i; + + if (validposition == 0) { + reversevalidposition = r; + } + else if (validposition == r) { + reversevalidposition = 0; + } + else { + reversevalidposition = 2 * r - validposition; + } + + break; + } + } + + if (validposition != -1) { + valid = true; + } + break; + case branched: + candidate.getPermutationsOfBranches(trotations); + for (int i = 0; i < (int)trotations.size(); i++) { + if (regex_search(trotations[i].tcomposition, searchedsequence) && + (parameters->searchedmodifications[trotations[i].startmodifID].name.compare(parameters->searchedsequenceNtermmodif) == 0) && + (parameters->searchedmodifications[trotations[i].middlemodifID].name.compare(parameters->searchedsequenceTmodif) == 0) && + (parameters->searchedmodifications[trotations[i].endmodifID].name.compare(parameters->searchedsequenceCtermmodif) == 0)) { + valid = true; + break; + } + } + break; + case branchcyclic: + // normalize the candidate + candidate.getBranchCyclicRotations(branchcyclicrotations, false); + numberofbricks = getNumberOfBricks(candidate.getComposition()); + for (int i = 0; i < (int)branchcyclicrotations.size(); i++) { + if (branchcyclicrotations[i].getBranchEnd() == numberofbricks - 1) { + vector v; + v.push_back(branchcyclicrotations[i].getComposition()); + string name = candidate.getName(); + cSummaryFormula summary = candidate.getSummaryFormula(); + vector cpath = candidate.getPath(); + candidate.setCandidate(v, cpath, candidate.getStartIonType(), candidate.getStartModifID(), candidate.getEndModifID(), candidate.getMiddleModifID(), branchcyclicrotations[i].getBranchStart(), branchcyclicrotations[i].getBranchEnd()); + candidate.setName(name); + candidate.setSummaryFormula(summary); + break; + } + } + + // get branch-cyclic rotations + candidate.getBranchCyclicRotations(branchcyclicrotations, true); + + // get T-permutations of branch-cyclic rotations + trotationsofbranchcyclicrotations.resize(branchcyclicrotations.size()); + for (int i = 0; i < (int)branchcyclicrotations.size(); i++) { + branchcyclicrotations[i].getPermutationsOfBranches(trotationsofbranchcyclicrotations[i]); + } + + r = (int)branchcyclicrotations.size() / 2; + + for (int i = 0; i < (int)branchcyclicrotations.size(); i++) { + if (regex_search(branchcyclicrotations[i].getComposition(), searchedsequence)) { + validposition = i; + + if (validposition == 0) { + reversevalidposition = r; + } + else if (validposition == r) { + reversevalidposition = 0; + } + else { + reversevalidposition = 2 * r - validposition; + } + } + + for (int j = 0; j < (int)trotationsofbranchcyclicrotations[i].size(); j++) { + if (regex_search(trotationsofbranchcyclicrotations[i][j].tcomposition, searchedsequence) && + (parameters->searchedmodifications[trotationsofbranchcyclicrotations[i][j].middlemodifID].name.compare(parameters->searchedsequenceTmodif) == 0)) { + valid = true; + break; + } + } + } + break; + case linearpolyketide: + revertedcandidate = candidate; + revertedcandidate.revertComposition(); + if ((regex_search(candidate.getComposition(), searchedsequence) && + (parameters->searchedmodifications[candidate.getStartModifID()].name.compare(parameters->searchedsequenceNtermmodif) == 0) && + (parameters->searchedmodifications[candidate.getEndModifID()].name.compare(parameters->searchedsequenceCtermmodif) == 0)) + || + (regex_search(revertedcandidate.getComposition(), searchedsequence) && + (parameters->searchedmodifications[revertedcandidate.getStartModifID()].name.compare(parameters->searchedsequenceNtermmodif) == 0) && + (parameters->searchedmodifications[revertedcandidate.getEndModifID()].name.compare(parameters->searchedsequenceCtermmodif) == 0))) { + valid = true; + } + break; + case other: + break; + default: + break; + } +} + + int cTheoreticalSpectrum::getNumberOfMatchedBricks() const { return maskscore; } diff --git a/CycloBranch/core/cTheoreticalSpectrum.h b/CycloBranch/core/cTheoreticalSpectrum.h index 65f840c..088a093 100644 --- a/CycloBranch/core/cTheoreticalSpectrum.h +++ b/CycloBranch/core/cTheoreticalSpectrum.h @@ -9,8 +9,9 @@ #include #include -#include +#include #include +#include #include #include "core/cParameters.h" @@ -162,7 +163,7 @@ class cTheoreticalSpectrum { void removeUnmatchedMetalIsotopes(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks); // remove unmatched isotope patterns - void removeUnmatchedIsotopePatterns(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, cPeaksList& outputtheoreticalpeaks); + void removeUnmatchedIsotopePatterns(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, cPeaksList& outputtheoreticalpeaks, bool storeunmatchedpeaks); // calculate envelope scores void calculateEnvelopeScores(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks); @@ -188,6 +189,9 @@ class cTheoreticalSpectrum { // calculate the angle distance double getAngleDistance(cPeaksList& theoreticalpeaks, int start, int stop); + // generate isotope patterns of fragment ions + void generateFragmentIsotopePatterns(int& theoreticalpeaksrealsize, bool writedescription); + public: @@ -475,7 +479,7 @@ class cTheoreticalSpectrum { /** - \brief Check whether the theoretical spectrum corresponds to a searched sequence. + \brief Check if the candidate sequence corresponds to the searched sequence. \retval bool if true then the theoretical spectrum corresponds to a searched sequence */ bool isValid(); @@ -495,6 +499,13 @@ class cTheoreticalSpectrum { int getReverseValidPosition(); + /** + \brief Set a flag determining if the candidate sequence corresponds to the searched sequence. + \param searchedsequence searched sequence + */ + void setValidSequence(regex& searchedsequence); + + /** \brief Get the number of matched bricks. \retval int number of matched bricks diff --git a/CycloBranch/core/cTheoreticalSpectrumList.cpp b/CycloBranch/core/cTheoreticalSpectrumList.cpp index aa0b8a2..bbc54c5 100644 --- a/CycloBranch/core/cTheoreticalSpectrumList.cpp +++ b/CycloBranch/core/cTheoreticalSpectrumList.cpp @@ -5,7 +5,7 @@ double cTheoreticalSpectrumList::getCurrentWorstScore() { QMutexLocker ml(&mutex); - return worstScore; + return currentworstscore; } @@ -54,13 +54,12 @@ cTheoreticalSpectrumList::cTheoreticalSpectrumList() { void cTheoreticalSpectrumList::clear() { theoreticalspectra.clear(); + spectrumbuffer.clear(); os = 0; parameters = 0; graph = 0; - worstScore = 0; - worstNumberOfMatchedPeaks = 0; - refreshlimit = 0; + currentworstscore = 0; } @@ -68,8 +67,6 @@ void cTheoreticalSpectrumList::initialize(cMainThread& os, cParameters& paramete this->os = &os; this->parameters = ¶meters; this->graph = graph; - - refreshlimit = parameters.hitsreported + 500; } @@ -118,8 +115,7 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, //int pos; int theoreticalpeaksrealsize = 0; - worstScore = 0; - worstNumberOfMatchedPeaks = 0; + currentworstscore = 0; stmp = parameters->sequencetag; fixRegularExpression(stmp); @@ -190,15 +186,15 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, candidates.unlock(); QThreadPool::globalInstance()->start(comparatorthread); - if ((i % 100 == 0) && (i > 0)) { + if ((i + 1) % 100 == 0) { *os << "."; } - if ((i % 1000 == 0) && (i > 0)) { - *os << i << " "; + if ((i + 1) % 1000 == 0) { + *os << i + 1; } - if ((i % 10000 == 0) && (i > 0)) { + if ((i + 1) % 10000 == 0) { //*os << "(Remaining candidates in buffer: " << size << "; Are they all ?: " << (os->isGraphReaderWorking() ? "no" : "yes") << ")" << endl; *os << endl; } @@ -221,7 +217,10 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, os->usleep(1000); } - sortAndFitSize(); + // move the list to vector + theoreticalspectra.clear(); + theoreticalspectra.insert(theoreticalspectra.end(), make_move_iterator(spectrumbuffer.begin()), make_move_iterator(spectrumbuffer.end())); + spectrumbuffer.clear(); } else { @@ -234,6 +233,18 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, cTheoreticalSpectrum tsp; tsp.resizePeakList(5000); + isotopepatterncache.lock(); + isotopepatterncache.clear(); + isotopepatterncache.unlock(); + + unordered_map peakdesctoid; + unordered_map isotopeformuladesctoid; + + parameters->peakidtodesc.clear(); + parameters->isotopeformulaidtodesc.clear(); + + *os << " ok" << endl << endl << "Preparing the report... " << endl; + // fill descriptions of peaks resultspectra.resize(theoreticalspectra.size()); for (int i = 0; i < (int)theoreticalspectra.size(); i++) { @@ -242,29 +253,31 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, tsp.setParameters(parameters); tsp.setCandidate(theoreticalspectra[i].getCandidate()); - switch (parameters->peptidetype) - { - case linear: - theoreticalpeaksrealsize = tsp.compareLinear(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); - break; - case cyclic: - theoreticalpeaksrealsize = tsp.compareCyclic(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); - break; - case branched: - theoreticalpeaksrealsize = tsp.compareBranched(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); - break; - case branchcyclic: - theoreticalpeaksrealsize = tsp.compareBranchCyclic(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); - break; - case linearpolyketide: - theoreticalpeaksrealsize = tsp.compareLinearPolyketide(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); - break; - case cyclicpolyketide: - theoreticalpeaksrealsize = tsp.compareCyclicPolyketide(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); - break; - case other: - default: - break; + theoreticalspectra[i].clear(true); + + switch (parameters->peptidetype) { + case linear: + theoreticalpeaksrealsize = tsp.compareLinear(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); + break; + case cyclic: + theoreticalpeaksrealsize = tsp.compareCyclic(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); + break; + case branched: + theoreticalpeaksrealsize = tsp.compareBranched(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); + break; + case branchcyclic: + theoreticalpeaksrealsize = tsp.compareBranchCyclic(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); + break; + case linearpolyketide: + theoreticalpeaksrealsize = tsp.compareLinearPolyketide(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); + break; + case cyclicpolyketide: + theoreticalpeaksrealsize = tsp.compareCyclicPolyketide(peaklist, *bricksdb, true, rxsequencetag, rxsearchedsequence); + break; + case other: + break; + default: + break; } // invalid sequence tag @@ -273,9 +286,33 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, } resultspectra[i] = tsp; resultspectra[i].resizePeakList(theoreticalpeaksrealsize); + resultspectra[i].getTheoreticalPeaks()->reducePeakDescriptions(peakdesctoid); + resultspectra[i].getTheoreticalPeaks()->reduceIsotopeFormulaDescriptions(isotopeformuladesctoid); + + if ((i + 1) % 100 == 0) { + *os << "."; + } + + if ((i + 1) % 1000 == 0) { + *os << i + 1; + } + + if ((i + 1) % 10000 == 0) { + *os << endl; + } + } - theoreticalspectra = resultspectra; + convertStringIntUnorderedMapToStringVector(peakdesctoid, parameters->peakidtodesc); + convertStringIntUnorderedMapToStringVector(isotopeformuladesctoid, parameters->isotopeformulaidtodesc); + + isotopepatterncache.lock(); + isotopepatterncache.clear(); + isotopepatterncache.unlock(); + + theoreticalspectra.clear(); + theoreticalspectra.insert(theoreticalspectra.end(), make_move_iterator(resultspectra.begin()), make_move_iterator(resultspectra.end())); + resultspectra.clear(); //computeNumbersOfCompletedSeries(); @@ -307,7 +344,7 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, theoreticalspectra[i].setParameters(0); } - if (parameters->mode == denovoengine) { + if ((parameters->mode == denovoengine) || (parameters->mode == databasesearch)) { sortAndFitSize(); } @@ -316,188 +353,154 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, } -void cTheoreticalSpectrumList::addButDoNotFitSize(cTheoreticalSpectrum& theoreticalspectrum, int theoreticalpeaksrealsize) { +double cTheoreticalSpectrumList::updatekNNList(cTheoreticalSpectrum& theoreticalspectrum, int theoreticalpeaksrealsize, double score, regex* rxsearchedsequence) { QMutexLocker ml(&mutex); - if ((int)theoreticalspectra.size() < parameters->hitsreported) { + if (score < currentworstscore) { + return currentworstscore; + } - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); + bool (*comparatorfunction)(const cTheoreticalSpectrum&, const cTheoreticalSpectrum&); - if ((int)theoreticalspectra.size() == parameters->hitsreported) { - switch (parameters->scoretype) { + switch (parameters->scoretype) { + case b_ions: + comparatorfunction = &compareBandAllIonsDesc; + break; + case b_ions_and_b_dehydrated_ions: + comparatorfunction = &compareBBwaterLossAndAllIonsDesc; + break; + case b_ions_and_b_deamidated_ions: + comparatorfunction = &compareBBammoniaLossAndAllIonsDesc; + break; + case y_ions_and_b_ions: + comparatorfunction = &compareYBandAllIonsDesc; + break; + case y_ions: + comparatorfunction = &compareYandAllIonsDesc; + break; + case weighted_intensity: + comparatorfunction = &compareWeightedIntensityDesc; + break; + case matched_peaks: + comparatorfunction = &compareNumberOfMatchedPeaksDesc; + break; + case matched_bricks: + comparatorfunction = &compareNumberOfMatchedBricksDesc; + break; + } + + auto it1 = lower_bound(spectrumbuffer.begin(), spectrumbuffer.end(), theoreticalspectrum, comparatorfunction); + + theoreticalspectrum.setValidSequence(*rxsearchedsequence); + + if (it1 != spectrumbuffer.end()) { + double currentscore = 0; + + switch (parameters->scoretype) { case b_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBandAllIonsDesc); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion); + currentscore = it1->getNumberOfMatchedPeaks(b_ion); break; case b_ions_and_b_dehydrated_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBwaterLossAndAllIonsDesc); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion) + theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion_dehydrated); + currentscore = it1->getNumberOfMatchedPeaks(b_ion) + it1->getNumberOfMatchedPeaks(b_ion_dehydrated); break; case b_ions_and_b_deamidated_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBammoniaLossAndAllIonsDesc); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion) + theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion_deamidated); + currentscore = it1->getNumberOfMatchedPeaks(b_ion) + it1->getNumberOfMatchedPeaks(b_ion_deamidated); break; case y_ions_and_b_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYBandAllIonsDesc); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaksYB(); + currentscore = it1->getNumberOfMatchedPeaksYB(); break; case y_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYandAllIonsDesc); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(y_ion); + currentscore = it1->getNumberOfMatchedPeaks(y_ion); break; case weighted_intensity: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareWeightedIntensityDesc); - worstScore = theoreticalspectra.back().getWeightedIntensityScore(); + currentscore = it1->getWeightedIntensityScore(); break; case matched_peaks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedPeaksDesc); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(); + currentscore = it1->getNumberOfMatchedPeaks(); break; case matched_bricks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedBricksDesc); - worstScore = theoreticalspectra.back().getNumberOfMatchedBricks(); + currentscore = it1->getNumberOfMatchedBricks(); break; - } - worstNumberOfMatchedPeaks = theoreticalspectra.back().getNumberOfMatchedPeaks(); } - } - else { - - switch (parameters->scoretype) { - case b_ions: - if ((worstScore < theoreticalspectrum.getNumberOfMatchedPeaks(b_ion)) || ((worstScore == theoreticalspectrum.getNumberOfMatchedPeaks(b_ion)) && (worstNumberOfMatchedPeaks < theoreticalspectrum.getNumberOfMatchedPeaks()))) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); - } - break; - case b_ions_and_b_dehydrated_ions: - if ((worstScore < theoreticalspectrum.getNumberOfMatchedPeaks(b_ion) + theoreticalspectrum.getNumberOfMatchedPeaks(b_ion_dehydrated)) || ((worstScore == theoreticalspectrum.getNumberOfMatchedPeaks(b_ion) + theoreticalspectrum.getNumberOfMatchedPeaks(b_ion_dehydrated)) && (worstNumberOfMatchedPeaks < theoreticalspectrum.getNumberOfMatchedPeaks()))) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); - } - break; - case b_ions_and_b_deamidated_ions: - if ((worstScore < theoreticalspectrum.getNumberOfMatchedPeaks(b_ion) + theoreticalspectrum.getNumberOfMatchedPeaks(b_ion_deamidated)) || ((worstScore == theoreticalspectrum.getNumberOfMatchedPeaks(b_ion) + theoreticalspectrum.getNumberOfMatchedPeaks(b_ion_deamidated)) && (worstNumberOfMatchedPeaks < theoreticalspectrum.getNumberOfMatchedPeaks()))) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); - } - break; - case y_ions_and_b_ions: - if ((worstScore < theoreticalspectrum.getNumberOfMatchedPeaksYB()) || ((worstScore == theoreticalspectrum.getNumberOfMatchedPeaksYB()) && (worstNumberOfMatchedPeaks < theoreticalspectrum.getNumberOfMatchedPeaks()))) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); - } - break; - case y_ions: - if (worstScore < theoreticalspectrum.getNumberOfMatchedPeaks(y_ion)) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); - } - break; - case weighted_intensity: - if (worstScore < theoreticalspectrum.getWeightedIntensityScore()) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); + if ((currentscore == score) && (it1->getCandidate().getPath() == theoreticalspectrum.getCandidate().getPath())) { + if (!it1->isValid() && theoreticalspectrum.isValid()) { + *it1 = theoreticalspectrum; + it1->resizePeakList(theoreticalpeaksrealsize); } - break; - case matched_peaks: - if (worstScore < theoreticalspectrum.getNumberOfMatchedPeaks()) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); - } - break; - case matched_bricks: - if (worstScore < theoreticalspectrum.getNumberOfMatchedBricks()) { - theoreticalspectra.push_back(theoreticalspectrum); - theoreticalspectra.back().resizePeakList(theoreticalpeaksrealsize); - } - break; + return currentworstscore; } - - if ((int)theoreticalspectra.size() >= refreshlimit) { + } - switch (parameters->scoretype) { + auto it2 = spectrumbuffer.insert(it1, theoreticalspectrum); + it2->resizePeakList(theoreticalpeaksrealsize); + + if ((int)spectrumbuffer.size() > parameters->hitsreported) { + spectrumbuffer.pop_back(); + + switch (parameters->scoretype) { case b_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBandAllIonsDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion); + currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedPeaks(b_ion); break; case b_ions_and_b_dehydrated_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBwaterLossAndAllIonsDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion) + theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion_dehydrated); + currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedPeaks(b_ion) + prev(spectrumbuffer.end())->getNumberOfMatchedPeaks(b_ion_dehydrated); break; case b_ions_and_b_deamidated_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBammoniaLossAndAllIonsDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion) + theoreticalspectra.back().getNumberOfMatchedPeaks(b_ion_deamidated); + currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedPeaks(b_ion) + prev(spectrumbuffer.end())->getNumberOfMatchedPeaks(b_ion_deamidated); break; case y_ions_and_b_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYBandAllIonsDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaksYB(); + currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedPeaksYB(); break; case y_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYandAllIonsDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(y_ion); + currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedPeaks(y_ion); break; case weighted_intensity: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareWeightedIntensityDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getWeightedIntensityScore(); + currentworstscore = prev(spectrumbuffer.end())->getWeightedIntensityScore(); break; case matched_peaks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedPeaksDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getNumberOfMatchedPeaks(); + currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedPeaks(); break; case matched_bricks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedBricksDesc); - theoreticalspectra.resize(parameters->hitsreported); - worstScore = theoreticalspectra.back().getNumberOfMatchedBricks(); + currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedBricks(); break; - } - - worstNumberOfMatchedPeaks = theoreticalspectra.back().getNumberOfMatchedPeaks(); - } + } + return currentworstscore; } void cTheoreticalSpectrumList::sortAndFitSize() { switch (parameters->scoretype) { - case b_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBandAllIonsDesc); - break; - case b_ions_and_b_dehydrated_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBwaterLossAndAllIonsDesc); - break; - case b_ions_and_b_deamidated_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBammoniaLossAndAllIonsDesc); - break; - case y_ions_and_b_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYBandAllIonsDesc); - break; - case y_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYandAllIonsDesc); - break; - case weighted_intensity: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareWeightedIntensityDesc); - break; - case matched_peaks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedPeaksDesc); - break; - case matched_bricks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedBricksDesc); - break; + case b_ions: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBandAllIonsDesc); + break; + case b_ions_and_b_dehydrated_ions: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBwaterLossAndAllIonsDesc); + break; + case b_ions_and_b_deamidated_ions: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBBammoniaLossAndAllIonsDesc); + break; + case y_ions_and_b_ions: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYBandAllIonsDesc); + break; + case y_ions: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYandAllIonsDesc); + break; + case weighted_intensity: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareWeightedIntensityDesc); + break; + case matched_peaks: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedPeaksDesc); + break; + case matched_bricks: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedBricksDesc); + break; } + // might be useful for databasesearch mode if ((int)theoreticalspectra.size() > parameters->hitsreported) { theoreticalspectra.resize(parameters->hitsreported); } diff --git a/CycloBranch/core/cTheoreticalSpectrumList.h b/CycloBranch/core/cTheoreticalSpectrumList.h index 8d2cba5..27a6829 100644 --- a/CycloBranch/core/cTheoreticalSpectrumList.h +++ b/CycloBranch/core/cTheoreticalSpectrumList.h @@ -8,6 +8,7 @@ #define _CTHEORETICALSPECTRUMLIST_H #include +#include #include #include "parallel/cSpectrumComparatorThread.h" @@ -21,13 +22,12 @@ class cMainThread; class cTheoreticalSpectrumList { vector theoreticalspectra; + list spectrumbuffer; cMainThread* os; cParameters* parameters; cDeNovoGraph* graph; - double worstScore; - int worstNumberOfMatchedPeaks; - int refreshlimit; + double currentworstscore; QMutex mutex; @@ -93,12 +93,14 @@ class cTheoreticalSpectrumList { /** - \brief Add a new spectrum to the list when the number cParameters::hitsreported has not been exceeded or when it has been exceeded but - the score of the newly added spectrum is better than the worst score of a peptide in the list (thread-safe). - \param theoreticalspectrum reference to a newly added spectrum + \brief Update the kNN list of peptide sequence candidates (thread-safe). + \param theoreticalspectrum reference to the newly added spectrum \param theoreticalpeaksrealsize the number of peaks in the newly added spectrum (required because of a performance improvement) + \param score score of the candidate to be inserted + \param rxsearchedsequence regular expression corresponding to searched sequence + \retval double current value of the worst score in the list of candidates */ - void addButDoNotFitSize(cTheoreticalSpectrum& theoreticalspectrum, int theoreticalpeaksrealsize); + double updatekNNList(cTheoreticalSpectrum& theoreticalspectrum, int theoreticalpeaksrealsize, double score, regex* rxsearchedsequence); /** diff --git a/CycloBranch/core/utilities.cpp b/CycloBranch/core/utilities.cpp index 42325f9..44cdffa 100644 --- a/CycloBranch/core/utilities.cpp +++ b/CycloBranch/core/utilities.cpp @@ -4,7 +4,7 @@ QString appname = "CycloBranch"; -QString appversion = "v. 1.2.495 (64-bit)"; +QString appversion = "v. 1.2.660 (64-bit)"; #if OS_TYPE == UNX @@ -50,6 +50,69 @@ void loadStringVector(vector& v, ifstream& is) { } +void storeStringIntMap(map& map, ofstream& os) { + int size; + string s; + + size = (int)map.size(); + os.write((char *)&size, sizeof(int)); + for (auto it = map.begin(); it != map.end(); ++it) { + s = it->first; + storeString(s, os); + os.write((char *)&it->second, sizeof(int)); + } +} + + +void loadStringIntMap(map& map, ifstream& is) { + int size, value; + string s; + + is.read((char *)&size, sizeof(int)); + map.clear(); + for (int i = 0; i < size; i++) { + loadString(s, is); + is.read((char *)&value, sizeof(int)); + map[s] = value; + } +} + + +void storeIntStringMap(map& map, ofstream& os) { + int size = (int)map.size(); + os.write((char *)&size, sizeof(int)); + for (auto it = map.begin(); it != map.end(); ++it) { + os.write((char *)&it->first, sizeof(int)); + storeString(it->second, os); + } +} + + +void loadIntStringMap(map& map, ifstream& is) { + int size, value; + string s; + + is.read((char *)&size, sizeof(int)); + map.clear(); + for (int i = 0; i < size; i++) { + is.read((char *)&value, sizeof(int)); + loadString(s, is); + map[value] = s; + } +} + + +void convertStringIntUnorderedMapToStringVector(unordered_map& map, vector& vector) { + vector.resize(map.size()); + unordered_map::iterator it; + while (map.begin() != map.end()) { + it = map.begin(); + vector[it->second] = it->first; + map.erase(it); + } +} + + bool isWhiteSpaceExceptSpace(char c) { return isspace(c) && (c != ' '); } diff --git a/CycloBranch/core/utilities.h b/CycloBranch/core/utilities.h index eb4cac0..c1a8757 100644 --- a/CycloBranch/core/utilities.h +++ b/CycloBranch/core/utilities.h @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include #include @@ -141,6 +143,46 @@ void storeStringVector(vector& v, ofstream& os); void loadStringVector(vector& v, ifstream& is); +/** + \brief Store a map into an output stream. + \param map reference to a map + \param os reference to an output stream +*/ +void storeStringIntMap(map& map, ofstream& os); + + +/** + \brief Load a map from an input stream. + \param map reference to a map + \param is reference to an input stream +*/ +void loadStringIntMap(map& map, ifstream& is); + + +/** + \brief Store a map into an output stream. + \param map reference to a map + \param os reference to an output stream +*/ +void storeIntStringMap(map& map, ofstream& os); + + +/** + \brief Load a map from an input stream. + \param map reference to a map + \param is reference to an input stream +*/ +void loadIntStringMap(map& map, ifstream& is); + + +/** + \brief Convert an unordered_map to a vector. + \param map an input map + \param vector an output vector +*/ +void convertStringIntUnorderedMapToStringVector(unordered_map& map, vector& vector); + + /** \brief Check if \a c is a white space (except normal space). \param c char diff --git a/CycloBranch/gui/cAboutWidget.cpp b/CycloBranch/gui/cAboutWidget.cpp index d1fc73b..cd4e958 100644 --- a/CycloBranch/gui/cAboutWidget.cpp +++ b/CycloBranch/gui/cAboutWidget.cpp @@ -33,7 +33,7 @@ cAboutWidget::cAboutWidget(QWidget* parent) { licence += "This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

"; licence += "You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.


"; - QString developers = "Developers:

Jiri Novak
Laboratory of Molecular Structure Characterization
Institute of Microbiology
Academy of Sciences of the Czech Republic
Videnska 1083
142 20 Prague
Czech Republic
jiri.novak@biomed.cas.cz
http://ms.biomed.cas.cz/staff-novak_jiri.php
https://cas-cz.academia.edu/JiriNovak

(C) 2013 - 2017


"; + QString developers = "Developers:

Jiri Novak
Laboratory of Molecular Structure Characterization
Institute of Microbiology
Academy of Sciences of the Czech Republic
Videnska 1083
142 20 Prague
Czech Republic
jiri.novak@biomed.cas.cz
http://ms.biomed.cas.cz/staff-novak_jiri.php
https://cas-cz.academia.edu/JiriNovak

(C) 2013 - 2018


"; QString splash = "



"; diff --git a/CycloBranch/gui/cChromatogramWindowWidget.cpp b/CycloBranch/gui/cChromatogramWindowWidget.cpp index b4dff21..7983c60 100644 --- a/CycloBranch/gui/cChromatogramWindowWidget.cpp +++ b/CycloBranch/gui/cChromatogramWindowWidget.cpp @@ -186,63 +186,49 @@ void cChromatogramWindowWidget::wheelEvent(QWheelEvent *event) { void cChromatogramWindowWidget::mouseMoveEvent(QMouseEvent *event) { QGraphicsView::mouseMoveEvent(event); - if (enablemouseselection && (pressedx != -1) && (pressedy != -1)) { + if ((pressedx != -1) && (pressedy != -1)) { QPointF p = mapToScene(event->x(), event->y()); currentx = (int)p.x(); currenty = (int)p.y(); - updateZoomGroup(); - } + if (enablemouseselection) { + updateZoomGroup(); + } + else { + calculateMinMaxScan(); - event->accept(); -} + emit updateScanIDInterval(minscan, maxscan); - -void cChromatogramWindowWidget::mouseReleaseEvent(QMouseEvent *event) { - QGraphicsView::mouseReleaseEvent(event); - - if (enablemouseselection) { - if (pressedx == currentx) { - pressedx = -1; - currentx = -1; + pressedx = currentx; + pressedy = currenty; redrawScene(); } + } - if ((event->button() == Qt::LeftButton) && (pressedx != -1) && (pressedy != -1)) { - if (pressedx < leftmargin) { - pressedx = leftmargin; - } - - if (pressedx > origwidth - rightmargin) { - pressedx = origwidth - rightmargin; - } - - if (currentx < leftmargin) { - currentx = leftmargin; - } + event->accept(); +} - if (currentx > origwidth - rightmargin) { - currentx = origwidth - rightmargin; - } - int tmpminscan = getScanIDFromXPosition((pressedx < currentx) ? pressedx : currentx, origwidth); - int tmpmaxscan = getScanIDFromXPosition((pressedx < currentx) ? currentx : pressedx, origwidth); +void cChromatogramWindowWidget::mouseReleaseEvent(QMouseEvent *event) { + QGraphicsView::mouseReleaseEvent(event); - if (tmpminscan != tmpmaxscan) { + if (pressedx == currentx) { + pressedx = -1; + currentx = -1; - minscan = tmpminscan; - maxscan = tmpmaxscan; + redrawScene(); + } - emit updateScanIDInterval(minscan, maxscan); + if ((event->button() == Qt::LeftButton) && (pressedx != -1) && (pressedy != -1)) { + calculateMinMaxScan(); - } + emit updateScanIDInterval(minscan, maxscan); - pressedx = -1; - pressedy = -1; + pressedx = -1; + pressedy = -1; - redrawScene(); - } + redrawScene(); } event->accept(); @@ -252,25 +238,27 @@ void cChromatogramWindowWidget::mouseReleaseEvent(QMouseEvent *event) { void cChromatogramWindowWidget::mousePressEvent(QMouseEvent *event) { QGraphicsView::mousePressEvent(event); - if (enablemouseselection) { - if (event->button() == Qt::LeftButton) { - QPointF p = mapToScene(event->x(), event->y()); - pressedx = (int)p.x(); - pressedy = (int)p.y(); + if (event->button() == Qt::LeftButton) { + QPointF p = mapToScene(event->x(), event->y()); + pressedx = (int)p.x(); + pressedy = (int)p.y(); - currentx = pressedx; - currenty = pressedy; + currentx = pressedx; + currenty = pressedy; + if (enablemouseselection) { updateZoomGroup(); } + } - if (event->button() == Qt::RightButton) { - pressedx = -1; - pressedy = -1; + if (event->button() == Qt::RightButton) { + pressedx = -1; + pressedy = -1; - redrawScene(); - } + redrawScene(); + } + if (enablemouseselection) { if (event->button() == Qt::MiddleButton) { pressedx = -1; pressedy = -1; @@ -616,6 +604,45 @@ void cChromatogramWindowWidget::updateZoomGroup() { } +void cChromatogramWindowWidget::calculateMinMaxScan() { + if (pressedx < leftmargin) { + pressedx = leftmargin; + } + + if (pressedx > origwidth - rightmargin) { + pressedx = origwidth - rightmargin; + } + + if (currentx < leftmargin) { + currentx = leftmargin; + } + + if (currentx > origwidth - rightmargin) { + currentx = origwidth - rightmargin; + } + + int tmpminscan = getScanIDFromXPosition((pressedx < currentx) ? pressedx : currentx, origwidth); + int tmpmaxscan = getScanIDFromXPosition((pressedx < currentx) ? currentx : pressedx, origwidth); + + if (enablemouseselection) { + if (tmpminscan != tmpmaxscan) { + minscan = tmpminscan; + maxscan = tmpmaxscan; + } + } + else { + if (pressedx > currentx) { + minscan = min(minscan + tmpmaxscan - tmpminscan, max(1, ticchromatogram.size())); + maxscan = min(maxscan + tmpmaxscan - tmpminscan, max(1, ticchromatogram.size())); + } + else { + minscan = max(1, minscan - tmpmaxscan + tmpminscan); + maxscan = max(1, maxscan - tmpmaxscan + tmpminscan); + } + } +} + + void cChromatogramWindowWidget::zoomIn() { if (currentscale < 32) { currentscale += factor; diff --git a/CycloBranch/gui/cChromatogramWindowWidget.h b/CycloBranch/gui/cChromatogramWindowWidget.h index 3db1973..300d4b3 100644 --- a/CycloBranch/gui/cChromatogramWindowWidget.h +++ b/CycloBranch/gui/cChromatogramWindowWidget.h @@ -175,6 +175,9 @@ class cChromatogramWindowWidget : public QGraphicsView void updateZoomGroup(); + void calculateMinMaxScan(); + + signals: diff --git a/CycloBranch/gui/cImageWindow.cpp b/CycloBranch/gui/cImageWindow.cpp index c781cd2..6810c8a 100644 --- a/CycloBranch/gui/cImageWindow.cpp +++ b/CycloBranch/gui/cImageWindow.cpp @@ -112,6 +112,23 @@ cImageWindow::cImageWindow(QWidget* parent) { maxy->setValue(500); maxy->setToolTip("The Y coordinate of the bottom-right corner of an optical image [number of points]; see manual for vendor specific details."); + pixelsizexlabel = new QLabel("Pixel Width: "); + + pixelsizexspinbox = new QSpinBox(); + pixelsizexspinbox->setRange(1, 100000); + pixelsizexspinbox->setSingleStep(1); + pixelsizexspinbox->setValue(100); + pixelsizexspinbox->setSuffix(" um"); + pixelsizexspinbox->setToolTip("Pixel width [um]."); + + pixelsizeylabel = new QLabel("Pixel Height: "); + + pixelsizeyspinbox = new QSpinBox(); + pixelsizeyspinbox->setRange(1, 100000); + pixelsizeyspinbox->setSingleStep(1); + pixelsizeyspinbox->setValue(100); + pixelsizeyspinbox->setSuffix(" um"); + pixelsizeyspinbox->setToolTip("Pixel height [um]."); setmaxbutton = new QPushButton(" Correlate "); setmaxbutton->setToolTip("Correlate the measured region of compounds with optical image."); @@ -128,6 +145,10 @@ cImageWindow::cImageWindow(QWidget* parent) { maxcoordinateshbox->addWidget(maxx); maxcoordinateshbox->addWidget(maxylabel); maxcoordinateshbox->addWidget(maxy); + maxcoordinateshbox->addWidget(pixelsizexlabel); + maxcoordinateshbox->addWidget(pixelsizexspinbox); + maxcoordinateshbox->addWidget(pixelsizeylabel); + maxcoordinateshbox->addWidget(pixelsizeyspinbox); maxcoordinateshbox->addWidget(setmaxbutton); maxcoordinateshbox->addWidget(setdefaultbutton); @@ -419,6 +440,8 @@ cImageWindow::cImageWindow(QWidget* parent) { toolbarRegion = addToolBar(tr("Compounds")); toolbarRegion->addWidget(regionwidget); + addToolBarBreak(); + toolbarMaxCoordinates = addToolBar(tr("Optical Image")); toolbarMaxCoordinates->addWidget(maxcoordinateswidget); @@ -490,7 +513,8 @@ cImageWindow::cImageWindow(QWidget* parent) { defaultmaxx = 1; defaultmaxy = 1; - pixelsize = 1; + defaultpixelsizex = 1; + defaultpixelsizey = 1; vendor = unknownvendor; } @@ -517,6 +541,10 @@ cImageWindow::~cImageWindow() { delete maxx; delete maxylabel; delete maxy; + delete pixelsizexlabel; + delete pixelsizexspinbox; + delete pixelsizeylabel; + delete pixelsizeyspinbox; delete setmaxbutton; delete setdefaultbutton; delete maxcoordinateshbox; @@ -590,12 +618,13 @@ void cImageWindow::closeEvent(QCloseEvent *event) { } -void cImageWindow::setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int pixelsize, eVendorType vendor) { +void cImageWindow::setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor) { this->defaultmaxx = defaultmaxx; this->defaultmaxy = defaultmaxy; - this->pixelsize = pixelsize; + this->defaultpixelsizex = defaultpixelsizex; + this->defaultpixelsizey = defaultpixelsizey; this->vendor = vendor; - imagewindowwidget->setDefaultMaxXY(defaultmaxx, defaultmaxy, pixelsize, vendor); + imagewindowwidget->setDefaultMaxXY(defaultmaxx, defaultmaxy, defaultpixelsizex, defaultpixelsizey, vendor); } @@ -686,12 +715,16 @@ void cImageWindow::colorSpinBoxes(int layerid) { topshift->setStyleSheet("QSpinBox { background-color: lime; }"); maxx->setStyleSheet("QSpinBox { background-color: lime; }"); maxy->setStyleSheet("QSpinBox { background-color: lime; }"); + pixelsizexspinbox->setStyleSheet("QSpinBox { background-color: lime; }"); + pixelsizeyspinbox->setStyleSheet("QSpinBox { background-color: lime; }"); } else { leftshift->setStyleSheet("QSpinBox { background-color: white; }"); topshift->setStyleSheet("QSpinBox { background-color: white; }"); maxx->setStyleSheet("QSpinBox { background-color: white; }"); maxy->setStyleSheet("QSpinBox { background-color: white; }"); + pixelsizexspinbox->setStyleSheet("QSpinBox { background-color: white; }"); + pixelsizeyspinbox->setStyleSheet("QSpinBox { background-color: white; }"); } if ((eLayerType)layerid == layer_histology_image) { @@ -734,7 +767,7 @@ void cImageWindow::keyPressEvent(QKeyEvent *event) { setregionbutton->click(); } - if (leftshift->hasFocus() || topshift->hasFocus() || maxx->hasFocus() || maxy->hasFocus()) { + if (leftshift->hasFocus() || topshift->hasFocus() || maxx->hasFocus() || maxy->hasFocus() || pixelsizexspinbox->hasFocus() || pixelsizeyspinbox->hasFocus()) { setmaxbutton->click(); } @@ -834,6 +867,8 @@ void cImageWindow::openOpticalImage() { topshift->setValue(0); maxx->setValue(defaultmaxx); maxy->setValue(defaultmaxy); + pixelsizexspinbox->setValue(defaultpixelsizex); + pixelsizeyspinbox->setValue(defaultpixelsizey); setMaxButtonReleased(); @@ -1043,7 +1078,7 @@ void cImageWindow::setFilterOptionsSlot(vector coordinates, string void cImageWindow::setMaxButtonReleased() { - imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value()); + imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value(), pixelsizexspinbox->value(), pixelsizeyspinbox->value()); resetregionbutton->click(); } @@ -1053,7 +1088,9 @@ void cImageWindow::setDefaultButtonReleased() { topshift->setValue(0); maxx->setValue(defaultmaxx); maxy->setValue(defaultmaxy); - imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value()); + pixelsizexspinbox->setValue(defaultpixelsizex); + pixelsizeyspinbox->setValue(defaultpixelsizey); + imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value(), pixelsizexspinbox->value(), pixelsizeyspinbox->value()); resetregionbutton->click(); } @@ -1137,7 +1174,7 @@ void cImageWindow::microscopyDefaultButtonReleased() { microscopylayers[activelayer].y = microscopylayers[layer_microscopy_navigation_image].y + (microscopylayers[layer_microscopy_navigation_image].height - microscopylayers[activelayer].defaultheight) / 2.0 + (microscopylayers[activelayer].stagey - microscopylayers[layer_microscopy_navigation_image].stagey) * 1000000.0; microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; - microscopylayers[activelayer].angle = 0; + microscopylayers[activelayer].angle = microscopylayers[layer_microscopy_navigation_image].angle; imagewindowwidget->setMicroscopyPosition((eLayerType)activelayer, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); } diff --git a/CycloBranch/gui/cImageWindow.h b/CycloBranch/gui/cImageWindow.h index 41ba165..8cf3ba8 100644 --- a/CycloBranch/gui/cImageWindow.h +++ b/CycloBranch/gui/cImageWindow.h @@ -178,10 +178,11 @@ class cImageWindow : public QMainWindow \brief Set the default max count of pixel x/y values parsed from an imzML file. \param defaultmaxx max count of pixel x - parsed from imzML file \param defaultmaxy max count of pixel y - parsed from imzML file - \param pixelsize pixel size + \param defaultpixelsizex pixel size x - parsed from imzML file + \param defaultpixelsizey pixel size y - parsed from imzML file \param vendor vendor type */ - void setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int pixelsize, eVendorType vendor); + void setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor); /** @@ -243,6 +244,10 @@ class cImageWindow : public QMainWindow QSpinBox* maxx; QLabel* maxylabel; QSpinBox* maxy; + QLabel* pixelsizexlabel; + QSpinBox* pixelsizexspinbox; + QLabel* pixelsizeylabel; + QSpinBox* pixelsizeyspinbox; QPushButton* setmaxbutton; QPushButton* setdefaultbutton; @@ -296,7 +301,10 @@ class cImageWindow : public QMainWindow int defaultmaxx; int defaultmaxy; - int pixelsize; + + int defaultpixelsizex; + int defaultpixelsizey; + eVendorType vendor; void colorSpinBoxes(int layerid); diff --git a/CycloBranch/gui/cImageWindowWidget.cpp b/CycloBranch/gui/cImageWindowWidget.cpp index 53cde80..554bc01 100644 --- a/CycloBranch/gui/cImageWindowWidget.cpp +++ b/CycloBranch/gui/cImageWindowWidget.cpp @@ -34,10 +34,13 @@ cImageWindowWidget::cImageWindowWidget() { topshift = 0; maxx = 1; maxy = 1; + pixelsizex = 1; + pixelsizey = 1; defaultmaxx = 1; defaultmaxy = 1; - pixelsize = 1; + defaultpixelsizex = 1; + defaultpixelsizey = 1; vendor = unknownvendor; currentscale = 1; @@ -55,6 +58,9 @@ cImageWindowWidget::cImageWindowWidget() { showselection = false; + microscopynavigationcenterx = 0; + microscopynavigationcentery = 0; + selectionrect = new QGraphicsRectItem(); selectionrect->setZValue(1000); scene->addItem(selectionrect); @@ -109,7 +115,10 @@ void cImageWindowWidget::setMicroscopyImage(eLayerType layer, QImage* microscopy QImage cImageWindowWidget::getImage() { - QImage image(sceneRect().size().toSize(), QImage::Format_ARGB32); + QRect rect_viewport(0, 0, viewport()->width(), viewport()->height()); + QRectF rect_scene = mapToScene(rect_viewport).boundingRect(); + + QImage image(rect_scene.size().toSize(), QImage::Format_ARGB32); image.fill(Qt::white); QPainter painter; @@ -121,7 +130,7 @@ QImage cImageWindowWidget::getImage() { return image; } - scene->render(&painter, sceneRect(), sceneRect(), Qt::KeepAspectRatio); + scene->render(&painter, rect_viewport, rect_scene, Qt::KeepAspectRatio); painter.end(); return image; @@ -139,20 +148,23 @@ void cImageWindowWidget::setFilterOptions(vector& coordinates, str } -void cImageWindowWidget::setCorrelationValues(int leftshift, int topshift, int maxx, int maxy) { +void cImageWindowWidget::setCorrelationValues(int leftshift, int topshift, int maxx, int maxy, int pixelsizex, int pixelsizey) { this->leftshift = leftshift; this->topshift = topshift; this->maxx = maxx; this->maxy = maxy; + this->pixelsizex = pixelsizex; + this->pixelsizey = pixelsizey; emit updateRuler(recalculateRulerValue(currentscale)); } -void cImageWindowWidget::setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int pixelsize, eVendorType vendor) { +void cImageWindowWidget::setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor) { this->defaultmaxx = defaultmaxx; this->defaultmaxy = defaultmaxy; - this->pixelsize = pixelsize; + this->defaultpixelsizex = defaultpixelsizex; + this->defaultpixelsizey = defaultpixelsizey; this->vendor = vendor; } @@ -229,7 +241,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { QTransform transform; - tmpangle = prepareTransformation(selectionrect->rect(), transform, layersvector[activelayer].fliphorizontally, layersvector[activelayer].flipvertically, layersvector[activelayer].angle); + tmpangle = prepareTransformation(selectionrect->rect(), transform, layersvector[activelayer].fliphorizontally, layersvector[activelayer].flipvertically, layersvector[activelayer].angle, true); transform.map(currentx, currenty, &transformedx, &transformedy); } @@ -511,16 +523,16 @@ void cImageWindowWidget::mouseReleaseEvent(QMouseEvent *event) { int micrometerswidth, micrometersheight; switch (vendor) { case unknownvendor: - micrometerswidth = maxx*pixelsize; - micrometersheight = maxy*pixelsize; + micrometerswidth = maxx*pixelsizex; + micrometersheight = maxy*pixelsizey; break; case bruker: - micrometerswidth = (maxx + 1)*sqrt(pixelsize); - micrometersheight = (maxy + 1)*sqrt(pixelsize); + micrometerswidth = (maxx + 1)*pixelsizex; + micrometersheight = (maxy + 1)*pixelsizey; break; case waters: - micrometerswidth = maxx*pixelsize; - micrometersheight = maxy*pixelsize; + micrometerswidth = maxx*pixelsizex; + micrometersheight = maxy*pixelsizey; break; default: break; @@ -647,9 +659,12 @@ void cImageWindowWidget::redrawScene() { } } + microscopynavigationcenterx = 0; + microscopynavigationcentery = 0; + for (int i = layer_microscopy_navigation_image; i < layer_end; i++) { if (((int)layersvector.size() >= i + 1) && layersvector[i].ispixmapdefined) { - if (layersvector[i].checked) { + if ((i == layer_microscopy_navigation_image) || (layersvector[i].checked)) { drawMicroscopyImage((eLayerType)i, rect_scene, currentwidth, currentheight); } } @@ -945,25 +960,25 @@ void cImageWindowWidget::redrawScene() { void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scene, int currentwidth, int currentheight) { + int micrometerswidth, micrometersheight; switch (vendor) { case unknownvendor: - micrometerswidth = maxx*pixelsize; - micrometersheight = maxy*pixelsize; + micrometerswidth = maxx*pixelsizex; + micrometersheight = maxy*pixelsizey; break; case bruker: - micrometerswidth = (maxx + 1)*sqrt(pixelsize); - micrometersheight = (maxy + 1)*sqrt(pixelsize); + micrometerswidth = (maxx + 1)*pixelsizex; + micrometersheight = (maxy + 1)*pixelsizey; break; case waters: - micrometerswidth = maxx*pixelsize; - micrometersheight = maxy*pixelsize; + micrometerswidth = maxx*pixelsizex; + micrometersheight = maxy*pixelsizey; break; default: break; } - QPixmap scaledmicroscopypixmap = *layersvector[layer].pixmap; int microscopyorigcenterx = scaledmicroscopypixmap.rect().center().x(); @@ -979,9 +994,11 @@ void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scen int microscopynewcenterx = scaledmicroscopypixmap.rect().center().x(); int microscopynewcentery = scaledmicroscopypixmap.rect().center().y(); + qreal centershiftx = microscopyorigcenterx - microscopynewcenterx; + qreal centershifty = microscopyorigcentery - microscopynewcentery; + int microscopynewwidth = scaledmicroscopypixmap.width(); int microscopynewheight = scaledmicroscopypixmap.height(); - int scaledmicroscopywidth = ((double)layersvector[layer].width / (double)layersvector[layer].pixmap->width() * (double)microscopynewwidth) / (double)micrometerswidth * (double)currentwidth; int scaledmicroscopyheight = ((double)layersvector[layer].height / (double)layersvector[layer].pixmap->height() * (double)microscopynewheight) / (double)micrometersheight * (double)currentheight; @@ -992,9 +1009,31 @@ void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scen qreal microscopywidthratio = (double)scaledmicroscopywidth / (double)microscopynewwidth; qreal microscopyheightratio = (double)scaledmicroscopyheight / (double)microscopynewheight; + qreal scaledmicroscopycenterx = ((qreal)scaledmicroscopyx / microscopywidthratio + (qreal)microscopynewwidth / 2.0 + centershiftx) * microscopywidthratio; + qreal scaledmicroscopycentery = ((qreal)scaledmicroscopyy / microscopyheightratio + (qreal)microscopynewheight / 2.0 + centershifty) * microscopyheightratio; - if (((qreal)((qreal)scaledmicroscopyx / microscopywidthratio + microscopynewwidth + microscopyorigcenterx - microscopynewcenterx) * microscopywidthratio > rect_scene.x()) && ((qreal)((qreal)scaledmicroscopyy / microscopyheightratio + microscopynewheight + microscopyorigcentery - microscopynewcentery) * microscopyheightratio > rect_scene.y())) { - scaledmicroscopypixmap = scaledmicroscopypixmap.copy(max(rect_scene.x() / microscopywidthratio - (qreal)((qreal)scaledmicroscopyx / microscopywidthratio + microscopyorigcenterx - microscopynewcenterx), 0.0), max(rect_scene.y() / microscopyheightratio - (qreal)((qreal)scaledmicroscopyy / microscopyheightratio + microscopyorigcentery - microscopynewcentery), 0.0), rect_scene.width() / microscopywidthratio + 1, rect_scene.height() / microscopyheightratio + 1); + if (layer == layer_microscopy_navigation_image) { + microscopynavigationcenterx = scaledmicroscopycenterx; + microscopynavigationcentery = scaledmicroscopycentery; + + if (!layersvector[layer].checked) { + return; + } + } + + QTransform transformcenter; + transformcenter.translate((qreal)microscopynavigationcenterx, (qreal)microscopynavigationcentery); + transformcenter.rotate(layersvector[layer].angle); + transformcenter.translate(-(qreal)microscopynavigationcenterx, -(qreal)microscopynavigationcentery); + + QPointF oldcenterpoint(scaledmicroscopycenterx, scaledmicroscopycentery); + QPointF newcenterpoint = transformcenter.map(oldcenterpoint); + + centershiftx += (newcenterpoint.x() - scaledmicroscopycenterx) / microscopywidthratio; + centershifty += (newcenterpoint.y() - scaledmicroscopycentery) / microscopyheightratio; + + if (((qreal)((qreal)scaledmicroscopyx / microscopywidthratio + microscopynewwidth + centershiftx) * microscopywidthratio > rect_scene.x()) && ((qreal)((qreal)scaledmicroscopyy / microscopyheightratio + microscopynewheight + centershifty) * microscopyheightratio > rect_scene.y())) { + scaledmicroscopypixmap = scaledmicroscopypixmap.copy(max(rect_scene.x() / microscopywidthratio - (qreal)((qreal)scaledmicroscopyx / microscopywidthratio + centershiftx), 0.0), max(rect_scene.y() / microscopyheightratio - (qreal)((qreal)scaledmicroscopyy / microscopyheightratio + centershifty), 0.0), rect_scene.width() / microscopywidthratio + 1, rect_scene.height() / microscopyheightratio + 1); scaledmicroscopypixmap = scaledmicroscopypixmap.scaled(scaledmicroscopypixmap.width() * microscopywidthratio, scaledmicroscopypixmap.height() * microscopyheightratio); QPixmap alphapixmap(scaledmicroscopypixmap.size()); @@ -1006,12 +1045,12 @@ void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scen painter.end(); QGraphicsPixmapItem* pixmapitem = scene->addPixmap(alphapixmap); - pixmapitem->setPos(max(rect_scene.x(), (qreal)((qreal)scaledmicroscopyx / microscopywidthratio + microscopyorigcenterx - microscopynewcenterx) * microscopywidthratio), max(rect_scene.y(), (qreal)((qreal)scaledmicroscopyy / microscopyheightratio + microscopyorigcentery - microscopynewcentery) * microscopyheightratio)); + pixmapitem->setPos(max(rect_scene.x(), (qreal)((qreal)scaledmicroscopyx / microscopywidthratio + centershiftx) * microscopywidthratio), max(rect_scene.y(), (qreal)((qreal)scaledmicroscopyy / microscopyheightratio + centershifty) * microscopyheightratio)); pixmapitem->setZValue(layersvector[layer].zvalue); } - layersvector[layer].lastx = (qreal)((qreal)scaledmicroscopyx / microscopywidthratio + microscopyorigcenterx - microscopynewcenterx) * microscopywidthratio; - layersvector[layer].lasty = (qreal)((qreal)scaledmicroscopyy / microscopyheightratio + microscopyorigcentery - microscopynewcentery) * microscopyheightratio; + layersvector[layer].lastx = (qreal)((qreal)scaledmicroscopyx / microscopywidthratio + centershiftx) * microscopywidthratio; + layersvector[layer].lasty = (qreal)((qreal)scaledmicroscopyy / microscopyheightratio + centershifty) * microscopyheightratio; } @@ -1029,16 +1068,16 @@ void cImageWindowWidget::updateSelectionGroup() { int micrometerswidth, micrometersheight; switch (vendor) { case unknownvendor: - micrometerswidth = maxx*pixelsize; - micrometersheight = maxy*pixelsize; + micrometerswidth = maxx*pixelsizex; + micrometersheight = maxy*pixelsizey; break; case bruker: - micrometerswidth = (maxx + 1)*sqrt(pixelsize); - micrometersheight = (maxy + 1)*sqrt(pixelsize); + micrometerswidth = (maxx + 1)*pixelsizex; + micrometersheight = (maxy + 1)*pixelsizey; break; case waters: - micrometerswidth = maxx*pixelsize; - micrometersheight = maxy*pixelsize; + micrometerswidth = maxx*pixelsizex; + micrometersheight = maxy*pixelsizey; break; default: break; @@ -1049,7 +1088,7 @@ void cImageWindowWidget::updateSelectionGroup() { if ((pressedx != -1) && (pressedy != -1)) { getRectanglePoints(rx1, ry1, rx2, ry2); - + if (activelayer == layer_compounds) { selectionrect->resetTransform(); @@ -1127,6 +1166,15 @@ void cImageWindowWidget::updateSelectionGroup() { selectionrect->setRect(QRectF(QPointF(rx1, ry1), QPointF(rx2, ry2))); QTransform transform; + if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + QTransform transformcenter; + transformcenter.translate((qreal)microscopynavigationcenterx, (qreal)microscopynavigationcentery); + transformcenter.rotate(layersvector[activelayer].angle); + transformcenter.translate(-(qreal)microscopynavigationcenterx, -(qreal)microscopynavigationcentery); + + QPointF newcenterpoint = transformcenter.map(selectionrect->rect().center()); + transform.translate(newcenterpoint.x() - selectionrect->rect().center().x(), newcenterpoint.y() - selectionrect->rect().center().y()); + } transform.translate(selectionrect->rect().center().x(), selectionrect->rect().center().y()); transform.scale(testedflipvertically ? -1 : 1, testedfliphorizontally ? -1 : 1); transform.rotate(testedangle); @@ -1161,7 +1209,7 @@ void cImageWindowWidget::updateSelectionGroup() { if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { QTransform transform; - tmpangle = prepareTransformation(selectionrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle); + tmpangle = prepareTransformation(selectionrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle, true); transform.map(currentx, currenty, &transformedx, &transformedy); } @@ -1419,6 +1467,15 @@ void cImageWindowWidget::updateSelectionGroup() { selectionrect->setRect(QRectF(QPointF(rx1, ry1), QPointF(rx2, ry2))); QTransform transform; + if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + QTransform transformcenter; + transformcenter.translate((qreal)microscopynavigationcenterx, (qreal)microscopynavigationcentery); + transformcenter.rotate(layersvector[activelayer].angle); + transformcenter.translate(-(qreal)microscopynavigationcenterx, -(qreal)microscopynavigationcentery); + + QPointF newcenterpoint = transformcenter.map(selectionrect->rect().center()); + transform.translate(newcenterpoint.x() - selectionrect->rect().center().x(), newcenterpoint.y() - selectionrect->rect().center().y()); + } transform.translate(selectionrect->rect().center().x(), selectionrect->rect().center().y()); transform.scale(testedflipvertically ? -1 : 1, testedfliphorizontally ? -1 : 1); transform.rotate(testedangle); @@ -1500,7 +1557,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { QTransform transform; - prepareTransformation(currentrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle); + prepareTransformation(currentrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle, true); transform.map((qreal)currentx, (qreal)currenty, &untransformedcurrentx, &untransformedcurrenty); transform.map((qreal)pressedx, (qreal)pressedy, &untransformedpressedx, &untransformedpressedy); } @@ -1529,10 +1586,26 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, } break; case cursoractivity_move: - rx1 = tmprx1 + (qreal)currentx - (qreal)pressedx; - ry1 = tmpry1 + (qreal)currenty - (qreal)pressedy; - rx2 = tmprx2 + (qreal)currentx - (qreal)pressedx; - ry2 = tmpry2 + (qreal)currenty - (qreal)pressedy; + if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (((testedangle >= 90.0) && (testedangle <= 270.0)) || ((testedangle <= -90.0) && (testedangle >= -270.0))) { + rx1 = tmprx1 - untransformedcurrentx + untransformedpressedx; + ry1 = tmpry1 - untransformedcurrenty + untransformedpressedy; + rx2 = tmprx2 - untransformedcurrentx + untransformedpressedx; + ry2 = tmpry2 - untransformedcurrenty + untransformedpressedy; + } + else { + rx1 = tmprx1 + untransformedcurrentx - untransformedpressedx; + ry1 = tmpry1 + untransformedcurrenty - untransformedpressedy; + rx2 = tmprx2 + untransformedcurrentx - untransformedpressedx; + ry2 = tmpry2 + untransformedcurrenty - untransformedpressedy; + } + } + else { + rx1 = tmprx1 + (qreal)currentx - (qreal)pressedx; + ry1 = tmpry1 + (qreal)currenty - (qreal)pressedy; + rx2 = tmprx2 + (qreal)currentx - (qreal)pressedx; + ry2 = tmpry2 + (qreal)currenty - (qreal)pressedy; + } if (rx1 < 0) { rx2 = rx2 - rx1; rx1 = 0; @@ -1708,9 +1781,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, } -double cImageWindowWidget::prepareTransformation(QRectF rect, QTransform& transform, bool testedfliphorizontally, bool testedflipvertically, double testedangle) { - transform.reset(); - transform.translate(rect.center().x(), rect.center().y()); +double cImageWindowWidget::prepareTransformation(QRectF rect, QTransform& transform, bool testedfliphorizontally, bool testedflipvertically, double testedangle, bool flipaxes) { double tmpangle = testedangle; if (tmpangle < 0) { tmpangle += 360.0; @@ -1731,6 +1802,25 @@ double cImageWindowWidget::prepareTransformation(QRectF rect, QTransform& transf tmpangle -= 180.0; } } + + transform.reset(); + + if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + QTransform transformcenter; + transformcenter.translate((qreal)microscopynavigationcenterx, (qreal)microscopynavigationcentery); + transformcenter.rotate(-testedangle); + transformcenter.translate(-(qreal)microscopynavigationcenterx, -(qreal)microscopynavigationcentery); + + QPointF newcenterpoint = transformcenter.map(rect.center()); + if (flipaxes && (((testedangle >= 90.0) && (testedangle <= 270.0)) || ((testedangle <= -90.0) && (testedangle >= -270.0)))) { + transform.translate(rect.center().x() - newcenterpoint.x(), rect.center().y() - newcenterpoint.y()); + } + else { + transform.translate(newcenterpoint.x() - rect.center().x(), newcenterpoint.y() - rect.center().y()); + } + } + + transform.translate(rect.center().x(), rect.center().y()); transform.rotate(-tmpangle); transform.translate(-rect.center().x(), -rect.center().y()); @@ -1742,15 +1832,15 @@ void cImageWindowWidget::fixRectCenter(qreal& rx1, qreal& ry1, qreal& rx2, qreal qreal x1, y1, x2, y2; QTransform transform; - prepareTransformation(currentrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle); + prepareTransformation(currentrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle, true); transform.inverted().map(rx1, ry1, &x1, &y1); transform.inverted().map(rx2, ry2, &x2, &y2); QGraphicsLineItem gline; gline.setLine(x1, y1, x2, y2); - prepareTransformation(gline.boundingRect(), transform, testedfliphorizontally, testedflipvertically, testedangle); - + prepareTransformation(gline.boundingRect(), transform, testedfliphorizontally, testedflipvertically, testedangle, false); + transform.map(x1, y1, &rx1, &ry1); transform.map(x2, y2, &rx2, &ry2); } @@ -1761,13 +1851,13 @@ double cImageWindowWidget::recalculateRulerValue(qreal currentscale) { switch (vendor) { case unknownvendor: - value = ((double)maxx*(double)pixelsize) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); + value = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); break; case bruker: - value = ((double)(maxx + 1)*sqrt((double)pixelsize)) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); + value = ((double)(maxx + 1)*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); break; case waters: - value = ((double)maxx*(double)pixelsize) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); + value = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); break; default: break; @@ -1798,13 +1888,13 @@ void cImageWindowWidget::setRulerValue(double value) { rulervalue = value; switch (vendor) { case unknownvendor: - currentscale = ((double)maxx*(double)pixelsize) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); + currentscale = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); break; case bruker: - currentscale = ((double)(maxx + 1)*sqrt((double)pixelsize)) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); + currentscale = ((double)(maxx + 1)*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); break; case waters: - currentscale = ((double)maxx*(double)pixelsize) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); + currentscale = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); break; default: break; diff --git a/CycloBranch/gui/cImageWindowWidget.h b/CycloBranch/gui/cImageWindowWidget.h index 251cf60..30d7ba0 100644 --- a/CycloBranch/gui/cImageWindowWidget.h +++ b/CycloBranch/gui/cImageWindowWidget.h @@ -264,18 +264,21 @@ class cImageWindowWidget : public QGraphicsView \param topshift top shift \param maxx maximum X coordinate \param maxy maximum Y coordinate + \param pixelsizex pixel size x + \param pixelsizey pixel size y */ - void setCorrelationValues(int leftshift, int topshift, int maxx, int maxy); + void setCorrelationValues(int leftshift, int topshift, int maxx, int maxy, int pixelsizex, int pixelsizey); /** \brief Set the default maximum X and Y coordinates - parsed from the imzML file. \param defaultmaxx maximum X coordinate \param defaultmaxy maximum Y coordinate - \param pixelsize pixel size + \param defaultpixelsizex pixel size x + \param defaultpixelsizey pixel size y \param vendor vendor type */ - void setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int pixelsize, eVendorType vendor); + void setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor); /** @@ -441,10 +444,13 @@ class cImageWindowWidget : public QGraphicsView int topshift; int maxx; int maxy; + int pixelsizex; + int pixelsizey; int defaultmaxx; int defaultmaxy; - int pixelsize; + int defaultpixelsizex; + int defaultpixelsizey; eVendorType vendor; qreal currentscale; @@ -462,6 +468,9 @@ class cImageWindowWidget : public QGraphicsView bool showselection; + qreal microscopynavigationcenterx; + qreal microscopynavigationcentery; + QGraphicsRectItem* selectionrect; QGraphicsSimpleTextItem* selectionsimpletextitem; @@ -476,7 +485,7 @@ class cImageWindowWidget : public QGraphicsView void getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, qreal& ry2); - double prepareTransformation(QRectF rect, QTransform& transform, bool testedfliphorizontally, bool testedflipvertically, double testedangle); + double prepareTransformation(QRectF rect, QTransform& transform, bool testedfliphorizontally, bool testedflipvertically, double testedangle, bool flipaxes); void fixRectCenter(qreal& rx1, qreal& ry1, qreal& rx2, qreal& ry2, bool testedfliphorizontally, bool testedflipvertically, double testedangle); diff --git a/CycloBranch/gui/cMainThread.cpp b/CycloBranch/gui/cMainThread.cpp index e2b3e64..1374bdb 100644 --- a/CycloBranch/gui/cMainThread.cpp +++ b/CycloBranch/gui/cMainThread.cpp @@ -1,6 +1,9 @@ #include "gui/cMainThread.h" +cIsotopePatternCache isotopepatterncache; + + bool cMainThread::checkModifications(cParameters& parameters, cSequence& sequence, int& startmodifid, int& endmodifid, int& middlemodifid, string& errormessage) { startmodifid = 0; endmodifid = 0; @@ -138,6 +141,10 @@ void cMainThread::run() { theoreticalspectrumlist->clear(); + isotopepatterncache.lock(); + isotopepatterncache.clear(); + isotopepatterncache.unlock(); + QTime time; time.start(); @@ -223,7 +230,7 @@ void cMainThread::run() { } *os << endl; *os << parameters.peaklistseries[i].print(); - if (parameters.masserrortolerancefordeisotoping > 0) { + if (!parameters.generateisotopepattern && (parameters.masserrortolerancefordeisotoping > 0)) { parameters.peaklistseries[i].removeIsotopes(parameters.precursorcharge, parameters.masserrortolerancefordeisotoping, this); } } @@ -483,10 +490,17 @@ void cMainThread::run() { ts.generateMSSpectrum(true); } - // efficient store of theoretical peak descriptions - parameters.peakdesctoid.clear(); + unordered_map tempmap; parameters.peakidtodesc.clear(); - ts.getTheoreticalPeaks()->reducePeakDescriptions(parameters.peakidtodesc, parameters.peakdesctoid); + parameters.isotopeformulaidtodesc.clear(); + + tempmap.clear(); + ts.getTheoreticalPeaks()->reducePeakDescriptions(tempmap); + convertStringIntUnorderedMapToStringVector(tempmap, parameters.peakidtodesc); + + //tempmap.clear(); + //ts.getTheoreticalPeaks()->reduceIsotopeFormulaDescriptions(tempmap); + //convertStringIntUnorderedMapToStringVector(tempmap, parameters.isotopeformulaidtodesc); *os << "ok" << endl; *os << "Comparing theoretical peaks with the experimental peaklist(s)... " << endl; diff --git a/CycloBranch/gui/cMainThread.h b/CycloBranch/gui/cMainThread.h index a52e15d..27fc318 100644 --- a/CycloBranch/gui/cMainThread.h +++ b/CycloBranch/gui/cMainThread.h @@ -16,10 +16,17 @@ #include "core/cParameters.h" #include "core/cDeNovoGraph.h" #include "core/cTheoreticalSpectrum.h" +#include "core/cIsotopePatternCache.h" using namespace std; +/** + \brief Global isotope pattern cache. +*/ +extern cIsotopePatternCache isotopepatterncache; + + /** \brief The class representing a thread launched by the command 'Search->Run'. */ diff --git a/CycloBranch/gui/cMainWindow.cpp b/CycloBranch/gui/cMainWindow.cpp index edf48eb..0cef3c8 100644 --- a/CycloBranch/gui/cMainWindow.cpp +++ b/CycloBranch/gui/cMainWindow.cpp @@ -677,7 +677,7 @@ void cMainWindow::showSummaryTableOfMatchedPeaks() { void cMainWindow::showImageWindow() { if (prepareSummaryTableOfMatchedPeaks()) { - imagewindow->setDefaultMaxXY(parameters.defaultmaxx, parameters.defaultmaxy, parameters.pixelsize, parameters.vendor); + imagewindow->setDefaultMaxXY(parameters.defaultmaxx, parameters.defaultmaxy, parameters.defaultpixelsizex, parameters.defaultpixelsizey, parameters.vendor); imagewindow->show(); imagewindow->activateWindow(); if (imagewindow->isMinimized()) { @@ -1381,10 +1381,20 @@ void cMainWindow::exportToHTML() { } } else if (parameters.mode == denovoengine) { - columncount = 9; + if (parameters.generateisotopepattern) { + columncount = 11; + } + else { + columncount = 10; + } } else { - columncount = 8; + if (parameters.generateisotopepattern) { + columncount = 10; + } + else { + columncount = 9; + } } tdwidth = to_string(100/columncount); @@ -1414,7 +1424,7 @@ void cMainWindow::exportToHTML() { out << "Theoretical m/z"; - if ((parameters.mode == dereplication) && (parameters.generateisotopepattern)) { + if (parameters.generateisotopepattern) { out << "Theoretical Intensity [%]"; } @@ -1433,6 +1443,7 @@ void cMainWindow::exportToHTML() { out << "Reference"; } else { + out << "Summary Formula"; out << "Sequence"; } diff --git a/CycloBranch/gui/cParametersWidget.cpp b/CycloBranch/gui/cParametersWidget.cpp index 0d5b92f..6609917 100644 --- a/CycloBranch/gui/cParametersWidget.cpp +++ b/CycloBranch/gui/cParametersWidget.cpp @@ -153,7 +153,7 @@ cParametersWidget::cParametersWidget(QWidget* parent) { peaklistformlayout->addRow(tr("Minimum m/z Ratio: "), minimummz); fwhm = new QDoubleSpinBox(); - fwhm->setToolTip("Full width at half maximum. The value is used if the profile spectra are converted into peaklists (mzML and imzML) and if full isotope patterns of compounds are generated (MS and MSI)."); + fwhm->setToolTip("Full width at half maximum. The value is used if the profile spectra are converted into peaklists (mzML and imzML) and if the full isotope patterns of compounds are generated."); fwhm->setDecimals(6); fwhm->setRange(0, 1); fwhm->setSingleStep(0.01); @@ -311,7 +311,7 @@ cParametersWidget::cParametersWidget(QWidget* parent) { generateisotopepattern = new QCheckBox(); generateisotopepattern->setChecked(true); - generateisotopepattern->setToolTip("Full isotope patters of compounds are generated in theoretical spectra (MS and MSI).\nThe FWHM value is used when theoretical patterns are generated."); + generateisotopepattern->setToolTip("The full isotope patterns of compounds are generated in theoretical spectra.\nThe FWHM value is used for this purpose. If checked, the deisotoping is disabled automatically."); applicationformlayout->addRow(tr("Generate Full Isotope Patterns: "), generateisotopepattern); minimumpatternsize = new QSpinBox(); @@ -618,10 +618,12 @@ void cParametersWidget::loadSettings() { settings.value("regularblocksorder", 0).toInt() == 0 ? regularblocksorder->setChecked(false) : regularblocksorder->setChecked(true); mode->setCurrentIndex(settings.value("mode", 0).toInt()); + updateSettingsWhenModeChanged(mode->currentIndex()); + sequencedatabaseline->setText(settings.value("sequencedatabase", "").toString()); maximumnumberofthreads->setValue(settings.value("maximumnumberofthreads", 1).toInt()); scoretype->setCurrentIndex(settings.value("scoretype", (int)matched_peaks).toInt()); - hitsreported->setValue(settings.value("hitsreported", 1000).toInt()); + hitsreported->setValue(settings.value("hitsreported", 100).toInt()); sequencetag->setText(settings.value("sequencetag", "").toString()); for (int i = 0; i < fragmentiontypes->getList()->count(); i++) { @@ -630,14 +632,13 @@ void cParametersWidget::loadSettings() { } settings.value("clearhitswithoutparent", 0).toInt() == 0 ? clearhitswithoutparent->setChecked(false) : clearhitswithoutparent->setChecked(true); - settings.value("generateisotopepattern", 1).toInt() == 0 ? generateisotopepattern->setChecked(false) : generateisotopepattern->setChecked(true); + settings.value("generateisotopepattern", 0).toInt() == 0 ? generateisotopepattern->setChecked(false) : generateisotopepattern->setChecked(true); minimumpatternsize->setValue(settings.value("minimumpatternsize", 1).toInt()); searchedsequenceline->setText(settings.value("searchedsequence", "").toString()); searchedsequenceNtermmodif->setText(settings.value("searchedsequenceNtermmodif", "").toString()); searchedsequenceCtermmodif->setText(settings.value("searchedsequenceCtermmodif", "").toString()); searchedsequenceTmodif->setText(settings.value("searchedsequenceTmodif", "").toString()); - } } @@ -1106,7 +1107,7 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { sequencetag->setDisabled(false); fragmentiontypes->setDisabled(false); clearhitswithoutparent->setDisabled(false); - generateisotopepattern->setDisabled(true); + generateisotopepattern->setDisabled(false); minimumpatternsize->setDisabled(true); searchedsequenceline->setDisabled(false); searchedsequencebutton->setDisabled(false); @@ -1140,7 +1141,7 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { sequencetag->setDisabled(true); fragmentiontypes->setDisabled(false); clearhitswithoutparent->setDisabled(false); - generateisotopepattern->setDisabled(true); + generateisotopepattern->setDisabled(false); minimumpatternsize->setDisabled(true); searchedsequenceline->setDisabled(false); searchedsequencebutton->setDisabled(false); @@ -1174,7 +1175,7 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { sequencetag->setDisabled(false); fragmentiontypes->setDisabled(false); clearhitswithoutparent->setDisabled(false); - generateisotopepattern->setDisabled(true); + generateisotopepattern->setDisabled(false); minimumpatternsize->setDisabled(true); searchedsequenceline->setDisabled(false); searchedsequencebutton->setDisabled(false); @@ -1239,30 +1240,30 @@ void cParametersWidget::resetFragmentIonTypes() { if ((eModeType)mode->currentIndex() == dereplication) { start = ms_Hplus; - end = ms_NH4plus; + end = ms_MGa4H; } else { switch ((ePeptideType)peptidetype->currentIndex()) { case linear: case branched: start = a_ion; - end = z_ion_dehydrated_and_deamidated; + end = z_ion_dehydrated_deamidated_deamidated_deamidated; break; case cyclic: start = a_ion; - end = c_ion_dehydrated_and_deamidated; + end = c_ion_dehydrated_deamidated_deamidated_deamidated; break; case branchcyclic: start = a_ion; - end = z_ion_dehydrated_and_deamidated; + end = z_ion_dehydrated_deamidated_deamidated_deamidated; break; case linearpolyketide: start = l1h_ion; - end = r2oh_ion_co_loss_dehydrated_and_deamidated; + end = r2oh_ion_co_loss_dehydrated_deamidated; break; case cyclicpolyketide: start = l1h_ion; // l0h_ion; - end = l2h_ion_co_loss_dehydrated_and_deamidated; + end = l2h_ion_co_loss_dehydrated_deamidated; break; case other: break; diff --git a/CycloBranch/gui/cSpectrumDetailProxyModel.cpp b/CycloBranch/gui/cSpectrumDetailProxyModel.cpp index 1c71e4e..25bcc67 100644 --- a/CycloBranch/gui/cSpectrumDetailProxyModel.cpp +++ b/CycloBranch/gui/cSpectrumDetailProxyModel.cpp @@ -5,13 +5,17 @@ cSpectrumDetailProxyModel::cSpectrumDetailProxyModel(QObject *parent) : QSortFil hidematched = false; hideunmatched = false; hidescrambled = false; + hiderotations = false; + hidetrotations = false; } -void cSpectrumDetailProxyModel::setFlags(bool hidematched, bool hideunmatched, bool hidescrambled) { +void cSpectrumDetailProxyModel::setFlags(bool hidematched, bool hideunmatched, bool hidescrambled, bool hiderotations, bool hidetrotations) { this->hidematched = hidematched; this->hideunmatched = hideunmatched; this->hidescrambled = hidescrambled; + this->hiderotations = hiderotations; + this->hidetrotations = hidetrotations; } @@ -40,7 +44,8 @@ bool cSpectrumDetailProxyModel::filterAcceptsRow(int sourceRow, const QModelInde show = false; } - if (hidescrambled && ((QStandardItemModel *)sourceModel())->item(sourceRow, 0) && (sourceModel()->data(sourceModel()->index(sourceRow, 0, sourceParent)).toString().contains(filterRegExp()))) { + if ((hidescrambled || hiderotations || hidetrotations) && + ((QStandardItemModel *)sourceModel())->item(sourceRow, 0) && (!sourceModel()->data(sourceModel()->index(sourceRow, 0, sourceParent)).toString().contains(filterRegExp()))) { show = false; } diff --git a/CycloBranch/gui/cSpectrumDetailProxyModel.h b/CycloBranch/gui/cSpectrumDetailProxyModel.h index c02232a..0be8679 100644 --- a/CycloBranch/gui/cSpectrumDetailProxyModel.h +++ b/CycloBranch/gui/cSpectrumDetailProxyModel.h @@ -22,7 +22,7 @@ class cSpectrumDetailProxyModel : public QSortFilterProxyModel { private: - bool hidematched, hideunmatched, hidescrambled; + bool hidematched, hideunmatched, hidescrambled, hiderotations, hidetrotations; public: @@ -39,8 +39,10 @@ class cSpectrumDetailProxyModel : public QSortFilterProxyModel { \param hidematched hide matched peaks \param hideunmatched hide unmatched peaks \param hidescrambled hide scrambled peaks - */ - void setFlags(bool hidematched, bool hideunmatched, bool hidescrambled); + \param hiderotations hide rotations of a cyclic peptide or branch-cyclic peptide or cyclic polyketide + \param hidetrotations hide trotations of a branched or branch-cyclic peptide + */ + void setFlags(bool hidematched, bool hideunmatched, bool hidescrambled, bool hiderotations, bool hidetrotations); protected: diff --git a/CycloBranch/gui/cSpectrumDetailWidget.cpp b/CycloBranch/gui/cSpectrumDetailWidget.cpp index ae4d436..51fc1cc 100644 --- a/CycloBranch/gui/cSpectrumDetailWidget.cpp +++ b/CycloBranch/gui/cSpectrumDetailWidget.cpp @@ -174,7 +174,12 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica } } else { - columncount = 7; + if (parameters->generateisotopepattern) { + columncount = 9; + } + else { + columncount = 8; + } } tdwidth = to_string(100/columncount); @@ -193,7 +198,7 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica s += "Theoretical m/z"; - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { + if (parameters->generateisotopepattern) { s += "Theoretical Intensity [%]"; } @@ -212,6 +217,7 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica s += "Reference"; } else { + s += "Summary Formula"; s += "Sequence"; } @@ -225,10 +231,15 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica // theoretical peaks for (int i = 0; i < thpeakscount; i++) { peak = &((*thpeaks)[i]); + if (peak->descriptionid != -1) { peak->description = parameters->peakidtodesc[peak->descriptionid]; } + if (peak->isotopeformulaid != -1) { + peak->isotopeformula = parameters->isotopeformulaidtodesc[peak->isotopeformulaid]; + } + if (peak->matchedmz > 0) { isred = true; } @@ -252,8 +263,13 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->mzratio)), isred); - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { - s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->relativeintensity)), isred); + if (parameters->generateisotopepattern) { + if (peak->relativeintensity > 0) { + s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->relativeintensity)), isred); + } + else { + s += ""; + } } if (peak->matchedmz > 0) { @@ -296,6 +312,13 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica } } else { + if (parameters->generateisotopepattern) { + s += printHTMLTableCell(peak->isotopeformula, isred); + } + else { + s += printHTMLTableCell(peak->formula.getFancySummary(peak->charge).c_str(), isred); + } + pos = peak->description.find(':'); if ((pos != string::npos) && (pos + 2 < peak->description.size())) { desc = peak->description.substr(pos + 2); @@ -322,15 +345,15 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica } s += ""; s += ""; - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { + if (parameters->generateisotopepattern) { s += ""; } s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->mzratio)), false); s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->relativeintensity)), false); s += printHTMLTableCell(QVariant(cropDecimalsByteArray(peak->absoluteintensity)).toString().toStdString(), false); - s += ""; + s += ""; if (parameters->mode == dereplication) { - s += ""; + s += ""; if (parameters->generateisotopepattern) { s += ""; } @@ -377,10 +400,15 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo // theoretical peaks for (int i = 0; i < thpeakscount; i++) { peak = &((*thpeaks)[i]); + if (peak->descriptionid != -1) { peak->description = parameters->peakidtodesc[peak->descriptionid]; } + if (peak->isotopeformulaid != -1) { + peak->isotopeformula = parameters->isotopeformulaidtodesc[peak->isotopeformulaid]; + } + if (peak->matchedmz > 0) { isred = true; } @@ -393,18 +421,12 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo } s += ""; - s += ""; - s += to_string(id + 1); - s += ""; + s += printHTMLTableCell(to_string(id + 1), isred); if (parameters->mode == dereplication) { if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - s += ""; - s += to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateX()); - s += ""; - s += ""; - s += to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateY()); - s += ""; + s += printHTMLTableCell(to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateX()), isred); + s += printHTMLTableCell(to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateY()), isred); } secondspace = (int)peak->description.find(' ', peak->description.find(' ') + 1); s += printHTMLTableCell(peak->description.substr(0, secondspace), isred); @@ -420,7 +442,7 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->mzratio)), isred); - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { + if (parameters->generateisotopepattern) { s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->relativeintensity)), isred); } @@ -464,6 +486,13 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo } } else { + if (parameters->generateisotopepattern) { + s += printHTMLTableCell(peak->isotopeformula, isred); + } + else { + s += printHTMLTableCell(peak->formula.getFancySummary(peak->charge).c_str(), isred); + } + pos = peak->description.find(':'); if ((pos != string::npos) && (pos + 2 < peak->description.size())) { desc = peak->description.substr(pos + 2); @@ -877,6 +906,7 @@ void cSpectrumDetailWidget::prepareToShow(ePeptideType peptidetype, QAction* act connect(rotation, SIGNAL(currentIndexChanged(int)), spectrumscene, SLOT(rotationChanged(int))); connect(rotation, SIGNAL(currentIndexChanged(QString)), spectrumscene, SLOT(rotationChanged(QString))); connect(rotation, SIGNAL(currentIndexChanged(int)), cyclicwidget, SLOT(rotationChanged(int))); + connect(rotation, SIGNAL(currentIndexChanged(int)), this, SLOT(filterTableAfterRotationChanged(int))); toolbarRotation = addToolBar(tr("Ring break up point")); toolbarRotation->addWidget(widgetrotation); @@ -894,6 +924,7 @@ void cSpectrumDetailWidget::prepareToShow(ePeptideType peptidetype, QAction* act connect(trotation, SIGNAL(currentIndexChanged(int)), spectrumscene, SLOT(trotationChanged(int))); connect(trotation, SIGNAL(currentIndexChanged(int)), branchedwidget, SLOT(trotationChanged(int))); + connect(trotation, SIGNAL(currentIndexChanged(int)), this, SLOT(filterTableAfterTRotationChanged(int))); toolbarTrotation = addToolBar(tr("Linearized sequence")); toolbarTrotation->addWidget(widgettrotation); @@ -917,6 +948,7 @@ void cSpectrumDetailWidget::prepareToShow(ePeptideType peptidetype, QAction* act connect(rotation, SIGNAL(currentIndexChanged(int)), spectrumscene, SLOT(rotationChanged(int))); connect(rotation, SIGNAL(currentIndexChanged(QString)), spectrumscene, SLOT(rotationChanged(QString))); connect(rotation, SIGNAL(currentIndexChanged(int)), branchcyclicwidget, SLOT(rotationChanged(int))); + connect(rotation, SIGNAL(currentIndexChanged(int)), this, SLOT(filterTableAfterRotationChanged(int))); toolbarRotation = addToolBar(tr("Ring break up point")); toolbarRotation->addWidget(widgetrotation); @@ -931,7 +963,8 @@ void cSpectrumDetailWidget::prepareToShow(ePeptideType peptidetype, QAction* act connect(trotation, SIGNAL(currentIndexChanged(int)), spectrumscene, SLOT(trotationChanged(int))); connect(trotation, SIGNAL(currentIndexChanged(int)), branchcyclicwidget, SLOT(trotationChanged(int))); - + connect(trotation, SIGNAL(currentIndexChanged(int)), this, SLOT(filterTableAfterTRotationChanged(int))); + toolbarTrotation = addToolBar(tr("Linearized sequence")); toolbarTrotation->addWidget(widgettrotation); } @@ -1201,7 +1234,12 @@ void cSpectrumDetailWidget::preparePeaksTable() { } } else { - peakstablemodel->setColumnCount(7); + if (parameters->generateisotopepattern) { + peakstablemodel->setColumnCount(9); + } + else { + peakstablemodel->setColumnCount(8); + } } for (int i = 0; i < peakstablemodel->columnCount(); i++) { @@ -1225,7 +1263,7 @@ void cSpectrumDetailWidget::preparePeaksTable() { peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical m/z"); currentcolumn++; - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { + if (parameters->generateisotopepattern) { peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical Intensity [%]"); currentcolumn++; } @@ -1266,6 +1304,12 @@ void cSpectrumDetailWidget::preparePeaksTable() { currentcolumn++; } else { + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Summary Formula"); + if (parameters->generateisotopepattern) { + peakstable->setItemDelegateForColumn(currentcolumn, new cHTMLDelegate()); + } + currentcolumn++; + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Sequence"); currentcolumn++; } @@ -1299,10 +1343,15 @@ void cSpectrumDetailWidget::preparePeaksTable() { // theoretical peaks for (int i = 0; i < thpeakscount; i++) { peak = &((*thpeaks)[i]); + if (peak->descriptionid != -1) { peak->description = parameters->peakidtodesc[peak->descriptionid]; } + if (peak->isotopeformulaid != -1) { + peak->isotopeformula = parameters->isotopeformulaidtodesc[peak->isotopeformulaid]; + } + if (peak->matchedmz > 0) { brush.setColor(QColor(255, 0, 0)); } @@ -1330,10 +1379,12 @@ void cSpectrumDetailWidget::preparePeaksTable() { peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(peak->mzratio)), Qt::DisplayRole); currentcolumn++; - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { - peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); - peakstablemodel->item(i, currentcolumn)->setForeground(brush); - peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(peak->relativeintensity)), Qt::DisplayRole); + if (parameters->generateisotopepattern) { + if (peak->relativeintensity > 0) { + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setForeground(brush); + peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(peak->relativeintensity)), Qt::DisplayRole); + } currentcolumn++; } @@ -1419,6 +1470,24 @@ void cSpectrumDetailWidget::preparePeaksTable() { } } else { + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setForeground(brush); + if (parameters->generateisotopepattern) { + QString summary; + if (peak->matched > 0) { + summary += ""; + } + summary += peak->isotopeformula.c_str(); + if (peak->matched > 0) { + summary += ""; + } + peakstablemodel->item(i, currentcolumn)->setText(summary); + } + else { + peakstablemodel->item(i, currentcolumn)->setText(peak->formula.getFancySummary(peak->charge).c_str()); + } + currentcolumn++; + pos = peak->description.find(':'); if ((pos != string::npos) && (pos + 2 < peak->description.size())) { peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); @@ -1448,7 +1517,7 @@ void cSpectrumDetailWidget::preparePeaksTable() { continue; } - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { + if (parameters->generateisotopepattern) { currentcolumn = 3; } else { @@ -1491,6 +1560,11 @@ void cSpectrumDetailWidget::preparePeaksTable() { peakstable->setColumnWidth(6, min(400, peakstable->columnWidth(6))); } } + else { + if (parameters->generateisotopepattern) { + peakstable->setColumnWidth(7, min(400, peakstable->columnWidth(7))); + } + } progress.setValue(thpeakscount + theoreticalspectrum->getUnmatchedExperimentalPeaksCount()); @@ -1848,10 +1922,35 @@ void cSpectrumDetailWidget::filterPeaksTable() { bool hm = actionHideMatched->isChecked(); bool hu = actionHideUnmatched->isChecked(); bool hs = actionHideScrambled->isChecked(); + bool hr = false; + bool ht = false; + + QString pattern; + + if (parameters && ((parameters->mode == denovoengine) || (parameters->mode == singlecomparison) || (parameters->mode == databasesearch))) { + if ((parameters->peptidetype == cyclic) || (parameters->peptidetype == branchcyclic) || (parameters->peptidetype == cyclicpolyketide)) { + if (rotation->currentIndex() > 0) { + pattern += rotation->currentText() + "_"; + hr = true; + } + } + if ((parameters->peptidetype == branched) || (parameters->peptidetype == branchcyclic)) { + if (trotation->currentIndex() > 0) { + pattern += QString::number(trotation->currentIndex()) + "_"; + ht = true; + } + } + } + + if (hs) { + if (pattern.isEmpty()) { + pattern = "^((?!scrambled).)*$"; + } + } - proxymodel->setFlags(hm, hu, hs); + proxymodel->setFlags(hm, hu, hs, hr, ht); proxymodel->setFilterKeyColumn(-1); - proxymodel->setFilterFixedString("scrambled"); + proxymodel->setFilterRegExp(pattern); } @@ -1873,6 +1972,16 @@ void cSpectrumDetailWidget::hideScrambledPeaks(bool hide) { } +void cSpectrumDetailWidget::filterTableAfterRotationChanged(int index) { + filterPeaksTable(); +} + + +void cSpectrumDetailWidget::filterTableAfterTRotationChanged(int index) { + filterPeaksTable(); +} + + void cSpectrumDetailWidget::showIsomersStateChanged() { if (parameters->mode != dereplication) { @@ -1917,10 +2026,15 @@ void cSpectrumDetailWidget::showIsomersStateChanged() { for (int i = 0; i < thpeakscount; i++) { peak = &((*thpeaks)[i]); + if (peak->descriptionid != -1) { peak->description = parameters->peakidtodesc[peak->descriptionid]; } + if (peak->isotopeformulaid != -1) { + peak->isotopeformula = parameters->isotopeformulaidtodesc[peak->isotopeformulaid]; + } + pos = peak->description.find(':'); if ((pos != string::npos) && (pos + 2 < peak->description.size()) && peakstablemodel->item(i, currentcolumn)) { desc = peak->description.substr(pos + 2); diff --git a/CycloBranch/gui/cSpectrumDetailWidget.h b/CycloBranch/gui/cSpectrumDetailWidget.h index 2e7237a..c6eccd4 100644 --- a/CycloBranch/gui/cSpectrumDetailWidget.h +++ b/CycloBranch/gui/cSpectrumDetailWidget.h @@ -336,6 +336,12 @@ private slots: void hideScrambledPeaks(bool hide); + void filterTableAfterRotationChanged(int index); + + + void filterTableAfterTRotationChanged(int index); + + void showIsomersStateChanged(); diff --git a/CycloBranch/gui/cSpectrumSceneWidget.cpp b/CycloBranch/gui/cSpectrumSceneWidget.cpp index 6ecc93f..832f500 100644 --- a/CycloBranch/gui/cSpectrumSceneWidget.cpp +++ b/CycloBranch/gui/cSpectrumSceneWidget.cpp @@ -204,12 +204,24 @@ void cSpectrumSceneWidget::wheelEvent(QWheelEvent *event) { void cSpectrumSceneWidget::mouseMoveEvent(QMouseEvent *event) { QGraphicsView::mouseMoveEvent(event); - if (enablemousemzselection && (pressedx != -1) && (pressedy != -1)) { + if ((pressedx != -1) && (pressedy != -1)) { QPointF p = mapToScene(event->x(), event->y()); currentx = (int)p.x(); currenty = (int)p.y(); - updateZoomGroup(); + if (enablemousemzselection) { + updateZoomGroup(); + } + else { + calculateMinMaxMZ(); + + emit updateMZInterval(minmzratio, maxmzratio); + + pressedx = currentx; + pressedy = currenty; + + redrawScene(); + } } event->accept(); @@ -219,44 +231,22 @@ void cSpectrumSceneWidget::mouseMoveEvent(QMouseEvent *event) { void cSpectrumSceneWidget::mouseReleaseEvent(QMouseEvent *event) { QGraphicsView::mouseReleaseEvent(event); - if (enablemousemzselection) { - if (pressedx == currentx) { - pressedx = -1; - currentx = -1; + if (pressedx == currentx) { + pressedx = -1; + currentx = -1; - redrawScene(); - } + redrawScene(); + } - if ((event->button() == Qt::LeftButton) && (pressedx != -1) && (pressedy != -1)) { - if (pressedx < leftmargin) { - pressedx = leftmargin; - } - - if (pressedx > origwidth - rightmargin) { - pressedx = origwidth - rightmargin; - } - - if (currentx < leftmargin) { - currentx = leftmargin; - } - - if (currentx > origwidth - rightmargin) { - currentx = origwidth - rightmargin; - } + if ((event->button() == Qt::LeftButton) && (pressedx != -1) && (pressedy != -1)) { + calculateMinMaxMZ(); - double tmpminmzratio = getMZRatioFromXPosition((pressedx < currentx)?pressedx:currentx, origwidth); - double tmpmaxmzratio = getMZRatioFromXPosition((pressedx < currentx)?currentx:pressedx, origwidth); + emit updateMZInterval(minmzratio, maxmzratio); - minmzratio = tmpminmzratio; - maxmzratio = tmpmaxmzratio; + pressedx = -1; + pressedy = -1; - emit updateMZInterval(minmzratio, maxmzratio); - - pressedx = -1; - pressedy = -1; - - redrawScene(); - } + redrawScene(); } event->accept(); @@ -266,25 +256,27 @@ void cSpectrumSceneWidget::mouseReleaseEvent(QMouseEvent *event) { void cSpectrumSceneWidget::mousePressEvent(QMouseEvent *event) { QGraphicsView::mousePressEvent(event); - if (enablemousemzselection) { - if (event->button() == Qt::LeftButton) { - QPointF p = mapToScene(event->x(), event->y()); - pressedx = (int)p.x(); - pressedy = (int)p.y(); + if (event->button() == Qt::LeftButton) { + QPointF p = mapToScene(event->x(), event->y()); + pressedx = (int)p.x(); + pressedy = (int)p.y(); - currentx = pressedx; - currenty = pressedy; + currentx = pressedx; + currenty = pressedy; + if (enablemousemzselection) { updateZoomGroup(); } + } - if (event->button() == Qt::RightButton) { - pressedx = -1; - pressedy = -1; + if (event->button() == Qt::RightButton) { + pressedx = -1; + pressedy = -1; - redrawScene(); - } + redrawScene(); + } + if (enablemousemzselection) { if (event->button() == Qt::MiddleButton) { pressedx = -1; pressedy = -1; @@ -478,7 +470,7 @@ void cSpectrumSceneWidget::redrawScene() { visiblepeaks[visiblepeakscount].description += parameters->peakidtodesc[thpeaks[*it].descriptionid].substr(0, parameters->peakidtodesc[thpeaks[*it].descriptionid].rfind(':')); } else { - visiblepeaks[visiblepeakscount].description += thpeaks[*it].description.substr(0, thpeaks[*it].description.find(':')); + visiblepeaks[visiblepeakscount].description += parameters->peakidtodesc[thpeaks[*it].descriptionid].substr(0, parameters->peakidtodesc[thpeaks[*it].descriptionid].find(':')); } } @@ -674,6 +666,43 @@ void cSpectrumSceneWidget::updateZoomGroup() { } +void cSpectrumSceneWidget::calculateMinMaxMZ() { + if (pressedx < leftmargin) { + pressedx = leftmargin; + } + + if (pressedx > origwidth - rightmargin) { + pressedx = origwidth - rightmargin; + } + + if (currentx < leftmargin) { + currentx = leftmargin; + } + + if (currentx > origwidth - rightmargin) { + currentx = origwidth - rightmargin; + } + + double tmpminmzratio = getMZRatioFromXPosition((pressedx < currentx) ? pressedx : currentx, origwidth); + double tmpmaxmzratio = getMZRatioFromXPosition((pressedx < currentx) ? currentx : pressedx, origwidth); + + if (enablemousemzselection) { + minmzratio = tmpminmzratio; + maxmzratio = tmpmaxmzratio; + } + else { + if (pressedx > currentx) { + minmzratio = min(minmzratio + tmpmaxmzratio - tmpminmzratio, theoreticalspectrum->getExperimentalSpectrum().getMaximumMZRatio()); + maxmzratio = min(maxmzratio + tmpmaxmzratio - tmpminmzratio, theoreticalspectrum->getExperimentalSpectrum().getMaximumMZRatio()); + } + else { + minmzratio = max(0.0, minmzratio - tmpmaxmzratio + tmpminmzratio); + maxmzratio = max(0.0, maxmzratio - tmpmaxmzratio + tmpminmzratio); + } + } +} + + void cSpectrumSceneWidget::zoomIn() { if (currentscale < 32) { currentscale += factor; diff --git a/CycloBranch/gui/cSpectrumSceneWidget.h b/CycloBranch/gui/cSpectrumSceneWidget.h index aca5ca8..ee85068 100644 --- a/CycloBranch/gui/cSpectrumSceneWidget.h +++ b/CycloBranch/gui/cSpectrumSceneWidget.h @@ -196,6 +196,9 @@ class cSpectrumSceneWidget : public QGraphicsView void updateZoomGroup(); + void calculateMinMaxMZ(); + + signals: diff --git a/CycloBranch/gui/cSummaryPeaksTableWidget.cpp b/CycloBranch/gui/cSummaryPeaksTableWidget.cpp index 2d7a91c..cd0db03 100644 --- a/CycloBranch/gui/cSummaryPeaksTableWidget.cpp +++ b/CycloBranch/gui/cSummaryPeaksTableWidget.cpp @@ -264,12 +264,22 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard } } else if (parameters->mode == denovoengine) { - databasemodel->setColumnCount(9); + if (parameters->generateisotopepattern) { + databasemodel->setColumnCount(11); + } + else { + databasemodel->setColumnCount(10); + } } else { - databasemodel->setColumnCount(8); + if (parameters->generateisotopepattern) { + databasemodel->setColumnCount(10); + } + else { + databasemodel->setColumnCount(9); + } } - + databasemodel->setHorizontalHeaderItem(0, new QStandardItem()); databasemodel->horizontalHeaderItem(0)->setText("ID"); database->setItemDelegateForColumn(0, new QItemDelegate()); @@ -320,7 +330,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); currentcolumn++; - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { + if (parameters->generateisotopepattern) { databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); databasemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical Intensity [%]"); database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); @@ -381,11 +391,21 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard currentcolumn++; } else { + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Summary Formula"); + if (parameters->generateisotopepattern) { + database->setItemDelegateForColumn(currentcolumn, new cHTMLDelegate()); + } + else { + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + } + currentcolumn++; + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); databasemodel->horizontalHeaderItem(currentcolumn)->setText("Sequence"); database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); currentcolumn++; - } + } rowsfiltercombobox->clear(); for (int i = 0; i < databasemodel->columnCount(); i++) { @@ -436,7 +456,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard spectrumindex = resultsstandardmodel->item(i, 1)->data(Qt::DisplayRole).toInt() - 1; - if ((parameters->mode == dereplication) && (parameters->peaklistfileformat != mis) && (parameters->peaklistfileformat != imzML)) { + if ((parameters->mode == dereplication) && (parameters->peaklistfileformat != mis) && (parameters->peaklistfileformat != imzML)) { addEICPeak(eicchromatogram, (*spectralist)[spectrumindex].getExperimentalSpectrum()); } @@ -451,10 +471,15 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard // theoretical peaks for (int j = 0; j < thpeakscount; j++) { peak = &((*thpeaks)[j]); + if (peak->descriptionid != -1) { peak->description = parameters->peakidtodesc[peak->descriptionid]; } + if (peak->isotopeformulaid != -1) { + peak->isotopeformula = parameters->isotopeformulaidtodesc[peak->isotopeformulaid]; + } + if (peak->matchedmz == 0) { continue; } @@ -475,7 +500,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue((*spectralist)[spectrumindex].getExperimentalSpectrum().getCoordinateX()), Qt::DisplayRole); currentcolumn++; - + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue((*spectralist)[spectrumindex].getExperimentalSpectrum().getCoordinateY()), Qt::DisplayRole); @@ -487,29 +512,29 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setText(peak->description.substr(0, secondspace).c_str()); - currentcolumn++; + currentcolumn++; } if (parameters->mode == denovoengine) { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue((*spectralist)[spectrumindex].getPathId() + 1), Qt::DisplayRole); - currentcolumn++; + currentcolumn++; } - + if (parameters->mode != dereplication) { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setText(peak->description.substr(0, peak->description.find(':')).c_str()); - currentcolumn++; + currentcolumn++; } - + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(peak->mzratio)), Qt::DisplayRole); currentcolumn++; - if ((parameters->mode == dereplication) && (parameters->generateisotopepattern)) { + if (parameters->generateisotopepattern) { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(peak->relativeintensity)), Qt::DisplayRole); @@ -552,7 +577,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setText(peak->description.substr(peak->description.rfind('(') + 1, peak->description.rfind(')') - peak->description.rfind('(') - 1).c_str()); - currentcolumn++; + currentcolumn++; langle = (int)peak->description.rfind(""); rangle = (int)peak->description.find('>'); @@ -569,7 +594,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard coordinates.back().name += databasemodel->item(currentrow, currentcolumn)->text().toStdString(); } } - currentcolumn++; + currentcolumn++; tmp = (int)peak->description.find('<'); stmp = peak->description.substr(tmp, rangle - tmp + 1); @@ -579,7 +604,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setText(stmp.c_str()); - currentcolumn++; + currentcolumn++; } else { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); @@ -594,15 +619,25 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard coordinates.back().name += databasemodel->item(currentrow, currentcolumn)->text().toStdString(); } } - currentcolumn++; + currentcolumn++; databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setText(""); - currentcolumn++; + currentcolumn++; } } else { + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setForeground(brush); + if (parameters->generateisotopepattern) { + databasemodel->item(currentrow, currentcolumn)->setText(peak->isotopeformula.c_str()); + } + else { + databasemodel->item(currentrow, currentcolumn)->setText(peak->formula.getFancySummary(peak->charge).c_str()); + } + currentcolumn++; + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setText(""); @@ -613,17 +648,17 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard } databasemodel->item(currentrow, currentcolumn)->setText(fragmentname.c_str()); } - currentcolumn++; + currentcolumn++; } } - progress->setValue(i); - if (progress->wasCanceled()) { + progress->setValue(i); + if (progress->wasCanceled()) { deleteTable(); emit tableCancelled(); break; - } + } } @@ -636,30 +671,40 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard for (int i = 0; i < databasemodel->columnCount(); i++) { database->resizeColumnToContents(i); } - } - if ((parameters->mode == dereplication) && !progress->wasCanceled()) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - emit resetRegion(); - emit sendFilterOptionsToImageWindow(coordinates, rowsfiltercombobox->currentText().toStdString(), rowsfiltercomparatorcombobox->currentText().toStdString(), rowsfilterline->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); + if (parameters->mode == dereplication) { + if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + emit resetRegion(); + emit sendFilterOptionsToImageWindow(coordinates, rowsfiltercombobox->currentText().toStdString(), rowsfiltercomparatorcombobox->currentText().toStdString(), rowsfilterline->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); - if (parameters->generateisotopepattern) { - database->setColumnWidth(12, min(400, database->columnWidth(12))); + if (parameters->generateisotopepattern) { + database->setColumnWidth(12, min(400, database->columnWidth(12))); + } + else { + database->setColumnWidth(9, min(400, database->columnWidth(9))); + } } else { + eicchromatogram.normalizeIntenzity(); + origeicchromatogram = eicchromatogram; + emit sendFilterOptionsToChromatogram(eicchromatogram); + + if (parameters->generateisotopepattern) { + database->setColumnWidth(10, min(400, database->columnWidth(10))); + } + else { + database->setColumnWidth(7, min(400, database->columnWidth(7))); + } + } + } + else if (parameters->mode == denovoengine) { + if (parameters->generateisotopepattern) { database->setColumnWidth(9, min(400, database->columnWidth(9))); } } else { - eicchromatogram.normalizeIntenzity(); - origeicchromatogram = eicchromatogram; - emit sendFilterOptionsToChromatogram(eicchromatogram); - if (parameters->generateisotopepattern) { - database->setColumnWidth(10, min(400, database->columnWidth(10))); - } - else { - database->setColumnWidth(7, min(400, database->columnWidth(7))); + database->setColumnWidth(8, min(400, database->columnWidth(8))); } } } @@ -1042,11 +1087,13 @@ void cSummaryPeaksTableWidget::exportStatistics() { int idcol; int xcol, ycol; int relintcol, absintcol; - int scorecol, qvaluecol; + int scorecol, fdrcol; int experimentalmzcol; int ppmcol; + int thintcol; + if (parameters->mode == dereplication) { if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { @@ -1057,7 +1104,7 @@ void cSummaryPeaksTableWidget::exportStatistics() { namecol = 13; referencecol = 14; scorecol = 10; - qvaluecol = 11; + fdrcol = 11; idcol = 0; xcol = 1; ycol = 2; @@ -1085,7 +1132,7 @@ void cSummaryPeaksTableWidget::exportStatistics() { namecol = 11; referencecol = 12; scorecol = 8; - qvaluecol = 9; + fdrcol = 9; idcol = 0; relintcol = 5; absintcol = 6; @@ -1104,18 +1151,42 @@ void cSummaryPeaksTableWidget::exportStatistics() { } else if (parameters->mode == denovoengine) { - theoreticalmzcol = 3; - experimentalmzcol = 4; - relintcol = 5; - absintcol = 6; - ppmcol = 7; + if (parameters->generateisotopepattern) { + theoreticalmzcol = 3; + thintcol = 4; + experimentalmzcol = 5; + relintcol = 6; + absintcol = 7; + ppmcol = 8; + summaryformulacol = 9; + } + else { + theoreticalmzcol = 3; + experimentalmzcol = 4; + relintcol = 5; + absintcol = 6; + ppmcol = 7; + summaryformulacol = 8; + } } else { - theoreticalmzcol = 2; - experimentalmzcol = 3; - relintcol = 4; - absintcol = 5; - ppmcol = 6; + if (parameters->generateisotopepattern) { + theoreticalmzcol = 2; + thintcol = 3; + experimentalmzcol = 4; + relintcol = 5; + absintcol = 6; + ppmcol = 7; + summaryformulacol = 8; + } + else { + theoreticalmzcol = 2; + experimentalmzcol = 3; + relintcol = 4; + absintcol = 5; + ppmcol = 6; + summaryformulacol = 7; + } } map, cIonSummaryTableKeyMS_comp> ionmapms; @@ -1132,6 +1203,10 @@ void cSummaryPeaksTableWidget::exportStatistics() { keyms.clear(); + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, idcol))); + if (item) { + keyms.id = item->text().toStdString(); + } item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, iontypecol))); if (item) { keyms.iontype = item->text().toStdString(); @@ -1152,6 +1227,16 @@ void cSummaryPeaksTableWidget::exportStatistics() { if (item) { keyms.reference = item->text().toStdString(); } + if (parameters->generateisotopepattern) { + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, scorecol))); + if (item) { + keyms.score = item->text().toStdString(); + } + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, fdrcol))); + if (item) { + keyms.fdr = item->text().toStdString(); + } + } auto obj = ionmapms.find(keyms); if (obj != ionmapms.end()) { @@ -1184,6 +1269,10 @@ void cSummaryPeaksTableWidget::exportStatistics() { if (item) { keymsms.theoreticalmz = item->text().toStdString(); } + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, thintcol))); + if (item) { + keymsms.thint = item->text().toStdString(); + } item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, experimentalmzcol))); if (item) { keymsms.experimentalmz = item->text().toStdString(); @@ -1200,6 +1289,10 @@ void cSummaryPeaksTableWidget::exportStatistics() { if (item) { keymsms.ppmerror = item->text().toStdString(); } + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, summaryformulacol))); + if (item) { + keymsms.summary = item->text().toStdString(); + } auto obj = mapmsms.find(keymsms); if (obj != mapmsms.end()) { @@ -1226,11 +1319,11 @@ void cSummaryPeaksTableWidget::exportStatistics() { double relintmax, relintavg, relintmed, relintcur; double absintmax, absintavg, absintmed, absintcur; double scoremin, scoreavg, scoremed, scoremax, scorecur; - double qvaluemin, qvalueavg, qvaluemed, qvaluemax, qvaluecur; + double fdrmin, fdravg, fdrmed, fdrmax, fdrcur; vector relintmedianvector; vector absintmedianvector; vector scoremedianvector; - vector qvaluemedianvector; + vector fdrmedianvector; if (parameters->mode == dereplication) { @@ -1274,65 +1367,79 @@ void cSummaryPeaksTableWidget::exportStatistics() { out << "\"Whole Pattern Statistics\"" << endl << endl; - out << "\"Name\",\"Pattern Type\","; + out << "\"Name\",\"Pattern Type\",\"Number of Patterns\","; out << "\"Minimum Score\",\"Average Score\",\"Median Score\",\"Maximum Score\","; out << "\"Minimum FDR\",\"Average FDR\",\"Median FDR\",\"Maximum FDR\","; out << "\"Reference\"" << endl; - for (auto it = envelopestatisticsms.begin(); it != envelopestatisticsms.end(); ++it) { + scoremin = DBL_MAX; + scoremax = 0; + scoreavg = 0; + scoremedianvector.clear(); - scoremin = DBL_MAX; - scoremax = 0; - scoreavg = 0; - scoremedianvector.clear(); + fdrmin = DBL_MAX; + fdrmax = 0; + fdravg = 0; + fdrmedianvector.clear(); - qvaluemin = DBL_MAX; - qvaluemax = 0; - qvalueavg = 0; - qvaluemedianvector.clear(); + int envelopesstatisticssize = (int)envelopestatisticsms.size(); + int cnt = 0; + for (int i = 0; i < envelopesstatisticssize; i++) { - for (auto it2 = it->second.begin(); it2 != it->second.end(); ++it2) { - item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(*it2, scorecol))); - if (item) { - scorecur = item->data(Qt::DisplayRole).toDouble(); - if (scorecur > scoremax) { - scoremax = scorecur; - } - if (scorecur < scoremin) { - scoremin = scorecur; - } - scoreavg += scorecur; - scoremedianvector.push_back(scorecur); - } + scorecur = QString(envelopestatisticsms[i].first.score.c_str()).toDouble(); + if (scorecur > scoremax) { + scoremax = scorecur; + } + if (scorecur < scoremin) { + scoremin = scorecur; + } + scoreavg += scorecur; + scoremedianvector.push_back(scorecur); - item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(*it2, qvaluecol))); - if (item) { - qvaluecur = item->data(Qt::DisplayRole).toDouble(); - if (qvaluecur > qvaluemax) { - qvaluemax = qvaluecur; - } - if (qvaluecur < qvaluemin) { - qvaluemin = qvaluecur; - } - qvalueavg += qvaluecur; - qvaluemedianvector.push_back(qvaluecur); - } + fdrcur = QString(envelopestatisticsms[i].first.fdr.c_str()).toDouble(); + if (fdrcur > fdrmax) { + fdrmax = fdrcur; + } + if (fdrcur < fdrmin) { + fdrmin = fdrcur; + } + fdravg += fdrcur; + fdrmedianvector.push_back(fdrcur); + + cnt++; + + if ((i + 1 < envelopesstatisticssize) && (envelopestatisticsms[i].first.iontype.compare(envelopestatisticsms[i + 1].first.iontype) == 0) + && (envelopestatisticsms[i].first.name.compare(envelopestatisticsms[i + 1].first.name) == 0) + && (envelopestatisticsms[i].first.reference.compare(envelopestatisticsms[i + 1].first.reference) == 0)) { + continue; } - scoreavg /= (double)it->second.size(); - qvalueavg /= (double)it->second.size(); + scoreavg /= (double)cnt; + fdravg /= (double)cnt; scoremed = median(scoremedianvector); - qvaluemed = median(qvaluemedianvector); + fdrmed = median(fdrmedianvector); - out << "\"" << it->first.name.c_str() << "\",\"" << it->first.iontype.c_str() << "\",\""; + out << "\"" << envelopestatisticsms[i].first.name.c_str() << "\",\"" << envelopestatisticsms[i].first.iontype.c_str() << "\",\"" << cnt << "\",\""; stringstream ss; ss << std::fixed << std::setprecision(6) << scoremin << "\",\"" << scoreavg << "\",\"" << scoremed << "\",\"" << scoremax << "\",\""; - ss << std::fixed << std::setprecision(6) << qvaluemin << "\",\"" << qvalueavg << "\",\"" << qvaluemed << "\",\"" << qvaluemax << "\",\""; + ss << std::fixed << std::setprecision(6) << fdrmin << "\",\"" << fdravg << "\",\"" << fdrmed << "\",\"" << fdrmax << "\",\""; out << ss.str().c_str(); - out << it->first.reference.c_str() << "\"" << endl; + out << envelopestatisticsms[i].first.reference.c_str() << "\"" << endl; + + scoremin = DBL_MAX; + scoremax = 0; + scoreavg = 0; + scoremedianvector.clear(); + + fdrmin = DBL_MAX; + fdrmax = 0; + fdravg = 0; + fdrmedianvector.clear(); + + cnt = 0; } @@ -1466,7 +1573,11 @@ void cSummaryPeaksTableWidget::exportStatistics() { } else { - out << "\"Number of Matches\",\"Theoretical m/z\",\"Experimental m/z\",\"Relative Intensity [%]\",\"Absolute Intensity\",\"Error [ppm]\"" << endl; + out << "\"Number of Matches\",\"Theoretical m/z\","; + if (parameters->generateisotopepattern) { + out << "\"Theoretical Intensity [%]\","; + } + out << "\"Experimental m/z\",\"Relative Intensity [%]\",\"Absolute Intensity\",\"Error [ppm]\",\"Summary Formula\"" << endl; vector< pair > > statisticsmsms; @@ -1480,7 +1591,11 @@ void cSummaryPeaksTableWidget::exportStatistics() { sort(statisticsmsms.begin(), statisticsmsms.end(), cmpmsms); for (auto it = statisticsmsms.begin(); it != statisticsmsms.end(); ++it) { - out << "\"" << it->second.size() << "\",\"" << it->first.theoreticalmz.c_str() << "\",\"" << it->first.experimentalmz.c_str() << "\",\"" << it->first.relint.c_str() << "\",\"" << it->first.absint.c_str() << "\",\"" << it->first.ppmerror.c_str() << "\"" << endl; + out << "\"" << it->second.size() << "\",\"" << it->first.theoreticalmz.c_str() << "\","; + if (parameters->generateisotopepattern) { + out << "\"" << it->first.thint.c_str() << "\","; + } + out << "\"" << it->first.experimentalmz.c_str() << "\",\"" << it->first.relint.c_str() << "\",\"" << it->first.absint.c_str() << "\",\"" << it->first.ppmerror.c_str() << "\",\"" << stripHTML(it->first.summary).c_str() << "\"" << endl; } } diff --git a/CycloBranch/gui/cSummaryPeaksTableWidget.h b/CycloBranch/gui/cSummaryPeaksTableWidget.h index b9e7bfc..76ac558 100644 --- a/CycloBranch/gui/cSummaryPeaksTableWidget.h +++ b/CycloBranch/gui/cSummaryPeaksTableWidget.h @@ -47,6 +47,12 @@ class QMenu; */ struct cSummaryTableKeyMS { + /** + \brief Identification ID subkey. + */ + string id; + + /** \brief Ion type subkey. */ @@ -77,15 +83,30 @@ struct cSummaryTableKeyMS { string reference; + /** + \brief Score subkey. + */ + string score; + + + /** + \brief FDR subkey. + */ + string fdr; + + /** \brief Clear the structure. */ void clear() { + id.clear(); iontype.clear(); theoreticalmz.clear(); summaryformula.clear(); name.clear(); reference.clear(); + score.clear(); + fdr.clear(); } }; @@ -102,6 +123,12 @@ struct cSummaryTableKeyMSMS { string theoreticalmz; + /** + \brief Theoretical intensity subkey. + */ + string thint; + + /** \brief Experimental m/z subkey. */ @@ -126,15 +153,23 @@ struct cSummaryTableKeyMSMS { string ppmerror; + /** + \brief summary formula subkey. + */ + string summary; + + /** \brief Clear the structure. */ void clear() { theoreticalmz.clear(); + thint.clear(); experimentalmz.clear(); relint.clear(); absint.clear(); ppmerror.clear(); + summary.clear(); } }; @@ -170,7 +205,7 @@ struct cEnvelopeSummaryTableKeyMS_comp { \retval bool true if the first object is less than the second object */ bool operator()(const cSummaryTableKeyMS& left, const cSummaryTableKeyMS& right) const { - return (left.iontype + left.name + left.reference < right.iontype + right.name + right.reference); + return (left.id + left.iontype + left.name + left.reference < right.id + right.iontype + right.name + right.reference); } }; @@ -188,7 +223,7 @@ struct cSummaryTableKeyMSMS_comp { \retval bool true if the first object is less than the second object */ bool operator()(const cSummaryTableKeyMSMS& left, const cSummaryTableKeyMSMS& right) const { - return (left.theoreticalmz + left.experimentalmz + left.relint + left.absint + left.ppmerror < right.theoreticalmz + right.experimentalmz + right.relint + right.absint + right.ppmerror); + return (left.theoreticalmz + left.thint + left.experimentalmz + left.relint + left.absint + left.ppmerror + left.summary < right.theoreticalmz + right.thint + right.experimentalmz + right.relint + right.absint + right.ppmerror + right.summary); } }; diff --git a/CycloBranch/parallel/cSpectrumComparatorThread.cpp b/CycloBranch/parallel/cSpectrumComparatorThread.cpp index d6c27fa..8deac28 100644 --- a/CycloBranch/parallel/cSpectrumComparatorThread.cpp +++ b/CycloBranch/parallel/cSpectrumComparatorThread.cpp @@ -3,6 +3,34 @@ #include "core/cTheoreticalSpectrumList.h" +bool comparePaths(vector& a, vector& b) { + if (a.size() < b.size()) { + return true; + } + + if (a.size() > b.size()) { + return false; + } + + for (int i = 0; i < a.size(); i++) { + if (a[i].nodeid < b[i].nodeid) { + return true; + } + if (a[i].nodeid > b[i].nodeid) { + return false; + } + if (a[i].edgeid < b[i].edgeid) { + return true; + } + if (a[i].edgeid > b[i].edgeid) { + return false; + } + } + + return false; +} + + bool compareBandAllIonsDesc(const cTheoreticalSpectrum& a, const cTheoreticalSpectrum& b) { if (a.getNumberOfMatchedPeaks(b_ion) > b.getNumberOfMatchedPeaks(b_ion)) { return true; @@ -10,16 +38,25 @@ bool compareBandAllIonsDesc(const cTheoreticalSpectrum& a, const cTheoreticalSpe if (a.getNumberOfMatchedPeaks(b_ion) < b.getNumberOfMatchedPeaks(b_ion)) { return false; } + if (a.getNumberOfMatchedPeaks() > b.getNumberOfMatchedPeaks()) { return true; } if (a.getNumberOfMatchedPeaks() < b.getNumberOfMatchedPeaks()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } @@ -30,16 +67,25 @@ bool compareBBwaterLossAndAllIonsDesc(const cTheoreticalSpectrum& a, const cTheo if (a.getNumberOfMatchedPeaks(b_ion) + a.getNumberOfMatchedPeaks(b_ion_dehydrated) < b.getNumberOfMatchedPeaks(b_ion) + b.getNumberOfMatchedPeaks(b_ion_dehydrated)) { return false; } + if (a.getNumberOfMatchedPeaks() > b.getNumberOfMatchedPeaks()) { return true; } if (a.getNumberOfMatchedPeaks() < b.getNumberOfMatchedPeaks()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } @@ -50,16 +96,25 @@ bool compareBBammoniaLossAndAllIonsDesc(const cTheoreticalSpectrum& a, const cTh if (a.getNumberOfMatchedPeaks(b_ion) + a.getNumberOfMatchedPeaks(b_ion_deamidated) < b.getNumberOfMatchedPeaks(b_ion) + b.getNumberOfMatchedPeaks(b_ion_deamidated)) { return false; } + if (a.getNumberOfMatchedPeaks() > b.getNumberOfMatchedPeaks()) { return true; } if (a.getNumberOfMatchedPeaks() < b.getNumberOfMatchedPeaks()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } @@ -70,16 +125,25 @@ bool compareYBandAllIonsDesc(const cTheoreticalSpectrum& a, const cTheoreticalSp if (a.getNumberOfMatchedPeaksYB() < b.getNumberOfMatchedPeaksYB()) { return false; } + if (a.getNumberOfMatchedPeaks() > b.getNumberOfMatchedPeaks()) { return true; } if (a.getNumberOfMatchedPeaks() < b.getNumberOfMatchedPeaks()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } @@ -90,16 +154,25 @@ bool compareYandAllIonsDesc(const cTheoreticalSpectrum& a, const cTheoreticalSpe if (a.getNumberOfMatchedPeaks(y_ion) < b.getNumberOfMatchedPeaks(y_ion)) { return false; } + if (a.getNumberOfMatchedPeaks() > b.getNumberOfMatchedPeaks()) { return true; } if (a.getNumberOfMatchedPeaks() < b.getNumberOfMatchedPeaks()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } @@ -110,10 +183,18 @@ bool compareWeightedIntensityDesc(const cTheoreticalSpectrum& a, const cTheoreti if (a.getWeightedIntensityScore() < b.getWeightedIntensityScore()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } @@ -124,10 +205,18 @@ bool compareNumberOfMatchedPeaksDesc(const cTheoreticalSpectrum& a, const cTheor if (a.getNumberOfMatchedPeaks() < b.getNumberOfMatchedPeaks()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } @@ -138,21 +227,29 @@ bool compareNumberOfMatchedBricksDesc(const cTheoreticalSpectrum& a, const cTheo if (a.getNumberOfMatchedBricks() < b.getNumberOfMatchedBricks()) { return false; } + if (a.getPathId() < b.getPathId()) { return true; } - return false; + if (a.getPathId() > b.getPathId()) { + return false; + } + + vector v1 = ((cTheoreticalSpectrum&)a).getCandidate().getPath(); + vector v2 = ((cTheoreticalSpectrum&)b).getCandidate().getPath(); + + return comparePaths(v1, v2); } -void cSpectrumComparatorThread::initialize(cCandidate& candidate, cPeaksList& peaklist, cBricksDatabase* bricksdatabasewithcombinations, cTheoreticalSpectrumList* theoreticalspectrumlist, cParameters* parameters, regex* rxsequencetag, regex* rxsearchedsequence, double worstscore, bool* terminatecomputation) { +void cSpectrumComparatorThread::initialize(cCandidate& candidate, cPeaksList& peaklist, cBricksDatabase* bricksdatabasewithcombinations, cTheoreticalSpectrumList* theoreticalspectrumlist, cParameters* parameters, regex* rxsequencetag, regex* rxsearchedsequence, double currentworstscore, bool* terminatecomputation) { this->candidate = candidate; this->peaklist = peaklist; this->theoreticalspectrumlist = theoreticalspectrumlist; this->parameters = parameters; this->rxsequencetag = rxsequencetag; this->rxsearchedsequence = rxsearchedsequence; - this->worstscore = worstscore; + this->lastavailableworstscore = currentworstscore; this->terminatecomputation = terminatecomputation; this->bricksdatabasewithcombinations = bricksdatabasewithcombinations; } @@ -193,30 +290,29 @@ void cSpectrumComparatorThread::run() { } } - switch (parameters->peptidetype) - { - case linear: - theoreticalpeaksrealsize = tsp.compareLinear(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); - break; - case cyclic: - theoreticalpeaksrealsize = tsp.compareCyclic(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); - break; - case branched: - theoreticalpeaksrealsize = tsp.compareBranched(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); - break; - case branchcyclic: - theoreticalpeaksrealsize = tsp.compareBranchCyclic(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); - break; - case linearpolyketide: - theoreticalpeaksrealsize = tsp.compareLinearPolyketide(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); - break; - case cyclicpolyketide: - theoreticalpeaksrealsize = tsp.compareCyclicPolyketide(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); - break; - case other: - break; - default: - break; + switch (parameters->peptidetype) { + case linear: + theoreticalpeaksrealsize = tsp.compareLinear(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); + break; + case cyclic: + theoreticalpeaksrealsize = tsp.compareCyclic(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); + break; + case branched: + theoreticalpeaksrealsize = tsp.compareBranched(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); + break; + case branchcyclic: + theoreticalpeaksrealsize = tsp.compareBranchCyclic(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); + break; + case linearpolyketide: + theoreticalpeaksrealsize = tsp.compareLinearPolyketide(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); + break; + case cyclicpolyketide: + theoreticalpeaksrealsize = tsp.compareCyclicPolyketide(peaklist, *bricksdatabasewithcombinations, false, *rxsequencetag, *rxsearchedsequence); + break; + case other: + break; + default: + break; } // invalid sequence tag @@ -226,34 +322,34 @@ void cSpectrumComparatorThread::run() { score = 0; switch (parameters->scoretype) { - case b_ions: - score = tsp.getNumberOfMatchedPeaks(b_ion); - break; - case b_ions_and_b_dehydrated_ions: - score = tsp.getNumberOfMatchedPeaks(b_ion) + tsp.getNumberOfMatchedPeaks(b_ion_dehydrated); - break; - case b_ions_and_b_deamidated_ions: - score = tsp.getNumberOfMatchedPeaks(b_ion) + tsp.getNumberOfMatchedPeaks(b_ion_deamidated); - break; - case y_ions_and_b_ions: - score = tsp.getNumberOfMatchedPeaksYB(); - break; - case y_ions: - score = tsp.getNumberOfMatchedPeaks(y_ion); - break; - case weighted_intensity: - score = tsp.getWeightedIntensityScore(); - break; - case matched_peaks: - score = tsp.getNumberOfMatchedPeaks(); - break; - case matched_bricks: - score = tsp.getNumberOfMatchedBricks(); - break; + case b_ions: + score = tsp.getNumberOfMatchedPeaks(b_ion); + break; + case b_ions_and_b_dehydrated_ions: + score = tsp.getNumberOfMatchedPeaks(b_ion) + tsp.getNumberOfMatchedPeaks(b_ion_dehydrated); + break; + case b_ions_and_b_deamidated_ions: + score = tsp.getNumberOfMatchedPeaks(b_ion) + tsp.getNumberOfMatchedPeaks(b_ion_deamidated); + break; + case y_ions_and_b_ions: + score = tsp.getNumberOfMatchedPeaksYB(); + break; + case y_ions: + score = tsp.getNumberOfMatchedPeaks(y_ion); + break; + case weighted_intensity: + score = tsp.getWeightedIntensityScore(); + break; + case matched_peaks: + score = tsp.getNumberOfMatchedPeaks(); + break; + case matched_bricks: + score = tsp.getNumberOfMatchedBricks(); + break; } - if (score >= worstscore) { - theoreticalspectrumlist->addButDoNotFitSize(tsp, theoreticalpeaksrealsize); + if (score >= lastavailableworstscore) { + lastavailableworstscore = theoreticalspectrumlist->updatekNNList(tsp, theoreticalpeaksrealsize, score, rxsearchedsequence); } } diff --git a/CycloBranch/parallel/cSpectrumComparatorThread.h b/CycloBranch/parallel/cSpectrumComparatorThread.h index c7c7a23..cf2a052 100644 --- a/CycloBranch/parallel/cSpectrumComparatorThread.h +++ b/CycloBranch/parallel/cSpectrumComparatorThread.h @@ -15,6 +15,14 @@ class cTheoreticalSpectrumList; +/** + \brief Compare two paths of a peptide sequence candidate as a string. + \param a first theoretical spectrum + \param b second theoretical spectrum + \retval bool true if the path of \a a is smaller than the path of \a b +*/ +bool comparePaths(vector& a, vector& b); + /** \brief Compare scores of two theoretical spectra (number of b-ions and all ions secondly). @@ -103,7 +111,7 @@ class cSpectrumComparatorThread : public QObject, public QRunnable { cParameters* parameters; regex* rxsequencetag; regex* rxsearchedsequence; - double worstscore; + double lastavailableworstscore; bool* terminatecomputation; cBricksDatabase* bricksdatabasewithcombinations; @@ -119,10 +127,10 @@ class cSpectrumComparatorThread : public QObject, public QRunnable { \param parameters pointer to program parameters \param rxsequencetag pointer to a regular expression of a sequence tag \param rxsearchedsequence pointer to a regular expression of a searched sequence - \param worstscore worst score in the resulting set of theoretical spectra + \param currentworstscore worst score in the resulting set of theoretical spectra \param terminatecomputation reference to a variable determining that the thread must be stopped */ - void initialize(cCandidate& candidate, cPeaksList& peaklist, cBricksDatabase* bricksdatabasewithcombinations, cTheoreticalSpectrumList* theoreticalspectrumlist, cParameters* parameters, regex* rxsequencetag, regex* rxsearchedsequence, double worstscore, bool* terminatecomputation); + void initialize(cCandidate& candidate, cPeaksList& peaklist, cBricksDatabase* bricksdatabasewithcombinations, cTheoreticalSpectrumList* theoreticalspectrumlist, cParameters* parameters, regex* rxsequencetag, regex* rxsearchedsequence, double currentworstscore, bool* terminatecomputation); protected: