From 44ac4970d618a1bf4d9851884c0dbf3894843403 Mon Sep 17 00:00:00 2001 From: Jiri Novak Date: Wed, 11 Mar 2020 13:15:17 +0100 Subject: [PATCH] release 2.0.8 --- CycloBranch/CycloBranch-Linux.pro | 14 + CycloBranch/CycloBranch-MacOSX.pro | 14 + CycloBranch/CycloBranch.vcxproj | 164 ++++ CycloBranch/CycloBranch.vcxproj.filters | 78 ++ .../database_search/ms/peptides_test.ini | 88 +- .../dereplication/batch-lc-ms-1.ini | 86 +- .../dereplication/batch-lc-ms-2.ini | 86 +- .../dereplication/ferrichromes.ini | 89 +- .../dereplication/ferrioxamines.ini | 89 +- .../fusarinines_and_coprogens.ini | 89 +- .../dereplication/ornibactins.ini | 89 +- .../siderophores/dereplication/pyoverdins.ini | 89 +- .../dereplication/rhodotulic_acid.ini | 89 +- .../fine_isotope/tafc_fine_isotope.ini | 86 +- .../imaging/siderophore_mixtures.ini | 88 +- .../pyoverdin_esi/ms1_fine_isotope_4M.ini | 84 +- .../Settings/tutorials/cb2_tutorial1.ini | 76 +- .../Settings/tutorials/cb2_tutorial2.ini | 76 +- .../Settings/tutorials/cb2_tutorial3.ini | 76 +- .../Settings/tutorials/cb2_tutorial4.ini | 78 +- .../Settings/tutorials/cb2_tutorial5.ini | 78 +- .../Settings/tutorials/tutorial13a.ini | 89 +- .../Settings/tutorials/tutorial13b.ini | 86 +- CycloBranch/Settings/tutorials/tutorial14.ini | 86 +- CycloBranch/Settings/tutorials/tutorial8.ini | 87 +- CycloBranch/core/cFragmentIons.cpp | 691 +------------- CycloBranch/core/cFragmentIons.h | 108 +-- CycloBranch/core/cGlobalPreferences.cpp | 902 ++++++++++++++++++ CycloBranch/core/cGlobalPreferences.h | 152 +++ CycloBranch/core/cParameters.cpp | 88 +- CycloBranch/core/cParameters.h | 16 +- CycloBranch/core/cSequence.cpp | 4 +- CycloBranch/core/cTheoreticalSpectrum.cpp | 880 ++++++++++------- CycloBranch/core/cTheoreticalSpectrum.h | 19 +- CycloBranch/core/cTheoreticalSpectrumList.cpp | 12 + CycloBranch/core/utilities.cpp | 7 +- CycloBranch/core/utilities.h | 99 +- CycloBranch/gui/cAboutWidget.cpp | 2 +- CycloBranch/gui/cBricksDatabaseWidget.cpp | 18 +- CycloBranch/gui/cBricksDatabaseWidget.h | 13 +- CycloBranch/gui/cChromatogramWindow.cpp | 45 +- CycloBranch/gui/cChromatogramWindow.h | 17 +- CycloBranch/gui/cChromatogramWindowWidget.cpp | 79 +- CycloBranch/gui/cChromatogramWindowWidget.h | 4 + CycloBranch/gui/cImageWindow.cpp | 63 +- CycloBranch/gui/cImageWindow.h | 21 +- CycloBranch/gui/cImageWindowWidget.cpp | 52 +- CycloBranch/gui/cImageWindowWidget.h | 6 +- CycloBranch/gui/cMainWindow.cpp | 146 ++- CycloBranch/gui/cMainWindow.h | 17 +- CycloBranch/gui/cModificationsWidget.cpp | 22 +- CycloBranch/gui/cModificationsWidget.h | 15 +- CycloBranch/gui/cParametersWidget.cpp | 208 ++-- CycloBranch/gui/cParametersWidget.h | 12 +- CycloBranch/gui/cPreferencesDialog.cpp | 79 ++ CycloBranch/gui/cPreferencesDialog.h | 91 ++ CycloBranch/gui/cPreferencesIonTypeDialog.cpp | 93 ++ CycloBranch/gui/cPreferencesIonTypeDialog.h | 86 ++ .../gui/cPreferencesTabDataProcessing.cpp | 77 ++ .../gui/cPreferencesTabDataProcessing.h | 85 ++ .../gui/cPreferencesTabDirectories.cpp | 351 +++++++ CycloBranch/gui/cPreferencesTabDirectories.h | 165 ++++ CycloBranch/gui/cPreferencesTabIonTypes.cpp | 209 ++++ CycloBranch/gui/cPreferencesTabIonTypes.h | 101 ++ CycloBranch/gui/cPreferencesTabURLs.cpp | 75 ++ CycloBranch/gui/cPreferencesTabURLs.h | 85 ++ CycloBranch/gui/cSequenceDatabaseWidget.cpp | 18 +- CycloBranch/gui/cSequenceDatabaseWidget.h | 13 +- CycloBranch/gui/cSpectrumDetailWidget.cpp | 61 +- CycloBranch/gui/cSpectrumDetailWidget.h | 5 +- CycloBranch/gui/cSummaryPeaksTableWidget.cpp | 323 ++++--- CycloBranch/gui/cSummaryPeaksTableWidget.h | 26 +- CycloBranch/gui/cViewButtonDelegate.cpp | 2 +- CycloBranch/images.qrc | 9 +- CycloBranch/images/icons/23.png | Bin 1103 -> 0 bytes CycloBranch/images/icons/43.png | Bin 1000 -> 0 bytes CycloBranch/images/icons/62.png | Bin 1003 -> 0 bytes CycloBranch/images/icons/csv.png | Bin 0 -> 1103 bytes CycloBranch/images/icons/image.png | Bin 0 -> 902 bytes CycloBranch/images/icons/preferences.png | Bin 0 -> 536 bytes CycloBranch/images/icons/table.png | Bin 0 -> 157 bytes CycloBranch/main.cpp | 4 +- .../parallel/cSpectrumComparatorThread.cpp | 25 + .../parallel/cSpectrumComparatorThread.h | 9 + 84 files changed, 4613 insertions(+), 3151 deletions(-) create mode 100644 CycloBranch/core/cGlobalPreferences.cpp create mode 100644 CycloBranch/core/cGlobalPreferences.h create mode 100644 CycloBranch/gui/cPreferencesDialog.cpp create mode 100644 CycloBranch/gui/cPreferencesDialog.h create mode 100644 CycloBranch/gui/cPreferencesIonTypeDialog.cpp create mode 100644 CycloBranch/gui/cPreferencesIonTypeDialog.h create mode 100644 CycloBranch/gui/cPreferencesTabDataProcessing.cpp create mode 100644 CycloBranch/gui/cPreferencesTabDataProcessing.h create mode 100644 CycloBranch/gui/cPreferencesTabDirectories.cpp create mode 100644 CycloBranch/gui/cPreferencesTabDirectories.h create mode 100644 CycloBranch/gui/cPreferencesTabIonTypes.cpp create mode 100644 CycloBranch/gui/cPreferencesTabIonTypes.h create mode 100644 CycloBranch/gui/cPreferencesTabURLs.cpp create mode 100644 CycloBranch/gui/cPreferencesTabURLs.h delete mode 100644 CycloBranch/images/icons/23.png delete mode 100644 CycloBranch/images/icons/43.png delete mode 100644 CycloBranch/images/icons/62.png create mode 100644 CycloBranch/images/icons/csv.png create mode 100644 CycloBranch/images/icons/image.png create mode 100644 CycloBranch/images/icons/preferences.png create mode 100644 CycloBranch/images/icons/table.png diff --git a/CycloBranch/CycloBranch-Linux.pro b/CycloBranch/CycloBranch-Linux.pro index 1dacae9..ec8cf46 100644 --- a/CycloBranch/CycloBranch-Linux.pro +++ b/CycloBranch/CycloBranch-Linux.pro @@ -20,6 +20,7 @@ HEADERS += core/cBrick.h \ core/cDeNovoGraph.h \ core/cDeNovoGraphNode.h \ core/cFragmentIons.h \ + core/cGlobalPreferences.h \ core/cImzML.h \ core/cIsotopePatternCache.h \ core/cMzML.h \ @@ -62,6 +63,12 @@ HEADERS += core/cBrick.h \ gui/cMultipleButtonDelegate.h \ gui/cNeutralLossesListWidget.h \ gui/cParametersWidget.h \ + gui/cPreferencesDialog.h \ + gui/cPreferencesIonTypeDialog.h \ + gui/cPreferencesTabDataProcessing.h \ + gui/cPreferencesTabDirectories.h \ + gui/cPreferencesTabIonTypes.h \ + gui/cPreferencesTabURLs.h \ gui/cSequenceDatabaseProxyModel.h \ gui/cSequenceDatabaseWidget.h \ gui/cSpectrumDetailProxyModel.h \ @@ -79,6 +86,7 @@ SOURCES += core/cBrick.cpp \ core/cDeNovoGraph.cpp \ core/cDeNovoGraphNode.cpp \ core/cFragmentIons.cpp \ + core/cGlobalPreferences.cpp \ core/cImzML.cpp \ core/cIsotopePatternCache.cpp \ core/cMzML.cpp \ @@ -121,6 +129,12 @@ SOURCES += core/cBrick.cpp \ gui/cMultipleButtonDelegate.cpp \ gui/cNeutralLossesListWidget.cpp \ gui/cParametersWidget.cpp \ + gui/cPreferencesDialog.cpp \ + gui/cPreferencesIonTypeDialog.cpp \ + gui/cPreferencesTabDataProcessing.cpp \ + gui/cPreferencesTabDirectories.cpp \ + gui/cPreferencesTabIonTypes.cpp \ + gui/cPreferencesTabURLs.cpp \ gui/cSequenceDatabaseProxyModel.cpp \ gui/cSequenceDatabaseWidget.cpp \ gui/cSpectrumDetailProxyModel.cpp \ diff --git a/CycloBranch/CycloBranch-MacOSX.pro b/CycloBranch/CycloBranch-MacOSX.pro index 18c60cc..879d9d2 100644 --- a/CycloBranch/CycloBranch-MacOSX.pro +++ b/CycloBranch/CycloBranch-MacOSX.pro @@ -22,6 +22,7 @@ HEADERS += core/cBrick.h \ core/cDeNovoGraph.h \ core/cDeNovoGraphNode.h \ core/cFragmentIons.h \ + core/cGlobalPreferences.h \ core/cImzML.h \ core/cIsotopePatternCache.h \ core/cMzML.h \ @@ -64,6 +65,12 @@ HEADERS += core/cBrick.h \ gui/cMultipleButtonDelegate.h \ gui/cNeutralLossesListWidget.h \ gui/cParametersWidget.h \ + gui/cPreferencesDialog.h \ + gui/cPreferencesIonTypeDialog.h \ + gui/cPreferencesTabDataProcessing.h \ + gui/cPreferencesTabDirectories.h \ + gui/cPreferencesTabIonTypes.h \ + gui/cPreferencesTabURLs.h \ gui/cSequenceDatabaseProxyModel.h \ gui/cSequenceDatabaseWidget.h \ gui/cSpectrumDetailProxyModel.h \ @@ -81,6 +88,7 @@ SOURCES += core/cBrick.cpp \ core/cDeNovoGraph.cpp \ core/cDeNovoGraphNode.cpp \ core/cFragmentIons.cpp \ + core/cGlobalPreferences.cpp \ core/cImzML.cpp \ core/cIsotopePatternCache.cpp \ core/cMzML.cpp \ @@ -123,6 +131,12 @@ SOURCES += core/cBrick.cpp \ gui/cMultipleButtonDelegate.cpp \ gui/cNeutralLossesListWidget.cpp \ gui/cParametersWidget.cpp \ + gui/cPreferencesDialog.cpp \ + gui/cPreferencesIonTypeDialog.cpp \ + gui/cPreferencesTabDataProcessing.cpp \ + gui/cPreferencesTabDirectories.cpp \ + gui/cPreferencesTabIonTypes.cpp \ + gui/cPreferencesTabURLs.cpp \ gui/cSequenceDatabaseProxyModel.cpp \ gui/cSequenceDatabaseWidget.cpp \ gui/cSpectrumDetailProxyModel.cpp \ diff --git a/CycloBranch/CycloBranch.vcxproj b/CycloBranch/CycloBranch.vcxproj index d3a4baf..d1c499e 100644 --- a/CycloBranch/CycloBranch.vcxproj +++ b/CycloBranch/CycloBranch.vcxproj @@ -155,6 +155,7 @@ + @@ -288,6 +289,30 @@ true true + + true + true + + + true + true + + + true + true + + + true + true + + + true + true + + + true + true + true true @@ -454,6 +479,30 @@ true true + + true + true + + + true + true + + + true + true + + + true + true + + + true + true + + + true + true + true true @@ -519,6 +568,12 @@ + + + + + + @@ -539,6 +594,7 @@ + @@ -550,6 +606,114 @@ + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I." "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include\QtPrintSupport" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I." "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include\QtPrintSupport" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I." "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include\QtPrintSupport" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I." "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include\QtPrintSupport" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I." "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include\QtPrintSupport" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtPrintSupport" "-I$(QTDIR)\include\QtSvg" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing %(Identity)... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -D%(PreprocessorDefinitions) "-I." "-I.\GeneratedFiles" "-I.\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtSvg" "-I$(QTDIR)\include\QtPrintSupport" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" + $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cNeutralLossesListWidget.h... diff --git a/CycloBranch/CycloBranch.vcxproj.filters b/CycloBranch/CycloBranch.vcxproj.filters index 2707b9d..5acf206 100644 --- a/CycloBranch/CycloBranch.vcxproj.filters +++ b/CycloBranch/CycloBranch.vcxproj.filters @@ -464,6 +464,63 @@ Source Files\gui + + Source Files\gui + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\gui + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\gui + + + Source Files\gui + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\core + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\gui + + + Source Files\gui + + + Generated Files\Debug + + + Generated Files\Release + @@ -592,6 +649,24 @@ Header Files\gui + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + @@ -648,6 +723,9 @@ Header Files\core + + Header Files\core + diff --git a/CycloBranch/Settings/database_search/ms/peptides_test.ini b/CycloBranch/Settings/database_search/ms/peptides_test.ini index 2c16e42..d4368e3 100644 --- a/CycloBranch/Settings/database_search/ms/peptides_test.ini +++ b/CycloBranch/Settings/database_search/ms/peptides_test.ini @@ -5,7 +5,6 @@ precursormass=0 precursormasserrortolerance=1 precursorcharge=1 fragmentmasserrortolerance=1 -masserrortolerancefordeisotoping=1 minimumrelativeintensitythreshold=0 minimummz=150 brickdatabase= @@ -18,10 +17,6 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=0 -fragmentiontype_2=0 -clearhitswithoutparent=0 cyclicnterminus=0 cycliccterminus=0 enablescrambling=0 @@ -31,19 +26,6 @@ searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=0 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 precursoradduct= modificationsfile= scannumber=1 @@ -51,61 +33,19 @@ minimumabsoluteintensitythreshold=0 fwhm=0.05 similaritysearch=0 regularblocksorder=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 generateisotopepattern=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +maximumcombinedlosses=2 +reportunmatchedtheoreticalpeaks=0 +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-1.ini b/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-1.ini index 13c9c97..bec7502 100644 --- a/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-1.ini +++ b/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-1.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=1 precursorcharge=1 fragmentmasserrortolerance=5 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -27,54 +26,6 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= @@ -82,32 +33,19 @@ searchedsequenceTmodif= fwhm=0.1 scannumber=1 minimumabsoluteintensitythreshold=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-2.ini b/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-2.ini index 5b28bae..b5e26b1 100644 --- a/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-2.ini +++ b/CycloBranch/Settings/siderophores/dereplication/batch-lc-ms-2.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=1 precursorcharge=1 fragmentmasserrortolerance=5 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -27,54 +26,6 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= @@ -82,32 +33,19 @@ searchedsequenceTmodif= fwhm=0.1 scannumber=1 minimumabsoluteintensitythreshold=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/ferrichromes.ini b/CycloBranch/Settings/siderophores/dereplication/ferrichromes.ini index 8289ff4..01dcb4d 100644 --- a/CycloBranch/Settings/siderophores/dereplication/ferrichromes.ini +++ b/CycloBranch/Settings/siderophores/dereplication/ferrichromes.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=2 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -26,88 +25,30 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= regularblocksorder=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 scannumber=1 minimumabsoluteintensitythreshold=0 fwhm=0.05 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +iontype_3=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/ferrioxamines.ini b/CycloBranch/Settings/siderophores/dereplication/ferrioxamines.ini index 425e29f..29bf3c8 100644 --- a/CycloBranch/Settings/siderophores/dereplication/ferrioxamines.ini +++ b/CycloBranch/Settings/siderophores/dereplication/ferrioxamines.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=2 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -26,88 +25,30 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= regularblocksorder=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 scannumber=1 minimumabsoluteintensitythreshold=0 fwhm=0.05 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +iontype_3=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/fusarinines_and_coprogens.ini b/CycloBranch/Settings/siderophores/dereplication/fusarinines_and_coprogens.ini index 3435e8e..5a9bfb0 100644 --- a/CycloBranch/Settings/siderophores/dereplication/fusarinines_and_coprogens.ini +++ b/CycloBranch/Settings/siderophores/dereplication/fusarinines_and_coprogens.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=2 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=0.25 minimummz=150 brickdatabase= @@ -26,88 +25,30 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= regularblocksorder=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 scannumber=1 minimumabsoluteintensitythreshold=0 fwhm=0.05 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +iontype_3=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/ornibactins.ini b/CycloBranch/Settings/siderophores/dereplication/ornibactins.ini index bd204bb..87b7583 100644 --- a/CycloBranch/Settings/siderophores/dereplication/ornibactins.ini +++ b/CycloBranch/Settings/siderophores/dereplication/ornibactins.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=2 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -26,88 +25,30 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= regularblocksorder=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 scannumber=1 minimumabsoluteintensitythreshold=0 fwhm=0.05 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +iontype_3=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/pyoverdins.ini b/CycloBranch/Settings/siderophores/dereplication/pyoverdins.ini index a73203b..c74596e 100644 --- a/CycloBranch/Settings/siderophores/dereplication/pyoverdins.ini +++ b/CycloBranch/Settings/siderophores/dereplication/pyoverdins.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=2 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -26,88 +25,30 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= regularblocksorder=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 scannumber=1 minimumabsoluteintensitythreshold=0 fwhm=0.05 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +iontype_3=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/dereplication/rhodotulic_acid.ini b/CycloBranch/Settings/siderophores/dereplication/rhodotulic_acid.ini index 36fc707..d0fb950 100644 --- a/CycloBranch/Settings/siderophores/dereplication/rhodotulic_acid.ini +++ b/CycloBranch/Settings/siderophores/dereplication/rhodotulic_acid.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=2 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -26,88 +25,30 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= regularblocksorder=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 scannumber=1 minimumabsoluteintensitythreshold=0 fwhm=0.05 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +iontype_3=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/fine_isotope/tafc_fine_isotope.ini b/CycloBranch/Settings/siderophores/fine_isotope/tafc_fine_isotope.ini index 2911b08..c15ad33 100644 --- a/CycloBranch/Settings/siderophores/fine_isotope/tafc_fine_isotope.ini +++ b/CycloBranch/Settings/siderophores/fine_isotope/tafc_fine_isotope.ini @@ -7,7 +7,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=0.5 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=0 minimummz=150 fwhm=0.0004 @@ -29,85 +28,24 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -clearhitswithoutparent=0 generateisotopepattern=1 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= minimumabsoluteintensitythreshold=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 minimumpatternsize=1 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/imaging/siderophore_mixtures.ini b/CycloBranch/Settings/siderophores/imaging/siderophore_mixtures.ini index 6ccf2bd..71afc7f 100644 --- a/CycloBranch/Settings/siderophores/imaging/siderophore_mixtures.ini +++ b/CycloBranch/Settings/siderophores/imaging/siderophore_mixtures.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=1 precursorcharge=1 fragmentmasserrortolerance=5 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 brickdatabase= @@ -27,54 +26,6 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=0 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= @@ -82,32 +33,21 @@ searchedsequenceTmodif= fwhm=0.02 scannumber=1 minimumabsoluteintensitythreshold=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 generateisotopepattern=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/siderophores/pyoverdin_esi/ms1_fine_isotope_4M.ini b/CycloBranch/Settings/siderophores/pyoverdin_esi/ms1_fine_isotope_4M.ini index 923894a..5d82862 100644 --- a/CycloBranch/Settings/siderophores/pyoverdin_esi/ms1_fine_isotope_4M.ini +++ b/CycloBranch/Settings/siderophores/pyoverdin_esi/ms1_fine_isotope_4M.ini @@ -29,87 +29,27 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=100 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=0 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 generateisotopepattern=1 minimumpatternsize=1 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=1 reportunmatchedtheoreticalpeaks=0 neutrallosstype_0=1 neutrallossformula_0=H2O neutrallosstype_1=1 neutrallossformula_1=NH3 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/tutorials/cb2_tutorial1.ini b/CycloBranch/Settings/tutorials/cb2_tutorial1.ini index f05721e..04a40fb 100644 --- a/CycloBranch/Settings/tutorials/cb2_tutorial1.ini +++ b/CycloBranch/Settings/tutorials/cb2_tutorial1.ini @@ -32,81 +32,6 @@ sequencedatabase=D:/CycloBranch-git/cyclobranch/CycloBranch/SequenceDatabases/si scoretype=3 hitsreported=100 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=0 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 -fragmentiontype_72=0 -fragmentiontype_73=0 -fragmentiontype_74=0 neutrallosstype_0=0 neutrallossformula_0=H2O maximumcombinedlosses=0 @@ -125,3 +50,4 @@ searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= searchedsequenceformula= +iontype_0=[M+H]+ diff --git a/CycloBranch/Settings/tutorials/cb2_tutorial2.ini b/CycloBranch/Settings/tutorials/cb2_tutorial2.ini index b93eb78..c8e6d9e 100644 --- a/CycloBranch/Settings/tutorials/cb2_tutorial2.ini +++ b/CycloBranch/Settings/tutorials/cb2_tutorial2.ini @@ -32,81 +32,6 @@ sequencedatabase=D:/CycloBranch-git/cyclobranch/CycloBranch/SequenceDatabases/si scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 -fragmentiontype_72=0 -fragmentiontype_73=0 -fragmentiontype_74=0 maximumcombinedlosses=0 reportunmatchedtheoreticalpeaks=0 generateisotopepattern=1 @@ -123,3 +48,4 @@ searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= searchedsequenceformula= +iontype_0=[M+Fe-2H]+ diff --git a/CycloBranch/Settings/tutorials/cb2_tutorial3.ini b/CycloBranch/Settings/tutorials/cb2_tutorial3.ini index 53080c2..a78e8a2 100644 --- a/CycloBranch/Settings/tutorials/cb2_tutorial3.ini +++ b/CycloBranch/Settings/tutorials/cb2_tutorial3.ini @@ -32,81 +32,6 @@ sequencedatabase=D:/CycloBranch-git/cyclobranch/CycloBranch/SequenceDatabases/si scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 -fragmentiontype_72=0 -fragmentiontype_73=0 -fragmentiontype_74=0 neutrallosstype_0=1 neutrallossformula_0=H neutrallosstype_1=1 @@ -135,3 +60,4 @@ searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= searchedsequenceformula= +iontype_0=[M+Fe-2H]+ diff --git a/CycloBranch/Settings/tutorials/cb2_tutorial4.ini b/CycloBranch/Settings/tutorials/cb2_tutorial4.ini index 35d5213..5b97dd2 100644 --- a/CycloBranch/Settings/tutorials/cb2_tutorial4.ini +++ b/CycloBranch/Settings/tutorials/cb2_tutorial4.ini @@ -32,81 +32,6 @@ sequencedatabase=D:/CycloBranch-git/cyclobranch/CycloBranch/SequenceDatabases/tu scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 -fragmentiontype_72=0 -fragmentiontype_73=0 -fragmentiontype_74=0 maximumcombinedlosses=0 reportunmatchedtheoreticalpeaks=0 generateisotopepattern=1 @@ -123,3 +48,6 @@ searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= searchedsequenceformula= +iontype_0=[M+Na]+ +iontype_1=[M+K]+ +iontype_2=[M+Fe-2H]+ diff --git a/CycloBranch/Settings/tutorials/cb2_tutorial5.ini b/CycloBranch/Settings/tutorials/cb2_tutorial5.ini index 75dcf44..c444e0a 100644 --- a/CycloBranch/Settings/tutorials/cb2_tutorial5.ini +++ b/CycloBranch/Settings/tutorials/cb2_tutorial5.ini @@ -32,81 +32,6 @@ sequencedatabase=D:/CycloBranch-git/cyclobranch/CycloBranch/SequenceDatabases/si scoretype=3 hitsreported=1000 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 -fragmentiontype_72=0 -fragmentiontype_73=0 -fragmentiontype_74=0 neutrallosstype_0=1 neutrallossformula_0=H neutrallosstype_1=1 @@ -135,3 +60,6 @@ searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= searchedsequenceformula= +iontype_0=[M+Na]+ +iontype_1=[M+K]+ +iontype_2=[M+Fe-2H]+ diff --git a/CycloBranch/Settings/tutorials/tutorial13a.ini b/CycloBranch/Settings/tutorials/tutorial13a.ini index e4c5844..ac8d6db 100644 --- a/CycloBranch/Settings/tutorials/tutorial13a.ini +++ b/CycloBranch/Settings/tutorials/tutorial13a.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=5 precursorcharge=1 fragmentmasserrortolerance=2 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 fwhm=0.1 @@ -28,86 +27,28 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=100 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=1 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= scannumber=1 minimumabsoluteintensitythreshold=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=1 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +iontype_2=[M+K]+ +iontype_3=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/tutorials/tutorial13b.ini b/CycloBranch/Settings/tutorials/tutorial13b.ini index d0cd47f..efad536 100644 --- a/CycloBranch/Settings/tutorials/tutorial13b.ini +++ b/CycloBranch/Settings/tutorials/tutorial13b.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=1 precursorcharge=1 fragmentmasserrortolerance=5 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 fwhm=0.1 @@ -28,86 +27,25 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=100 sequencetag= -fragmentiontype_0=0 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=1 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= scannumber=1 minimumabsoluteintensitythreshold=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 generateisotopepattern=1 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+Fe-2H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/tutorials/tutorial14.ini b/CycloBranch/Settings/tutorials/tutorial14.ini index b62a377..4a5b6fc 100644 --- a/CycloBranch/Settings/tutorials/tutorial14.ini +++ b/CycloBranch/Settings/tutorials/tutorial14.ini @@ -6,7 +6,6 @@ precursoradduct= precursormasserrortolerance=1 precursorcharge=1 fragmentmasserrortolerance=5 -masserrortolerancefordeisotoping=0 minimumrelativeintensitythreshold=1 minimummz=150 fwhm=0.02 @@ -28,86 +27,25 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=100 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=0 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=0 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -clearhitswithoutparent=0 searchedsequence= searchedsequenceNtermmodif= searchedsequenceCtermmodif= searchedsequenceTmodif= scannumber=1 minimumabsoluteintensitythreshold=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 generateisotopepattern=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/Settings/tutorials/tutorial8.ini b/CycloBranch/Settings/tutorials/tutorial8.ini index 4b87f16..e3a7497 100644 --- a/CycloBranch/Settings/tutorials/tutorial8.ini +++ b/CycloBranch/Settings/tutorials/tutorial8.ini @@ -5,7 +5,6 @@ precursormass=0 precursormasserrortolerance=1 precursorcharge=2 fragmentmasserrortolerance=1 -masserrortolerancefordeisotoping=1 minimumrelativeintensitythreshold=0 minimummz=150 brickdatabase= @@ -18,23 +17,6 @@ maximumnumberofthreads=1 scoretype=3 hitsreported=100 sequencetag= -fragmentiontype_0=1 -fragmentiontype_1=1 -fragmentiontype_2=0 -fragmentiontype_3=0 -fragmentiontype_4=0 -fragmentiontype_5=0 -fragmentiontype_6=0 -fragmentiontype_7=0 -fragmentiontype_8=0 -fragmentiontype_9=0 -fragmentiontype_10=0 -fragmentiontype_11=0 -fragmentiontype_12=0 -fragmentiontype_13=0 -fragmentiontype_14=0 -fragmentiontype_15=0 -clearhitswithoutparent=0 cyclicnterminus=0 cycliccterminus=0 enablescrambling=0 @@ -51,63 +33,20 @@ minimumabsoluteintensitythreshold=0 fwhm=0.05 similaritysearch=0 regularblocksorder=0 -fragmentiontype_16=0 -fragmentiontype_17=0 -fragmentiontype_18=0 -fragmentiontype_19=0 -fragmentiontype_20=0 -fragmentiontype_21=0 -fragmentiontype_22=0 -fragmentiontype_23=0 -fragmentiontype_24=0 -fragmentiontype_25=0 -fragmentiontype_26=0 -fragmentiontype_27=0 -fragmentiontype_28=0 -fragmentiontype_29=0 -fragmentiontype_30=0 -fragmentiontype_31=0 -fragmentiontype_32=0 -fragmentiontype_33=0 -fragmentiontype_34=0 -fragmentiontype_35=0 -fragmentiontype_36=0 -fragmentiontype_37=0 -fragmentiontype_38=0 -fragmentiontype_39=0 -fragmentiontype_40=0 -fragmentiontype_41=0 -fragmentiontype_42=0 -fragmentiontype_43=0 -fragmentiontype_44=0 -fragmentiontype_45=0 -fragmentiontype_46=0 -fragmentiontype_47=0 -fragmentiontype_48=0 -fragmentiontype_49=0 -fragmentiontype_50=0 -fragmentiontype_51=0 -fragmentiontype_52=0 -fragmentiontype_53=0 -fragmentiontype_54=0 -fragmentiontype_55=0 -fragmentiontype_56=0 -fragmentiontype_57=0 -fragmentiontype_58=0 -fragmentiontype_59=0 -fragmentiontype_60=0 -fragmentiontype_61=0 -fragmentiontype_62=0 -fragmentiontype_63=0 -fragmentiontype_64=0 -fragmentiontype_65=0 -fragmentiontype_66=0 -fragmentiontype_67=0 -fragmentiontype_68=0 -fragmentiontype_69=0 -fragmentiontype_70=0 -fragmentiontype_71=0 maximumcombinedlosses=2 reportunmatchedtheoreticalpeaks=0 generateisotopepattern=0 minimumpatternsize=1 +useprofiledata=0 +maximummz=0 +internalfragments=0 +iontype_0=[M+H]+ +iontype_1=[M+Na]+ +minimumfeaturesize=1 +minimumiontypes=1 +basicformulacheck=1 +advancedformulacheck=1 +noratiocheck=1 +mzdifftolerance=0 +intensitytolerance=0 +searchedsequenceformula= diff --git a/CycloBranch/core/cFragmentIons.cpp b/CycloBranch/core/cFragmentIons.cpp index 772229a..f5a8763 100644 --- a/CycloBranch/core/cFragmentIons.cpp +++ b/CycloBranch/core/cFragmentIons.cpp @@ -1442,7 +1442,7 @@ double uncharge(double mzratio, int charge) { } -void fragmentDescription::store(ofstream& os) { +void cFragmentIonType::store(ofstream& os) { storeString(name, os); storeString(summary, os); storeStringIntMap(summarymap, os); @@ -1450,11 +1450,10 @@ void fragmentDescription::store(ofstream& os) { os.write((char *)&nterminal, sizeof(bool)); os.write((char *)&cterminal, sizeof(bool)); os.write((char *)&positive, sizeof(bool)); - os.write((char *)&multiplier, sizeof(int)); } -void fragmentDescription::load(ifstream& is) { +void cFragmentIonType::load(ifstream& is) { loadString(name, is); loadString(summary, is); loadStringIntMap(summarymap, is); @@ -1462,7 +1461,6 @@ void fragmentDescription::load(ifstream& is) { is.read((char *)&nterminal, sizeof(bool)); is.read((char *)&cterminal, sizeof(bool)); is.read((char *)&positive, sizeof(bool)); - is.read((char *)&multiplier, sizeof(int)); } @@ -1477,7 +1475,7 @@ cFragmentIons::cFragmentIons(bool cyclicnterminus, bool cycliccterminus, string& } -fragmentDescription &cFragmentIons::operator[](eFragmentIonType iontype) { +cFragmentIonType &cFragmentIons::operator[](eFragmentIonType iontype) { return fragmentions[iontype]; } @@ -1648,681 +1646,6 @@ void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cyclicctermi fragmentions[cyclic_polyketide_precursor_ion].massdifference = H - e + adductshift; fragmentions[cyclic_polyketide_precursor_ion].summary = "H+" + adductshiftsummary; - // initialize ion [M+H]+ - fragmentions[ms_Hplus].nterminal = true; - fragmentions[ms_Hplus].cterminal = true; - fragmentions[ms_Hplus].name = "[M+H]+"; - fragmentions[ms_Hplus].massdifference = H - e; - fragmentions[ms_Hplus].positive = true; - fragmentions[ms_Hplus].multiplier = 1; - fragmentions[ms_Hplus].summary = "H+"; - - // initialize ion [M+Na]+ - fragmentions[ms_Naplus].nterminal = true; - fragmentions[ms_Naplus].cterminal = true; - fragmentions[ms_Naplus].name = "[M+Na]+"; - fragmentions[ms_Naplus].massdifference = Na - e; - fragmentions[ms_Naplus].positive = true; - fragmentions[ms_Naplus].multiplier = 1; - fragmentions[ms_Naplus].summary = "Na+"; - - // initialize ion [M+K]+ - fragmentions[ms_Kplus].nterminal = true; - fragmentions[ms_Kplus].cterminal = true; - fragmentions[ms_Kplus].name = "[M+K]+"; - fragmentions[ms_Kplus].massdifference = K - e; - fragmentions[ms_Kplus].positive = true; - fragmentions[ms_Kplus].multiplier = 1; - fragmentions[ms_Kplus].summary = "K+"; - - // initialize ion [M-H]- - fragmentions[ms_Hminus].nterminal = true; - fragmentions[ms_Hminus].cterminal = true; - fragmentions[ms_Hminus].name = "[M-H]-"; - fragmentions[ms_Hminus].massdifference = -H + e; - fragmentions[ms_Hminus].positive = false; - fragmentions[ms_Hminus].multiplier = 1; - fragmentions[ms_Hminus].summary = "H-1+-1"; - - // initialize ion [M+Na-2H]- - fragmentions[ms_Naminus].nterminal = true; - fragmentions[ms_Naminus].cterminal = true; - fragmentions[ms_Naminus].name = "[M+Na-2H]-"; - fragmentions[ms_Naminus].massdifference = Na - 2*H + e; - fragmentions[ms_Naminus].positive = false; - fragmentions[ms_Naminus].multiplier = 1; - fragmentions[ms_Naminus].summary = "NaH-2+-1"; - - // initialize ion [M+K-2H]- - fragmentions[ms_Kminus].nterminal = true; - fragmentions[ms_Kminus].cterminal = true; - fragmentions[ms_Kminus].name = "[M+K-2H]-"; - fragmentions[ms_Kminus].massdifference = K - 2*H + e; - fragmentions[ms_Kminus].positive = false; - fragmentions[ms_Kminus].multiplier = 1; - fragmentions[ms_Kminus].summary = "KH-2+-1"; - - // initialize ion [M+Fe-2H]+ - fragmentions[ms_MFe2H].nterminal = true; - fragmentions[ms_MFe2H].cterminal = true; - fragmentions[ms_MFe2H].name = "[M+Fe-2H]+"; - fragmentions[ms_MFe2H].massdifference = Fe - 3*H + H - e; - fragmentions[ms_MFe2H].positive = true; - fragmentions[ms_MFe2H].multiplier = 1; - fragmentions[ms_MFe2H].summary = "FeH-3H+"; - - // initialize ion [M+Fe-3H+Na]+ - fragmentions[ms_MFe3HNa].nterminal = true; - fragmentions[ms_MFe3HNa].cterminal = true; - fragmentions[ms_MFe3HNa].name = "[M+Fe-3H+Na]+"; - fragmentions[ms_MFe3HNa].massdifference = Fe - 3*H + Na - e; - fragmentions[ms_MFe3HNa].positive = true; - fragmentions[ms_MFe3HNa].multiplier = 1; - fragmentions[ms_MFe3HNa].summary = "FeH-3Na+"; - - // initialize ion [M+Fe-3H+K]+ - fragmentions[ms_MFe3HK].nterminal = true; - fragmentions[ms_MFe3HK].cterminal = true; - fragmentions[ms_MFe3HK].name = "[M+Fe-3H+K]+"; - fragmentions[ms_MFe3HK].massdifference = Fe - 3*H + K - e; - fragmentions[ms_MFe3HK].positive = true; - fragmentions[ms_MFe3HK].multiplier = 1; - fragmentions[ms_MFe3HK].summary = "FeH-3K+"; - - // initialize ion [2M+Fe-2H]+ - fragmentions[ms_2MFe2H].nterminal = true; - fragmentions[ms_2MFe2H].cterminal = true; - fragmentions[ms_2MFe2H].name = "[2M+Fe-2H]+"; - fragmentions[ms_2MFe2H].massdifference = Fe - 3*H + H - e; - fragmentions[ms_2MFe2H].positive = true; - fragmentions[ms_2MFe2H].multiplier = 2; - fragmentions[ms_2MFe2H].summary = "FeH-3H+"; - - // initialize ion [2M+Fe-3H+Na]+ - fragmentions[ms_2MFe3HNa].nterminal = true; - fragmentions[ms_2MFe3HNa].cterminal = true; - fragmentions[ms_2MFe3HNa].name = "[2M+Fe-3H+Na]+"; - fragmentions[ms_2MFe3HNa].massdifference = Fe - 3*H + Na - e; - fragmentions[ms_2MFe3HNa].positive = true; - fragmentions[ms_2MFe3HNa].multiplier = 2; - fragmentions[ms_2MFe3HNa].summary = "FeH-3Na+"; - - // initialize ion [2M+Fe-3H+K]+ - fragmentions[ms_2MFe3HK].nterminal = true; - fragmentions[ms_2MFe3HK].cterminal = true; - fragmentions[ms_2MFe3HK].name = "[2M+Fe-3H+K]+"; - fragmentions[ms_2MFe3HK].massdifference = Fe - 3*H + K - e; - fragmentions[ms_2MFe3HK].positive = true; - fragmentions[ms_2MFe3HK].multiplier = 2; - fragmentions[ms_2MFe3HK].summary = "FeH-3K+"; - - // initialize ion [3M+Fe-2H]+ - fragmentions[ms_3MFe2H].nterminal = true; - fragmentions[ms_3MFe2H].cterminal = true; - fragmentions[ms_3MFe2H].name = "[3M+Fe-2H]+"; - fragmentions[ms_3MFe2H].massdifference = Fe - 3*H + H - e; - fragmentions[ms_3MFe2H].positive = true; - fragmentions[ms_3MFe2H].multiplier = 3; - fragmentions[ms_3MFe2H].summary = "FeH-3H+"; - - // initialize ion [3M+Fe-3H+Na]+ - fragmentions[ms_3MFe3HNa].nterminal = true; - fragmentions[ms_3MFe3HNa].cterminal = true; - fragmentions[ms_3MFe3HNa].name = "[3M+Fe-3H+Na]+"; - fragmentions[ms_3MFe3HNa].massdifference = Fe - 3*H + Na - e; - fragmentions[ms_3MFe3HNa].positive = true; - fragmentions[ms_3MFe3HNa].multiplier = 3; - fragmentions[ms_3MFe3HNa].summary = "FeH-3Na+"; - - // initialize ion [3M+Fe-3H+K]+ - fragmentions[ms_3MFe3HK].nterminal = true; - fragmentions[ms_3MFe3HK].cterminal = true; - fragmentions[ms_3MFe3HK].name = "[3M+Fe-3H+K]+"; - fragmentions[ms_3MFe3HK].massdifference = Fe - 3*H + K - e; - fragmentions[ms_3MFe3HK].positive = true; - fragmentions[ms_3MFe3HK].multiplier = 3; - fragmentions[ms_3MFe3HK].summary = "FeH-3K+"; - - // initialize ion [3M+2Fe-5H]+ - fragmentions[ms_3M2Fe5H].nterminal = true; - fragmentions[ms_3M2Fe5H].cterminal = true; - fragmentions[ms_3M2Fe5H].name = "[3M+2Fe-5H]+"; - fragmentions[ms_3M2Fe5H].massdifference = 2*Fe - 6*H + H - e; - fragmentions[ms_3M2Fe5H].positive = true; - fragmentions[ms_3M2Fe5H].multiplier = 3; - fragmentions[ms_3M2Fe5H].summary = "Fe2H-6H+"; - - // initialize ion [3M+2Fe-6H+Na]+ - fragmentions[ms_3M2Fe6HNa].nterminal = true; - fragmentions[ms_3M2Fe6HNa].cterminal = true; - fragmentions[ms_3M2Fe6HNa].name = "[3M+2Fe-6H+Na]+"; - fragmentions[ms_3M2Fe6HNa].massdifference = 2*Fe - 6*H + Na - e; - fragmentions[ms_3M2Fe6HNa].positive = true; - fragmentions[ms_3M2Fe6HNa].multiplier = 3; - fragmentions[ms_3M2Fe6HNa].summary = "Fe2H-6Na+"; - - // initialize ion [3M+2Fe-6H+K]+ - fragmentions[ms_3M2Fe6HK].nterminal = true; - fragmentions[ms_3M2Fe6HK].cterminal = true; - fragmentions[ms_3M2Fe6HK].name = "[3M+2Fe-6H+K]+"; - fragmentions[ms_3M2Fe6HK].massdifference = 2*Fe - 6*H + K - e; - fragmentions[ms_3M2Fe6HK].positive = true; - fragmentions[ms_3M2Fe6HK].multiplier = 3; - fragmentions[ms_3M2Fe6HK].summary = "Fe2H-6K+"; - - // initialize ion [M+Fe-4H]- - fragmentions[ms_MFe4H].nterminal = true; - fragmentions[ms_MFe4H].cterminal = true; - fragmentions[ms_MFe4H].name = "[M+Fe-4H]-"; - fragmentions[ms_MFe4H].massdifference = Fe - 3*H - H + e; - fragmentions[ms_MFe4H].positive = false; - fragmentions[ms_MFe4H].multiplier = 1; - fragmentions[ms_MFe4H].summary = "FeH-3H-1+-1"; - - // initialize ion [2M+Fe-4H]- - fragmentions[ms_2MFe4H].nterminal = true; - fragmentions[ms_2MFe4H].cterminal = true; - fragmentions[ms_2MFe4H].name = "[2M+Fe-4H]-"; - fragmentions[ms_2MFe4H].massdifference = Fe - 3*H - H + e; - fragmentions[ms_2MFe4H].positive = false; - fragmentions[ms_2MFe4H].multiplier = 2; - fragmentions[ms_2MFe4H].summary = "FeH-3H-1+-1"; - - // initialize ion [3M+Fe-4H]- - fragmentions[ms_3MFe4H].nterminal = true; - fragmentions[ms_3MFe4H].cterminal = true; - fragmentions[ms_3MFe4H].name = "[3M+Fe-4H]-"; - fragmentions[ms_3MFe4H].massdifference = Fe - 3*H - H + e; - fragmentions[ms_3MFe4H].positive = false; - fragmentions[ms_3MFe4H].multiplier = 3; - fragmentions[ms_3MFe4H].summary = "FeH-3H-1+-1"; - - // initialize ion [3M+2Fe-7H]- - fragmentions[ms_3M2Fe7H].nterminal = true; - fragmentions[ms_3M2Fe7H].cterminal = true; - fragmentions[ms_3M2Fe7H].name = "[3M+2Fe-7H]-"; - fragmentions[ms_3M2Fe7H].massdifference = 2*Fe - 6*H - H + e; - fragmentions[ms_3M2Fe7H].positive = false; - 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].positive = true; - fragmentions[ms_NH4plus].multiplier = 1; - fragmentions[ms_NH4plus].summary = "NH4+"; - - // initialize ion [M+Cl]- - fragmentions[ms_Clminus].nterminal = true; - fragmentions[ms_Clminus].cterminal = true; - fragmentions[ms_Clminus].name = "[M+Cl]-"; - fragmentions[ms_Clminus].massdifference = Cl + e; - fragmentions[ms_Clminus].positive = false; - fragmentions[ms_Clminus].multiplier = 1; - fragmentions[ms_Clminus].summary = "Cl+-1"; - - // initialize ion [M]+ - fragmentions[ms_plus].nterminal = true; - fragmentions[ms_plus].cterminal = true; - fragmentions[ms_plus].name = "[M]+"; - fragmentions[ms_plus].massdifference = -e; - fragmentions[ms_plus].positive = true; - fragmentions[ms_plus].multiplier = 1; - fragmentions[ms_plus].summary = "+"; - - // initialize ion [M]- - fragmentions[ms_minus].nterminal = true; - fragmentions[ms_minus].cterminal = true; - fragmentions[ms_minus].name = "[M]-"; - fragmentions[ms_minus].massdifference = e; - fragmentions[ms_minus].positive = false; - fragmentions[ms_minus].multiplier = 1; - fragmentions[ms_minus].summary = "+-1"; - - // initialize ion Li+ - fragmentions[ms_liplus].nterminal = true; - fragmentions[ms_liplus].cterminal = true; - fragmentions[ms_liplus].name = "[M+Li]+"; - fragmentions[ms_liplus].massdifference = Li - e; - fragmentions[ms_liplus].positive = true; - fragmentions[ms_liplus].multiplier = 1; - fragmentions[ms_liplus].summary = "Li+"; - - // initialize ion [M+Mg-H]+ - fragmentions[ms_MMgH].nterminal = true; - fragmentions[ms_MMgH].cterminal = true; - fragmentions[ms_MMgH].name = "[M+Mg-H]+"; - fragmentions[ms_MMgH].massdifference = Mg - 2*H + H - e; - fragmentions[ms_MMgH].positive = true; - fragmentions[ms_MMgH].multiplier = 1; - fragmentions[ms_MMgH].summary = "MgH-2H+"; - - // initialize ion [M+Mg-2H+Na]+ - fragmentions[ms_MMg2HNa].nterminal = true; - fragmentions[ms_MMg2HNa].cterminal = true; - fragmentions[ms_MMg2HNa].name = "[M+Mg-2H+Na]+"; - fragmentions[ms_MMg2HNa].massdifference = Mg - 2*H + Na - e; - fragmentions[ms_MMg2HNa].positive = true; - fragmentions[ms_MMg2HNa].multiplier = 1; - fragmentions[ms_MMg2HNa].summary = "MgH-2Na+"; - - // initialize ion [M+Mg-2H+K]+ - fragmentions[ms_MMg2HK].nterminal = true; - fragmentions[ms_MMg2HK].cterminal = true; - fragmentions[ms_MMg2HK].name = "[M+Mg-2H+K]+"; - fragmentions[ms_MMg2HK].massdifference = Mg - 2*H + K - e; - fragmentions[ms_MMg2HK].positive = true; - fragmentions[ms_MMg2HK].multiplier = 1; - fragmentions[ms_MMg2HK].summary = "MgH-2K+"; - - // initialize ion [M+Mg-3H]- - fragmentions[ms_MMg3H].nterminal = true; - fragmentions[ms_MMg3H].cterminal = true; - fragmentions[ms_MMg3H].name = "[M+Mg-3H]-"; - fragmentions[ms_MMg3H].massdifference = Mg - 2*H - H + e; - fragmentions[ms_MMg3H].positive = false; - fragmentions[ms_MMg3H].multiplier = 1; - fragmentions[ms_MMg3H].summary = "MgH-2H-1+-1"; - - // initialize ion [M+Al-2H]+ - fragmentions[ms_MAl2H].nterminal = true; - fragmentions[ms_MAl2H].cterminal = true; - fragmentions[ms_MAl2H].name = "[M+Al-2H]+"; - fragmentions[ms_MAl2H].massdifference = Al - 3*H + H - e; - fragmentions[ms_MAl2H].positive = true; - fragmentions[ms_MAl2H].multiplier = 1; - fragmentions[ms_MAl2H].summary = "AlH-3H+"; - - // initialize ion [M+Al-3H+Na]+ - fragmentions[ms_MAl3HNa].nterminal = true; - fragmentions[ms_MAl3HNa].cterminal = true; - fragmentions[ms_MAl3HNa].name = "[M+Al-3H+Na]+"; - fragmentions[ms_MAl3HNa].massdifference = Al - 3*H + Na - e; - fragmentions[ms_MAl3HNa].positive = true; - fragmentions[ms_MAl3HNa].multiplier = 1; - fragmentions[ms_MAl3HNa].summary = "AlH-3Na+"; - - // initialize ion [M+Al-3H+K]+ - fragmentions[ms_MAl3HK].nterminal = true; - fragmentions[ms_MAl3HK].cterminal = true; - fragmentions[ms_MAl3HK].name = "[M+Al-3H+K]+"; - fragmentions[ms_MAl3HK].massdifference = Al - 3*H + K - e; - fragmentions[ms_MAl3HK].positive = true; - fragmentions[ms_MAl3HK].multiplier = 1; - fragmentions[ms_MAl3HK].summary = "AlH-3K+"; - - // initialize ion [M+Al-4H]- - fragmentions[ms_MAl4H].nterminal = true; - fragmentions[ms_MAl4H].cterminal = true; - fragmentions[ms_MAl4H].name = "[M+Al-4H]-"; - fragmentions[ms_MAl4H].massdifference = Al - 3*H - H + e; - fragmentions[ms_MAl4H].positive = false; - 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].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].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].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].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; - fragmentions[ms_MCaH].name = "[M+Ca-H]+"; - fragmentions[ms_MCaH].massdifference = Ca - 2*H + H - e; - fragmentions[ms_MCaH].positive = true; - fragmentions[ms_MCaH].multiplier = 1; - fragmentions[ms_MCaH].summary = "CaH-2H+"; - - // initialize ion [M+Ca-2H+Na]+ - fragmentions[ms_MCa2HNa].nterminal = true; - fragmentions[ms_MCa2HNa].cterminal = true; - fragmentions[ms_MCa2HNa].name = "[M+Ca-2H+Na]+"; - fragmentions[ms_MCa2HNa].massdifference = Ca - 2*H + Na - e; - fragmentions[ms_MCa2HNa].positive = true; - fragmentions[ms_MCa2HNa].multiplier = 1; - fragmentions[ms_MCa2HNa].summary = "CaH-2Na+"; - - // initialize ion [M+Ca-2H+K]+ - fragmentions[ms_MCa2HK].nterminal = true; - fragmentions[ms_MCa2HK].cterminal = true; - fragmentions[ms_MCa2HK].name = "[M+Ca-2H+K]+"; - fragmentions[ms_MCa2HK].massdifference = Ca - 2*H + K - e; - fragmentions[ms_MCa2HK].positive = true; - fragmentions[ms_MCa2HK].multiplier = 1; - fragmentions[ms_MCa2HK].summary = "CaH-2K+"; - - // initialize ion [M+Ca-3H]- - fragmentions[ms_MCa3H].nterminal = true; - fragmentions[ms_MCa3H].cterminal = true; - fragmentions[ms_MCa3H].name = "[M+Ca-3H]-"; - fragmentions[ms_MCa3H].massdifference = Ca - 2*H - H + e; - fragmentions[ms_MCa3H].positive = false; - fragmentions[ms_MCa3H].multiplier = 1; - fragmentions[ms_MCa3H].summary = "CaH-2H-1+-1"; - - // initialize ion [M+Sc-2H]+ - fragmentions[ms_MSc2H].nterminal = true; - fragmentions[ms_MSc2H].cterminal = true; - fragmentions[ms_MSc2H].name = "[M+Sc-2H]+"; - fragmentions[ms_MSc2H].massdifference = Sc - 3*H + H - e; - fragmentions[ms_MSc2H].positive = true; - fragmentions[ms_MSc2H].multiplier = 1; - fragmentions[ms_MSc2H].summary = "ScH-3H+"; - - // initialize ion [M+Sc-3H+Na]+ - fragmentions[ms_MSc3HNa].nterminal = true; - fragmentions[ms_MSc3HNa].cterminal = true; - fragmentions[ms_MSc3HNa].name = "[M+Sc-3H+Na]+"; - fragmentions[ms_MSc3HNa].massdifference = Sc - 3*H + Na - e; - fragmentions[ms_MSc3HNa].positive = true; - fragmentions[ms_MSc3HNa].multiplier = 1; - fragmentions[ms_MSc3HNa].summary = "ScH-3Na+"; - - // initialize ion [M+Sc-3H+K]+ - fragmentions[ms_MSc3HK].nterminal = true; - fragmentions[ms_MSc3HK].cterminal = true; - fragmentions[ms_MSc3HK].name = "[M+Sc-3H+K]+"; - fragmentions[ms_MSc3HK].massdifference = Sc - 3*H + K - e; - fragmentions[ms_MSc3HK].positive = true; - fragmentions[ms_MSc3HK].multiplier = 1; - fragmentions[ms_MSc3HK].summary = "ScH-3K+"; - - // initialize ion [M+Sc-4H]- - fragmentions[ms_MSc4H].nterminal = true; - fragmentions[ms_MSc4H].cterminal = true; - fragmentions[ms_MSc4H].name = "[M+Sc-4H]-"; - fragmentions[ms_MSc4H].massdifference = Sc - 3*H - H + e; - fragmentions[ms_MSc4H].positive = false; - fragmentions[ms_MSc4H].multiplier = 1; - fragmentions[ms_MSc4H].summary = "ScH-3H-1+-1"; - - // initialize ion [M+Cr-2H]+ - fragmentions[ms_MCr2H].nterminal = true; - fragmentions[ms_MCr2H].cterminal = true; - fragmentions[ms_MCr2H].name = "[M+Cr-2H]+"; - fragmentions[ms_MCr2H].massdifference = Cr - 3*H + H - e; - fragmentions[ms_MCr2H].positive = true; - fragmentions[ms_MCr2H].multiplier = 1; - fragmentions[ms_MCr2H].summary = "CrH-3H+"; - - // initialize ion [M+Cr-3H+Na]+ - fragmentions[ms_MCr3HNa].nterminal = true; - fragmentions[ms_MCr3HNa].cterminal = true; - fragmentions[ms_MCr3HNa].name = "[M+Cr-3H+Na]+"; - fragmentions[ms_MCr3HNa].massdifference = Cr - 3*H + Na - e; - fragmentions[ms_MCr3HNa].positive = true; - fragmentions[ms_MCr3HNa].multiplier = 1; - fragmentions[ms_MCr3HNa].summary = "CrH-3Na+"; - - // initialize ion [M+Cr-3H+K]+ - fragmentions[ms_MCr3HK].nterminal = true; - fragmentions[ms_MCr3HK].cterminal = true; - fragmentions[ms_MCr3HK].name = "[M+Cr-3H+K]+"; - fragmentions[ms_MCr3HK].massdifference = Cr - 3*H + K - e; - fragmentions[ms_MCr3HK].positive = true; - fragmentions[ms_MCr3HK].multiplier = 1; - fragmentions[ms_MCr3HK].summary = "CrH-3K+"; - - // initialize ion [M+Cr-4H]- - fragmentions[ms_MCr4H].nterminal = true; - fragmentions[ms_MCr4H].cterminal = true; - fragmentions[ms_MCr4H].name = "[M+Cr-4H]-"; - fragmentions[ms_MCr4H].massdifference = Cr - 3*H - H + e; - fragmentions[ms_MCr4H].positive = false; - fragmentions[ms_MCr4H].multiplier = 1; - fragmentions[ms_MCr4H].summary = "CrH-3H-1+-1"; - - // initialize ion [M+Mn-H]+ - fragmentions[ms_MMnH].nterminal = true; - fragmentions[ms_MMnH].cterminal = true; - fragmentions[ms_MMnH].name = "[M+Mn-H]+"; - fragmentions[ms_MMnH].massdifference = Mn - 2*H + H - e; - fragmentions[ms_MMnH].positive = true; - fragmentions[ms_MMnH].multiplier = 1; - fragmentions[ms_MMnH].summary = "MnH-2H+"; - - // initialize ion [M+Mn-2H+Na]+ - fragmentions[ms_MMn2HNa].nterminal = true; - fragmentions[ms_MMn2HNa].cterminal = true; - fragmentions[ms_MMn2HNa].name = "[M+Mn-2H+Na]+"; - fragmentions[ms_MMn2HNa].massdifference = Mn - 2*H + Na - e; - fragmentions[ms_MMn2HNa].positive = true; - fragmentions[ms_MMn2HNa].multiplier = 1; - fragmentions[ms_MMn2HNa].summary = "MnH-2Na+"; - - // initialize ion [M+Mn-2H+K]+ - fragmentions[ms_MMn2HK].nterminal = true; - fragmentions[ms_MMn2HK].cterminal = true; - fragmentions[ms_MMn2HK].name = "[M+Mn-2H+K]+"; - fragmentions[ms_MMn2HK].massdifference = Mn - 2*H + K - e; - fragmentions[ms_MMn2HK].positive = true; - fragmentions[ms_MMn2HK].multiplier = 1; - fragmentions[ms_MMn2HK].summary = "MnH-2K+"; - - // initialize ion [M+Mn-3H]- - fragmentions[ms_MMn3H].nterminal = true; - fragmentions[ms_MMn3H].cterminal = true; - fragmentions[ms_MMn3H].name = "[M+Mn-3H]-"; - fragmentions[ms_MMn3H].massdifference = Mn - 2*H - H + e; - fragmentions[ms_MMn3H].positive = false; - fragmentions[ms_MMn3H].multiplier = 1; - fragmentions[ms_MMn3H].summary = "MnH-2H-1+-1"; - - // initialize ion [M+Co-H]+ - fragmentions[ms_MCoH].nterminal = true; - fragmentions[ms_MCoH].cterminal = true; - fragmentions[ms_MCoH].name = "[M+Co-H]+"; - fragmentions[ms_MCoH].massdifference = Co - 2*H + H - e; - fragmentions[ms_MCoH].positive = true; - fragmentions[ms_MCoH].multiplier = 1; - fragmentions[ms_MCoH].summary = "CoH-2H+"; - - // initialize ion [M+Co-2H+Na]+ - fragmentions[ms_MCo2HNa].nterminal = true; - fragmentions[ms_MCo2HNa].cterminal = true; - fragmentions[ms_MCo2HNa].name = "[M+Co-2H+Na]+"; - fragmentions[ms_MCo2HNa].massdifference = Co - 2*H + Na - e; - fragmentions[ms_MCo2HNa].positive = true; - fragmentions[ms_MCo2HNa].multiplier = 1; - fragmentions[ms_MCo2HNa].summary = "CoH-2Na+"; - - // initialize ion [M+Co-2H+K]+ - fragmentions[ms_MCo2HK].nterminal = true; - fragmentions[ms_MCo2HK].cterminal = true; - fragmentions[ms_MCo2HK].name = "[M+Co-2H+K]+"; - fragmentions[ms_MCo2HK].massdifference = Co - 2*H + K - e; - fragmentions[ms_MCo2HK].positive = true; - fragmentions[ms_MCo2HK].multiplier = 1; - fragmentions[ms_MCo2HK].summary = "CoH-2K+"; - - // initialize ion [M+Co-3H]- - fragmentions[ms_MCo3H].nterminal = true; - fragmentions[ms_MCo3H].cterminal = true; - fragmentions[ms_MCo3H].name = "[M+Co-3H]-"; - fragmentions[ms_MCo3H].massdifference = Co - 2*H - H + e; - fragmentions[ms_MCo3H].positive = false; - fragmentions[ms_MCo3H].multiplier = 1; - fragmentions[ms_MCo3H].summary = "CoH-2H-1+-1"; - - // initialize ion [M+Ni-H]+ - fragmentions[ms_MNiH].nterminal = true; - fragmentions[ms_MNiH].cterminal = true; - fragmentions[ms_MNiH].name = "[M+Ni-H]+"; - fragmentions[ms_MNiH].massdifference = Ni - 2*H + H - e; - fragmentions[ms_MNiH].positive = true; - fragmentions[ms_MNiH].multiplier = 1; - fragmentions[ms_MNiH].summary = "NiH-2H+"; - - // initialize ion [M+Ni-2H+Na]+ - fragmentions[ms_MNi2HNa].nterminal = true; - fragmentions[ms_MNi2HNa].cterminal = true; - fragmentions[ms_MNi2HNa].name = "[M+Ni-2H+Na]+"; - fragmentions[ms_MNi2HNa].massdifference = Ni - 2*H + Na - e; - fragmentions[ms_MNi2HNa].positive = true; - fragmentions[ms_MNi2HNa].multiplier = 1; - fragmentions[ms_MNi2HNa].summary = "NiH-2Na+"; - - // initialize ion [M+Ni-2H+K]+ - fragmentions[ms_MNi2HK].nterminal = true; - fragmentions[ms_MNi2HK].cterminal = true; - fragmentions[ms_MNi2HK].name = "[M+Ni-2H+K]+"; - fragmentions[ms_MNi2HK].massdifference = Ni - 2*H + K - e; - fragmentions[ms_MNi2HK].positive = true; - fragmentions[ms_MNi2HK].multiplier = 1; - fragmentions[ms_MNi2HK].summary = "NiH-2K+"; - - // initialize ion [M+Ni-3H]- - fragmentions[ms_MNi3H].nterminal = true; - fragmentions[ms_MNi3H].cterminal = true; - fragmentions[ms_MNi3H].name = "[M+Ni-3H]-"; - fragmentions[ms_MNi3H].massdifference = Ni - 2*H - H + e; - fragmentions[ms_MNi3H].positive = false; - fragmentions[ms_MNi3H].multiplier = 1; - fragmentions[ms_MNi3H].summary = "NiH-2H-1+-1"; - - // initialize ion [M+Cu-H]+ - fragmentions[ms_MCuH].nterminal = true; - fragmentions[ms_MCuH].cterminal = true; - fragmentions[ms_MCuH].name = "[M+Cu-H]+"; - fragmentions[ms_MCuH].massdifference = Cu - 2*H + H - e; - fragmentions[ms_MCuH].positive = true; - fragmentions[ms_MCuH].multiplier = 1; - fragmentions[ms_MCuH].summary = "CuH-2H+"; - - // initialize ion [M+Cu-2H+Na]+ - fragmentions[ms_MCu2HNa].nterminal = true; - fragmentions[ms_MCu2HNa].cterminal = true; - fragmentions[ms_MCu2HNa].name = "[M+Cu-2H+Na]+"; - fragmentions[ms_MCu2HNa].massdifference = Cu - 2*H + Na - e; - fragmentions[ms_MCu2HNa].positive = true; - fragmentions[ms_MCu2HNa].multiplier = 1; - fragmentions[ms_MCu2HNa].summary = "CuH-2Na+"; - - // initialize ion [M+Cu-2H+K]+ - fragmentions[ms_MCu2HK].nterminal = true; - fragmentions[ms_MCu2HK].cterminal = true; - fragmentions[ms_MCu2HK].name = "[M+Cu-2H+K]+"; - fragmentions[ms_MCu2HK].massdifference = Cu - 2*H + K - e; - fragmentions[ms_MCu2HK].positive = true; - fragmentions[ms_MCu2HK].multiplier = 1; - fragmentions[ms_MCu2HK].summary = "CuH-2K+"; - - // initialize ion [M+Cu-3H]- - fragmentions[ms_MCu3H].nterminal = true; - fragmentions[ms_MCu3H].cterminal = true; - fragmentions[ms_MCu3H].name = "[M+Cu-3H]-"; - fragmentions[ms_MCu3H].massdifference = Cu - 2*H - H + e; - fragmentions[ms_MCu3H].positive = false; - fragmentions[ms_MCu3H].multiplier = 1; - fragmentions[ms_MCu3H].summary = "CuH-2H-1+-1"; - - // initialize ion [M+Zn-H]+ - fragmentions[ms_MZnH].nterminal = true; - fragmentions[ms_MZnH].cterminal = true; - fragmentions[ms_MZnH].name = "[M+Zn-H]+"; - fragmentions[ms_MZnH].massdifference = Zn - 2*H + H - e; - fragmentions[ms_MZnH].positive = true; - fragmentions[ms_MZnH].multiplier = 1; - fragmentions[ms_MZnH].summary = "ZnH-2H+"; - - // initialize ion [M+Zn-2H+Na]+ - fragmentions[ms_MZn2HNa].nterminal = true; - fragmentions[ms_MZn2HNa].cterminal = true; - fragmentions[ms_MZn2HNa].name = "[M+Zn-2H+Na]+"; - fragmentions[ms_MZn2HNa].massdifference = Zn - 2*H + Na - e; - fragmentions[ms_MZn2HNa].positive = true; - fragmentions[ms_MZn2HNa].multiplier = 1; - fragmentions[ms_MZn2HNa].summary = "ZnH-2Na+"; - - // initialize ion [M+Zn-2H+K]+ - fragmentions[ms_MZn2HK].nterminal = true; - fragmentions[ms_MZn2HK].cterminal = true; - fragmentions[ms_MZn2HK].name = "[M+Zn-2H+K]+"; - fragmentions[ms_MZn2HK].massdifference = Zn - 2*H + K - e; - fragmentions[ms_MZn2HK].positive = true; - fragmentions[ms_MZn2HK].multiplier = 1; - fragmentions[ms_MZn2HK].summary = "ZnH-2K+"; - - // initialize ion [M+Zn-3H]- - fragmentions[ms_MZn3H].nterminal = true; - fragmentions[ms_MZn3H].cterminal = true; - fragmentions[ms_MZn3H].name = "[M+Zn-3H]-"; - fragmentions[ms_MZn3H].massdifference = Zn - 2*H - H + e; - fragmentions[ms_MZn3H].positive = false; - fragmentions[ms_MZn3H].multiplier = 1; - fragmentions[ms_MZn3H].summary = "ZnH-2H-1+-1"; - - // initialize ion [M+Ga-2H]+ - fragmentions[ms_MGa2H].nterminal = true; - fragmentions[ms_MGa2H].cterminal = true; - fragmentions[ms_MGa2H].name = "[M+Ga-2H]+"; - fragmentions[ms_MGa2H].massdifference = Ga - 3*H + H - e; - fragmentions[ms_MGa2H].positive = true; - fragmentions[ms_MGa2H].multiplier = 1; - fragmentions[ms_MGa2H].summary = "GaH-3H+"; - - // initialize ion [M+Ga-3H+Na]+ - fragmentions[ms_MGa3HNa].nterminal = true; - fragmentions[ms_MGa3HNa].cterminal = true; - fragmentions[ms_MGa3HNa].name = "[M+Ga-3H+Na]+"; - fragmentions[ms_MGa3HNa].massdifference = Ga - 3*H + Na - e; - fragmentions[ms_MGa3HNa].positive = true; - fragmentions[ms_MGa3HNa].multiplier = 1; - fragmentions[ms_MGa3HNa].summary = "GaH-3Na+"; - - // initialize ion [M+Ga-3H+K]+ - fragmentions[ms_MGa3HK].nterminal = true; - fragmentions[ms_MGa3HK].cterminal = true; - fragmentions[ms_MGa3HK].name = "[M+Ga-3H+K]+"; - fragmentions[ms_MGa3HK].massdifference = Ga - 3*H + K - e; - fragmentions[ms_MGa3HK].positive = true; - fragmentions[ms_MGa3HK].multiplier = 1; - fragmentions[ms_MGa3HK].summary = "GaH-3K+"; - - // initialize ion [M+Ga-4H]- - fragmentions[ms_MGa4H].nterminal = true; - fragmentions[ms_MGa4H].cterminal = true; - fragmentions[ms_MGa4H].name = "[M+Ga-4H]-"; - fragmentions[ms_MGa4H].massdifference = Ga - 3*H - H + e; - fragmentions[ms_MGa4H].positive = false; - fragmentions[ms_MGa4H].multiplier = 1; - fragmentions[ms_MGa4H].summary = "GaH-3H-1+-1"; - // initialize maps of atoms for (auto& it : fragmentions) { it.second.summarymap.clear(); @@ -2346,7 +1669,7 @@ void cFragmentIons::store(ofstream& os) { void cFragmentIons::load(ifstream& is) { int size; eFragmentIonType iontype; - fragmentDescription description; + cFragmentIonType description; is.read((char *)&size, sizeof(int)); fragmentions.clear(); @@ -2434,9 +1757,9 @@ cDefaultNeutralLosses::cDefaultNeutralLosses() { } -int loadModificationsFromPlainTextStream(ifstream &stream, vector& modifications, string& errormessage, bool ignoreerrors) { +int loadModificationsFromPlainTextStream(ifstream &stream, vector& modifications, string& errormessage, bool ignoreerrors) { string s; - fragmentDescription modification; + cFragmentIonType modification; size_t pos; double mass; @@ -2538,7 +1861,7 @@ int loadModificationsFromPlainTextStream(ifstream &stream, vector& modifications) { +void storeModificationsToPlainTextStream(ofstream &stream, vector& modifications) { for (int i = 0; i < (int)modifications.size(); i++) { stream << removeWhiteSpacesExceptSpaces(modifications[i].name) << "\t"; stream << removeWhiteSpacesExceptSpaces(modifications[i].summary) << "\t"; diff --git a/CycloBranch/core/cFragmentIons.h b/CycloBranch/core/cFragmentIons.h index 198b471..623265e 100644 --- a/CycloBranch/core/cFragmentIons.h +++ b/CycloBranch/core/cFragmentIons.h @@ -963,81 +963,6 @@ enum eFragmentIonType { linear_polyketide_precursor_ion_h_oh, linear_polyketide_precursor_ion_oh_oh, cyclic_polyketide_precursor_ion, - ms_Hplus, - ms_Naplus, - ms_Kplus, - ms_Hminus, - ms_Naminus, - ms_Kminus, - ms_MFe2H, - ms_MFe3HNa, - ms_MFe3HK, - ms_2MFe2H, - ms_2MFe3HNa, - ms_2MFe3HK, - ms_3MFe2H, - ms_3MFe3HNa, - ms_3MFe3HK, - ms_3M2Fe5H, - ms_3M2Fe6HNa, - ms_3M2Fe6HK, - ms_MFe4H, - ms_2MFe4H, - ms_3MFe4H, - ms_3M2Fe7H, - ms_NH4plus, - ms_Clminus, - ms_plus, - ms_minus, - ms_liplus, - ms_MMgH, - ms_MMg2HNa, - ms_MMg2HK, - ms_MMg3H, - ms_MAl2H, - ms_MAl3HNa, - ms_MAl3HK, - ms_MAl4H, - ms_MSi3H, - ms_MSi4HNa, - ms_MSi4HK, - ms_MSi5H, - ms_MCaH, - ms_MCa2HNa, - ms_MCa2HK, - ms_MCa3H, - ms_MSc2H, - ms_MSc3HNa, - ms_MSc3HK, - ms_MSc4H, - ms_MCr2H, - ms_MCr3HNa, - ms_MCr3HK, - ms_MCr4H, - ms_MMnH, - ms_MMn2HNa, - ms_MMn2HK, - ms_MMn3H, - ms_MCoH, - ms_MCo2HNa, - ms_MCo2HK, - ms_MCo3H, - ms_MNiH, - ms_MNi2HNa, - ms_MNi2HK, - ms_MNi3H, - ms_MCuH, - ms_MCu2HNa, - ms_MCu2HK, - ms_MCu3H, - ms_MZnH, - ms_MZn2HNa, - ms_MZn2HK, - ms_MZn3H, - ms_MGa2H, - ms_MGa3HNa, - ms_MGa3HK, - ms_MGa4H, fragmentIonTypeEnd }; @@ -1049,9 +974,9 @@ Q_DECLARE_METATYPE(vector); /** - \brief The structure for a detailed definition of a fragment ion type. + \brief The struct for definition of a fragment ion type. */ -struct fragmentDescription { +struct cFragmentIonType { /** \brief Name of the fragment. @@ -1060,13 +985,13 @@ struct fragmentDescription { /** - \brief Summary formula of the fragment. + \brief Formula of the fragment. */ string summary; /** - \brief A map of atoms corresponding to the summary formula. + \brief A map of atoms corresponding to the formula. */ map summarymap; @@ -1090,21 +1015,15 @@ struct fragmentDescription { /** - \brief True when the fragment is charged positively; false when the fragment is charged negatively. + \brief Charge of the fragment. */ bool positive; - /** - \brief The multiplier (n) of M in [nM + H]+. - */ - int multiplier; - - /** \brief The default constructor. */ - fragmentDescription() { + cFragmentIonType() { clear(); } @@ -1120,7 +1039,6 @@ struct fragmentDescription { nterminal = false; cterminal = false; positive = true; - multiplier = 1; } @@ -1141,9 +1059,9 @@ struct fragmentDescription { /** - \brief Register vector by Qt. + \brief Register vector by Qt. */ -Q_DECLARE_METATYPE(vector); +Q_DECLARE_METATYPE(vector); /** @@ -1151,7 +1069,7 @@ Q_DECLARE_METATYPE(vector); */ class cFragmentIons { - map fragmentions; + map fragmentions; public: @@ -1174,9 +1092,9 @@ class cFragmentIons { /** \brief Overloaded operator []. \param iontype type of fragment ion - \retval fragmentDescription reference to a structure with detailed information about the fragment ion + \retval cFragmentIonType reference to a structure with detailed information about the fragment ion */ - fragmentDescription &operator[](eFragmentIonType iontype); + cFragmentIonType &operator[](eFragmentIonType iontype); /** @@ -1349,7 +1267,7 @@ extern cDefaultNeutralLosses defaultneutrallosses; \param ignoreerrors if true errors are ignored \retval int 0 when modifications were successfully loaded, -1 when an error occurred (\a errormessage is filled up) */ -int loadModificationsFromPlainTextStream(ifstream &stream, vector& modifications, string& errormessage, bool ignoreerrors); +int loadModificationsFromPlainTextStream(ifstream &stream, vector& modifications, string& errormessage, bool ignoreerrors); /** @@ -1357,7 +1275,7 @@ int loadModificationsFromPlainTextStream(ifstream &stream, vector& modifications); +void storeModificationsToPlainTextStream(ofstream &stream, vector& modifications); #endif diff --git a/CycloBranch/core/cGlobalPreferences.cpp b/CycloBranch/core/cGlobalPreferences.cpp new file mode 100644 index 0000000..411acbe --- /dev/null +++ b/CycloBranch/core/cGlobalPreferences.cpp @@ -0,0 +1,902 @@ +#include "core/cGlobalPreferences.h" + + +cGlobalPreferences::cGlobalPreferences() { + settingsfile = "CycloBranch.ini"; + + #if OS_TYPE != WIN + char *homedir = getenv("HOME"); + if (homedir != 0) { + settingsfile = homedir; + settingsfile += "/CycloBranch.ini"; + } + #endif + + setDefaultIonTypes(); + setDefaultDataProcessingMethods(); + setDefaultDirectories(); + setDefaultURLs(); +} + + +void cGlobalPreferences::loadSettings() { + if (!QFile(settingsfile).exists()) { + return; + } + + QSettings settings(settingsfile, QSettings::IniFormat); + + int customionscount = settings.value("customionscount", 0).toInt(); + QString customionvalue; + + customions.clear(); + for (int i = 0; i < customionscount; i++) { + cIonType ion; + + customionvalue = "customion_name_" + QVariant(i).toString(); + ion.name = settings.value(customionvalue, ion.name.c_str()).toString().toStdString(); + + customionvalue = "customion_formula_" + QVariant(i).toString(); + ion.formula = settings.value(customionvalue, ion.formula.c_str()).toString().toStdString(); + + customionvalue = "customion_positive_" + QVariant(i).toString(); + ion.positive = settings.value(customionvalue, (int)ion.positive).toInt() == 0 ? false : true; + + customionvalue = "customion_multiplier_" + QVariant(i).toString(); + ion.multiplier = settings.value(customionvalue, ion.multiplier).toInt(); + + cSummaryFormula formula; + formula.setFormula(ion.formula); + ion.massdifference = formula.getMass(); + + customions.push_back(ion); + } + + if (settings.contains("bafprocessingmethod")) { + bafprocessingmethod = settings.value("bafprocessingmethod").toInt(); + } + + if (settings.contains("rawdataprocessingmethod")) { + rawdataprocessingmethod = settings.value("rawdataprocessingmethod").toInt(); + } + + if (settings.contains("settingsdefaultdir")) { + settingsdefaultdir = settings.value("settingsdefaultdir").toString(); + } + + if (settings.contains("peaklistsdefaultdir")) { + peaklistsdefaultdir = settings.value("peaklistsdefaultdir").toString(); + } + + if (settings.contains("blocksdefaultdir")) { + blocksdefaultdir = settings.value("blocksdefaultdir").toString(); + } + + if (settings.contains("sequencesdefaultdir")) { + sequencesdefaultdir = settings.value("sequencesdefaultdir").toString(); + } + + if (settings.contains("modificationsdefaultdir")) { + modificationsdefaultdir = settings.value("modificationsdefaultdir").toString(); + } + + if (settings.contains("openopticalimagedir")) { + openopticalimagedir = settings.value("openopticalimagedir").toString(); + } + + if (settings.contains("openhistologyimagedir")) { + openhistologyimagedir = settings.value("openhistologyimagedir").toString(); + } + + if (settings.contains("openmicroscopyimagedir")) { + openmicroscopyimagedir = settings.value("openmicroscopyimagedir").toString(); + } + + if (settings.contains("resultsdefaultdir")) { + resultsdefaultdir = settings.value("resultsdefaultdir").toString(); + } + + if (settings.contains("exportcsvdefaultdir")) { + exportcsvdefaultdir = settings.value("exportcsvdefaultdir").toString(); + } + + if (settings.contains("exporthtmldefaultdir")) { + exporthtmldefaultdir = settings.value("exporthtmldefaultdir").toString(); + } + + if (settings.contains("exportimagedefaultdir ")) { + exportimagedefaultdir = settings.value("exportimagedefaultdir ").toString(); + } + + if (settings.contains("bookmarkurl1")) { + bookmarkurl1 = settings.value("bookmarkurl1").toString(); + } + + if (settings.contains("bookmarkurl2")) { + bookmarkurl2 = settings.value("bookmarkurl2").toString(); + } +} + + +void cGlobalPreferences::saveSettings() { + QSettings settings(settingsfile, QSettings::IniFormat); + settings.clear(); + + settings.setValue("customionscount", (int)customions.size()); + + QString customionvalue; + for (int i = 0; i < (int)customions.size(); i++) { + customionvalue = "customion_name_" + QVariant(i).toString(); + settings.setValue(customionvalue, customions[i].name.c_str()); + + customionvalue = "customion_formula_" + QVariant(i).toString(); + settings.setValue(customionvalue, customions[i].formula.c_str()); + + customionvalue = "customion_positive_" + QVariant(i).toString(); + settings.setValue(customionvalue, (int)customions[i].positive); + + customionvalue = "customion_multiplier_" + QVariant(i).toString(); + settings.setValue(customionvalue, customions[i].multiplier); + } + + settings.setValue("bafprocessingmethod", bafprocessingmethod); + settings.setValue("rawdataprocessingmethod", rawdataprocessingmethod); + + settings.setValue("settingsdefaultdir", settingsdefaultdir); + settings.setValue("peaklistsdefaultdir", peaklistsdefaultdir); + settings.setValue("blocksdefaultdir", blocksdefaultdir); + settings.setValue("sequencesdefaultdir", sequencesdefaultdir); + settings.setValue("modificationsdefaultdir", modificationsdefaultdir); + settings.setValue("openopticalimagedir", openopticalimagedir); + settings.setValue("openhistologyimagedir", openhistologyimagedir); + settings.setValue("openmicroscopyimagedir", openmicroscopyimagedir); + settings.setValue("resultsdefaultdir", resultsdefaultdir); + settings.setValue("exportcsvdefaultdir", exportcsvdefaultdir); + settings.setValue("exporthtmldefaultdir", exporthtmldefaultdir); + settings.setValue("exportimagedefaultdir", exportimagedefaultdir); + + settings.setValue("bookmarkurl1", bookmarkurl1); + settings.setValue("bookmarkurl2", bookmarkurl2); +} + + +void cGlobalPreferences::setDefaultIonTypes() { + cIonType ion; + + customions.clear(); + + /* + cFragmentIons iondefinitions; + + int start = (int)ms_Hplus; + int end = (int)ms_MGa4H; + + for (int i = start; i <= end; i++) { + ion.clear(); + ion.name = iondefinitions[(eFragmentIonType)i].name.c_str(); + ion.formula = iondefinitions[(eFragmentIonType)i].summary.c_str(); + ion.positive = iondefinitions[(eFragmentIonType)i].positive; + ion.multiplier = iondefinitions[(eFragmentIonType)i].multiplier; + customions.push_back(ion); + } + */ + + // initialize ion [M+H]+ + ion.clear(); + ion.name = "[M+H]+"; + ion.formula = "H+"; + ion.massdifference = H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Na]+ + ion.clear(); + ion.name = "[M+Na]+"; + ion.formula = "Na+"; + ion.massdifference = Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+K]+ + ion.clear(); + ion.name = "[M+K]+"; + ion.formula = "K+"; + ion.massdifference = K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M-H]- + ion.clear(); + ion.name = "[M-H]-"; + ion.formula = "H-1+-1"; + ion.massdifference = -H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Na-2H]- + ion.clear(); + ion.name = "[M+Na-2H]-"; + ion.formula = "NaH-2+-1"; + ion.massdifference = Na - 2 * H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+K-2H]- + ion.clear(); + ion.name = "[M+K-2H]-"; + ion.formula = "KH-2+-1"; + ion.massdifference = K - 2 * H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Fe-2H]+ + ion.clear(); + ion.name = "[M+Fe-2H]+"; + ion.formula = "FeH-3H+"; + ion.massdifference = Fe - 3 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Fe-3H+Na]+ + ion.clear(); + ion.name = "[M+Fe-3H+Na]+"; + ion.formula = "FeH-3Na+"; + ion.massdifference = Fe - 3 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Fe-3H+K]+ + ion.clear(); + ion.name = "[M+Fe-3H+K]+"; + ion.formula = "FeH-3K+"; + ion.massdifference = Fe - 3 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [2M+Fe-2H]+ + ion.clear(); + ion.name = "[2M+Fe-2H]+"; + ion.formula = "FeH-3H+"; + ion.massdifference = Fe - 3 * H + H - e; + ion.positive = true; + ion.multiplier = 2; + customions.push_back(ion); + + // initialize ion [2M+Fe-3H+Na]+ + ion.clear(); + ion.name = "[2M+Fe-3H+Na]+"; + ion.formula = "FeH-3Na+"; + ion.massdifference = Fe - 3 * H + Na - e; + ion.positive = true; + ion.multiplier = 2; + customions.push_back(ion); + + // initialize ion [2M+Fe-3H+K]+ + ion.clear(); + ion.name = "[2M+Fe-3H+K]+"; + ion.formula = "FeH-3K+"; + ion.massdifference = Fe - 3 * H + K - e; + ion.positive = true; + ion.multiplier = 2; + customions.push_back(ion); + + // initialize ion [3M+Fe-2H]+ + ion.clear(); + ion.name = "[3M+Fe-2H]+"; + ion.formula = "FeH-3H+"; + ion.massdifference = Fe - 3 * H + H - e; + ion.positive = true; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [3M+Fe-3H+Na]+ + ion.clear(); + ion.name = "[3M+Fe-3H+Na]+"; + ion.formula = "FeH-3Na+"; + ion.massdifference = Fe - 3 * H + Na - e; + ion.positive = true; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [3M+Fe-3H+K]+ + ion.clear(); + ion.name = "[3M+Fe-3H+K]+"; + ion.formula = "FeH-3K+"; + ion.massdifference = Fe - 3 * H + K - e; + ion.positive = true; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [3M+2Fe-5H]+ + ion.clear(); + ion.name = "[3M+2Fe-5H]+"; + ion.formula = "Fe2H-6H+"; + ion.massdifference = 2 * Fe - 6 * H + H - e; + ion.positive = true; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [3M+2Fe-6H+Na]+ + ion.clear(); + ion.name = "[3M+2Fe-6H+Na]+"; + ion.formula = "Fe2H-6Na+"; + ion.massdifference = 2 * Fe - 6 * H + Na - e; + ion.positive = true; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [3M+2Fe-6H+K]+ + ion.clear(); + ion.name = "[3M+2Fe-6H+K]+"; + ion.formula = "Fe2H-6K+"; + ion.massdifference = 2 * Fe - 6 * H + K - e; + ion.positive = true; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [M+Fe-4H]- + ion.clear(); + ion.name = "[M+Fe-4H]-"; + ion.formula = "FeH-3H-1+-1"; + ion.massdifference = Fe - 3 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [2M+Fe-4H]- + ion.clear(); + ion.name = "[2M+Fe-4H]-"; + ion.formula = "FeH-3H-1+-1"; + ion.massdifference = Fe - 3 * H - H + e; + ion.positive = false; + ion.multiplier = 2; + customions.push_back(ion); + + // initialize ion [3M+Fe-4H]- + ion.clear(); + ion.name = "[3M+Fe-4H]-"; + ion.formula = "FeH-3H-1+-1"; + ion.massdifference = Fe - 3 * H - H + e; + ion.positive = false; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [3M+2Fe-7H]- + ion.clear(); + ion.name = "[3M+2Fe-7H]-"; + ion.formula = "Fe2H-6H-1+-1"; + ion.massdifference = 2 * Fe - 6 * H - H + e; + ion.positive = false; + ion.multiplier = 3; + customions.push_back(ion); + + // initialize ion [M+NH4]+ + ion.clear(); + ion.name = "[M+NH4]+"; + ion.formula = "NH4+"; + ion.massdifference = H + NH3 - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cl]- + ion.clear(); + ion.name = "[M+Cl]-"; + ion.formula = "Cl+-1"; + ion.massdifference = Cl + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M]+ + ion.clear(); + ion.name = "[M]+"; + ion.formula = "+"; + ion.massdifference = -e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M]- + ion.clear(); + ion.name = "[M]-"; + ion.formula = "+-1"; + ion.massdifference = e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion Li+ + ion.clear(); + ion.name = "[M+Li]+"; + ion.formula = "Li+"; + ion.massdifference = Li - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mg-H]+ + ion.clear(); + ion.name = "[M+Mg-H]+"; + ion.formula = "MgH-2H+"; + ion.massdifference = Mg - 2 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mg-2H+Na]+ + ion.clear(); + ion.name = "[M+Mg-2H+Na]+"; + ion.formula = "MgH-2Na+"; + ion.massdifference = Mg - 2 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mg-2H+K]+ + ion.clear(); + ion.name = "[M+Mg-2H+K]+"; + ion.formula = "MgH-2K+"; + ion.massdifference = Mg - 2 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mg-3H]- + ion.clear(); + ion.name = "[M+Mg-3H]-"; + ion.formula = "MgH-2H-1+-1"; + ion.massdifference = Mg - 2 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Al-2H]+ + ion.clear(); + ion.name = "[M+Al-2H]+"; + ion.formula = "AlH-3H+"; + ion.massdifference = Al - 3 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Al-3H+Na]+ + ion.clear(); + ion.name = "[M+Al-3H+Na]+"; + ion.formula = "AlH-3Na+"; + ion.massdifference = Al - 3 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Al-3H+K]+ + ion.clear(); + ion.name = "[M+Al-3H+K]+"; + ion.formula = "AlH-3K+"; + ion.massdifference = Al - 3 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Al-4H]- + ion.clear(); + ion.name = "[M+Al-4H]-"; + ion.formula = "AlH-3H-1+-1"; + ion.massdifference = Al - 3 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Si-3H]+ + ion.clear(); + ion.name = "[M+Si-3H]+"; + ion.formula = "SiH-4H+"; + ion.massdifference = Si - 4 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Si-4H+Na]+ + ion.clear(); + ion.name = "[M+Si-4H+Na]+"; + ion.formula = "SiH-4Na+"; + ion.massdifference = Si - 4 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Si-4H+K]+ + ion.clear(); + ion.name = "[M+Si-4H+K]+"; + ion.formula = "SiH-4K+"; + ion.massdifference = Si - 4 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Si-5H]- + ion.clear(); + ion.name = "[M+Si-5H]-"; + ion.formula = "SiH-4H-1+-1"; + ion.massdifference = Si - 4 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ca-H]+ + ion.clear(); + ion.name = "[M+Ca-H]+"; + ion.formula = "CaH-2H+"; + ion.massdifference = Ca - 2 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ca-2H+Na]+ + ion.clear(); + ion.name = "[M+Ca-2H+Na]+"; + ion.formula = "CaH-2Na+"; + ion.massdifference = Ca - 2 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ca-2H+K]+ + ion.clear(); + ion.name = "[M+Ca-2H+K]+"; + ion.formula = "CaH-2K+"; + ion.massdifference = Ca - 2 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ca-3H]- + ion.clear(); + ion.name = "[M+Ca-3H]-"; + ion.formula = "CaH-2H-1+-1"; + ion.massdifference = Ca - 2 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Sc-2H]+ + ion.clear(); + ion.name = "[M+Sc-2H]+"; + ion.formula = "ScH-3H+"; + ion.massdifference = Sc - 3 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Sc-3H+Na]+ + ion.clear(); + ion.name = "[M+Sc-3H+Na]+"; + ion.formula = "ScH-3Na+"; + ion.massdifference = Sc - 3 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Sc-3H+K]+ + ion.clear(); + ion.name = "[M+Sc-3H+K]+"; + ion.formula = "ScH-3K+"; + ion.massdifference = Sc - 3 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Sc-4H]- + ion.clear(); + ion.name = "[M+Sc-4H]-"; + ion.formula = "ScH-3H-1+-1"; + ion.massdifference = Sc - 3 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cr-2H]+ + ion.clear(); + ion.name = "[M+Cr-2H]+"; + ion.formula = "CrH-3H+"; + ion.massdifference = Cr - 3 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cr-3H+Na]+ + ion.clear(); + ion.name = "[M+Cr-3H+Na]+"; + ion.formula = "CrH-3Na+"; + ion.massdifference = Cr - 3 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cr-3H+K]+ + ion.clear(); + ion.name = "[M+Cr-3H+K]+"; + ion.formula = "CrH-3K+"; + ion.massdifference = Cr - 3 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cr-4H]- + ion.clear(); + ion.name = "[M+Cr-4H]-"; + ion.formula = "CrH-3H-1+-1"; + ion.massdifference = Cr - 3 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mn-H]+ + ion.clear(); + ion.name = "[M+Mn-H]+"; + ion.formula = "MnH-2H+"; + ion.massdifference = Mn - 2 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mn-2H+Na]+ + ion.clear(); + ion.name = "[M+Mn-2H+Na]+"; + ion.formula = "MnH-2Na+"; + ion.massdifference = Mn - 2 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mn-2H+K]+ + ion.clear(); + ion.name = "[M+Mn-2H+K]+"; + ion.formula = "MnH-2K+"; + ion.massdifference = Mn - 2 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Mn-3H]- + ion.clear(); + ion.name = "[M+Mn-3H]-"; + ion.formula = "MnH-2H-1+-1"; + ion.massdifference = Mn - 2 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Co-H]+ + ion.clear(); + ion.name = "[M+Co-H]+"; + ion.formula = "CoH-2H+"; + ion.massdifference = Co - 2 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Co-2H+Na]+ + ion.clear(); + ion.name = "[M+Co-2H+Na]+"; + ion.formula = "CoH-2Na+"; + ion.massdifference = Co - 2 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Co-2H+K]+ + ion.clear(); + ion.name = "[M+Co-2H+K]+"; + ion.formula = "CoH-2K+"; + ion.massdifference = Co - 2 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Co-3H]- + ion.clear(); + ion.name = "[M+Co-3H]-"; + ion.formula = "CoH-2H-1+-1"; + ion.massdifference = Co - 2 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ni-H]+ + ion.clear(); + ion.name = "[M+Ni-H]+"; + ion.formula = "NiH-2H+"; + ion.massdifference = Ni - 2 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ni-2H+Na]+ + ion.clear(); + ion.name = "[M+Ni-2H+Na]+"; + ion.formula = "NiH-2Na+"; + ion.massdifference = Ni - 2 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ni-2H+K]+ + ion.clear(); + ion.name = "[M+Ni-2H+K]+"; + ion.formula = "NiH-2K+"; + ion.massdifference = Ni - 2 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ni-3H]- + ion.clear(); + ion.name = "[M+Ni-3H]-"; + ion.formula = "NiH-2H-1+-1"; + ion.massdifference = Ni - 2 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cu-H]+ + ion.clear(); + ion.name = "[M+Cu-H]+"; + ion.formula = "CuH-2H+"; + ion.massdifference = Cu - 2 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cu-2H+Na]+ + ion.clear(); + ion.name = "[M+Cu-2H+Na]+"; + ion.formula = "CuH-2Na+"; + ion.massdifference = Cu - 2 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cu-2H+K]+ + ion.clear(); + ion.name = "[M+Cu-2H+K]+"; + ion.formula = "CuH-2K+"; + ion.massdifference = Cu - 2 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Cu-3H]- + ion.clear(); + ion.name = "[M+Cu-3H]-"; + ion.formula = "CuH-2H-1+-1"; + ion.massdifference = Cu - 2 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Zn-H]+ + ion.clear(); + ion.name = "[M+Zn-H]+"; + ion.formula = "ZnH-2H+"; + ion.massdifference = Zn - 2 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Zn-2H+Na]+ + ion.clear(); + ion.name = "[M+Zn-2H+Na]+"; + ion.formula = "ZnH-2Na+"; + ion.massdifference = Zn - 2 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Zn-2H+K]+ + ion.clear(); + ion.name = "[M+Zn-2H+K]+"; + ion.formula = "ZnH-2K+"; + ion.massdifference = Zn - 2 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Zn-3H]- + ion.clear(); + ion.name = "[M+Zn-3H]-"; + ion.formula = "ZnH-2H-1+-1"; + ion.massdifference = Zn - 2 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ga-2H]+ + ion.clear(); + ion.name = "[M+Ga-2H]+"; + ion.formula = "GaH-3H+"; + ion.massdifference = Ga - 3 * H + H - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ga-3H+Na]+ + ion.clear(); + ion.name = "[M+Ga-3H+Na]+"; + ion.formula = "GaH-3Na+"; + ion.massdifference = Ga - 3 * H + Na - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ga-3H+K]+ + ion.clear(); + ion.name = "[M+Ga-3H+K]+"; + ion.formula = "GaH-3K+"; + ion.massdifference = Ga - 3 * H + K - e; + ion.positive = true; + ion.multiplier = 1; + customions.push_back(ion); + + // initialize ion [M+Ga-4H]- + ion.clear(); + ion.name = "[M+Ga-4H]-"; + ion.formula = "GaH-3H-1+-1"; + ion.massdifference = Ga - 3 * H - H + e; + ion.positive = false; + ion.multiplier = 1; + customions.push_back(ion); +} + + +void cGlobalPreferences::setDefaultDataProcessingMethods() { + bafprocessingmethod = 0; + rawdataprocessingmethod = 0; +} + + +void cGlobalPreferences::setDefaultDirectories() { + #if OS_TYPE == WIN + settingsdefaultdir = "./Settings/"; + peaklistsdefaultdir = "./PeakLists/"; + blocksdefaultdir = "./BrickDatabases/"; + sequencesdefaultdir = "./SequenceDatabases/"; + modificationsdefaultdir = "./Modifications/"; + openopticalimagedir = "./"; + openhistologyimagedir = "./"; + openmicroscopyimagedir = "./"; + resultsdefaultdir = "./"; + exportcsvdefaultdir = "./"; + exporthtmldefaultdir = "./"; + exportimagedefaultdir = "./"; + #else + settingsdefaultdir = installdir + "Settings/"; + peaklistsdefaultdir = installdir + "PeakLists/"; + blocksdefaultdir = installdir + "BrickDatabases/"; + sequencesdefaultdir = installdir + "SequenceDatabases/"; + modificationsdefaultdir = installdir + "Modifications/"; + openopticalimagedir = "./"; + openhistologyimagedir = "./"; + openmicroscopyimagedir = "./"; + resultsdefaultdir = "./"; + exportcsvdefaultdir = "./"; + exporthtmldefaultdir = "./"; + exportimagedefaultdir = "./"; + #endif +} + + +void cGlobalPreferences::setDefaultURLs() { + bookmarkurl1 = "https://bioinfo.lifl.fr/norine/"; + bookmarkurl2 = "https://ms.biomed.cas.cz/bbdgnc/"; +} + diff --git a/CycloBranch/core/cGlobalPreferences.h b/CycloBranch/core/cGlobalPreferences.h new file mode 100644 index 0000000..90ccfb2 --- /dev/null +++ b/CycloBranch/core/cGlobalPreferences.h @@ -0,0 +1,152 @@ +/** + \file cGlobalPreferences.h + \brief The representation of a set of peptide sequence candidates. +*/ + + +#ifndef _CGLOBALPREFERENCES_H +#define _CGLOBALPREFERENCES_H + +#include "core/utilities.h" +#include "core/cFragmentIons.h" +#include "core/cSummaryFormula.h" +#include +#include +#include + + +/** + \brief The struct for definition of a ion type. +*/ +struct cIonType { + + /** + \brief Name of the ion. + */ + string name; + + + /** + \brief Formula of the ion. + */ + string formula; + + + /** + \brief Mass difference of the ion from the neutral molecule. + */ + double massdifference; + + + /** + \brief Charge of the ion. + */ + bool positive; + + + /** + \brief The multiplier n in [nM + H]+. + */ + int multiplier; + + + /** + \brief The default constructor. + */ + cIonType() { + clear(); + } + + + /** + \brief Clear the structure. + */ + void clear() { + name = "[M+H]+"; + formula = "H+"; + massdifference = H - e; + positive = true; + multiplier = 1; + } + +}; + + +/** + \brief The class storing global preferences. +*/ +class cGlobalPreferences { + + QString settingsfile; + +public: + + vector customions; + + int bafprocessingmethod; + int rawdataprocessingmethod; + + QString settingsdefaultdir; + QString peaklistsdefaultdir; + QString blocksdefaultdir; + QString sequencesdefaultdir; + QString modificationsdefaultdir; + QString openopticalimagedir; + QString openhistologyimagedir; + QString openmicroscopyimagedir; + QString resultsdefaultdir; + QString exportcsvdefaultdir; + QString exporthtmldefaultdir; + QString exportimagedefaultdir; + + QString bookmarkurl1; + QString bookmarkurl2; + + + /** + \brief The constructor. + */ + cGlobalPreferences(); + + + /** + \brief Set default ion types. + */ + void setDefaultIonTypes(); + + + /** + \brief Set default data processing methods. + */ + void setDefaultDataProcessingMethods(); + + + /** + \brief Set default directories. + */ + void setDefaultDirectories(); + + + /** + \brief Set default URLs. + */ + void setDefaultURLs(); + + + /** + \brief Load settings. + */ + void loadSettings(); + + + /** + \brief Save settings. + */ + void saveSettings(); + + +}; + + +#endif + diff --git a/CycloBranch/core/cParameters.cpp b/CycloBranch/core/cParameters.cpp index c332ffe..8f38709 100644 --- a/CycloBranch/core/cParameters.cpp +++ b/CycloBranch/core/cParameters.cpp @@ -149,7 +149,8 @@ void cParameters::clear() { sequencedatabasefilename = ""; fragmentionsfordenovograph.clear(); - ionsfortheoreticalspectra.clear(); + ionsfortheoreticalspectraMS1.clear(); + ionsfortheoreticalspectraMS2.clear(); neutrallossesdefinitions.clear(); neutralLoss loss; @@ -882,10 +883,10 @@ int cParameters::checkAndPrepare(bool& terminatecomputation) { modificationsstream.close(); } - fragmentDescription fd; - fd.nterminal = true; - fd.cterminal = true; - searchedmodifications.insert(searchedmodifications.begin(), fd); + cFragmentIonType fiontype; + fiontype.nterminal = true; + fiontype.cterminal = true; + searchedmodifications.insert(searchedmodifications.begin(), fiontype); } @@ -970,9 +971,9 @@ int cParameters::checkAndPrepare(bool& terminatecomputation) { // check theoretical fragments in positive/negative mode if (!error && ((mode == dereplication) || (mode == compoundsearch))) { i = 0; - while (i < (int)ionsfortheoreticalspectra.size()) { - if (iondefinitions[ionsfortheoreticalspectra[i]].positive != (precursorcharge > 0)) { - ionsfortheoreticalspectra.erase(ionsfortheoreticalspectra.begin() + i); + while (i < (int)ionsfortheoreticalspectraMS1.size()) { + if (ionsfortheoreticalspectraMS1[i].positive != (precursorcharge > 0)) { + ionsfortheoreticalspectraMS1.erase(ionsfortheoreticalspectraMS1.begin() + i); } else { i++; @@ -1015,7 +1016,7 @@ int cParameters::prepareLossesAndCompounds(bool& terminatecomputation) { } } else if (mode == compoundsearch) { - errtype = generateCompounds(terminatecomputation, errormessage); // uses ionsfortheoreticalspectra + errtype = generateCompounds(terminatecomputation, errormessage); // uses ionsfortheoreticalspectraMS1 if (errtype == -1) { error = true; } @@ -1234,6 +1235,9 @@ string cParameters::printToString() { case number_of_b_and_y_ions: s += "Number of b-ions and y-ions"; break; + case weighted_ratio_of_matched_peaks: + s += "Weighted Ratio of Matched Peaks"; + break; default: s += "undefined"; break; @@ -1244,10 +1248,20 @@ string cParameters::printToString() { s += "Peptide Sequence Tag: " + originalsequencetag + "\n"; s += "Ion Types: "; - for (int i = 0; i < (int)ionsfortheoreticalspectra.size(); i++) { - s += iondefinitions[ionsfortheoreticalspectra[i]].name; - if (i < (int)ionsfortheoreticalspectra.size() - 1) { - s += ", "; + if ((mode == dereplication) || (mode == compoundsearch)) { + for (int i = 0; i < (int)ionsfortheoreticalspectraMS1.size(); i++) { + s += ionsfortheoreticalspectraMS1[i].name; + if (i < (int)ionsfortheoreticalspectraMS1.size() - 1) { + s += ", "; + } + } + } + else { + for (int i = 0; i < (int)ionsfortheoreticalspectraMS2.size(); i++) { + s += iondefinitions[ionsfortheoreticalspectraMS2[i]].name; + if (i < (int)ionsfortheoreticalspectraMS2.size() - 1) { + s += ", "; + } } } s += "\n"; @@ -1917,15 +1931,15 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess combarray.push_back(0); } - if (ionsfortheoreticalspectra.size() > 0) { - minadd = iondefinitions[ionsfortheoreticalspectra[0]].massdifference; - //maxadd = iondefinitions[ionsfortheoreticalspectra[0]].massdifference; - for (int i = 1; i < (int)ionsfortheoreticalspectra.size(); i++) { - if (iondefinitions[ionsfortheoreticalspectra[i]].massdifference < minadd) { - minadd = iondefinitions[ionsfortheoreticalspectra[i]].massdifference; + if (ionsfortheoreticalspectraMS1.size() > 0) { + minadd = ionsfortheoreticalspectraMS1[0].massdifference; + //maxadd = ionsfortheoreticalspectraMS1[0].massdifference; + for (int i = 1; i < (int)ionsfortheoreticalspectraMS1.size(); i++) { + if (ionsfortheoreticalspectraMS1[i].massdifference < minadd) { + minadd = ionsfortheoreticalspectraMS1[i].massdifference; } - //if (iondefinitions[ionsfortheoreticalspectra[i]].massdifference > maxadd) { - // maxadd = iondefinitions[ionsfortheoreticalspectra[i]].massdifference; + //if (ionsfortheoreticalspectraMS1[i].massdifference > maxadd) { + // maxadd = ionsfortheoreticalspectraMS1[i].massdifference; //} } } @@ -1963,9 +1977,9 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess //sumofmasses = getMassAndCounts(combarray, countsofelements, massesofelements); alloutofmz = true; - for (auto& it : ionsfortheoreticalspectra) { + for (auto& it : ionsfortheoreticalspectraMS1) { for (int j = 0; j < abs(precursorcharge); j++) { - tmpmzdifference = sumofmasses + iondefinitions[it].massdifference; + tmpmzdifference = sumofmasses + it.massdifference; if (precursorcharge > 0) { tmpmzdifference += j * (H - e); } @@ -2319,11 +2333,11 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess compoundshint = 0; - for (auto& it : ionsfortheoreticalspectra) { + for (auto& it : ionsfortheoreticalspectraMS1) { for (int j = 0; j < abs(precursorcharge); j++) { - tmpmzdifference = sumofmasses + iondefinitions[it].massdifference; + tmpmzdifference = sumofmasses + it.massdifference; if (precursorcharge > 0) { tmpmzdifference += j * (H - e); } @@ -2523,10 +2537,16 @@ void cParameters::store(ofstream& os) { os.write((char *)&fragmentionsfordenovograph[i], sizeof(eFragmentIonType)); } - size = (int)ionsfortheoreticalspectra.size(); + size = (int)ionsfortheoreticalspectraMS1.size(); os.write((char *)&size, sizeof(int)); - for (int i = 0; i < (int)ionsfortheoreticalspectra.size(); i++) { - os.write((char *)&ionsfortheoreticalspectra[i], sizeof(eFragmentIonType)); + for (int i = 0; i < (int)ionsfortheoreticalspectraMS1.size(); i++) { + os.write((char *)&ionsfortheoreticalspectraMS1[i], sizeof(cIonType)); + } + + size = (int)ionsfortheoreticalspectraMS2.size(); + os.write((char *)&size, sizeof(int)); + for (int i = 0; i < (int)ionsfortheoreticalspectraMS2.size(); i++) { + os.write((char *)&ionsfortheoreticalspectraMS2[i], sizeof(eFragmentIonType)); } size = (int)neutrallossesdefinitions.size(); @@ -2661,9 +2681,15 @@ void cParameters::load(ifstream& is) { } is.read((char *)&size, sizeof(int)); - ionsfortheoreticalspectra.resize(size); - for (int i = 0; i < (int)ionsfortheoreticalspectra.size(); i++) { - is.read((char *)&ionsfortheoreticalspectra[i], sizeof(eFragmentIonType)); + ionsfortheoreticalspectraMS1.resize(size); + for (int i = 0; i < (int)ionsfortheoreticalspectraMS1.size(); i++) { + is.read((char *)&ionsfortheoreticalspectraMS1[i], sizeof(cIonType)); + } + + is.read((char *)&size, sizeof(int)); + ionsfortheoreticalspectraMS2.resize(size); + for (int i = 0; i < (int)ionsfortheoreticalspectraMS2.size(); i++) { + is.read((char *)&ionsfortheoreticalspectraMS2[i], sizeof(eFragmentIonType)); } is.read((char *)&size, sizeof(int)); diff --git a/CycloBranch/core/cParameters.h b/CycloBranch/core/cParameters.h index 30f6811..aaa03ad 100644 --- a/CycloBranch/core/cParameters.h +++ b/CycloBranch/core/cParameters.h @@ -10,6 +10,7 @@ #include #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "core/cPeakListSeries.h" #include "core/cBricksDatabase.h" #include "core/cSequenceDatabase.h" @@ -47,7 +48,8 @@ enum eScoreType { sum_of_relative_intensities = 1, number_of_b_ions = 2, number_of_y_ions = 3, - number_of_b_and_y_ions = 4 + number_of_b_and_y_ions = 4, + weighted_ratio_of_matched_peaks = 5 }; @@ -443,7 +445,7 @@ class cParameters { /** \brief A vector of searched N-terminal and C-terminal modifications. */ - vector searchedmodifications; + vector searchedmodifications; /** @@ -453,9 +455,15 @@ class cParameters { /** - \brief A vector of ion types generated in theoretical spectra. + \brief A vector of ion types generated in theoretical conventional mass spectra. */ - vector ionsfortheoreticalspectra; + vector ionsfortheoreticalspectraMS1; + + + /** + \brief A vector of ion types generated in theoretical fragment ion spectra. + */ + vector ionsfortheoreticalspectraMS2; /** diff --git a/CycloBranch/core/cSequence.cpp b/CycloBranch/core/cSequence.cpp index f9a002e..ab7b115 100644 --- a/CycloBranch/core/cSequence.cpp +++ b/CycloBranch/core/cSequence.cpp @@ -120,7 +120,7 @@ string cSequence::getNameWithReferenceAsHTMLString() { // performance improvement - quick return without regex_search string s = ""; if (reference.empty()) { - s += ""; + s += ""; s += name; s += ""; return s; @@ -258,7 +258,7 @@ string cSequence::getNameWithReferenceAsHTMLString() { } if (!correctreference) { - s += ""; + s += ""; s += name; s += ""; } diff --git a/CycloBranch/core/cTheoreticalSpectrum.cpp b/CycloBranch/core/cTheoreticalSpectrum.cpp index d456eac..5a78d59 100644 --- a/CycloBranch/core/cTheoreticalSpectrum.cpp +++ b/CycloBranch/core/cTheoreticalSpectrum.cpp @@ -133,6 +133,8 @@ void cTheoreticalSpectrum::searchForPeakPairs(cPeaksList& theoreticalpeaks, int void cTheoreticalSpectrum::computeStatistics(bool writedescription) { + double sumofallintensities = 0; + experimentalpeaksmatched = 0; scrambledpeaksmatched = 0; sumofrelativeintensities = 0; @@ -142,6 +144,8 @@ void cTheoreticalSpectrum::computeStatistics(bool writedescription) { } for (int i = 0; i < (int)experimentalpeaks.size(); i++) { + sumofallintensities += experimentalpeaks[i].relativeintensity; + if (experimentalpeaks[i].matched > 0) { experimentalpeaksmatched++; @@ -165,8 +169,12 @@ void cTheoreticalSpectrum::computeStatistics(bool writedescription) { peakstested = experimentalpeaks.size(); + weightedpeaksratio = 0; if (experimentalpeaks.size() > 0) { experimentalpeaksmatchedratio = ((double)experimentalpeaksmatched) / ((double)experimentalpeaks.size()); + if (sumofallintensities > 0) { + weightedpeaksratio = sumofrelativeintensities / sumofallintensities; + } } else { experimentalpeaksmatchedratio = 0; @@ -771,7 +779,12 @@ void cTheoreticalSpectrum::generateScrambledIons(cBricksDatabase& bricksdatabase } tempmzratio = 0; + currentlosses.clear(); + fragmentlossmass.clear(); + fragmentlosssummary.clear(); + fragmentlossmap.clear(); + for (int i = 0; i < (int)intcomposition.size(); i++) { tempmzratio += bricksdatabase[intcomposition[i] - 1].getMass(); @@ -781,14 +794,14 @@ void cTheoreticalSpectrum::generateScrambledIons(cBricksDatabase& bricksdatabase tempmapready = false; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { for (int k = -1; k < (int)fragmentlossmass.size(); k++) { peak.clear(); - peak.iontype = (eFragmentIonType)parameters->ionsfortheoreticalspectra[i]; + peak.iontype = (eFragmentIonType)parameters->ionsfortheoreticalspectraMS2[i]; if (j >= 0) { peak.neutrallosstype = parameters->neutrallossesfortheoreticalspectra[j]; } @@ -1597,16 +1610,64 @@ void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theore int langle = 0; int rangle = 0; double fwhmthreshold = 0.001; - double mzdiff; string subdesc; + bool hasLi = false; + bool hasB = false; + bool hasMg = false; + bool hasSi = false; bool hasS = false; + bool hasCl = false; bool hasK = false; + bool hasTi = false; + bool hasCr = false; bool hasFe = false; - - int posS = -1; - int posK = -1; - int posFe = -1; + bool hasNi = false; + bool hasCu = false; + bool hasZn = false; + bool hasGa = false; + + string elementLi = " Li"; + string elementB = " B"; + string elementMg = " Mg"; + string elementSi = " Si"; + string elementS = " S"; + string elementCl = " Cl"; + string elementK = " K"; + string elementTi = " Ti"; + string elementCr = " Cr"; + string elementFe = " Fe"; + string elementNi = " Ni"; + string elementCu = " Cu"; + string elementZn = " Zn"; + string elementGa = " Ga"; + + string isotopeLi6 = " 6Li "; + string isotopeB10 = " 10B "; + string isotopeMg25 = " 25Mg "; + string isotopeMg26 = " 26Mg "; + string isotopeSi29 = " 29Si "; + string isotopeSi30 = " 30Si "; + string isotopeS34 = " 34S "; + string isotopeCl37 = " 37Cl "; + string isotopeK41 = " 41K "; + string isotopeTi46 = " 46Ti "; + string isotopeTi47 = " 47Ti "; + string isotopeTi49 = " 49Ti "; + string isotopeTi50 = " 50Ti "; + string isotopeCr50 = " 50Cr "; + string isotopeCr53 = " 53Cr "; + string isotopeFe54 = " 54Fe "; + string isotopeNi60 = " 60Ni "; + string isotopeNi62 = " 62Ni "; + string isotopeCu65 = " 65Cu "; + string isotopeZn66 = " 66Zn "; + string isotopeZn67 = " 67Zn "; + string isotopeZn68 = " 68Zn "; + string isotopeGa71 = " 71Ga "; + + size_t elempos; + size_t subdescsize; double maximumexperimentalintensity; if (theoreticalpeaks[maximumintensityid].matched) { @@ -1617,59 +1678,105 @@ void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theore rangle = (int)parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].rfind(')'); if ((langle != string::npos) && (rangle != string::npos)) { subdesc = parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].substr(langle + 1, rangle - langle - 1); - if (subdesc.find("Fe") != string::npos) { + subdescsize = subdesc.size(); + + elempos = subdesc.find("Li"); + if (elempos != string::npos) { + hasLi = true; + } + + elempos = subdesc.find("B"); + if (elempos != string::npos) { + if (elempos + 1 < subdescsize) { + if ((subdesc[elempos + 1] < 'a') || (subdesc[elempos + 1] > 'z')) { + hasB = true; + } + } + else { + hasB = true; + } + } + + elempos = subdesc.find("Ti"); + if (elempos != string::npos) { + hasTi = true; + } + + elempos = subdesc.find("Cr"); + if (elempos != string::npos) { + hasCr = true; + } + + elempos = subdesc.find("Fe"); + if (elempos != string::npos) { hasFe = true; } + if (parameters->fwhm <= fwhmthreshold) { - if (subdesc.find("S") != string::npos) { - hasS = true; + + elempos = subdesc.find("Mg"); + if (elempos != string::npos) { + hasMg = true; } - if (subdesc.find("K") != string::npos) { - hasK = true; + + elempos = subdesc.find("Si"); + if (elempos != string::npos) { + hasSi = true; } - } - } - - /* - if (parameters->fwhm <= fwhmthreshold) { - langle = (int)parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].rfind('('); - rangle = (int)parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].rfind(')'); - if ((langle != string::npos) && (rangle != string::npos)) { - subdesc = parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].substr(langle + 1, rangle - langle - 1); - if (subdesc.find("Fe") != string::npos) { - hasFe = true; + + elempos = subdesc.find("S"); + if (elempos != string::npos) { + if (elempos + 1 < subdescsize) { + if ((subdesc[elempos + 1] < 'a') || (subdesc[elempos + 1] > 'z')) { + hasS = true; + } + } + else { + hasS = true; + } + } + + elempos = subdesc.find("Cl"); + if (elempos != string::npos) { + hasCl = true; } - if (subdesc.find("S") != string::npos) { - hasS = true; + + elempos = subdesc.find("K"); + if (elempos != string::npos) { + if (elempos + 1 < subdescsize) { + if ((subdesc[elempos + 1] < 'a') || (subdesc[elempos + 1] > 'z')) { + hasK = true; + } + } + else { + hasK = true; + } } - if (subdesc.find("K") != string::npos) { - hasK = true; + + elempos = subdesc.find("Ni"); + if (elempos != string::npos) { + hasNi = true; } + + elempos = subdesc.find("Cu"); + if (elempos != string::npos) { + hasCu = true; + } + + elempos = subdesc.find("Zn"); + if (elempos != string::npos) { + hasZn = true; + } + + elempos = subdesc.find("Ga"); + if (elempos != string::npos) { + hasGa = true; + } + } - } - else { - if ((theoreticalpeaks[start].iontype == ms_MFe2H) - || (theoreticalpeaks[start].iontype == ms_MFe3HNa) - || (theoreticalpeaks[start].iontype == ms_MFe3HK) - || (theoreticalpeaks[start].iontype == ms_2MFe2H) - || (theoreticalpeaks[start].iontype == ms_2MFe3HNa) - || (theoreticalpeaks[start].iontype == ms_2MFe3HK) - || (theoreticalpeaks[start].iontype == ms_3MFe2H) - || (theoreticalpeaks[start].iontype == ms_3MFe3HNa) - || (theoreticalpeaks[start].iontype == ms_3MFe3HK) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe5H) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe6HNa) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe6HK) - || (theoreticalpeaks[start].iontype == ms_MFe4H) - || (theoreticalpeaks[start].iontype == ms_2MFe4H) - || (theoreticalpeaks[start].iontype == ms_3MFe4H) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe7H) - ) { - hasFe = true; - } - } - */ + } + for (int i = 0; i < theoreticalpeaksrealsize; i++) { if (groupid == theoreticalpeaks[i].groupid) { @@ -1686,142 +1793,138 @@ void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theore if ((groupid != theoreticalpeaks[i].groupid) || (i == theoreticalpeaksrealsize - 1)) { - /* - if ((theoreticalpeaks[start].iontype == ms_MFe2H) || (theoreticalpeaks[start].iontype == ms_MFe3HNa) || (theoreticalpeaks[start].iontype == ms_MFe3HK)) { + // lithium + if (hasLi) { + if (checkIsotope(elementLi, isotopeLi6, Li6, Li7, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + } - if ((theoreticalpeaks[start].matched == 0) && (theoreticalpeaks[maximumintensityid].matched > 0)) { + // boron + if (hasB) { + if (checkIsotope(elementB, isotopeB10, B10, B11, 0.3, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } + } - if ((theoreticalpeaks[start].matched > 0) && (theoreticalpeaks[maximumintensityid].matched > 0)) { - if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { - if (theoreticalpeaks[start].relativeintensity*maximumexperimentalintensity / 100.0 >= parameters->minimumrelativeintensitythreshold) { - if (experimentalpeaks[theoreticalpeaks[start].matchedid].relativeintensity > 0.1 * maximumexperimentalintensity) { - cleargroup = true; - } - } - else { - cleargroup = true; - } - } + // titanium (part 1) + if (hasTi) { + if (checkIsotope(elementTi, isotopeTi46, Ti46, Ti48, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + if (checkIsotope(elementTi, isotopeTi47, Ti47, Ti48, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; } + } + // chromium (part 1) + if (hasCr) { + if (checkIsotope(elementCr, isotopeCr50, Cr50, Cr52, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } } - */ + // iron if (hasFe) { - if (theoreticalpeaks[maximumintensityid].matched > 0) { - if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { - for (int j = start; j <= stop; j++) { - if (theoreticalpeaks[j].matched > 0) { - mzdiff = fabs(uncharge(theoreticalpeaks[j].mzratio, theoreticalpeaks[j].charge) - uncharge(theoreticalpeaks[maximumintensityid].mzratio, theoreticalpeaks[maximumintensityid].charge) - Fe54 + Fe56); - if (mzdiff < 0.1) { - if (parameters->peakidtodesc[theoreticalpeaks[j].descriptionid].find("\\[") == string::npos) { - if (parameters->peakidtodesc[theoreticalpeaks[j].descriptionid].find(" 54Fe ") != string::npos) { - posFe = j; - break; - } - } - } - } - } + if (checkIsotope(elementFe, isotopeFe54, Fe54, Fe56, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + } + + if (parameters->fwhm <= fwhmthreshold) { + + // magnesium + if (hasMg) { + if (checkIsotope(elementMg, isotopeMg25, Mg25, Mg24, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + if (checkIsotope(elementMg, isotopeMg26, Mg26, Mg24, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; } } - if (posFe == -1) { - cleargroup = true; + // silicon + if (hasSi) { + if (checkIsotope(elementSi, isotopeSi29, Si29, Si28, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + if (checkIsotope(elementSi, isotopeSi30, Si30, Si28, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } } - else { - if ((theoreticalpeaks[posFe].matched > 0) && (theoreticalpeaks[maximumintensityid].matched > 0)) { - if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { - if (theoreticalpeaks[posFe].relativeintensity*maximumexperimentalintensity / 100.0 >= parameters->minimumrelativeintensitythreshold) { - if (experimentalpeaks[theoreticalpeaks[posFe].matchedid].relativeintensity > 0.1 * maximumexperimentalintensity) { - cleargroup = true; - } - } - else { - cleargroup = true; - } - } + + // sulfur + if (hasS) { + if (checkIsotope(elementS, isotopeS34, S34, S32, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; } } - } - if (parameters->fwhm <= fwhmthreshold) { + // chlorine + if (hasCl) { + if (checkIsotope(elementCl, isotopeCl37, Cl37, Cl35, 0.4, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + } - if (hasS) { - if (theoreticalpeaks[maximumintensityid].matched > 0) { - if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { - for (int j = start; j <= stop; j++) { - if (theoreticalpeaks[j].matched > 0) { - mzdiff = fabs(uncharge(theoreticalpeaks[j].mzratio, theoreticalpeaks[j].charge) - uncharge(theoreticalpeaks[maximumintensityid].mzratio, theoreticalpeaks[maximumintensityid].charge) - S34 + S32); - if (mzdiff < 0.1) { - if (parameters->peakidtodesc[theoreticalpeaks[j].descriptionid].find("\\[") == string::npos) { - if (parameters->peakidtodesc[theoreticalpeaks[j].descriptionid].find(" 34S ") != string::npos) { - posS = j; - break; - } - } - } - } - } - } + // potassium + if (hasK) { + if (checkIsotope(elementK, isotopeK41, K41, K39, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; } + } - if (posS == -1) { + // titanium (part 2) + if (hasTi) { + if (checkIsotope(elementTi, isotopeTi49, Ti49, Ti48, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } - else { - if ((theoreticalpeaks[posS].matched > 0) && (theoreticalpeaks[maximumintensityid].matched > 0)) { - if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { - if (theoreticalpeaks[posS].relativeintensity*maximumexperimentalintensity / 100.0 >= parameters->minimumrelativeintensitythreshold) { - if (experimentalpeaks[theoreticalpeaks[posS].matchedid].relativeintensity > 0.1 * maximumexperimentalintensity) { - cleargroup = true; - } - } - else { - cleargroup = true; - } - } - } + if (checkIsotope(elementTi, isotopeTi50, Ti50, Ti48, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; } } - if (hasK) { - if (theoreticalpeaks[maximumintensityid].matched > 0) { - if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { - for (int j = start; j <= stop; j++) { - if (theoreticalpeaks[j].matched > 0) { - mzdiff = fabs(uncharge(theoreticalpeaks[j].mzratio, theoreticalpeaks[j].charge) - uncharge(theoreticalpeaks[maximumintensityid].mzratio, theoreticalpeaks[maximumintensityid].charge) - K41 + K39); - if (mzdiff < 0.1) { - if (parameters->peakidtodesc[theoreticalpeaks[j].descriptionid].find("\\[") == string::npos) { - if (parameters->peakidtodesc[theoreticalpeaks[j].descriptionid].find(" 41K ") != string::npos) { - posK = j; - break; - } - } - } - } - } - } + // chromium (part 2) + if (hasCr) { + if (checkIsotope(elementCr, isotopeCr53, Cr53, Cr52, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; } + } - if (posK == -1) { + // nickel + if (hasNi) { + if (checkIsotope(elementNi, isotopeNi60, Ni60, Ni58, 0.5, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } - else { - if ((theoreticalpeaks[posK].matched > 0) && (theoreticalpeaks[maximumintensityid].matched > 0)) { - if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { - if (theoreticalpeaks[posK].relativeintensity*maximumexperimentalintensity / 100.0 >= parameters->minimumrelativeintensitythreshold) { - if (experimentalpeaks[theoreticalpeaks[posK].matchedid].relativeintensity > 0.1 * maximumexperimentalintensity) { - cleargroup = true; - } - } - else { - cleargroup = true; - } - } - } + if (checkIsotope(elementNi, isotopeNi62, Ni62, Ni58, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + } + + // copper + if (hasCu) { + if (checkIsotope(elementCu, isotopeCu65, Cu65, Cu63, 0.6, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + } + + // zinc + if (hasZn) { + if (checkIsotope(elementZn, isotopeZn66, Zn66, Zn64, 0.7, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + if (checkIsotope(elementZn, isotopeZn67, Zn67, Zn64, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + if (checkIsotope(elementZn, isotopeZn68, Zn68, Zn64, 0.5, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; + } + } + + // gallium + if (hasGa) { + if (checkIsotope(elementGa, isotopeGa71, Ga71, Ga69, 0.8, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + cleargroup = true; } } @@ -1846,13 +1949,20 @@ void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theore maximumintensity = theoreticalpeaks[i].relativeintensity; cleargroup = false; + hasLi = false; + hasB = false; + hasMg = false; + hasSi = false; hasS = false; + hasCl = false; hasK = false; + hasTi = false; + hasCr = false; hasFe = false; - - posS = -1; - posK = -1; - posFe = -1; + hasNi = false; + hasCu = false; + hasZn = false; + hasGa = false; if (theoreticalpeaks[i].matched) { maximumexperimentalintensity = experimentalpeaks[theoreticalpeaks[i].matchedid].relativeintensity; @@ -1862,59 +1972,105 @@ void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theore rangle = (int)parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].rfind(')'); if ((langle != string::npos) && (rangle != string::npos)) { subdesc = parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].substr(langle + 1, rangle - langle - 1); - if (subdesc.find("Fe") != string::npos) { + subdescsize = subdesc.size(); + + elempos = subdesc.find("Li"); + if (elempos != string::npos) { + hasLi = true; + } + + elempos = subdesc.find("B"); + if (elempos != string::npos) { + if (elempos + 1 < subdescsize) { + if ((subdesc[elempos + 1] < 'a') || (subdesc[elempos + 1] > 'z')) { + hasB = true; + } + } + else { + hasB = true; + } + } + + elempos = subdesc.find("Ti"); + if (elempos != string::npos) { + hasTi = true; + } + + elempos = subdesc.find("Cr"); + if (elempos != string::npos) { + hasCr = true; + } + + elempos = subdesc.find("Fe"); + if (elempos != string::npos) { hasFe = true; } + if (parameters->fwhm <= fwhmthreshold) { - if (subdesc.find("S") != string::npos) { - hasS = true; + + elempos = subdesc.find("Mg"); + if (elempos != string::npos) { + hasMg = true; } - if (subdesc.find("K") != string::npos) { - hasK = true; + + elempos = subdesc.find("Si"); + if (elempos != string::npos) { + hasSi = true; } - } - } - - /* - if (parameters->fwhm <= fwhmthreshold) { - langle = (int)parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].rfind('('); - rangle = (int)parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].rfind(')'); - if ((langle != string::npos) && (rangle != string::npos)) { - subdesc = parameters->peakidtodesc[theoreticalpeaks[start].descriptionid].substr(langle + 1, rangle - langle - 1); - if (subdesc.find("Fe") != string::npos) { - hasFe = true; - } - if (subdesc.find("S") != string::npos) { - hasS = true; + + elempos = subdesc.find("S"); + if (elempos != string::npos) { + if (elempos + 1 < subdescsize) { + if ((subdesc[elempos + 1] < 'a') || (subdesc[elempos + 1] > 'z')) { + hasS = true; + } + } + else { + hasS = true; + } } - if (subdesc.find("K") != string::npos) { - hasK = true; + + elempos = subdesc.find("Cl"); + if (elempos != string::npos) { + hasCl = true; } + + elempos = subdesc.find("K"); + if (elempos != string::npos) { + if (elempos + 1 < subdescsize) { + if ((subdesc[elempos + 1] < 'a') || (subdesc[elempos + 1] > 'z')) { + hasK = true; + } + } + else { + hasK = true; + } + } + + elempos = subdesc.find("Ni"); + if (elempos != string::npos) { + hasNi = true; + } + + elempos = subdesc.find("Cu"); + if (elempos != string::npos) { + hasCu = true; + } + + elempos = subdesc.find("Zn"); + if (elempos != string::npos) { + hasZn = true; + } + + elempos = subdesc.find("Ga"); + if (elempos != string::npos) { + hasGa = true; + } + } - } - else { - if ((theoreticalpeaks[start].iontype == ms_MFe2H) - || (theoreticalpeaks[start].iontype == ms_MFe3HNa) - || (theoreticalpeaks[start].iontype == ms_MFe3HK) - || (theoreticalpeaks[start].iontype == ms_2MFe2H) - || (theoreticalpeaks[start].iontype == ms_2MFe3HNa) - || (theoreticalpeaks[start].iontype == ms_2MFe3HK) - || (theoreticalpeaks[start].iontype == ms_3MFe2H) - || (theoreticalpeaks[start].iontype == ms_3MFe3HNa) - || (theoreticalpeaks[start].iontype == ms_3MFe3HK) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe5H) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe6HNa) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe6HK) - || (theoreticalpeaks[start].iontype == ms_MFe4H) - || (theoreticalpeaks[start].iontype == ms_2MFe4H) - || (theoreticalpeaks[start].iontype == ms_3MFe4H) - //|| (theoreticalpeaks[start].iontype == ms_3M2Fe7H) - ) { - hasFe = true; - } - } - */ + } + } } @@ -2651,6 +2807,78 @@ void cTheoreticalSpectrum::fillExperimentalAnnotationsAndRemoveUnmatchedTheoreti } +bool cTheoreticalSpectrum::checkIsotope(string& elementstring, string& isotopestring, double isotopemass1, double isotopemass2, double intensityratio, cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, int start, int stop, int maximumintensityid, double maximumexperimentalintensity) { + bool notdetected = false; + int isotopeposition = -1; + double intensitymultiplier = 1.0; + double mzdiff; + size_t pos; + + if (theoreticalpeaks[maximumintensityid].matched > 0) { + if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { + for (int i = start; i <= stop; i++) { + if (theoreticalpeaks[i].matched > 0) { + mzdiff = fabs(uncharge(theoreticalpeaks[i].mzratio, theoreticalpeaks[i].charge) - uncharge(theoreticalpeaks[maximumintensityid].mzratio, theoreticalpeaks[maximumintensityid].charge) - isotopemass1 + isotopemass2); + if (mzdiff < 0.1) { + if (parameters->peakidtodesc[theoreticalpeaks[i].descriptionid].find('%') == string::npos) { + pos = parameters->peakidtodesc[theoreticalpeaks[i].descriptionid].rfind(isotopestring); + if (pos != string::npos) { + intensitymultiplier = getIntensityMultiplier(theoreticalpeaks, i, elementstring, pos); + isotopeposition = i; + break; + } + } + } + } + } + } + } + + if (isotopeposition == -1) { + notdetected = true; + } + else { + if ((theoreticalpeaks[isotopeposition].matched > 0) && (theoreticalpeaks[maximumintensityid].matched > 0)) { + if (maximumexperimentalintensity >= parameters->minimumrelativeintensitythreshold) { + if (theoreticalpeaks[isotopeposition].relativeintensity*maximumexperimentalintensity / 100.0 >= parameters->minimumrelativeintensitythreshold) { + if (experimentalpeaks[theoreticalpeaks[isotopeposition].matchedid].relativeintensity > intensityratio * intensitymultiplier * maximumexperimentalintensity) { + notdetected = true; + } + } + else { + notdetected = true; + } + } + } + } + + return notdetected; +} + + +double cTheoreticalSpectrum::getIntensityMultiplier(cPeaksList& theoreticalpeaks, int peakid, string& elementstring, size_t startpos) { + size_t pos = parameters->peakidtodesc[theoreticalpeaks[peakid].descriptionid].find(elementstring, startpos); + if (pos == string::npos) { + // one occurrence + return 1.0; + } + + string shortstr = parameters->peakidtodesc[theoreticalpeaks[peakid].descriptionid].substr(pos + elementstring.size()); + if ((shortstr.size() > 0) && (shortstr[0] == ' ')) { + // two occurrences + return 2.0; + } + + pos = shortstr.find(' '); + if (pos != string::npos) { + shortstr = shortstr.substr(0, pos); + return atof(shortstr.c_str()) + 1.0; + } + + return 1.0; +} + + cTheoreticalSpectrum::cTheoreticalSpectrum() { clear(); } @@ -2679,6 +2907,7 @@ void cTheoreticalSpectrum::clear(bool clearpeaklist) { scrambledpeaksmatched = 0; peakstested = 0; experimentalpeaksmatchedratio = 0; + weightedpeaksratio = 0; unmatchedexperimentalpeakscount = 0; coveragebyseries = ""; valid = false; @@ -2741,7 +2970,7 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat experimentalpeaks = sortedpeaklist; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { @@ -2753,11 +2982,11 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat // in this case the modifID is 0, and both n-terminal and c-terminal fragments are generated // k == 2, 4, 5 are invalid if ((k == 0) || ((k == 1) && (parameters->searchedmodifications[trotations[k].startmodifID].nterminal)) || ((k == 3) && (parameters->searchedmodifications[trotations[k].endmodifID].cterminal))) { - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].nterminal) { - generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotations[k].bricks, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotations[k]); + if (parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].nterminal) { + generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotations[k].bricks, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotations[k]); } - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].cterminal) { - generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotations[k].bricks, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotations[k]); + if (parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].cterminal) { + generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotations[k].bricks, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotations[k]); } } @@ -2790,15 +3019,15 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat series.resize(trotations.size()); for (int i = 0; i < (int)series.size(); i++) { - for (int j = 0; j < (int)parameters->ionsfortheoreticalspectra.size(); j++) { + for (int j = 0; j < (int)parameters->ionsfortheoreticalspectraMS2.size(); j++) { for (int k = -1; k < (int)parameters->neutrallossesfortheoreticalspectra.size(); k++) { if (k >= 0) { - series[i][parameters->ionsfortheoreticalspectra[j]][parameters->neutrallossesfortheoreticalspectra[k]].resize(trotations[0].bricks.size()); + series[i][parameters->ionsfortheoreticalspectraMS2[j]][parameters->neutrallossesfortheoreticalspectra[k]].resize(trotations[0].bricks.size()); } else { - series[i][parameters->ionsfortheoreticalspectra[j]][-1].resize(trotations[0].bricks.size()); + series[i][parameters->ionsfortheoreticalspectraMS2[j]][-1].resize(trotations[0].bricks.size()); } } @@ -2819,7 +3048,7 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat // peak hits without parents are removed /*if (parameters->clearhitswithoutparent) { for (int i = 0; i < (int)trotations.size(); i++) { - clearFalseHits(series[i], parameters->ionsfortheoreticalspectra, parameters->neutrallossesfortheoreticalspectra); + clearFalseHits(series[i], parameters->ionsfortheoreticalspectraMS2, parameters->neutrallossesfortheoreticalspectra); } for (int i = 0; i < theoreticalpeaksrealsize; i++) { @@ -2863,26 +3092,26 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat /*matchedSeries tempseries; bool reportrow; - if (parameters->ionsfortheoreticalspectra.size() > 0) { + if (parameters->ionsfortheoreticalspectraMS2.size() > 0) { coveragebyseries += "Series of matched peaks:"; coveragebyseries += ""; - for (int m = 0; m < (int)series[0][parameters->ionsfortheoreticalspectra[0]][-1].size() - 1; m++) { + for (int m = 0; m < (int)series[0][parameters->ionsfortheoreticalspectraMS2[0]][-1].size() - 1; m++) { coveragebyseries += ""; } coveragebyseries += ""; for (int i = 0; i < (int)series.size(); i++) { - coveragebyseries += ""; - for (int j = 0; j < (int)parameters->ionsfortheoreticalspectra.size(); j++) { + coveragebyseries += ""; + for (int j = 0; j < (int)parameters->ionsfortheoreticalspectraMS2.size(); j++) { for (int k = -1; k < (int)parameters->neutrallossesfortheoreticalspectra.size(); k++) { - tempseries.name = to_string(i + 1) + "_" + parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].name; + tempseries.name = to_string(i + 1) + "_" + parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[j]].name; if (k >= 0) { tempseries.name += "-" + parameters->neutrallossesdefinitions[parameters->neutrallossesfortheoreticalspectra[k]].summary; } tempseries.series.clear(); losstype = (k == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[k]; reportrow = false; - for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectra[j]][losstype].size() - 1; m++) { - if (series[i][parameters->ionsfortheoreticalspectra[j]][losstype][m] > 0) { + for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype].size() - 1; m++) { + if (series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype][m] > 0) { reportrow = true; break; } @@ -2890,18 +3119,18 @@ int cTheoreticalSpectrum::compareBranched(cPeaksList& sortedpeaklist, cBricksDat if (reportrow) { coveragebyseries += ""; } - for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectra[j]][losstype].size() - 1; m++) { + for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype].size() - 1; m++) { if (reportrow) { - coveragebyseries += ""; + coveragebyseries += ""; } - tempseries.series.push_back(series[i][parameters->ionsfortheoreticalspectra[j]][losstype][m]); + tempseries.series.push_back(series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype][m]); } if (reportrow) { coveragebyseries += ""; } } } - coveragebyseries += ""; + coveragebyseries += ""; } coveragebyseries += "
" + to_string(m + 1) + " 
ionsfortheoreticalspectra[0]][-1].size()) + "\">" + to_string(i + 1) + ":
ionsfortheoreticalspectraMS2[0]][-1].size()) + "\">" + to_string(i + 1) + ":
" + tempseries.name + " " + to_string(series[i][parameters->ionsfortheoreticalspectra[j]][losstype][m]) + "" + to_string(series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype][m]) + "
ionsfortheoreticalspectra[0]][-1].size()) + "\"> 
ionsfortheoreticalspectraMS2[0]][-1].size()) + "\"> 
"; }*/ @@ -2945,18 +3174,18 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab brick.setComposition(candidate.getComposition(), false); brick.explodeToIntComposition(intcomposition); - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { losstype = (j == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[j]; - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].nterminal) { - generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder); + if (parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].nterminal) { + generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder); } - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].cterminal) { - generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder); + if (parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].cterminal) { + generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder); } } @@ -2983,15 +3212,15 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab // coverage of series /*map > > series; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { if (j >= 0) { - series[parameters->ionsfortheoreticalspectra[i]][parameters->neutrallossesfortheoreticalspectra[j]].resize(intcomposition.size()); + series[parameters->ionsfortheoreticalspectraMS2[i]][parameters->neutrallossesfortheoreticalspectra[j]].resize(intcomposition.size()); } else { - series[parameters->ionsfortheoreticalspectra[i]][-1].resize(intcomposition.size()); + series[parameters->ionsfortheoreticalspectraMS2[i]][-1].resize(intcomposition.size()); } } @@ -3009,7 +3238,7 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab // peak hits without parents are removed /*if (parameters->clearhitswithoutparent) { - clearFalseHits(series, parameters->ionsfortheoreticalspectra, parameters->neutrallossesfortheoreticalspectra); + clearFalseHits(series, parameters->ionsfortheoreticalspectraMS2, parameters->neutrallossesfortheoreticalspectra); for (int i = 0; i < theoreticalpeaksrealsize; i++) { if (!theoreticalpeaks[i].isotope && (theoreticalpeaks[i].matched > 0) && (theoreticalpeaks[i].rotationid != -1) @@ -3046,24 +3275,24 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab /*matchedSeries tempseries; bool reportrow; - if (parameters->ionsfortheoreticalspectra.size() > 0) { + if (parameters->ionsfortheoreticalspectraMS2.size() > 0) { coveragebyseries = "Series of matched peaks:"; coveragebyseries += ""; - for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectra[0]][-1].size() - 1; k++) { + for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectraMS2[0]][-1].size() - 1; k++) { coveragebyseries += ""; } coveragebyseries += ""; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { - tempseries.name = parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].name; + tempseries.name = parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].name; if (j >= 0) { tempseries.name += "-" + parameters->neutrallossesdefinitions[parameters->neutrallossesfortheoreticalspectra[j]].summary; } tempseries.series.clear(); losstype = (j == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[j]; reportrow = false; - for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectra[i]][losstype].size() - 1; k++) { - if (series[parameters->ionsfortheoreticalspectra[i]][losstype][k] > 0) { + for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectraMS2[i]][losstype].size() - 1; k++) { + if (series[parameters->ionsfortheoreticalspectraMS2[i]][losstype][k] > 0) { reportrow = true; break; } @@ -3071,11 +3300,11 @@ int cTheoreticalSpectrum::compareLinear(cPeaksList& sortedpeaklist, cBricksDatab if (reportrow) { coveragebyseries += ""; } - for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectra[i]][losstype].size() - 1; k++) { + for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectraMS2[i]][losstype].size() - 1; k++) { if (reportrow) { - coveragebyseries += ""; + coveragebyseries += ""; } - tempseries.series.push_back(series[parameters->ionsfortheoreticalspectra[i]][losstype][k]); + tempseries.series.push_back(series[parameters->ionsfortheoreticalspectraMS2[i]][losstype][k]); } if (reportrow) { coveragebyseries += ""; @@ -3182,13 +3411,13 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab eResidueLossType leftresiduelosstype = bricksdatabasewithcombinations[intcomposition[0] - 1].getResidueLossType(); bool hasfirstblockartificial = bricksdatabasewithcombinations[intcomposition[0] - 1].isArtificial(); - for (int j = 0; j < (int)parameters->ionsfortheoreticalspectra.size(); j++) { + for (int j = 0; j < (int)parameters->ionsfortheoreticalspectraMS2.size(); j++) { for (int k = -1; k < (int)parameters->neutrallossesfortheoreticalspectra.size(); k++) { losstype = (k == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[k]; - generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectra[j], losstype, bricksdatabasewithcombinations, writedescription, i, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, 0, leftresiduelosstype, hasfirstblockartificial); + generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectraMS2[j], losstype, bricksdatabasewithcombinations, writedescription, i, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, 0, leftresiduelosstype, hasfirstblockartificial); } @@ -3223,15 +3452,15 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab series.resize(rotations.size()); for (int i = 0; i < (int)series.size(); i++) { - for (int j = 0; j < (int)parameters->ionsfortheoreticalspectra.size(); j++) { + for (int j = 0; j < (int)parameters->ionsfortheoreticalspectraMS2.size(); j++) { for (int k = -1; k < (int)parameters->neutrallossesfortheoreticalspectra.size(); k++) { if (k >= 0) { - series[i][parameters->ionsfortheoreticalspectra[j]][parameters->neutrallossesfortheoreticalspectra[k]].resize(r); + series[i][parameters->ionsfortheoreticalspectraMS2[j]][parameters->neutrallossesfortheoreticalspectra[k]].resize(r); } else { - series[i][parameters->ionsfortheoreticalspectra[j]][-1].resize(r); + series[i][parameters->ionsfortheoreticalspectraMS2[j]][-1].resize(r); } } @@ -3252,7 +3481,7 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab // peak hits without parents are removed /*if (parameters->clearhitswithoutparent) { for (int i = 0; i < (int)rotations.size(); i++) { - clearFalseHits(series[i], parameters->ionsfortheoreticalspectra, parameters->neutrallossesfortheoreticalspectra); + clearFalseHits(series[i], parameters->ionsfortheoreticalspectraMS2, parameters->neutrallossesfortheoreticalspectra); } for (int i = 0; i < theoreticalpeaksrealsize; i++) { @@ -3270,7 +3499,7 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab if (parameters->enablescrambling) { int res; bool matchesscrambled; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { // parents at j == -1 are skipped for (int j = 0; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { @@ -3278,7 +3507,7 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab int k = 0; while (k < theoreticalpeaksrealsize) { // current peak is scrambled, matched, tested ion type matches the ion type and tested neutral loss type matches the loss type of the scrambled peak - if (theoreticalpeaks[k].scrambled && (theoreticalpeaks[k].matched > 0) && (parameters->ionsfortheoreticalspectra[i] == theoreticalpeaks[k].iontype) && (parameters->neutrallossesfortheoreticalspectra[j] == theoreticalpeaks[k].neutrallosstype)) { + if (theoreticalpeaks[k].scrambled && (theoreticalpeaks[k].matched > 0) && (parameters->ionsfortheoreticalspectraMS2[i] == theoreticalpeaks[k].iontype) && (parameters->neutrallossesfortheoreticalspectra[j] == theoreticalpeaks[k].neutrallosstype)) { // parent not found res = experimentalpeaks.find(theoreticalpeaks[k].mzratio - parameters->neutrallossesdefinitions[theoreticalpeaks[k].neutrallosstype].massdifference, parameters->fragmentmasserrortolerance); @@ -3359,26 +3588,26 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab /*matchedSeries tempseries; bool reportrow; - if (parameters->ionsfortheoreticalspectra.size() > 0) { + if (parameters->ionsfortheoreticalspectraMS2.size() > 0) { coveragebyseries += "Series of matched peaks:"; coveragebyseries += "
" + to_string(k + 1) + " 
" + tempseries.name + " " + to_string(series[parameters->ionsfortheoreticalspectra[i]][losstype][k]) + "" + to_string(series[parameters->ionsfortheoreticalspectraMS2[i]][losstype][k]) + "
"; - for (int m = 0; m < (int)series[0][parameters->ionsfortheoreticalspectra[0]][-1].size() - 1; m++) { + for (int m = 0; m < (int)series[0][parameters->ionsfortheoreticalspectraMS2[0]][-1].size() - 1; m++) { coveragebyseries += ""; } coveragebyseries += ""; for (int i = 0; i < (int)series.size(); i++) { - coveragebyseries += ""; - for (int j = 0; j < (int)parameters->ionsfortheoreticalspectra.size(); j++) { + coveragebyseries += ""; + for (int j = 0; j < (int)parameters->ionsfortheoreticalspectraMS2.size(); j++) { for (int k = -1; k < (int)parameters->neutrallossesfortheoreticalspectra.size(); k++) { - tempseries.name = to_string(splittingsites[i].first + 1) + "-" + to_string(splittingsites[i].second + 1) + "_" + parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].name; + tempseries.name = to_string(splittingsites[i].first + 1) + "-" + to_string(splittingsites[i].second + 1) + "_" + parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[j]].name; if (k >= 0) { tempseries.name += "-" + parameters->neutrallossesdefinitions[parameters->neutrallossesfortheoreticalspectra[k]].summary; } tempseries.series.clear(); losstype = (k == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[k]; reportrow = false; - for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectra[j]][losstype].size() - 1; m++) { - if (series[i][parameters->ionsfortheoreticalspectra[j]][losstype][m] > 0) { + for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype].size() - 1; m++) { + if (series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype][m] > 0) { reportrow = true; break; } @@ -3386,18 +3615,18 @@ int cTheoreticalSpectrum::compareCyclic(cPeaksList& sortedpeaklist, cBricksDatab if (reportrow) { coveragebyseries += ""; } - for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectra[j]][losstype].size() - 1; m++) { + for (int m = 0; m < (int)series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype].size() - 1; m++) { if (reportrow) { - coveragebyseries += ""; + coveragebyseries += ""; } - tempseries.series.push_back(series[i][parameters->ionsfortheoreticalspectra[j]][losstype][m]); + tempseries.series.push_back(series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype][m]); } if (reportrow) { coveragebyseries += ""; } } } - coveragebyseries += ""; + coveragebyseries += ""; } coveragebyseries += "
" + to_string(m + 1) + " 
ionsfortheoreticalspectra[0]][-1].size()) + "\">" + to_string(splittingsites[i].first + 1) + "-" + to_string(splittingsites[i].second + 1) + ":
ionsfortheoreticalspectraMS2[0]][-1].size()) + "\">" + to_string(splittingsites[i].first + 1) + "-" + to_string(splittingsites[i].second + 1) + ":
" + tempseries.name + " " + to_string(series[i][parameters->ionsfortheoreticalspectra[j]][losstype][m]) + "" + to_string(series[i][parameters->ionsfortheoreticalspectraMS2[j]][losstype][m]) + "
ionsfortheoreticalspectra[0]][-1].size()) + "\"> 
ionsfortheoreticalspectraMS2[0]][-1].size()) + "\"> 
"; }*/ @@ -3510,7 +3739,7 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick experimentalpeaks = sortedpeaklist; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { @@ -3523,18 +3752,18 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick // we do not know whether the middle branch is n-terminal or c-terminal for an unmodified middle branch // in this case the modifID is 0, and both n-terminal (*) and c-terminal (**) fragments are generated - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].nterminal) { + if (parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].nterminal) { // if the start modification for n == 1 or n == 4 is nterminal, generate n-terminal ions (*) if (!(((n == 1) || (n == 4)) && (!parameters->searchedmodifications[trotationsofbranchcyclicrotations[m][n].startmodifID].nterminal))) { - generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotationsofbranchcyclicrotations[m][n].bricks, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, m, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotationsofbranchcyclicrotations[m][n]); + generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotationsofbranchcyclicrotations[m][n].bricks, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, m, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotationsofbranchcyclicrotations[m][n]); } } // all permmutations except 3 and 5 have invalid c-terms - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].cterminal && ((n == 3) || (n == 5) /*|| ((n == 0) && (trotationsofbranchcyclicrotations[m][n].endsWithBracket())) || ((n == 2) && (trotationsofbranchcyclicrotations[m][n].startsWithBracket()))*/)) { + if (parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].cterminal && ((n == 3) || (n == 5) /*|| ((n == 0) && (trotationsofbranchcyclicrotations[m][n].endsWithBracket())) || ((n == 2) && (trotationsofbranchcyclicrotations[m][n].startsWithBracket()))*/)) { // if the end modification is cterminal, generate c-terminal ions (**) if (parameters->searchedmodifications[trotationsofbranchcyclicrotations[m][n].endmodifID].cterminal) { - generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotationsofbranchcyclicrotations[m][n].bricks, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, m, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotationsofbranchcyclicrotations[m][n]); + generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, trotationsofbranchcyclicrotations[m][n].bricks, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, m, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, &trotationsofbranchcyclicrotations[m][n]); } } @@ -3573,15 +3802,15 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick for (int j = 0; j < (int)series[i].size(); j++) { - for (int k = 0; k < (int)parameters->ionsfortheoreticalspectra.size(); k++) { + for (int k = 0; k < (int)parameters->ionsfortheoreticalspectraMS2.size(); k++) { for (int m = -1; m < (int)parameters->neutrallossesfortheoreticalspectra.size(); m++) { if (m >= 0) { - series[i][j][parameters->ionsfortheoreticalspectra[k]][parameters->neutrallossesfortheoreticalspectra[m]].resize(trotationsofbranchcyclicrotations[i][0].bricks.size()); + series[i][j][parameters->ionsfortheoreticalspectraMS2[k]][parameters->neutrallossesfortheoreticalspectra[m]].resize(trotationsofbranchcyclicrotations[i][0].bricks.size()); } else { - series[i][j][parameters->ionsfortheoreticalspectra[k]][-1].resize(trotationsofbranchcyclicrotations[i][0].bricks.size()); + series[i][j][parameters->ionsfortheoreticalspectraMS2[k]][-1].resize(trotationsofbranchcyclicrotations[i][0].bricks.size()); } } @@ -3606,7 +3835,7 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick /*if (parameters->clearhitswithoutparent) { for (int i = 0; i < (int)branchcyclicrotations.size(); i++) { for (int j = 0; j < (int)trotationsofbranchcyclicrotations[i].size(); j++) { - clearFalseHits(series[i][j], parameters->ionsfortheoreticalspectra, parameters->neutrallossesfortheoreticalspectra); + clearFalseHits(series[i][j], parameters->ionsfortheoreticalspectraMS2, parameters->neutrallossesfortheoreticalspectra); } for (int j = 0; j < theoreticalpeaksrealsize; j++) { @@ -3661,28 +3890,28 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick /*matchedSeries tempseries; bool reportrow; - if (parameters->ionsfortheoreticalspectra.size() > 0) { + if (parameters->ionsfortheoreticalspectraMS2.size() > 0) { coveragebyseries += "Series of matched peaks:"; coveragebyseries += ""; - for (int n = 0; n < (int)series[0][0][parameters->ionsfortheoreticalspectra[0]][-1].size() - 1; n++) { + for (int n = 0; n < (int)series[0][0][parameters->ionsfortheoreticalspectraMS2[0]][-1].size() - 1; n++) { coveragebyseries += ""; } coveragebyseries += ""; for (int i = 0; i < (int)branchcyclicrotations.size(); i++) { for (int j = 0; j < (int)series[i].size(); j++) { - coveragebyseries += ""; - for (int k = 0; k < (int)parameters->ionsfortheoreticalspectra.size(); k++) { + coveragebyseries += ""; + for (int k = 0; k < (int)parameters->ionsfortheoreticalspectraMS2.size(); k++) { for (int m = -1; m < (int)parameters->neutrallossesfortheoreticalspectra.size(); m++) { tempseries.name = to_string(splittingsites[i].first + 1) + "-" + to_string(splittingsites[i].second + 1) + "_"; - tempseries.name += to_string(j + 1) + "_" + parameters->iondefinitions[parameters->ionsfortheoreticalspectra[k]].name; + tempseries.name += to_string(j + 1) + "_" + parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[k]].name; if (m >= 0) { tempseries.name += "-" + parameters->neutrallossesdefinitions[parameters->neutrallossesfortheoreticalspectra[m]].summary; } tempseries.series.clear(); losstype = (m == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[m]; reportrow = false; - for (int n = 0; n < (int)series[i][j][parameters->ionsfortheoreticalspectra[k]][losstype].size() - 1; n++) { - if (series[i][j][parameters->ionsfortheoreticalspectra[k]][losstype][n] > 0) { + for (int n = 0; n < (int)series[i][j][parameters->ionsfortheoreticalspectraMS2[k]][losstype].size() - 1; n++) { + if (series[i][j][parameters->ionsfortheoreticalspectraMS2[k]][losstype][n] > 0) { reportrow = true; break; } @@ -3690,18 +3919,18 @@ int cTheoreticalSpectrum::compareBranchCyclic(cPeaksList& sortedpeaklist, cBrick if (reportrow) { coveragebyseries += ""; } - for (int n = 0; n < (int)series[i][j][parameters->ionsfortheoreticalspectra[k]][losstype].size() - 1; n++) { + for (int n = 0; n < (int)series[i][j][parameters->ionsfortheoreticalspectraMS2[k]][losstype].size() - 1; n++) { if (reportrow) { - coveragebyseries += ""; + coveragebyseries += ""; } - tempseries.series.push_back(series[i][j][parameters->ionsfortheoreticalspectra[k]][losstype][n]); + tempseries.series.push_back(series[i][j][parameters->ionsfortheoreticalspectraMS2[k]][losstype][n]); } if (reportrow) { coveragebyseries += ""; } } } - coveragebyseries += ""; + coveragebyseries += ""; } } coveragebyseries += "
" + to_string(n + 1) + " 
ionsfortheoreticalspectra[0]][-1].size()) + "\">" + to_string(splittingsites[i].first + 1) + "-" + to_string(splittingsites[i].second + 1) + "_" + to_string(j + 1) + ":
ionsfortheoreticalspectraMS2[0]][-1].size()) + "\">" + to_string(splittingsites[i].first + 1) + "-" + to_string(splittingsites[i].second + 1) + "_" + to_string(j + 1) + ":
" + tempseries.name + " " + to_string(series[i][j][parameters->ionsfortheoreticalspectra[k]][losstype][n]) + "" + to_string(series[i][j][parameters->ionsfortheoreticalspectraMS2[k]][losstype][n]) + "
ionsfortheoreticalspectra[0]][-1].size()) + "\"> 
ionsfortheoreticalspectraMS2[0]][-1].size()) + "\"> 
"; @@ -3769,25 +3998,25 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB experimentalpeaks = sortedpeaklist; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { losstype = (j == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[j]; if ( - ((hasfirstblockartificial || !parameters->regularblocksorder || (leftresiduelosstype == h2_loss)) && ((parameters->ionsfortheoreticalspectra[i] == l1h_ion) || (parameters->ionsfortheoreticalspectra[i] == l2h_ion))) + ((hasfirstblockartificial || !parameters->regularblocksorder || (leftresiduelosstype == h2_loss)) && ((parameters->ionsfortheoreticalspectraMS2[i] == l1h_ion) || (parameters->ionsfortheoreticalspectraMS2[i] == l2h_ion))) || - ((hasfirstblockartificial || !parameters->regularblocksorder || (leftresiduelosstype == h2o_loss)) && ((parameters->ionsfortheoreticalspectra[i] == l1oh_ion) || (parameters->ionsfortheoreticalspectra[i] == l2oh_ion))) + ((hasfirstblockartificial || !parameters->regularblocksorder || (leftresiduelosstype == h2o_loss)) && ((parameters->ionsfortheoreticalspectraMS2[i] == l1oh_ion) || (parameters->ionsfortheoreticalspectraMS2[i] == l2oh_ion))) ) { - generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, 0, leftresiduelosstype, hasfirstblockartificial); + generateNTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, 0, leftresiduelosstype, hasfirstblockartificial); } if ( - ((haslastblockartificial || !parameters->regularblocksorder || (rightresiduelosstype == h2_loss)) && ((parameters->ionsfortheoreticalspectra[i] == r1h_ion) || (parameters->ionsfortheoreticalspectra[i] == r2h_ion))) + ((haslastblockartificial || !parameters->regularblocksorder || (rightresiduelosstype == h2_loss)) && ((parameters->ionsfortheoreticalspectraMS2[i] == r1h_ion) || (parameters->ionsfortheoreticalspectraMS2[i] == r2h_ion))) || - ((haslastblockartificial || !parameters->regularblocksorder || (rightresiduelosstype == h2o_loss)) && ((parameters->ionsfortheoreticalspectra[i] == r1oh_ion) || (parameters->ionsfortheoreticalspectra[i] == r2oh_ion))) + ((haslastblockartificial || !parameters->regularblocksorder || (rightresiduelosstype == h2o_loss)) && ((parameters->ionsfortheoreticalspectraMS2[i] == r1oh_ion) || (parameters->ionsfortheoreticalspectraMS2[i] == r2oh_ion))) ) { - generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectra[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, 0, rightresiduelosstype, haslastblockartificial); + generateCTerminalFragmentIons(parameters->precursorcharge, theoreticalpeaksrealsize, intcomposition, parameters->ionsfortheoreticalspectraMS2[i], losstype, bricksdatabasewithcombinations, writedescription, 0, splittingsites, parameters->searchedmodifications, parameters->peptidetype, parameters->regularblocksorder, 0, rightresiduelosstype, haslastblockartificial); } } @@ -3814,15 +4043,15 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB // coverage of series /*map > > series; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { if (j >= 0) { - series[parameters->ionsfortheoreticalspectra[i]][parameters->neutrallossesfortheoreticalspectra[j]].resize(intcomposition.size()); + series[parameters->ionsfortheoreticalspectraMS2[i]][parameters->neutrallossesfortheoreticalspectra[j]].resize(intcomposition.size()); } else { - series[parameters->ionsfortheoreticalspectra[i]][-1].resize(intcomposition.size()); + series[parameters->ionsfortheoreticalspectraMS2[i]][-1].resize(intcomposition.size()); } } @@ -3840,7 +4069,7 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB // peak hits without parents are removed /*if (parameters->clearhitswithoutparent) { - clearFalseHits(series, parameters->ionsfortheoreticalspectra, parameters->neutrallossesfortheoreticalspectra); + clearFalseHits(series, parameters->ionsfortheoreticalspectraMS2, parameters->neutrallossesfortheoreticalspectra); for (int i = 0; i < theoreticalpeaksrealsize; i++) { if (!theoreticalpeaks[i].isotope && (theoreticalpeaks[i].matched > 0) && (theoreticalpeaks[i].rotationid != -1) @@ -3877,24 +4106,24 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB /*matchedSeries tempseries; bool reportrow; - if (parameters->ionsfortheoreticalspectra.size() > 0) { + if (parameters->ionsfortheoreticalspectraMS2.size() > 0) { coveragebyseries = "Series of matched peaks:"; coveragebyseries += ""; - for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectra[0]][-1].size() - 1; k++) { + for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectraMS2[0]][-1].size() - 1; k++) { coveragebyseries += ""; } coveragebyseries += ""; - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters->neutrallossesfortheoreticalspectra.size(); j++) { - tempseries.name = parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].name; + tempseries.name = parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].name; if (j >= 0) { tempseries.name += "-" + parameters->neutrallossesdefinitions[parameters->neutrallossesfortheoreticalspectra[j]].summary; } tempseries.series.clear(); losstype = (j == -1) ? -1 : parameters->neutrallossesfortheoreticalspectra[j]; reportrow = false; - for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectra[i]][losstype].size() - 1; k++) { - if (series[parameters->ionsfortheoreticalspectra[i]][losstype][k] > 0) { + for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectraMS2[i]][losstype].size() - 1; k++) { + if (series[parameters->ionsfortheoreticalspectraMS2[i]][losstype][k] > 0) { reportrow = true; break; } @@ -3902,11 +4131,11 @@ int cTheoreticalSpectrum::compareLinearPolyketide(cPeaksList& sortedpeaklist, cB if (reportrow) { coveragebyseries += ""; } - for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectra[i]][losstype].size() - 1; k++) { + for (int k = 0; k < (int)series[parameters->ionsfortheoreticalspectraMS2[i]][losstype].size() - 1; k++) { if (reportrow) { - coveragebyseries += ""; + coveragebyseries += ""; } - tempseries.series.push_back(series[parameters->ionsfortheoreticalspectra[i]][losstype][k]); + tempseries.series.push_back(series[parameters->ionsfortheoreticalspectraMS2[i]][losstype][k]); } if (reportrow) { coveragebyseries += ""; @@ -3990,10 +4219,10 @@ void cTheoreticalSpectrum::generateMSSpectrum(bool& terminatecomputation, bool w string metalname; vector< vector > metals; - metals.resize(parameters->ionsfortheoreticalspectra.size()); + metals.resize(parameters->ionsfortheoreticalspectraMS1.size()); - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { - metalname = parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].name; + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS1.size(); i++) { + metalname = parameters->ionsfortheoreticalspectraMS1[i].name; for (int j = 0; j < (int)periodictablemap.getAdductElements().size(); j++) { rx = periodictablemap.getAdductElements()[j] + "[^a-z]"; if (regex_search(metalname, rx)) { @@ -4018,18 +4247,18 @@ void cTheoreticalSpectrum::generateMSSpectrum(bool& terminatecomputation, bool w formula.clear(); formula.setFormula(parameters->sequencedatabase[i].getSummaryFormula()); - for (int j = 0; j < (int)parameters->ionsfortheoreticalspectra.size(); j++) { + for (int j = 0; j < (int)parameters->ionsfortheoreticalspectraMS1.size(); j++) { for (int k = -1; k < (int)parameters->neutrallossesfortheoreticalspectra.size(); k++) { for (int m = 0; m < abs(parameters->precursorcharge); m++) { - peak.iontype = parameters->ionsfortheoreticalspectra[j]; + //peak.iontype = parameters->ionsfortheoreticalspectra[j]; // unused peak.neutrallosstype = (k >= 0) ? parameters->neutrallossesfortheoreticalspectra[k] : -1; peak.charge = (parameters->precursorcharge > 0) ? m + 1 : -(m + 1); - peak.mzratio = (double)parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].multiplier*formula.getMass() + parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].massdifference; - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].positive) { + peak.mzratio = (double)parameters->ionsfortheoreticalspectraMS1[j].multiplier*formula.getMass() + parameters->ionsfortheoreticalspectraMS1[j].massdifference; + if (parameters->ionsfortheoreticalspectraMS1[j].positive) { peak.mzratio += (double)m*(H - e); } else { @@ -4041,9 +4270,9 @@ void cTheoreticalSpectrum::generateMSSpectrum(bool& terminatecomputation, bool w peak.mzratio = peak.mzratio / (double)(m + 1); if (writedescription) { - peak.description = parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].name.substr(0, parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].name.size() - 1) + " "; + peak.description = parameters->ionsfortheoreticalspectraMS1[j].name.substr(0, parameters->ionsfortheoreticalspectraMS1[j].name.size() - 1) + " "; peak.description += to_string(m + 1); - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].positive) { + if (parameters->ionsfortheoreticalspectraMS1[j].positive) { peak.description += "+"; } else { @@ -4109,17 +4338,17 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { formula.clear(); formula.setFormula(parameters->sequencedatabase[i].getSummaryFormula()); - for (int j = 0; j < (int)parameters->ionsfortheoreticalspectra.size(); j++) { + for (int j = 0; j < (int)parameters->ionsfortheoreticalspectraMS1.size(); j++) { for (int k = -1; k < (int)parameters->neutrallossesfortheoreticalspectra.size(); k++) { cSummaryFormula ionformula; - for (int m = 0; m < (double)parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].multiplier; m++) { + for (int m = 0; m < (double)parameters->ionsfortheoreticalspectraMS1[j].multiplier; m++) { tmp = formula.getSummary(); ionformula.addFormula(tmp); } - ionformula.addFormula(parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].summary); + ionformula.addFormula(parameters->ionsfortheoreticalspectraMS1[j].formula); if (k >= 0) { ionformula.addFormula(parameters->neutrallossesdefinitions[parameters->neutrallossesfortheoreticalspectra[k]].summary, true); @@ -4130,7 +4359,7 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { cSummaryFormula chargedformula; chargedformula = ionformula; - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].positive) { + if (parameters->ionsfortheoreticalspectraMS1[j].positive) { for (int p = 0; p < n; p++) { chargedformula.addFormula(proton); } @@ -4141,9 +4370,9 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { } } - description = parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].name.substr(0, parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].name.size() - 1) + " "; + description = parameters->ionsfortheoreticalspectraMS1[j].name.substr(0, parameters->ionsfortheoreticalspectraMS1[j].name.size() - 1) + " "; description += to_string(n + 1); - if (parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].positive) { + if (parameters->ionsfortheoreticalspectraMS1[j].positive) { description += "+"; } else { @@ -4154,10 +4383,10 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { } description += " " + parameters->sequencedatabase[i].getNameWithReferenceAsHTMLString() + " ("; - cPeaksList isotopepattern = chargedformula.getIsotopePattern(parameters->fwhm, n + 1, parameters->iondefinitions[parameters->ionsfortheoreticalspectra[j]].positive, true); + cPeaksList isotopepattern = chargedformula.getIsotopePattern(parameters->fwhm, n + 1, parameters->ionsfortheoreticalspectraMS1[j].positive, true); for (int p = 0; p < isotopepattern.size(); p++) { isotopepattern[p].description = description + isotopepattern[p].description + "): "; - isotopepattern[p].iontype = parameters->ionsfortheoreticalspectra[j]; + //isotopepattern[p].iontype = parameters->ionsfortheoreticalspectra[j]; // unused isotopepattern[p].neutrallosstype = (k >= 0) ? parameters->neutrallossesfortheoreticalspectra[k] : -1; isotopepattern[p].charge = (parameters->precursorcharge > 0) ? n + 1 : -(n + 1); isotopepattern[p].groupid = groupid; @@ -4447,7 +4676,12 @@ double cTheoreticalSpectrum::getRatioOfMatchedPeaks() { } -void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation, eResidueLossType leftresiduelosstype, bool hasfirstblockartificial) { +double cTheoreticalSpectrum::getWeightedRatioOfMatchedPeaks() const { + return weightedpeaksratio; +} + + +void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation, eResidueLossType leftresiduelosstype, bool hasfirstblockartificial) { cPeak peak; map atoms; @@ -4731,7 +4965,7 @@ void cTheoreticalSpectrum::generateNTerminalFragmentIons(int maxcharge, int& pea } -void cTheoreticalSpectrum::generateCTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation, eResidueLossType rightresiduelosstype, bool haslastblockartificial) { +void cTheoreticalSpectrum::generateCTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation, eResidueLossType rightresiduelosstype, bool haslastblockartificial) { cPeak peak; map atoms; @@ -5323,6 +5557,7 @@ void cTheoreticalSpectrum::store(ofstream& os) { os.write((char *)&peakstested, sizeof(int)); os.write((char *)&experimentalpeaksmatchedratio, sizeof(double)); + os.write((char *)&weightedpeaksratio, sizeof(double)); os.write((char *)&unmatchedexperimentalpeakscount, sizeof(int)); storeString(coveragebyseries, os); @@ -5405,6 +5640,7 @@ void cTheoreticalSpectrum::load(ifstream& is) { is.read((char *)&peakstested, sizeof(int)); is.read((char *)&experimentalpeaksmatchedratio, sizeof(double)); + is.read((char *)&weightedpeaksratio, sizeof(double)); is.read((char *)&unmatchedexperimentalpeakscount, sizeof(int)); loadString(coveragebyseries, is); diff --git a/CycloBranch/core/cTheoreticalSpectrum.h b/CycloBranch/core/cTheoreticalSpectrum.h index 05e775b..4bd2656 100644 --- a/CycloBranch/core/cTheoreticalSpectrum.h +++ b/CycloBranch/core/cTheoreticalSpectrum.h @@ -115,6 +115,7 @@ class cTheoreticalSpectrum { map > matchedions; int peakstested; double experimentalpeaksmatchedratio; + double weightedpeaksratio; int unmatchedexperimentalpeakscount; string coveragebyseries; bool valid; @@ -221,6 +222,13 @@ class cTheoreticalSpectrum { // fill annotations of experimental peaks and remove unmatched theoretical peaks void fillExperimentalAnnotationsAndRemoveUnmatchedTheoreticalPeaks(int& theoreticalpeaksrealsize, ePeptideType peptidetype, cPeaksList& unmatchedpeaksinmatchedpatterns, bool reportunmatchedtheoreticalpeaks, bool writedescription); + // check the existence of an isotope + bool checkIsotope(string& elementstring, string& isotopestring, double isotopemass1, double isotopemass2, double intensityratio, cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, int start, int stop, int maximumintensityid, double maximumexperimentalintensity); + + // get intensity multiplier + double getIntensityMultiplier(cPeaksList& theoreticalpeaks, int peakid, string& elementstring, size_t startpos); + + public: @@ -455,6 +463,13 @@ class cTheoreticalSpectrum { double getRatioOfMatchedPeaks(); + /** + \brief Get weighted ratio of matched peaks. + \retval double weighted ratio of matched peaks + */ + double getWeightedRatioOfMatchedPeaks() const; + + /** \brief Generate a N-terminal fragment ion series. \param maxcharge a charge of precursor ion @@ -473,7 +488,7 @@ class cTheoreticalSpectrum { \param leftresiduelosstype a residue type of the leftmost building block \param hasfirstblockartificial true when the first block is artificial, false otherwise */ - void generateNTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation = 0, eResidueLossType leftresiduelosstype = h2o_loss, bool hasfirstblockartificial = false); + void generateNTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation = 0, eResidueLossType leftresiduelosstype = h2o_loss, bool hasfirstblockartificial = false); /** @@ -494,7 +509,7 @@ class cTheoreticalSpectrum { \param rightresiduelosstype a residue type of the rightmost building block \param haslastblockartificial true when the last block is artificial, false otherwise */ - void generateCTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation = 0, eResidueLossType rightresiduelosstype = h2o_loss, bool haslastblockartificial = false); + void generateCTerminalFragmentIons(int maxcharge, int& peaklistrealsize, vector& intcomposition, eFragmentIonType fragmentiontype, int neutrallosstype, cBricksDatabase& bricksdatabase, bool writedescription, int rotationid, vector& splittingsites, vector& searchedmodifications, ePeptideType peptidetype, bool regularblocksorder, TRotationInfo* trotation = 0, eResidueLossType rightresiduelosstype = h2o_loss, bool haslastblockartificial = false); /** diff --git a/CycloBranch/core/cTheoreticalSpectrumList.cpp b/CycloBranch/core/cTheoreticalSpectrumList.cpp index 13ffe8b..72ea477 100644 --- a/CycloBranch/core/cTheoreticalSpectrumList.cpp +++ b/CycloBranch/core/cTheoreticalSpectrumList.cpp @@ -400,6 +400,9 @@ double cTheoreticalSpectrumList::updatekNNList(cTheoreticalSpectrum& theoretical case number_of_b_and_y_ions: comparatorfunction = &compareYBandAllIonsDesc; break; + case weighted_ratio_of_matched_peaks: + comparatorfunction = &compareWeightedRatioDesc; + break; default: break; } @@ -427,6 +430,9 @@ double cTheoreticalSpectrumList::updatekNNList(cTheoreticalSpectrum& theoretical case number_of_b_and_y_ions: currentscore = it1->getNumberOfMatchedPeaksYB(); break; + case weighted_ratio_of_matched_peaks: + currentscore = it1->getWeightedRatioOfMatchedPeaks(); + break; default: break; } @@ -462,6 +468,9 @@ double cTheoreticalSpectrumList::updatekNNList(cTheoreticalSpectrum& theoretical case number_of_b_and_y_ions: currentworstscore = prev(spectrumbuffer.end())->getNumberOfMatchedPeaksYB(); break; + case weighted_ratio_of_matched_peaks: + currentworstscore = prev(spectrumbuffer.end())->getWeightedRatioOfMatchedPeaks(); + break; default: break; } @@ -489,6 +498,9 @@ void cTheoreticalSpectrumList::sortAndFitSize() { case number_of_b_and_y_ions: sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYBandAllIonsDesc); break; + case weighted_ratio_of_matched_peaks: + sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareWeightedRatioDesc); + break; default: break; } diff --git a/CycloBranch/core/utilities.cpp b/CycloBranch/core/utilities.cpp index 523efc3..26a0f73 100644 --- a/CycloBranch/core/utilities.cpp +++ b/CycloBranch/core/utilities.cpp @@ -4,7 +4,7 @@ QString appname = "CycloBranch"; -QString appversion = "v. 2.0.0 (64-bit)"; +QString appversion = "v. 2.0.8 (64-bit)"; #if OS_TYPE == UNX @@ -374,11 +374,6 @@ QByteArray cropPrecisionToSixDecimalsByteArray(double value) { } -bool operator == (cCoordinates const& a, cCoordinates const& b) { - return ((a.x == b.x) && (a.y == b.y) && (a.id == b.id)); -} - - double fact(int value) { double result = 1; while (value > 1) { diff --git a/CycloBranch/core/utilities.h b/CycloBranch/core/utilities.h index 69c9139..35c97d2 100644 --- a/CycloBranch/core/utilities.h +++ b/CycloBranch/core/utilities.h @@ -341,9 +341,15 @@ QByteArray cropPrecisionToSixDecimalsByteArray(double value); /** - \brief Store coordinates x and y. + \brief Store aggregated information about a coordinate. */ -struct cCoordinates { +struct cCoordinateInfo { + + /** + \brief scan id + */ + int id; + /** \brief x coordinate @@ -357,18 +363,6 @@ struct cCoordinates { int y; - /** - \brief scan id - */ - int id; - - - /** - \brief m/z ratio - */ - double mzratio; - - /** \brief relative intensity */ @@ -382,93 +376,30 @@ struct cCoordinates { /** - \brief name of compound + \brief description */ - string name; + string description; /** \brief The constructor. */ - cCoordinates() { + cCoordinateInfo() { + id = 0; x = 0; y = 0; - id = 0; - mzratio = 0; relativeintensity = 0; absoluteintensity = 0; - name = ""; - } - - - /** - \brief The constructor. - \param x coordinate x - \param y coordinate y - \param id scan id - \param mzratio m/z ratio - \param relativeintensity relativeintensity - \param absoluteintensity absoluteintensity - \param name the name of item - */ - cCoordinates(int x, int y, int id, double mzratio, double relativeintensity, double absoluteintensity, string name = "") { - set(x, y, id, mzratio, relativeintensity, absoluteintensity, name); - } - - - /** - \brief Set the coordinates. - \param x coordinate x - \param y coordinate y - \param id scan id - \param mzratio m/z ratio - \param relativeintensity relativeintensity - \param absoluteintensity absoluteintensity - \param name the name of item - */ - void set(int x, int y, int id, double mzratio, double relativeintensity, double absoluteintensity, string name = "") { - this->x = x; - this->y = y; - this->id = id; - this->mzratio = mzratio; - this->relativeintensity = relativeintensity; - this->absoluteintensity = absoluteintensity; - this->name = name; - } - -}; - - -/** - \brief Register vector by Qt. -*/ -Q_DECLARE_METATYPE(vector); - - -/** - \brief The structure defining a hash function of cCoordinates. -*/ -struct hash_cCoordinates { - - /** - \brief Hash cCoordinates. - \param coordinates cCoordinates - \retval size_t hashed cCoordinates - */ - size_t operator()(const cCoordinates& coordinates) const { - return std::hash()(coordinates.x) ^ std::hash()(coordinates.y) ^ std::hash()(coordinates.id); + description = ""; } }; /** - \brief Overloaded operator ==. - \param a first candidate - \param b second candidate - \retval bool true when cCoordinates are equal + \brief Register vector by Qt. */ -bool operator == (cCoordinates const& a, cCoordinates const& b); +Q_DECLARE_METATYPE(vector); /** diff --git a/CycloBranch/gui/cAboutWidget.cpp b/CycloBranch/gui/cAboutWidget.cpp index 79bb351..9a16f13 100644 --- a/CycloBranch/gui/cAboutWidget.cpp +++ b/CycloBranch/gui/cAboutWidget.cpp @@ -38,7 +38,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 https://www.gnu.org/licenses/.


"; - QString developers = "Developers:

Jiri Novak
Laboratory of Molecular Structure Characterization
Institute of Microbiology
Czech Academy of Sciences
Videnska 1083
142 20 Prague
Czech Republic
jiri.novak@biomed.cas.cz

(C) 2013 - 2019


"; + QString developers = "Developers:

Jiri Novak
Laboratory of Molecular Structure Characterization
Institute of Microbiology
Czech Academy of Sciences
Videnska 1083
142 20 Prague
Czech Republic
jiri.novak@biomed.cas.cz

(C) 2013 - 2020


"; QString splash = "



"; diff --git a/CycloBranch/gui/cBricksDatabaseWidget.cpp b/CycloBranch/gui/cBricksDatabaseWidget.cpp index 3eaf009..af3fa41 100644 --- a/CycloBranch/gui/cBricksDatabaseWidget.cpp +++ b/CycloBranch/gui/cBricksDatabaseWidget.cpp @@ -28,7 +28,8 @@ int numberOfOccurrences(const string& s, char c) { } -cBricksDatabaseWidget::cBricksDatabaseWidget(QWidget* parent) { +cBricksDatabaseWidget::cBricksDatabaseWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { + this->globalpreferences = globalpreferences; this->parent = parent; editorname = "Building Blocks Editor"; @@ -252,11 +253,7 @@ cBricksDatabaseWidget::cBricksDatabaseWidget(QWidget* parent) { databasefile = ""; - #if OS_TYPE == WIN - lastdir = "./BrickDatabases/"; - #else - lastdir = installdir + "BrickDatabases/"; - #endif + applyGlobalPreferences(globalpreferences); bricks.clear(); @@ -314,6 +311,15 @@ void cBricksDatabaseWidget::closeEvent(QCloseEvent *event) { } +void cBricksDatabaseWidget::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if (lastdir.right(4).compare(".txt", Qt::CaseInsensitive) != 0) { + lastdir = globalpreferences->blocksdefaultdir; + } + } +} + + void cBricksDatabaseWidget::deleteTable() { for (int i = 0; i < databasemodel->columnCount(); i++) { if (database->itemDelegateForColumn(i)) { diff --git a/CycloBranch/gui/cBricksDatabaseWidget.h b/CycloBranch/gui/cBricksDatabaseWidget.h index 7108f16..f26598f 100644 --- a/CycloBranch/gui/cBricksDatabaseWidget.h +++ b/CycloBranch/gui/cBricksDatabaseWidget.h @@ -20,6 +20,7 @@ #include #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "core/cBricksDatabase.h" #include "gui/cBricksDatabaseProxyModel.h" #include "gui/cMultipleButtonDelegate.h" @@ -56,9 +57,10 @@ class cBricksDatabaseWidget : public QMainWindow /** \brief The constructor. + \param globalpreferences global preferences of the application \param parent pointer to a parent widget */ - cBricksDatabaseWidget(QWidget* parent = (QWidget *)0); + cBricksDatabaseWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0); /** @@ -74,12 +76,21 @@ class cBricksDatabaseWidget : public QMainWindow void closeEvent(QCloseEvent *event); + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + private: QString editorname; QWidget* parent; + cGlobalPreferences* globalpreferences; + QMenuBar* menuBar; QMenu* menuFile; QMenu* menuEdit; diff --git a/CycloBranch/gui/cChromatogramWindow.cpp b/CycloBranch/gui/cChromatogramWindow.cpp index f151a71..3b59b34 100644 --- a/CycloBranch/gui/cChromatogramWindow.cpp +++ b/CycloBranch/gui/cChromatogramWindow.cpp @@ -2,7 +2,8 @@ #include "gui/cEventFilter.h" -cChromatogramWindow::cChromatogramWindow(cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent) { +cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent) { + this->globalpreferences = globalpreferences; this->theoreticalspectrumlist = &theoreticalspectrumlist; this->parent = parent; @@ -97,6 +98,13 @@ cChromatogramWindow::cChromatogramWindow(cTheoreticalSpectrumList& theoreticalsp toolbarView->addAction(actionHideEIC); connect(actionHideEIC, SIGNAL(toggled(bool)), chromatogramwindowwidget, SLOT(hideEIC(bool))); + actionHideLabels = new QAction(QIcon(":/images/icons/79.png"), tr("Hide &Labels"), this); + actionHideLabels->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L)); + actionHideLabels->setToolTip("Hide Labels (Ctrl + L)"); + actionHideLabels->setCheckable(true); + toolbarView->addAction(actionHideLabels); + connect(actionHideLabels, SIGNAL(toggled(bool)), chromatogramwindowwidget, SLOT(hideLabels(bool))); + toolbarHelp = addToolBar(tr("Help")); @@ -205,6 +213,7 @@ cChromatogramWindow::cChromatogramWindow(cTheoreticalSpectrumList& theoreticalsp menuView->addSeparator(); menuView->addAction(actionHideTIC); menuView->addAction(actionHideEIC); + menuView->addAction(actionHideLabels); menuHelp->addAction(actionHTMLDocumentation); @@ -217,6 +226,8 @@ cChromatogramWindow::cChromatogramWindow(cTheoreticalSpectrumList& theoreticalsp setCentralWidget(chromatogramwindowwidget); centralWidget()->setContentsMargins(0, 0, 0, 0); + applyGlobalPreferences(globalpreferences); + resize(defaultwinsizex, defaultwinsizey); } @@ -252,6 +263,7 @@ cChromatogramWindow::~cChromatogramWindow() { delete actionAbsoluteIntensity; delete actionHideTIC; delete actionHideEIC; + delete actionHideLabels; delete actionHTMLDocumentation; delete menuFile; @@ -273,6 +285,21 @@ void cChromatogramWindow::recalculateTICChromatogram() { } +void cChromatogramWindow::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + #if OS_TYPE == WIN + if ((lastdirexportimage.right(4).compare(".pdf", Qt::CaseInsensitive) != 0) && (lastdirexportimage.right(3).compare(".ps", Qt::CaseInsensitive) != 0) && (lastdirexportimage.right(4).compare(".png", Qt::CaseInsensitive) != 0) && (lastdirexportimage.right(4).compare(".svg", Qt::CaseInsensitive) != 0)) { + lastdirexportimage = globalpreferences->exportimagedefaultdir; + } + #else + if ((lastdirexportimage.right(4).compare(".pdf", Qt::CaseInsensitive) != 0) && (lastdirexportimage.right(4).compare(".png", Qt::CaseInsensitive) != 0) && (lastdirexportimage.right(4).compare(".svg", Qt::CaseInsensitive) != 0)) { + lastdirexportimage = globalpreferences->exportimagedefaultdir; + } + #endif + } +} + + void cChromatogramWindow::keyPressEvent(QKeyEvent *event) { if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { if (minscanid->hasFocus() || maxscanid->hasFocus()) { @@ -288,12 +315,14 @@ void cChromatogramWindow::keyPressEvent(QKeyEvent *event) { void cChromatogramWindow::exportImage() { -#if OS_TYPE == WIN - QString filename = QFileDialog::getSaveFileName(this, tr("Export Image..."), "./", "PDF Files (*.pdf);; PS Files (*.ps);; PNG Files (*.png);; SVG Files (*.svg)"); -#else - QString filename = QFileDialog::getSaveFileName(this, tr("Export Image..."), "./", "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); -#endif + #if OS_TYPE == WIN + QString filename = QFileDialog::getSaveFileName(this, tr("Export Image..."), lastdirexportimage, "PDF Files (*.pdf);; PS Files (*.ps);; PNG Files (*.png);; SVG Files (*.svg)"); + #else + QString filename = QFileDialog::getSaveFileName(this, tr("Export Image..."), lastdirexportimage, "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); + #endif if (!filename.isEmpty()) { + lastdirexportimage = filename; + regex rx; bool selected = false; @@ -303,13 +332,13 @@ void cChromatogramWindow::exportImage() { selected = true; } -#if OS_TYPE == WIN + #if OS_TYPE == WIN rx = ".+\\.ps$"; if (!selected && (regex_search(filename.toStdString(), rx))) { chromatogramwindowwidget->exportToPDF(filename, true); selected = true; } -#endif + #endif rx = ".+\\.png$"; if (!selected && (regex_search(filename.toStdString(), rx))) { diff --git a/CycloBranch/gui/cChromatogramWindow.h b/CycloBranch/gui/cChromatogramWindow.h index 2d3018c..e58e78c 100644 --- a/CycloBranch/gui/cChromatogramWindow.h +++ b/CycloBranch/gui/cChromatogramWindow.h @@ -19,6 +19,7 @@ #include #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "gui/cChromatogramWindowWidget.h" @@ -34,10 +35,11 @@ class cChromatogramWindow : public QMainWindow /** \brief The constructor. + \param globalpreferences global preferences of the application \param theoreticalspectrumlist list of spectra \param parent pointer to a parent widget */ - cChromatogramWindow(cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent = (QWidget *)0); + cChromatogramWindow(cGlobalPreferences* globalpreferences, cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent = (QWidget *)0); /** @@ -59,10 +61,18 @@ class cChromatogramWindow : public QMainWindow void recalculateTICChromatogram(); + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + private: - QWidget* parent; + cGlobalPreferences* globalpreferences; cTheoreticalSpectrumList* theoreticalspectrumlist; + QWidget* parent; QMenuBar* menuBar; QMenu* menuFile; @@ -82,6 +92,7 @@ class cChromatogramWindow : public QMainWindow QAction* actionAbsoluteIntensity; QAction* actionHideTIC; QAction* actionHideEIC; + QAction* actionHideLabels; QToolBar* toolbarTime; @@ -108,6 +119,8 @@ class cChromatogramWindow : public QMainWindow cChromatogramWindowWidget* chromatogramwindowwidget; + QString lastdirexportimage; + protected: diff --git a/CycloBranch/gui/cChromatogramWindowWidget.cpp b/CycloBranch/gui/cChromatogramWindowWidget.cpp index 49fc20f..5bebec0 100644 --- a/CycloBranch/gui/cChromatogramWindowWidget.cpp +++ b/CycloBranch/gui/cChromatogramWindowWidget.cpp @@ -33,6 +33,7 @@ cChromatogramWindowWidget::cChromatogramWindowWidget(cTheoreticalSpectrumList& t absoluteintensity = true; hidetic = false; hideeic = false; + hidelabels = false; scene = new QGraphicsScene(this); @@ -78,9 +79,9 @@ void cChromatogramWindowWidget::exportToPDF(QString filename, bool postscript) { if (!painter.begin(&printer)) { QMessageBox msgBox; QString errstr = "The file cannot be created."; -#if OS_TYPE == UNX - errstr += "\nDo you have a properly configured print server (sudo apt-get install cups-pdf) ?"; -#endif + #if OS_TYPE == UNX + errstr += "\nDo you have a properly configured print server (sudo apt-get install cups-pdf) ?"; + #endif msgBox.setText(errstr); msgBox.exec(); return; @@ -389,6 +390,7 @@ int cChromatogramWindowWidget::getXPositionFromScanID(int scanid, int w) { void cChromatogramWindowWidget::redrawScene() { QGraphicsSimpleTextItem* simpletext; + QGraphicsTextItem* text; QGraphicsLineItem* line; qreal tx, ty; int x; @@ -693,20 +695,67 @@ void cChromatogramWindowWidget::redrawScene() { if (printintensity) { + QList hiddenitems; + qreal tx, ty, tw, th, sumh; + + vector hits; + string tmplong; + string tmpshort; + size_t pos; + + hits.clear(); + + if (!hidelabels) { + tmplong = eicchromatogram[i].description.c_str(); + pos = tmplong.find("
"); + while (pos != string::npos) { + tmpshort = tmplong.substr(0, pos - 1); + hits.push_back(tmpshort); + tmplong = tmplong.substr(pos + 5); + pos = tmplong.find("
"); + } + if (tmplong.size() > 0) { + hits.push_back(tmplong); + } + sort(hits.rbegin(), hits.rend()); + } + if (retentiontime) { - simpletext = scene->addSimpleText(QString::number(rtimes[i]) + " ", myFont); + tmpshort = QString::number(rtimes[i]).toStdString(); } else { - simpletext = scene->addSimpleText(QString::number((int)eicchromatogram[i].mzratio) + " ", myFont); + tmpshort = QString::number((int)eicchromatogram[i].mzratio).toStdString(); } - tx = x - 2; - ty = h - bottommargin - std::max((int)y, 2) - simpletext->boundingRect().height() - 1 - 4; - simpletext->setPos(tx, ty); - simpletext->setBrush(Qt::red); - simpletext->setZValue(1); - if (scene->collidingItems(simpletext, Qt::IntersectsItemBoundingRect).size() > 0) { - scene->removeItem(simpletext); + hits.push_back(tmpshort); + + hiddenitems.clear(); + sumh = 0; + for (vector::reverse_iterator rit = hits.rbegin(); rit != hits.rend(); ++rit) { + text = scene->addText(""); + text->setDefaultTextColor(QColor(Qt::red)); + text->setFont(myFont); + text->setTextInteractionFlags(Qt::TextBrowserInteraction); + text->setOpenExternalLinks(true); + text->setHtml(rit->c_str()); + + tw = text->boundingRect().width(); + th = text->boundingRect().height(); + sumh += th + 1; + tx = x - 2 - 4; + ty = h - bottommargin - std::max((int)y, 2) - sumh - 4; + text->setPos(tx, ty); + text->setZValue(2); + + hiddenitems.append(text); + + if (scene->items(tx, ty, tw, th, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder).size() > 1) { + for (int k = 0; k < (int)hiddenitems.size(); k++) { + scene->removeItem(hiddenitems[k]); + } + break; + } + } } @@ -955,3 +1004,9 @@ void cChromatogramWindowWidget::hideEIC(bool state) { redrawScene(); } + +void cChromatogramWindowWidget::hideLabels(bool state) { + hidelabels = state; + redrawScene(); +} + diff --git a/CycloBranch/gui/cChromatogramWindowWidget.h b/CycloBranch/gui/cChromatogramWindowWidget.h index 49b56d1..f735129 100644 --- a/CycloBranch/gui/cChromatogramWindowWidget.h +++ b/CycloBranch/gui/cChromatogramWindowWidget.h @@ -180,6 +180,7 @@ class cChromatogramWindowWidget : public QGraphicsView bool absoluteintensity; bool hidetic; bool hideeic; + bool hidelabels; int getScanIDFromXPosition(int x, int w); @@ -259,6 +260,9 @@ private slots: void hideEIC(bool state); + + + void hideLabels(bool state); }; diff --git a/CycloBranch/gui/cImageWindow.cpp b/CycloBranch/gui/cImageWindow.cpp index 19083bd..1c8281f 100644 --- a/CycloBranch/gui/cImageWindow.cpp +++ b/CycloBranch/gui/cImageWindow.cpp @@ -12,11 +12,12 @@ #include -cImageWindow::cImageWindow(QWidget* parent) { +cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* parent) { + this->globalpreferences = globalpreferences; this->parent = parent; setWindowTitle("CrossVis"); - setWindowIcon(QIcon(":/images/icons/23.png")); + setWindowIcon(QIcon(":/images/icons/image.png")); menuBar = new QMenuBar(this); menuBar->setNativeMenuBar(false); @@ -511,7 +512,7 @@ cImageWindow::cImageWindow(QWidget* parent) { resize(defaultwinsizex, defaultwinsizey); - lastimagedir = "./"; + applyGlobalPreferences(globalpreferences); defaultmaxx = 1; defaultmaxy = 1; @@ -697,6 +698,42 @@ void cImageWindow::addLayer(QString name) { } +void cImageWindow::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if ((lastdiropticalimage.right(4).compare(".jpg", Qt::CaseInsensitive) != 0) && + (lastdiropticalimage.right(5).compare(".jpeg", Qt::CaseInsensitive) != 0) && + (lastdiropticalimage.right(4).compare(".png", Qt::CaseInsensitive) != 0) && + (lastdiropticalimage.right(4).compare(".tif", Qt::CaseInsensitive) != 0) && + (lastdiropticalimage.right(5).compare(".tiff", Qt::CaseInsensitive) != 0) && + (lastdiropticalimage.right(4).compare(".bmp", Qt::CaseInsensitive) != 0) && + (lastdiropticalimage.right(4).compare(".gif", Qt::CaseInsensitive) != 0)) { + lastdiropticalimage = globalpreferences->openopticalimagedir; + } + if ((lastdirhistologyimage.right(4).compare(".jpg", Qt::CaseInsensitive) != 0) && + (lastdirhistologyimage.right(5).compare(".jpeg", Qt::CaseInsensitive) != 0) && + (lastdirhistologyimage.right(4).compare(".png", Qt::CaseInsensitive) != 0) && + (lastdirhistologyimage.right(4).compare(".tif", Qt::CaseInsensitive) != 0) && + (lastdirhistologyimage.right(5).compare(".tiff", Qt::CaseInsensitive) != 0) && + (lastdirhistologyimage.right(4).compare(".bmp", Qt::CaseInsensitive) != 0) && + (lastdirhistologyimage.right(4).compare(".gif", Qt::CaseInsensitive) != 0)) { + lastdirhistologyimage = globalpreferences->openhistologyimagedir; + } + if ((lastdirmicroscopyimage.right(4).compare(".jpg", Qt::CaseInsensitive) != 0) && + (lastdirmicroscopyimage.right(5).compare(".jpeg", Qt::CaseInsensitive) != 0) && + (lastdirmicroscopyimage.right(4).compare(".png", Qt::CaseInsensitive) != 0) && + (lastdirmicroscopyimage.right(4).compare(".tif", Qt::CaseInsensitive) != 0) && + (lastdirmicroscopyimage.right(5).compare(".tiff", Qt::CaseInsensitive) != 0) && + (lastdirmicroscopyimage.right(4).compare(".bmp", Qt::CaseInsensitive) != 0) && + (lastdirmicroscopyimage.right(4).compare(".gif", Qt::CaseInsensitive) != 0)) { + lastdirmicroscopyimage = globalpreferences->openmicroscopyimagedir; + } + if (lastdirexportimage.right(4).compare(".png", Qt::CaseInsensitive) != 0) { + lastdirexportimage = globalpreferences->exportimagedefaultdir; + } + } +} + + void cImageWindow::colorSpinBoxes(int layerid) { if ((eLayerType)layerid == layer_compounds) { @@ -858,10 +895,10 @@ void cImageWindow::imageTypeSelected(const QString &s) { void cImageWindow::openOpticalImage() { - QString filename = QFileDialog::getOpenFileName(this, tr("Open Optical Image ..."), lastimagedir, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); + QString filename = QFileDialog::getOpenFileName(this, tr("Open Optical Image ..."), lastdiropticalimage, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); if (!filename.isEmpty()) { - lastimagedir = filename; + lastdiropticalimage = filename; image->load(filename); @@ -882,10 +919,10 @@ void cImageWindow::openOpticalImage() { void cImageWindow::openHistologyImage() { - QString filename = QFileDialog::getOpenFileName(this, tr("Open Histology Image ..."), lastimagedir, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); + QString filename = QFileDialog::getOpenFileName(this, tr("Open Histology Image ..."), lastdirhistologyimage, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); if (!filename.isEmpty()) { - lastimagedir = filename; + lastdirhistologyimage = filename; histologyimage->load(filename); imagewindowwidget->setHistologyImage(histologyimage); @@ -1013,10 +1050,10 @@ void cImageWindow::openMicroscopyImage(eLayerType layer, const QString &layernam QString title = "Open " + layername + " ..."; QString filename; - filename = QFileDialog::getOpenFileName(this, tr(title.toStdString().c_str()), lastimagedir, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); + filename = QFileDialog::getOpenFileName(this, tr(title.toStdString().c_str()), lastdirmicroscopyimage, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); if (!filename.isEmpty()) { - lastimagedir = filename; + lastdirmicroscopyimage = filename; int microscopycountx, microscopycounty; double microscopypixelwidth, microscopypixelheight, stagex, stagey; @@ -1065,17 +1102,17 @@ void cImageWindow::openMicroscopyImage(eLayerType layer, const QString &layernam void cImageWindow::saveImage() { - QString filename = QFileDialog::getSaveFileName(this, tr("Save Image ..."), "./", "PNG Files (*.png)"); + QString filename = QFileDialog::getSaveFileName(this, tr("Save Image ..."), lastdirexportimage, "PNG Files (*.png)"); if (!filename.isEmpty()) { - lastimagedir = filename; + lastdirexportimage = filename; imagewindowwidget->getImage().save(filename, "PNG"); } } -void cImageWindow::setFilterOptionsSlot(vector coordinates, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword) { - imagewindowwidget->setFilterOptions(coordinates, operatortype, columnname1, comparatorname1, filterstring1, columnname2, comparatorname2, filterstring2, casesensitive, wholeword); +void cImageWindow::setFilterOptionsSlot(vector coordinateinfo, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword) { + imagewindowwidget->setFilterOptions(coordinateinfo, operatortype, columnname1, comparatorname1, filterstring1, columnname2, comparatorname2, filterstring2, casesensitive, wholeword); } diff --git a/CycloBranch/gui/cImageWindow.h b/CycloBranch/gui/cImageWindow.h index 9846255..f27cc15 100644 --- a/CycloBranch/gui/cImageWindow.h +++ b/CycloBranch/gui/cImageWindow.h @@ -21,6 +21,7 @@ #include #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "gui/cImageWindowWidget.h" @@ -156,9 +157,10 @@ class cImageWindow : public QMainWindow /** \brief The constructor. + \param globalpreferences global preferences of the application \param parent pointer to a parent widget */ - cImageWindow(QWidget* parent = (QWidget *)0); + cImageWindow(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0); /** @@ -192,8 +194,16 @@ class cImageWindow : public QMainWindow void addLayer(QString name); -private: + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + +private: + + cGlobalPreferences* globalpreferences; QWidget* parent; QMenuBar* menuBar; @@ -297,7 +307,10 @@ class cImageWindow : public QMainWindow int layerscount; int activelayer; - QString lastimagedir; + QString lastdiropticalimage; + QString lastdirhistologyimage; + QString lastdirmicroscopyimage; + QString lastdirexportimage; int defaultmaxx; int defaultmaxy; @@ -342,7 +355,7 @@ private slots: void saveImage(); - void setFilterOptionsSlot(vector coordinates, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword); + void setFilterOptionsSlot(vector coordinates, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword); void setMaxButtonReleased(); diff --git a/CycloBranch/gui/cImageWindowWidget.cpp b/CycloBranch/gui/cImageWindowWidget.cpp index f6efe22..2a6fc9a 100644 --- a/CycloBranch/gui/cImageWindowWidget.cpp +++ b/CycloBranch/gui/cImageWindowWidget.cpp @@ -12,7 +12,7 @@ cImageWindowWidget::cImageWindowWidget() { scene = new QGraphicsScene(this); setScene(scene); - coordinates.clear(); + coordinateinfo.clear(); operatortype = 0; columnname1 = ""; comparatorname1 = ""; @@ -141,8 +141,8 @@ QImage cImageWindowWidget::getImage() { } -void cImageWindowWidget::setFilterOptions(vector& coordinates, bool operatortype, string& columnname1, string& comparatorname1, string& filterstring1, string& columnname2, string& comparatorname2, string& filterstring2, bool casesensitive, bool wholeword) { - this->coordinates = coordinates; +void cImageWindowWidget::setFilterOptions(vector& coordinateinfo, bool operatortype, string& columnname1, string& comparatorname1, string& filterstring1, string& columnname2, string& comparatorname2, string& filterstring2, bool casesensitive, bool wholeword) { + this->coordinateinfo = coordinateinfo; this->operatortype = operatortype; this->columnname1 = columnname1; this->comparatorname1 = comparatorname1; @@ -593,7 +593,7 @@ void cImageWindowWidget::mouseDoubleClickEvent(QMouseEvent *event) { if ((currentx > 0) && (currenty > 0) && (currentx < currentwidth) && (currenty < currentheight)) { spectrumid = -1; - for (auto& it : coordinates) { + for (auto& it : coordinateinfo) { if ((it.x == x) && (it.y == y)) { spectrumid = it.id; break; @@ -742,31 +742,11 @@ void cImageWindowWidget::redrawScene() { } } - unordered_set reduced_coordinates; - for (int i = 0; i < (int)coordinates.size(); i++) { - if (reduced_coordinates.count(coordinates[i]) == 1) { - auto it = reduced_coordinates.find(coordinates[i]); - cCoordinates coord = *it; - coord.mzratio = 0; - coord.relativeintensity += coordinates[i].relativeintensity; - coord.absoluteintensity += coordinates[i].absoluteintensity; - if (coord.name.find(coordinates[i].name) == string::npos) { - coord.name += "\n" + coordinates[i].name; - } - reduced_coordinates.erase(it); - reduced_coordinates.insert(coord); - - } - else { - reduced_coordinates.insert(coordinates[i]); - } - } - double minimumintensity = DBL_MAX; double maximumintensity = 0; double averageintensity = 0; vector medianvector; - for (auto it = reduced_coordinates.begin(); it != reduced_coordinates.end(); ++it) { + for (auto it = coordinateinfo.begin(); it != coordinateinfo.end(); ++it) { if (!absoluteintensity) { if (it->relativeintensity < minimumintensity) { minimumintensity = it->relativeintensity; @@ -789,8 +769,8 @@ void cImageWindowWidget::redrawScene() { } } - if (reduced_coordinates.size() > 0) { - averageintensity /= (double)reduced_coordinates.size(); + if (coordinateinfo.size() > 0) { + averageintensity /= (double)coordinateinfo.size(); } double medianintensity = median(medianvector); @@ -805,9 +785,9 @@ void cImageWindowWidget::redrawScene() { double hue_max = 1; qreal x, y, w, h; - for (auto it = reduced_coordinates.begin(); it != reduced_coordinates.end(); ++it) { + for (auto it = coordinateinfo.begin(); it != coordinateinfo.end(); ++it) { - if (it == reduced_coordinates.begin()) { + if (it == coordinateinfo.begin()) { xmin = it->x; xmax = it->x; ymin = it->y; @@ -863,15 +843,9 @@ void cImageWindowWidget::redrawScene() { } rectitem->setBrush(QBrush(color)); - string tooltip; - if (it->mzratio == 0) { - tooltip = it->name + "\nID: " + to_string(it->id) + "\nX: " + to_string(it->x) + "\nY: " + to_string(it->y) + "\nsum of rel. intensities: " + to_string(it->relativeintensity) + "%\nsum of abs. intensities: " + QVariant(cropDecimalsByteArray(it->absoluteintensity)).toString().toStdString(); - } - else { - tooltip = it->name + "\nID: " + to_string(it->id) + "\nX: " + to_string(it->x) + "\nY: " + to_string(it->y) + "\nm/z: " + to_string(it->mzratio) + "\nrel. intensity: " + to_string(it->relativeintensity) + "%\nabs. intensity: " + QVariant(cropDecimalsByteArray(it->absoluteintensity)).toString().toStdString(); - } - + string tooltip = it->description + "\nID: " + to_string(it->id) + "\nX: " + to_string(it->x) + "\nY: " + to_string(it->y) + "\nsum of rel. intensities: " + to_string(it->relativeintensity) + "%\nsum of abs. intensities: " + QVariant(cropDecimalsByteArray(it->absoluteintensity)).toString().toStdString(); rectitem->setToolTip(tooltip.c_str()); + rectitem->setZValue(layersvector[layer_compounds].zvalue); scene->addItem(rectitem); } @@ -934,7 +908,7 @@ void cImageWindowWidget::redrawScene() { } - qstr = "Number of Points Selected: " + QString::number(reduced_coordinates.size()); + qstr = "Number of Points Selected: " + QString::number(coordinateinfo.size()); if (!filterstring1.empty() || !filterstring2.empty()) { qstr += " ("; } @@ -1080,6 +1054,8 @@ void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scen transform.scale(layersvector[layer].fliphorizontally ? -1 : 1, layersvector[layer].flipvertically ? -1 : 1); transform.rotate(layersvector[layer].angle); transform.translate(-(qreal)microscopyorigcenterx, -(qreal)microscopyorigcentery); + + // to do - potential bug scaledmicroscopypixmap = scaledmicroscopypixmap.transformed(transform); int microscopynewcenterx = scaledmicroscopypixmap.rect().center().x(); diff --git a/CycloBranch/gui/cImageWindowWidget.h b/CycloBranch/gui/cImageWindowWidget.h index b4cfd13..3c0c9bb 100644 --- a/CycloBranch/gui/cImageWindowWidget.h +++ b/CycloBranch/gui/cImageWindowWidget.h @@ -248,7 +248,7 @@ class cImageWindowWidget : public QGraphicsView /** \brief Set options which was used to filter the points. - \param coordinates a vector of coordinates + \param coordinateinfo a vector of coordinates \param operatortype the type of operator (0 = or; 1 = and) \param columnname1 name of column which was compared \param comparatorname1 name of used comparator @@ -259,7 +259,7 @@ class cImageWindowWidget : public QGraphicsView \param casesensitive true if the string was used as a casesensitive, false otherwise \param wholeword true if whole words only are compared, false otherwise */ - void setFilterOptions(vector& coordinates, bool operatortype, string& columnname1, string& comparatorname1, string& filterstring1, string& columnname2, string& comparatorname2, string& filterstring2, bool casesensitive, bool wholeword); + void setFilterOptions(vector& coordinateinfo, bool operatortype, string& columnname1, string& comparatorname1, string& filterstring1, string& columnname2, string& comparatorname2, string& filterstring2, bool casesensitive, bool wholeword); /** @@ -440,7 +440,7 @@ class cImageWindowWidget : public QGraphicsView QWidget* parent; QGraphicsScene* scene; - vector coordinates; + vector coordinateinfo; bool operatortype; string columnname1; string comparatorname1; diff --git a/CycloBranch/gui/cMainWindow.cpp b/CycloBranch/gui/cMainWindow.cpp index 715ca61..6c55604 100644 --- a/CycloBranch/gui/cMainWindow.cpp +++ b/CycloBranch/gui/cMainWindow.cpp @@ -38,12 +38,15 @@ cMainWindow::cMainWindow() { actionSaveResults = new QAction(QIcon(":/images/icons/22.png"), tr("&Save Results..."), this); actionSaveResults->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); - actionExportToCsv = new QAction(QIcon(":/images/icons/62.png"), tr("Export to &CSV"), this); + actionExportToCsv = new QAction(QIcon(":/images/icons/csv.png"), tr("Export to &CSV"), this); actionExportToCsv->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C)); actionExportToHTML = new QAction(QIcon(":/images/icons/77.png"), tr("Export to &HTML"), this); actionExportToHTML->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H)); + actionPreferences = new QAction(QIcon(":/images/icons/preferences.png"), tr("&Preferences"), this); + actionPreferences->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_P)); + actionQuit = new QAction(QIcon(":/images/icons/33.png"), tr("&Quit"), this); actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); @@ -69,22 +72,22 @@ cMainWindow::cMainWindow() { actionDrawPeptide = new QAction(QIcon(":/images/icons/96.png"), tr("Draw &Peptide"), this); actionDrawPeptide->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); - actionSummaryTableOfMatchedPeaks = new QAction(QIcon(":/images/icons/43.png"), tr("S&ummary Table of Matched Peaks"), this); + actionSummaryTableOfMatchedPeaks = new QAction(QIcon(":/images/icons/table.png"), tr("S&ummary Table of Matched Peaks"), this); actionSummaryTableOfMatchedPeaks->setShortcut(QKeySequence(Qt::Key_F9)); actionChromatogramWindow = new QAction(QIcon(":/images/icons/chromatography.png"), tr("C&hromatogram"), this); actionChromatogramWindow->setShortcut(QKeySequence(Qt::Key_F10)); actionChromatogramWindow->setDisabled(true); - actionImageWindow = new QAction(QIcon(":/images/icons/23.png"), tr("&CrossVis"), this); + actionImageWindow = new QAction(QIcon(":/images/icons/image.png"), tr("&CrossVis"), this); actionImageWindow->setShortcut(QKeySequence(Qt::Key_F11)); actionImageWindow->setDisabled(true); - actionNorine = new QAction(QIcon(":/images/icons/25.png"), tr("&Norine"), this); - actionNorine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1)); + actionBookMark1 = new QAction(QIcon(":/images/icons/25.png"), tr("&Norine"), this); + actionBookMark1->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1)); - actionBBDGNC = new QAction(QIcon(":/images/icons/5.png"), tr("Gene&rate Blocks and Sequences using BBDGNC"), this); - actionBBDGNC->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2)); + actionBookMark2 = new QAction(QIcon(":/images/icons/5.png"), tr("Gene&rate Blocks and Sequences using BBDGNC"), this); + actionBookMark2->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2)); actionShowIsomers = new QAction(QIcon(":/images/icons/95.png"), tr("Show &Isomers"), this); actionShowIsomers->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)); @@ -112,6 +115,7 @@ cMainWindow::cMainWindow() { toolbarFile->addAction(actionSaveResults); toolbarFile->addAction(actionExportToCsv); toolbarFile->addAction(actionExportToHTML); + toolbarFile->addAction(actionPreferences); toolbarFile->addAction(actionQuit); toolbarSearch = addToolBar(tr("Search")); @@ -128,8 +132,8 @@ cMainWindow::cMainWindow() { toolbarTools->addAction(actionChromatogramWindow); toolbarTools->addAction(actionImageWindow); toolbarTools->addSeparator(); - toolbarTools->addAction(actionNorine); - toolbarTools->addAction(actionBBDGNC); + toolbarTools->addAction(actionBookMark1); + toolbarTools->addAction(actionBookMark2); toolbarView = addToolBar(tr("View")); toolbarView->addAction(actionShowIsomers); @@ -238,20 +242,24 @@ cMainWindow::cMainWindow() { about = new cAboutWidget(this); graph = new cGraphWidget(); - bricksdatabasewidget = new cBricksDatabaseWidget(); - sequencedatabasewidget = new cSequenceDatabaseWidget(this); - modificationswidget = new cModificationsWidget(); + + globalpreferences.loadSettings(); + bricksdatabasewidget = new cBricksDatabaseWidget(&globalpreferences); + sequencedatabasewidget = new cSequenceDatabaseWidget(&globalpreferences, this); + modificationswidget = new cModificationsWidget(&globalpreferences); drawpeptidewidget = new cDrawPeptideWidget(this); - summarytableofmatchedpeaks = new cSummaryPeaksTableWidget(this); - imagewindow = new cImageWindow(this); - chromatogramwindow = new cChromatogramWindow(theoreticalspectrumlist, this); - parameterswidget = new cParametersWidget(this); + summarytableofmatchedpeaks = new cSummaryPeaksTableWidget(&globalpreferences, this); + imagewindow = new cImageWindow(&globalpreferences, this); + chromatogramwindow = new cChromatogramWindow(&globalpreferences, theoreticalspectrumlist, this); + parameterswidget = new cParametersWidget(&globalpreferences, this); htmlexportdialog = new cHTMLExportDialog(this); - + preferencesdialog = new cPreferencesDialog(globalpreferences, this); + connect(actionOpenResults, SIGNAL(triggered()), this, SLOT(openResultsFile())); connect(actionSaveResults, SIGNAL(triggered()), this, SLOT(saveResultsFile())); connect(actionExportToCsv, SIGNAL(triggered()), this, SLOT(exportToCsv())); connect(actionExportToHTML, SIGNAL(triggered()), this, SLOT(exportToHTML())); + connect(actionPreferences, SIGNAL(triggered()), this, SLOT(showPreferences())); connect(actionQuit, SIGNAL(triggered()), this, SLOT(quitApplication())); connect(actionRun, SIGNAL(triggered()), this, SLOT(run())); connect(actionStop, SIGNAL(triggered()), this, SLOT(stop())); @@ -260,8 +268,8 @@ cMainWindow::cMainWindow() { connect(actionSequenceDatabase, SIGNAL(triggered()), this, SLOT(showSequenceDatabase())); connect(actionModifications, SIGNAL(triggered()), this, SLOT(showModifications())); connect(actionDrawPeptide, SIGNAL(triggered()), this, SLOT(showDrawPeptideWidget())); - connect(actionNorine, SIGNAL(triggered()), this, SLOT(gotoNorine())); - connect(actionBBDGNC, SIGNAL(triggered()), this, SLOT(gotoBBDGNC())); + connect(actionBookMark1, SIGNAL(triggered()), this, SLOT(gotoBookMark1())); + connect(actionBookMark2, SIGNAL(triggered()), this, SLOT(gotoBookMark2())); connect(actionShowIsomers, SIGNAL(triggered()), this, SLOT(showIsomersStateChanged())); connect(actionGraph, SIGNAL(triggered()), this, SLOT(showGraph())); connect(actionSummaryTableOfMatchedPeaks, SIGNAL(triggered()), this, SLOT(showSummaryTableOfMatchedPeaks())); @@ -277,7 +285,7 @@ cMainWindow::cMainWindow() { connect(summarytableofmatchedpeaks, SIGNAL(tableCancelled()), this, SLOT(summaryPeaksTableCancelled())); connect(summarytableofmatchedpeaks, SIGNAL(summaryPeaksTableRowDoubleClicked(int, double)), this, SLOT(summaryPeaksTableRowDoubleClicked(int, double))); - connect(summarytableofmatchedpeaks, SIGNAL(sendFilterOptionsToImageWindow(vector, bool, string, string, string, string, string, string, bool, bool)), imagewindow, SLOT(setFilterOptionsSlot(vector, bool, string, string, string, string, string, string, bool, bool))); + connect(summarytableofmatchedpeaks, SIGNAL(sendFilterOptionsToImageWindow(vector, bool, string, string, string, string, string, string, bool, bool)), imagewindow, SLOT(setFilterOptionsSlot(vector, bool, string, string, string, string, string, string, bool, bool))); connect(summarytableofmatchedpeaks, SIGNAL(sendFilterOptionsToChromatogram(cPeaksList)), chromatogramwindow, SLOT(setFilterOptionsSlot(cPeaksList))); connect(summarytableofmatchedpeaks, SIGNAL(resetRegion()), imagewindow, SLOT(clearSelection())); @@ -290,6 +298,8 @@ cMainWindow::cMainWindow() { menuFile->addAction(actionExportToCsv); menuFile->addAction(actionExportToHTML); menuFile->addSeparator(); + menuFile->addAction(actionPreferences); + menuFile->addSeparator(); menuFile->addAction(actionQuit); menuSearch->addAction(actionRun); @@ -307,8 +317,8 @@ cMainWindow::cMainWindow() { menuTools->addAction(actionChromatogramWindow); menuTools->addAction(actionImageWindow); menuTools->addSeparator(); - menuTools->addAction(actionNorine); - menuTools->addAction(actionBBDGNC); + menuTools->addAction(actionBookMark1); + menuTools->addAction(actionBookMark2); menuView->addAction(actionShowIsomers); menuView->addSeparator(); @@ -371,14 +381,11 @@ cMainWindow::cMainWindow() { profilemz64precision = false; profileintensity64precision = false; - resultsbasecolumncount = 9; + resultsbasecolumncount = 10; resultsspecificcolumncount = 0; searchspecificcolumncount = 0; - lastdirexporttocsv = "./"; - lastdirexporttohtml = "./"; - lastdirsaveresults = "./"; - lastdiropenresults = "./"; + applyGlobalPreferences(); summarytableisprepared = false; @@ -421,11 +428,13 @@ cMainWindow::~cMainWindow() { delete chromatogramwindow; delete parameterswidget; delete htmlexportdialog; + delete preferencesdialog; delete actionOpenResults; delete actionSaveResults; delete actionExportToCsv; delete actionExportToHTML; + delete actionPreferences; delete actionQuit; delete actionProperties; delete actionRun; @@ -433,8 +442,8 @@ cMainWindow::~cMainWindow() { delete actionSequenceDatabase; delete actionModifications; delete actionDrawPeptide; - delete actionNorine; - delete actionBBDGNC; + delete actionBookMark1; + delete actionBookMark2; delete actionShowIsomers; delete actionGraph; delete actionSummaryTableOfMatchedPeaks; @@ -608,11 +617,14 @@ void cMainWindow::reportSpectrum(int row, cTheoreticalSpectrum& theoreticalspect resultsmodel->setItem(row, 8 + searchspecificcolumncount + resultsspecificcolumncount, new QStandardItem()); resultsmodel->item(row, 8 + searchspecificcolumncount + resultsspecificcolumncount)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(theoreticalspectrum.getSumOfRelativeIntensities())), Qt::DisplayRole); + resultsmodel->setItem(row, 9 + searchspecificcolumncount + resultsspecificcolumncount, new QStandardItem()); + resultsmodel->item(row, 9 + searchspecificcolumncount + resultsspecificcolumncount)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(theoreticalspectrum.getWeightedRatioOfMatchedPeaks() * 100)), Qt::DisplayRole); + int index = resultsbasecolumncount + searchspecificcolumncount + resultsspecificcolumncount; - for (int i = 0; i < (int)parameters.ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters.ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters.neutrallossesfortheoreticalspectra.size(); j++) { resultsmodel->setItem(row, index, new QStandardItem()); - resultsmodel->item(row, index)->setData(QVariant::fromValue(theoreticalspectrum.getNumberOfMatchedPeaks(parameters.ionsfortheoreticalspectra[i], (j == -1) ? -1 : parameters.neutrallossesfortheoreticalspectra[j])), Qt::DisplayRole); + resultsmodel->item(row, index)->setData(QVariant::fromValue(theoreticalspectrum.getNumberOfMatchedPeaks(parameters.ionsfortheoreticalspectraMS2[i], (j == -1) ? -1 : parameters.neutrallossesfortheoreticalspectra[j])), Qt::DisplayRole); index++; } @@ -658,6 +670,10 @@ void cMainWindow::reportSpectrum(int row, cTheoreticalSpectrum& theoreticalspect resultsmodel->item(row, mscol)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(theoreticalspectrum.getSumOfRelativeIntensities())), Qt::DisplayRole); mscol++; + resultsmodel->setItem(row, mscol, new QStandardItem()); + resultsmodel->item(row, mscol)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(theoreticalspectrum.getWeightedRatioOfMatchedPeaks() * 100)), Qt::DisplayRole); + mscol++; + if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { resultsmodel->setItem(row, mscol, new QStandardItem()); resultsmodel->item(row, mscol)->setData(QVariant::fromValue(theoreticalspectrum.getExperimentalSpectrum().getCoordinateX()), Qt::DisplayRole); @@ -669,7 +685,7 @@ void cMainWindow::reportSpectrum(int row, cTheoreticalSpectrum& theoreticalspect } - spectradetails[row].initialize(row + 1, ¶meters, theoreticalspectrum, this); + spectradetails[row].initialize(row + 1, &globalpreferences, ¶meters, theoreticalspectrum, this); } @@ -976,6 +992,7 @@ void cMainWindow::enableButtonsHandlingResults(bool enable) { actionSaveResults->setEnabled(enable); actionExportToCsv->setEnabled(enable); actionExportToHTML->setEnabled(enable); + actionPreferences->setEnabled(enable); rowsfilterwidget->setEnabled(enable); actionSummaryTableOfMatchedPeaks->setEnabled(enable); @@ -1049,7 +1066,7 @@ void cMainWindow::reportSpectra() { if ((parameters.mode == denovoengine) || (parameters.mode == singlecomparison) || (parameters.mode == databasesearch)) { - resultsmodel->setColumnCount(resultsbasecolumncount + searchspecificcolumncount + resultsspecificcolumncount + ((int)parameters.ionsfortheoreticalspectra.size() * ((int)parameters.neutrallossesfortheoreticalspectra.size() + 1))); + resultsmodel->setColumnCount(resultsbasecolumncount + searchspecificcolumncount + resultsspecificcolumncount + ((int)parameters.ionsfortheoreticalspectraMS2.size() * ((int)parameters.neutrallossesfortheoreticalspectra.size() + 1))); if ((parameters.peptidetype == cyclic) && parameters.enablescrambling) { resultsmodel->setColumnCount(resultsmodel->columnCount() + 1); @@ -1161,12 +1178,16 @@ void cMainWindow::reportSpectra() { resultsmodel->horizontalHeaderItem(8 + searchspecificcolumncount + resultsspecificcolumncount)->setText("Sum of Relative Intensities"); results->setItemDelegateForColumn(8 + searchspecificcolumncount + resultsspecificcolumncount, new QItemDelegate()); + resultsmodel->setHorizontalHeaderItem(9 + searchspecificcolumncount + resultsspecificcolumncount, new QStandardItem()); + resultsmodel->horizontalHeaderItem(9 + searchspecificcolumncount + resultsspecificcolumncount)->setText("Weighted Ratio of Matched Peaks [%]"); + results->setItemDelegateForColumn(9 + searchspecificcolumncount + resultsspecificcolumncount, new QItemDelegate()); + string name; int index = resultsbasecolumncount + searchspecificcolumncount + resultsspecificcolumncount; - for (int i = 0; i < (int)parameters.ionsfortheoreticalspectra.size(); i++) { + for (int i = 0; i < (int)parameters.ionsfortheoreticalspectraMS2.size(); i++) { for (int j = -1; j < (int)parameters.neutrallossesfortheoreticalspectra.size(); j++) { resultsmodel->setHorizontalHeaderItem(index, new QStandardItem()); - name = parameters.iondefinitions[(eFragmentIonType)parameters.ionsfortheoreticalspectra[i]].name; + name = parameters.iondefinitions[(eFragmentIonType)parameters.ionsfortheoreticalspectraMS2[i]].name; if (j >= 0) { name += "-" + parameters.neutrallossesdefinitions[parameters.neutrallossesfortheoreticalspectra[j]].summary; } @@ -1188,10 +1209,10 @@ void cMainWindow::reportSpectra() { if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { - resultsmodel->setColumnCount(8); + resultsmodel->setColumnCount(9); } else { - resultsmodel->setColumnCount(7); + resultsmodel->setColumnCount(8); } int mscol = 0; @@ -1233,6 +1254,11 @@ void cMainWindow::reportSpectra() { results->setItemDelegateForColumn(mscol, new QItemDelegate()); mscol++; + resultsmodel->setHorizontalHeaderItem(mscol, new QStandardItem()); + resultsmodel->horizontalHeaderItem(mscol)->setText("Weighted Ratio of Matched Peaks [%]"); + results->setItemDelegateForColumn(mscol, new QItemDelegate()); + mscol++; + if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { resultsmodel->setHorizontalHeaderItem(mscol, new QStandardItem()); resultsmodel->horizontalHeaderItem(mscol)->setText("Coordinate X"); @@ -1386,6 +1412,22 @@ void cMainWindow::deleteResults() { } +void cMainWindow::applyGlobalPreferences() { + if (lastdirexporttocsv.right(4).compare(".csv", Qt::CaseInsensitive) != 0) { + lastdirexporttocsv = globalpreferences.exportcsvdefaultdir; + } + if ((lastdirexporttohtml.right(4).compare(".htm", Qt::CaseInsensitive) != 0) && (lastdirexporttohtml.right(5).compare(".html", Qt::CaseInsensitive) != 0)) { + lastdirexporttohtml = globalpreferences.exporthtmldefaultdir; + } + if (lastdiropenresults.right(4).compare(".res", Qt::CaseInsensitive) != 0) { + lastdiropenresults = globalpreferences.resultsdefaultdir; + } + if (lastdirsaveresults.right(4).compare(".res", Qt::CaseInsensitive) != 0) { + lastdirsaveresults = globalpreferences.resultsdefaultdir; + } +} + + void cMainWindow::rowDoubleClicked(const QModelIndex& item) { int row = resultsproxymodel->mapToSource(item).row(); int rowid = resultsmodel->item(row, 1)->data(Qt::DisplayRole).toInt() - 1; @@ -1747,6 +1789,28 @@ void cMainWindow::exportToHTML() { } +void cMainWindow::showPreferences() { + if (preferencesdialog->exec() != QDialog::Accepted) { + preferencesdialog->resetPreferences(globalpreferences); + return; + } + + preferencesdialog->setPreferences(globalpreferences); + + parameterswidget->applyGlobalPreferences(&globalpreferences); + summarytableofmatchedpeaks->applyGlobalPreferences(&globalpreferences); + chromatogramwindow->applyGlobalPreferences(&globalpreferences); + imagewindow->applyGlobalPreferences(&globalpreferences); + bricksdatabasewidget->applyGlobalPreferences(&globalpreferences); + sequencedatabasewidget->applyGlobalPreferences(&globalpreferences); + modificationswidget->applyGlobalPreferences(&globalpreferences); + + applyGlobalPreferences(); + + globalpreferences.saveSettings(); +} + + void cMainWindow::showHTMLDocumentation() { #if OS_TYPE == WIN QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/userguide.html").absoluteFilePath())); @@ -2033,13 +2097,13 @@ void cMainWindow::resetFilter() { } -void cMainWindow::gotoNorine() { - QDesktopServices::openUrl(QUrl("https://bioinfo.lifl.fr/norine/")); +void cMainWindow::gotoBookMark1() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl1)); } -void cMainWindow::gotoBBDGNC() { - QDesktopServices::openUrl(QUrl("https://ms.biomed.cas.cz/bbdgnc/")); +void cMainWindow::gotoBookMark2() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl2)); } diff --git a/CycloBranch/gui/cMainWindow.h b/CycloBranch/gui/cMainWindow.h index 756e0a6..1a03d98 100644 --- a/CycloBranch/gui/cMainWindow.h +++ b/CycloBranch/gui/cMainWindow.h @@ -33,6 +33,7 @@ #include "gui/cImageWindow.h" #include "gui/cChromatogramWindow.h" #include "gui/cMainWindowProxyModel.h" +#include "gui/cPreferencesDialog.h" // forward declaration @@ -93,6 +94,7 @@ class cMainWindow : public QMainWindow QAction* actionSaveResults; QAction* actionExportToCsv; QAction* actionExportToHTML; + QAction* actionPreferences; QAction* actionQuit; QAction* actionRun; QAction* actionStop; @@ -101,8 +103,8 @@ class cMainWindow : public QMainWindow QAction* actionSequenceDatabase; QAction* actionModifications; QAction *actionDrawPeptide; - QAction *actionNorine; - QAction *actionBBDGNC; + QAction *actionBookMark1; + QAction *actionBookMark2; QAction* actionShowIsomers; QAction* actionGraph; QAction* actionSummaryTableOfMatchedPeaks; @@ -134,6 +136,7 @@ class cMainWindow : public QMainWindow cTheoreticalSpectrumList theoreticalspectrumlist; vector spectradetails; + cGlobalPreferences globalpreferences; cParameters parameters; cPeakListSeries rawdata; @@ -155,6 +158,7 @@ class cMainWindow : public QMainWindow cChromatogramWindow* chromatogramwindow; cParametersWidget* parameterswidget; cHTMLExportDialog* htmlexportdialog; + cPreferencesDialog* preferencesdialog; int resultsbasecolumncount; int resultsspecificcolumncount; @@ -162,6 +166,7 @@ class cMainWindow : public QMainWindow QString lastdirexporttocsv; QString lastdirexporttohtml; + QString lastdirsaveresults; QString lastdiropenresults; @@ -177,6 +182,8 @@ class cMainWindow : public QMainWindow void deleteResults(); + void applyGlobalPreferences(); + private slots: @@ -232,6 +239,8 @@ private slots: void exportToHTML(); + void showPreferences(); + void showHTMLDocumentation(); void showPDFManual(); @@ -252,9 +261,9 @@ private slots: void resetFilter(); - void gotoNorine(); + void gotoBookMark1(); - void gotoBBDGNC(); + void gotoBookMark2(); void summaryPeaksTableCancelled(); diff --git a/CycloBranch/gui/cModificationsWidget.cpp b/CycloBranch/gui/cModificationsWidget.cpp index e191fa3..eed3e8d 100644 --- a/CycloBranch/gui/cModificationsWidget.cpp +++ b/CycloBranch/gui/cModificationsWidget.cpp @@ -16,7 +16,8 @@ #include -cModificationsWidget::cModificationsWidget(QWidget* parent) { +cModificationsWidget::cModificationsWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { + this->globalpreferences = globalpreferences; this->parent = parent; editorname = "Modifications Editor"; @@ -240,11 +241,7 @@ cModificationsWidget::cModificationsWidget(QWidget* parent) { databasefile = ""; - #if OS_TYPE == WIN - lastdir = "./Modifications/"; - #else - lastdir = installdir + "Modifications/"; - #endif + applyGlobalPreferences(globalpreferences); modifications.clear(); @@ -302,6 +299,15 @@ void cModificationsWidget::closeEvent(QCloseEvent *event) { } +void cModificationsWidget::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if (lastdir.right(4).compare(".txt", Qt::CaseInsensitive) != 0) { + lastdir = globalpreferences->modificationsdefaultdir; + } + } +} + + void cModificationsWidget::deleteTable() { for (int i = 0; i < databasemodel->columnCount(); i++) { if (database->itemDelegateForColumn(i)) { @@ -559,7 +565,7 @@ bool cModificationsWidget::saveDatabase() { progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); - fragmentDescription modification; + cFragmentIonType modification; modifications.clear(); for (int i = 0; i < proxymodel->rowCount(); i++) { @@ -762,7 +768,7 @@ void cModificationsWidget::importDatabase() { else { resetFilter(); - vector importedmodifications; + vector importedmodifications; loadModificationsFromPlainTextStream(inputstream, importedmodifications, errormessage, true); QProgressDialog progress("Importing the Database of Modifications...", "Cancel", 0, (int)importedmodifications.size(), this); diff --git a/CycloBranch/gui/cModificationsWidget.h b/CycloBranch/gui/cModificationsWidget.h index cb1678c..44b40e4 100644 --- a/CycloBranch/gui/cModificationsWidget.h +++ b/CycloBranch/gui/cModificationsWidget.h @@ -20,6 +20,7 @@ #include #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "core/cFragmentIons.h" #include "core/cSummaryFormula.h" #include "gui/cModificationsProxyModel.h" @@ -47,9 +48,10 @@ class cModificationsWidget : public QMainWindow /** \brief The constructor. + \param globalpreferences global preferences of the application \param parent pointer to a parent widget */ - cModificationsWidget(QWidget* parent = (QWidget *)0); + cModificationsWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0); /** @@ -65,12 +67,21 @@ class cModificationsWidget : public QMainWindow void closeEvent(QCloseEvent *event); + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + private: QString editorname; QWidget* parent; + cGlobalPreferences* globalpreferences; + QMenuBar* menuBar; QMenu* menuFile; QMenu* menuEdit; @@ -118,7 +129,7 @@ class cModificationsWidget : public QMainWindow QString lastdir; ifstream inputstream; ofstream outputstream; - vector modifications; + vector modifications; bool datamodified; diff --git a/CycloBranch/gui/cParametersWidget.cpp b/CycloBranch/gui/cParametersWidget.cpp index 5acd447..1b49954 100644 --- a/CycloBranch/gui/cParametersWidget.cpp +++ b/CycloBranch/gui/cParametersWidget.cpp @@ -25,7 +25,8 @@ #include -cParametersWidget::cParametersWidget(QWidget* parent) { +cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { + this->globalpreferences = globalpreferences; this->parent = parent; int leftdefaultwidth = 400; @@ -418,6 +419,7 @@ cParametersWidget::cParametersWidget(QWidget* parent) { scoretype->addItem(tr("Number of b-ions")); scoretype->addItem(tr("Number of y-ions")); scoretype->addItem(tr("Number of b-ions and y-ions")); + scoretype->addItem(tr("Weighted Ratio of Matched Peaks")); scoretype->setFixedWidth(rightdefaultwidth); scoretypelabel = new QLabel("Score Type:"); theoreticalspectragridlayout->addWidget(scoretypelabel, 1, 0); @@ -666,24 +668,8 @@ cParametersWidget::cParametersWidget(QWidget* parent) { restoreParameters(); - #if OS_TYPE == WIN - lastdirloadsettings = "./Settings/"; - lastdirsavesettings = "./Settings/"; + applyGlobalPreferences(globalpreferences); - defaultdirselectpeaklist = "./PeakLists/"; - defaultdirselectbricksdatabase = "./BrickDatabases/"; - defaultdirselectmodifications = "./Modifications/"; - defaultdirselectsequencedatabase = "./SequenceDatabases/"; - #else - lastdirloadsettings = installdir + "Settings/"; - lastdirsavesettings = installdir + "Settings/"; - - defaultdirselectpeaklist = installdir + "PeakLists/"; - defaultdirselectbricksdatabase = installdir + "BrickDatabases/"; - defaultdirselectmodifications = installdir + "Modifications/"; - defaultdirselectsequencedatabase = installdir + "SequenceDatabases/"; - #endif - mode->setCurrentIndex(dereplication); } @@ -884,6 +870,27 @@ void cParametersWidget::setTag(int peptidetypeindex, QString tag) { } +void cParametersWidget::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if (lastdirloadsettings.right(4).compare(".ini", Qt::CaseInsensitive) != 0) { + lastdirloadsettings = globalpreferences->settingsdefaultdir; + } + if (lastdirsavesettings.right(4).compare(".ini", Qt::CaseInsensitive) != 0) { + lastdirsavesettings = globalpreferences->settingsdefaultdir; + } + + defaultdirselectpeaklist = globalpreferences->peaklistsdefaultdir; + defaultdirselectbricksdatabase = globalpreferences->blocksdefaultdir; + defaultdirselectmodifications = globalpreferences->modificationsdefaultdir; + defaultdirselectsequencedatabase = globalpreferences->sequencesdefaultdir; + + if (((eModeType)mode->currentIndex() == dereplication) || ((eModeType)mode->currentIndex() == compoundsearch)) { + resetFragmentIonTypes(); + } + } +} + + void cParametersWidget::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { restoreParameters(); @@ -977,9 +984,30 @@ void cParametersWidget::loadSettings() { hitsreported->setValue(settings.value("hitsreported", 100).toInt()); sequencetag->setText(settings.value("sequencetag", "").toString()); - for (i = 0; i < iontypes->getList()->count(); i++) { - qloadstring = ("fragmentiontype_" + to_string(i)).c_str(); - settings.value(qloadstring, 0).toInt() == 0 ? iontypes->getList()->item(i)->setSelected(false) : iontypes->getList()->item(i)->setSelected(true); + if (((eModeType)mode->currentIndex() == dereplication) || ((eModeType)mode->currentIndex() == compoundsearch)) { + for (i = 0; i < iontypes->getList()->count(); i++) { + iontypes->getList()->item(i)->setSelected(false); + } + + i = 0; + qloadstring = ("iontype_" + to_string(i)).c_str(); + while (settings.value(qloadstring, "XXX").toString().compare("XXX") != 0) { + for (int j = 0; j < iontypes->getList()->count(); j++) { + if (iontypes->getList()->item(j)->text().compare(settings.value(qloadstring).toString()) == 0) { + iontypes->getList()->item(j)->setSelected(true); + break; + } + } + + i++; + qloadstring = ("iontype_" + to_string(i)).c_str(); + } + } + else { + for (i = 0; i < iontypes->getList()->count(); i++) { + qloadstring = ("fragmentiontype_" + to_string(i)).c_str(); + settings.value(qloadstring, 0).toInt() == 0 ? iontypes->getList()->item(i)->setSelected(false) : iontypes->getList()->item(i)->setSelected(true); + } } neutrallosstypes->getList()->clear(); @@ -1068,9 +1096,21 @@ void cParametersWidget::saveSettings() { settings.setValue("hitsreported", hitsreported->value()); settings.setValue("sequencetag", sequencetag->text()); - for (int i = 0; i < iontypes->getList()->count(); i++) { - qsavestring = ("fragmentiontype_" + to_string(i)).c_str(); - iontypes->getList()->item(i)->isSelected() ? settings.setValue(qsavestring, 1) : settings.setValue(qsavestring, 0); + if (((eModeType)mode->currentIndex() == dereplication) || ((eModeType)mode->currentIndex() == compoundsearch)) { + int cnt = 0; + for (int i = 0; i < iontypes->getList()->count(); i++) { + if (iontypes->getList()->item(i)->isSelected()) { + qsavestring = ("iontype_" + to_string(cnt)).c_str(); + settings.setValue(qsavestring, iontypes->getList()->item(i)->text()); + cnt++; + } + } + } + else { + for (int i = 0; i < iontypes->getList()->count(); i++) { + qsavestring = ("fragmentiontype_" + to_string(i)).c_str(); + iontypes->getList()->item(i)->isSelected() ? settings.setValue(qsavestring, 1) : settings.setValue(qsavestring, 0); + } } for (int i = 0; i < neutrallosstypes->getList()->count(); i++) { @@ -1185,42 +1225,62 @@ bool cParametersWidget::updateParameters() { string errmsg; if (peaklistline->text().toStdString().compare("") == 0) { - errstr = "A peaklist must be specified!"; + errstr = "A peaklist must be specified !"; msgBox.setText(errstr); msgBox.exec(); return false; } if ((brickdatabaseline->text().toStdString().compare("") == 0) && (((eModeType)mode->currentIndex() == denovoengine) || (((eModeType)mode->currentIndex() == databasesearch) && ((ePeptideType)peptidetype->currentIndex() != other)) || (((eModeType)mode->currentIndex() == singlecomparison) && ((ePeptideType)peptidetype->currentIndex() != other)))) { - errstr = "A database of building blocks must be specified!"; + errstr = "A database of building blocks must be specified !"; msgBox.setText(errstr); msgBox.exec(); return false; } if ((sequencedatabaseline->text().toStdString().compare("") == 0) && (((eModeType)mode->currentIndex() == databasesearch) || ((eModeType)mode->currentIndex() == dereplication))) { - errstr = "A sequence database must be specified!"; + errstr = "A sequence database must be specified !"; msgBox.setText(errstr); msgBox.exec(); return false; } + if (((eModeType)mode->currentIndex() == databasesearch) || ((eModeType)mode->currentIndex() == dereplication)) { + int notselected = 0; + + for (int i = 0; i < iontypes->getList()->count(); i++) { + if (iontypes->getList()->item(i)->isSelected()) { + break; + } + else { + notselected++; + } + } + + if (iontypes->getList()->count() == notselected) { + errstr = "A ion type must be selected (e.g., [M+H]+) !"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + } + if ((precursormass->value() == 0) && (((eModeType)mode->currentIndex() == denovoengine) || ((eModeType)mode->currentIndex() == singlecomparison) || ((eModeType)mode->currentIndex() == databasesearch))) { - errstr = "The precursor m/z ratio cannot be zero!"; + errstr = "The precursor m/z ratio cannot be zero !"; msgBox.setText(errstr); msgBox.exec(); return false; } if (precursorcharge->value() == 0) { - errstr = "The charge cannot be zero!"; + errstr = "The charge cannot be zero !"; msgBox.setText(errstr); msgBox.exec(); return false; } if (((eModeType)mode->currentIndex() == compoundsearch) && (maximummz->value() <= minimummz->value())) { - errstr = "The maximum m/z ratio must be bigger than the minimum m/z ratio!"; + errstr = "The maximum m/z ratio must be bigger than the minimum m/z ratio !"; msgBox.setText(errstr); msgBox.exec(); return false; @@ -1228,7 +1288,7 @@ bool cParametersWidget::updateParameters() { if ((eModeType)mode->currentIndex() == denovoengine) { if ((ePeptideType)peptidetype->currentIndex() == other) { - errstr = "The peptide type 'Other' cannot be used in this mode!"; + errstr = "The peptide type 'Other' cannot be used in this mode !"; msgBox.setText(errstr); msgBox.exec(); return false; @@ -1238,7 +1298,7 @@ bool cParametersWidget::updateParameters() { if ((eModeType)mode->currentIndex() == singlecomparison) { if ((ePeptideType)peptidetype->currentIndex() == other) { if (searchedsequenceformula->text().isEmpty()) { - errstr = "The field 'Formula' is empty!"; + errstr = "The field 'Formula' is empty !"; msgBox.setText(errstr); msgBox.exec(); return false; @@ -1247,7 +1307,7 @@ bool cParametersWidget::updateParameters() { tmpstring = searchedsequenceformula->text().toStdString(); tmpformula.setFormula(tmpstring, false); if (!tmpformula.isValid(errmsg)) { - errstr = "The field 'Formula' is not valid!\n\n"; + errstr = "The field 'Formula' is not valid !\n\n"; errstr += errmsg.c_str(); msgBox.setText(errstr); msgBox.exec(); @@ -1322,13 +1382,19 @@ bool cParametersWidget::updateParameters() { parameters.sequencetag = sequencetag->text().toStdString(); parameters.originalsequencetag = parameters.sequencetag; - parameters.ionsfortheoreticalspectra.clear(); - - int start = -1; + parameters.ionsfortheoreticalspectraMS1.clear(); + parameters.ionsfortheoreticalspectraMS2.clear(); + if (((eModeType)mode->currentIndex() == dereplication) || ((eModeType)mode->currentIndex() == compoundsearch)) { - start = ms_Hplus; + for (int i = 0; i < iontypes->getList()->count(); i++) { + if (iontypes->getList()->item(i)->isSelected()) { + parameters.ionsfortheoreticalspectraMS1.push_back(globalpreferences->customions[i]); + } + } } else { + int start = -1; + switch ((ePeptideType)peptidetype->currentIndex()) { case linear: case branched: @@ -1347,12 +1413,12 @@ bool cParametersWidget::updateParameters() { default: break; } - } - if (start != -1) { - for (int i = 0; i < iontypes->getList()->count(); i++) { - if (iontypes->getList()->item(i)->isSelected()) { - parameters.ionsfortheoreticalspectra.push_back((eFragmentIonType)(i + start)); + if (start != -1) { + for (int i = 0; i < iontypes->getList()->count(); i++) { + if (iontypes->getList()->item(i)->isSelected()) { + parameters.ionsfortheoreticalspectraMS2.push_back((eFragmentIonType)(i + start)); + } } } } @@ -1443,11 +1509,23 @@ void cParametersWidget::restoreParameters() { hitsreported->setValue(parameters.hitsreported); sequencetag->setText(parameters.sequencetag.c_str()); - int start = -1; + for (int i = 0; i < iontypes->getList()->count(); i++) { + iontypes->getList()->item(i)->setSelected(false); + } + if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { - start = ms_Hplus; + for (int i = 0; i < (int)parameters.ionsfortheoreticalspectraMS1.size(); i++) { + for (int j = 0; j < iontypes->getList()->count(); j++) { + if (iontypes->getList()->item(j)->text().toStdString().compare(parameters.ionsfortheoreticalspectraMS1[i].name) == 0) { + iontypes->getList()->item(j)->setSelected(true); + break; + } + } + } } else { + int start = -1; + switch (parameters.peptidetype) { case linear: case branched: @@ -1466,14 +1544,15 @@ void cParametersWidget::restoreParameters() { default: break; } - } - if (start != -1) { - for (int i = 0; i < (int)parameters.ionsfortheoreticalspectra.size(); i++) { - iontypes->getList()->item(parameters.ionsfortheoreticalspectra[i] - start)->setSelected(true); + if (start != -1) { + for (int i = 0; i < (int)parameters.ionsfortheoreticalspectraMS2.size(); i++) { + iontypes->getList()->item(parameters.ionsfortheoreticalspectraMS2[i] - start)->setSelected(true); + } } } + neutrallosstypes->getList()->clear(); for (int i = 0; i < (int)parameters.originalneutrallossesdefinitions.size(); i++) { neutrallosstypes->addItem(parameters.originalneutrallossesdefinitions[i].summary.c_str()); @@ -1969,14 +2048,19 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { void cParametersWidget::resetFragmentIonTypes() { + iontypes->getList()->clear(); - eFragmentIonType start, end; if (((eModeType)mode->currentIndex() == dereplication) || ((eModeType)mode->currentIndex() == compoundsearch)) { - start = ms_Hplus; - end = ms_MGa4H; + if (globalpreferences) { + for (int i = 0; i < (int)globalpreferences->customions.size(); i++) { + iontypes->getList()->addItem(globalpreferences->customions[i].name.c_str()); + } + } } else { + eFragmentIonType start, end; + switch ((ePeptideType)peptidetype->currentIndex()) { case linear: case branched: @@ -2004,45 +2088,38 @@ void cParametersWidget::resetFragmentIonTypes() { default: break; } - } - for (int i = (int)start; i <= (int)end; i++) { + for (int i = (int)start; i <= (int)end; i++) { - iontypes->getList()->addItem(tr(parameters.iondefinitions[(eFragmentIonType)i].name.c_str())); + iontypes->getList()->addItem(tr(parameters.iondefinitions[(eFragmentIonType)i].name.c_str())); - if (((eModeType)mode->currentIndex() == dereplication) || ((eModeType)mode->currentIndex() == compoundsearch)) { - if ((eFragmentIonType)i == ms_Hplus) { - iontypes->getList()->item(i-start)->setSelected(true); - } - } - else { switch ((ePeptideType)peptidetype->currentIndex()) { case linear: case branched: if (((eFragmentIonType)i == b_ion) || ((eFragmentIonType)i == y_ion)) { - iontypes->getList()->item(i-start)->setSelected(true); + iontypes->getList()->item(i - start)->setSelected(true); } break; case cyclic: if ((eFragmentIonType)i == b_ion) { - iontypes->getList()->item(i-start)->setSelected(true); + iontypes->getList()->item(i - start)->setSelected(true); } break; case branchcyclic: if (((eFragmentIonType)i == b_ion) || ((eFragmentIonType)i == y_ion)) { - iontypes->getList()->item(i-start)->setSelected(true); + iontypes->getList()->item(i - start)->setSelected(true); } break; case linearpolyketide: if (((eFragmentIonType)i == l1h_ion) || ((eFragmentIonType)i == l2h_ion) || ((eFragmentIonType)i == r1h_ion) || ((eFragmentIonType)i == r2h_ion) || ((eFragmentIonType)i == l1oh_ion) || ((eFragmentIonType)i == l2oh_ion) || ((eFragmentIonType)i == r1oh_ion) || ((eFragmentIonType)i == r2oh_ion) ) { - iontypes->getList()->item(i-start)->setSelected(true); + iontypes->getList()->item(i - start)->setSelected(true); } break; case cyclicpolyketide: if (/*((eFragmentIonType)i == l0h_ion) ||*/ ((eFragmentIonType)i == l1h_ion) || ((eFragmentIonType)i == l2h_ion)) { - iontypes->getList()->item(i-start)->setSelected(true); + iontypes->getList()->item(i - start)->setSelected(true); } break; case other: @@ -2051,7 +2128,6 @@ void cParametersWidget::resetFragmentIonTypes() { break; } } - } } diff --git a/CycloBranch/gui/cParametersWidget.h b/CycloBranch/gui/cParametersWidget.h index 8dcabc8..09e79fd 100644 --- a/CycloBranch/gui/cParametersWidget.h +++ b/CycloBranch/gui/cParametersWidget.h @@ -18,6 +18,7 @@ #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "core/cSummaryFormula.h" #include "core/cParameters.h" #include "gui/cFragmentIonsListWidget.h" @@ -58,9 +59,10 @@ class cParametersWidget : public QWidget /** \brief The constructor. + \param globalpreferences global preferences of the application \param parent pointer to a parent widget */ - cParametersWidget(QWidget* parent = (QWidget *)0); + cParametersWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0); /** @@ -106,10 +108,18 @@ class cParametersWidget : public QWidget void setTag(int peptidetypeindex, QString tag); + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + private: QWidget* parent; + cGlobalPreferences* globalpreferences; cParameters parameters; QVBoxLayout* vlayout1; diff --git a/CycloBranch/gui/cPreferencesDialog.cpp b/CycloBranch/gui/cPreferencesDialog.cpp new file mode 100644 index 0000000..94ff4d4 --- /dev/null +++ b/CycloBranch/gui/cPreferencesDialog.cpp @@ -0,0 +1,79 @@ +#include "gui/cPreferencesDialog.h" +#include "gui/cPreferencesTabIonTypes.h" +#include "gui/cPreferencesTabDataProcessing.h" +#include "gui/cPreferencesTabDirectories.h" +#include "gui/cPreferencesTabURLs.h" + +#include + + +cPreferencesDialog::cPreferencesDialog(cGlobalPreferences& globalpreferences, QWidget *parent) : QDialog(parent) { + tabiontypes = new cPreferencesTabIonTypes(globalpreferences); + tabdataprocessing = new cPreferencesTabDataProcessing(globalpreferences); + tabdirectories = new cPreferencesTabDirectories(globalpreferences); + taburls = new cPreferencesTabURLs(globalpreferences); + + tabwidget = new QTabWidget(); + tabwidget->addTab(tabiontypes, tr("Ion Types")); + //tabwidget->addTab(tabdataprocessing, tr("Data Processing")); + tabwidget->addTab(tabdirectories, tr("Directories")); + tabwidget->addTab(taburls, tr("URLs")); + + buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + connect(buttonbox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(buttonbox, &QDialogButtonBox::rejected, this, &QDialog::reject); + + mainlayout = new QVBoxLayout(); + mainlayout->addWidget(tabwidget); + mainlayout->addWidget(buttonbox); + setLayout(mainlayout); + + resize(750, 600); + + setWindowTitle(tr("Preferences")); + setWindowIcon(QIcon(":/images/icons/preferences.png")); +} + + +void cPreferencesDialog::setPreferences(cGlobalPreferences& globalpreferences) { + tabiontypes->setPreferences(globalpreferences); + tabdataprocessing->setPreferences(globalpreferences); + tabdirectories->setPreferences(globalpreferences); + taburls->setPreferences(globalpreferences); +} + + +void cPreferencesDialog::resetPreferences(cGlobalPreferences& globalpreferences) { + tabiontypes->resetPreferences(globalpreferences); + tabdataprocessing->resetPreferences(globalpreferences); + tabdirectories->resetPreferences(globalpreferences); + taburls->resetPreferences(globalpreferences); +} + + +cPreferencesDialog::~cPreferencesDialog() { + delete tabiontypes; + delete tabdataprocessing; + delete tabdirectories; + delete taburls; + + delete tabwidget; + delete buttonbox; + + delete mainlayout; +} + + +void cPreferencesDialog::keyPressEvent(QKeyEvent *event) { + if (event->key() == Qt::Key_F1) { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/globalpreferences.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/globalpreferences.html").absoluteFilePath())); + #endif + } + + event->accept(); +} + diff --git a/CycloBranch/gui/cPreferencesDialog.h b/CycloBranch/gui/cPreferencesDialog.h new file mode 100644 index 0000000..7fb4561 --- /dev/null +++ b/CycloBranch/gui/cPreferencesDialog.h @@ -0,0 +1,91 @@ +/** + \file cPreferencesDialog.h + \brief The implementation of preferences dialog. +*/ + + +#ifndef _CPREFERENCESDIALOG_H +#define _CPREFERENCESDIALOG_H + +#include "core/cGlobalPreferences.h" + +#include +#include +#include +#include +#include +#include +#include + + +class cPreferencesTabIonTypes; +class cPreferencesTabDataProcessing; +class cPreferencesTabDirectories; +class cPreferencesTabURLs; + + +/** + \brief Preferences dialog. +*/ +class cPreferencesDialog : public QDialog +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + explicit cPreferencesDialog(cGlobalPreferences& globalpreferences, QWidget *parent = 0); + + + /** + \brief Set preferences. + \param globalpreferences global preferences of the application + */ + void setPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief Reset preferences. + \param globalpreferences global preferences of the application + */ + void resetPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief The destructor. + */ + ~cPreferencesDialog(); + + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + void keyPressEvent(QKeyEvent *event); + + +private: + + cPreferencesTabIonTypes* tabiontypes; + cPreferencesTabDataProcessing* tabdataprocessing; + cPreferencesTabDirectories* tabdirectories; + cPreferencesTabURLs* taburls; + + QTabWidget *tabwidget; + QDialogButtonBox *buttonbox; + + QVBoxLayout *mainlayout; + +}; + + +#endif + diff --git a/CycloBranch/gui/cPreferencesIonTypeDialog.cpp b/CycloBranch/gui/cPreferencesIonTypeDialog.cpp new file mode 100644 index 0000000..e59bde7 --- /dev/null +++ b/CycloBranch/gui/cPreferencesIonTypeDialog.cpp @@ -0,0 +1,93 @@ +#include "gui/cPreferencesIonTypeDialog.h" + +#include + + +cPreferencesIonTypeDialog::cPreferencesIonTypeDialog(QWidget *parent) : QDialog(parent) { + gridlayout = new QGridLayout(); + + labelname = new QLabel("Name : "); + lineeditname = new QLineEdit(); + gridlayout->addWidget(labelname, 0, 0); + gridlayout->addWidget(lineeditname, 0, 1); + + labelformula = new QLabel("Formula : "); + lineeditformula = new QLineEdit(); + gridlayout->addWidget(labelformula, 1, 0); + gridlayout->addWidget(lineeditformula, 1, 1); + + labelmode = new QLabel("Mode : "); + comboboxmode = new QComboBox(); + comboboxmode->addItem("positive"); + comboboxmode->addItem("negative"); + gridlayout->addWidget(labelmode, 2, 0); + gridlayout->addWidget(comboboxmode, 2, 1); + + labelmultiplier = new QLabel("M : "); + spinboxmultiplier = new QSpinBox(); + spinboxmultiplier->setRange(1, 100); + spinboxmultiplier->setSingleStep(1); + gridlayout->addWidget(labelmultiplier, 3, 0); + gridlayout->addWidget(spinboxmultiplier, 3, 1); + + gridlayoutwidget = new QWidget(); + gridlayoutwidget->setLayout(gridlayout); + + buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + + connect(buttonbox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(buttonbox, &QDialogButtonBox::rejected, this, &QDialog::reject); + + mainlayout = new QVBoxLayout(); + mainlayout->addWidget(gridlayoutwidget); + mainlayout->addWidget(buttonbox); + setLayout(mainlayout); + + resize(300, 200); + + setWindowTitle(tr("Define Ion Type")); + setWindowIcon(QIcon(":/images/icons/preferences.png")); +} + + +void cPreferencesIonTypeDialog::getValues(cIonType& ion) { + ion.name = lineeditname->text().toStdString(); + ion.formula = lineeditformula->text().toStdString(); + ion.positive = (comboboxmode->currentIndex() == 0) ? true : false; + ion.multiplier = spinboxmultiplier->value(); + + cSummaryFormula formula; + formula.setFormula(ion.formula); + ion.massdifference = formula.getMass(); +} + + +void cPreferencesIonTypeDialog::setValues(cIonType& ion) { + lineeditname->setText(ion.name.c_str()); + lineeditformula->setText(ion.formula.c_str()); + ion.positive ? comboboxmode->setCurrentIndex(0) : comboboxmode->setCurrentIndex(1); + spinboxmultiplier->setValue(ion.multiplier); +} + + +cPreferencesIonTypeDialog::~cPreferencesIonTypeDialog() { + delete labelname; + delete lineeditname; + + delete labelformula; + delete lineeditformula; + + delete labelmode; + delete comboboxmode; + + delete labelmultiplier; + delete spinboxmultiplier; + + delete gridlayout; + delete gridlayoutwidget; + + delete buttonbox; + + delete mainlayout; +} + diff --git a/CycloBranch/gui/cPreferencesIonTypeDialog.h b/CycloBranch/gui/cPreferencesIonTypeDialog.h new file mode 100644 index 0000000..841f681 --- /dev/null +++ b/CycloBranch/gui/cPreferencesIonTypeDialog.h @@ -0,0 +1,86 @@ +/** + \file cPreferencesIonTypeDialog.h + \brief The implementation of ion type dialog. +*/ + + +#ifndef _CPREFERENCESIONTYPEDIALOG_H +#define _CPREFERENCESIONTYPEDIALOG_H + +#include "core/cSummaryFormula.h" +#include "core/cGlobalPreferences.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/** + \brief Preferences dialog. +*/ +class cPreferencesIonTypeDialog : public QDialog +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + explicit cPreferencesIonTypeDialog(QWidget *parent = 0); + + + /** + \brief Get values. + \param ion ion + */ + void getValues(cIonType& ion); + + + /** + \brief Set values. + \param ion ion + */ + void setValues(cIonType& ion); + + + /** + \brief The destructor. + */ + ~cPreferencesIonTypeDialog(); + + +private: + + QVBoxLayout *mainlayout; + + QDialogButtonBox *buttonbox; + + QWidget* gridlayoutwidget; + QGridLayout* gridlayout; + + QLabel* labelname; + QLineEdit* lineeditname; + + QLabel* labelformula; + QLineEdit* lineeditformula; + + QLabel* labelmode; + QComboBox* comboboxmode; + + QLabel* labelmultiplier; + QSpinBox* spinboxmultiplier; + +}; + + +#endif + diff --git a/CycloBranch/gui/cPreferencesTabDataProcessing.cpp b/CycloBranch/gui/cPreferencesTabDataProcessing.cpp new file mode 100644 index 0000000..3c4a574 --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabDataProcessing.cpp @@ -0,0 +1,77 @@ +#include "gui/cPreferencesTabDataProcessing.h" + + +cPreferencesTabDataProcessing::cPreferencesTabDataProcessing(cGlobalPreferences& globalpreferences, QWidget *parent) : QWidget(parent) { + gridlayout = new QGridLayout(); + + labelbafprocessingmethod = new QLabel("BAF processing method : "); + comboboxbafprocessingmethod = new QComboBox(); + comboboxbafprocessingmethod->addItem("CompassXport"); + comboboxbafprocessingmethod->addItem("CompassXtract"); + gridlayout->addWidget(labelbafprocessingmethod, 0, 0); + gridlayout->addWidget(comboboxbafprocessingmethod, 0, 1); + + labelrawdataprocessingmethod = new QLabel("Peak Picking (non-vendor's file formats) : "); + comboboxrawdataprocessingmethod = new QComboBox(); + comboboxrawdataprocessingmethod->addItem("OpenMS"); + comboboxrawdataprocessingmethod->addItem("Built-in"); + gridlayout->addWidget(labelrawdataprocessingmethod, 1, 0); + gridlayout->addWidget(comboboxrawdataprocessingmethod, 1, 1); + + gridlayoutwidget = new QWidget(); + gridlayoutwidget->setLayout(gridlayout); + + defaultbutton = new QPushButton("Default"); + hlayout = new QHBoxLayout(); + hlayout->addWidget(defaultbutton); + hlayout->addStretch(1); + hwidget = new QWidget(); + hwidget->setLayout(hlayout); + + mainlayout = new QVBoxLayout(); + mainlayout->addWidget(gridlayoutwidget); + mainlayout->addWidget(hwidget); + mainlayout->addStretch(1); + + setLayout(mainlayout); + + connect(defaultbutton, SIGNAL(released()), this, SLOT(defaultButtonReleased())); +} + + +void cPreferencesTabDataProcessing::setPreferences(cGlobalPreferences& globalpreferences) { + globalpreferences.bafprocessingmethod = comboboxbafprocessingmethod->currentIndex(); + globalpreferences.rawdataprocessingmethod = comboboxrawdataprocessingmethod->currentIndex(); +} + + +void cPreferencesTabDataProcessing::resetPreferences(cGlobalPreferences& globalpreferences) { + comboboxbafprocessingmethod->setCurrentIndex(globalpreferences.bafprocessingmethod); + comboboxrawdataprocessingmethod->setCurrentIndex(globalpreferences.rawdataprocessingmethod); +} + + +cPreferencesTabDataProcessing::~cPreferencesTabDataProcessing() { + delete labelbafprocessingmethod; + delete comboboxbafprocessingmethod; + + delete labelrawdataprocessingmethod; + delete comboboxrawdataprocessingmethod; + + delete defaultbutton; + delete hlayout; + delete hwidget; + + delete gridlayout; + delete gridlayoutwidget; + + delete mainlayout; +} + + +void cPreferencesTabDataProcessing::defaultButtonReleased() { + cGlobalPreferences gp; + comboboxbafprocessingmethod->setCurrentIndex(gp.bafprocessingmethod); + comboboxrawdataprocessingmethod->setCurrentIndex(gp.rawdataprocessingmethod); +} + diff --git a/CycloBranch/gui/cPreferencesTabDataProcessing.h b/CycloBranch/gui/cPreferencesTabDataProcessing.h new file mode 100644 index 0000000..5ae96ed --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabDataProcessing.h @@ -0,0 +1,85 @@ +/** + \file cPreferencesTabDataProcessing.h + \brief The implementation of a tab used to define the data processing parameters in preferences dialog. +*/ + + +#ifndef _CPREFERENCESTABDATAPROCESSING_H +#define _CPREFERENCESTABDATAPROCESSING_H + +#include "core/cGlobalPreferences.h" + +#include +#include +#include +#include +#include +#include + + +/** + \brief The class representing a tab used to define the data processing parameters. +*/ +class cPreferencesTabDataProcessing : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + explicit cPreferencesTabDataProcessing(cGlobalPreferences& globalpreferences, QWidget *parent = 0); + + + /** + \brief Set preferences. + \param globalpreferences global preferences of the application + */ + void setPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief Reset preferences. + \param globalpreferences global preferences of the application + */ + void resetPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief The destructor. + */ + ~cPreferencesTabDataProcessing(); + + +private: + + QVBoxLayout *mainlayout; + + QWidget* gridlayoutwidget; + QGridLayout* gridlayout; + + QLabel* labelbafprocessingmethod; + QComboBox* comboboxbafprocessingmethod; + + QLabel* labelrawdataprocessingmethod; + QComboBox* comboboxrawdataprocessingmethod; + + QWidget* hwidget; + QHBoxLayout* hlayout; + QPushButton* defaultbutton; + + +private slots: + + + void defaultButtonReleased(); + +}; + + +#endif + diff --git a/CycloBranch/gui/cPreferencesTabDirectories.cpp b/CycloBranch/gui/cPreferencesTabDirectories.cpp new file mode 100644 index 0000000..ccb32ac --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabDirectories.cpp @@ -0,0 +1,351 @@ +#include "gui/cPreferencesTabDirectories.h" + + +cPreferencesTabDirectories::cPreferencesTabDirectories(cGlobalPreferences& globalpreferences, QWidget *parent) : QWidget(parent) { + gridlayout = new QGridLayout(); + + labelsettingsdefaultdir = new QLabel("Settings : "); + lineeditsettingsdefaultdir = new QLineEdit(); + lineeditsettingsdefaultdir->setText(globalpreferences.settingsdefaultdir); + buttonsettingsdefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelsettingsdefaultdir, 0, 0); + gridlayout->addWidget(lineeditsettingsdefaultdir, 0, 1); + gridlayout->addWidget(buttonsettingsdefaultdir, 0, 2); + + labelpeaklistsdefaultdir = new QLabel("Peaklists : "); + lineeditpeaklistsdefaultdir = new QLineEdit(); + lineeditpeaklistsdefaultdir->setText(globalpreferences.peaklistsdefaultdir); + buttonpeaklistsdefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelpeaklistsdefaultdir, 1, 0); + gridlayout->addWidget(lineeditpeaklistsdefaultdir, 1, 1); + gridlayout->addWidget(buttonpeaklistsdefaultdir, 1, 2); + + labelblocksdefaultdir = new QLabel("Building Blocks : "); + lineeditblocksdefaultdir = new QLineEdit(); + lineeditblocksdefaultdir->setText(globalpreferences.blocksdefaultdir); + buttonblocksdefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelblocksdefaultdir, 2, 0); + gridlayout->addWidget(lineeditblocksdefaultdir, 2, 1); + gridlayout->addWidget(buttonblocksdefaultdir, 2, 2); + + labelsequencesdefaultdir = new QLabel("Sequences/Compounds : "); + lineeditsequencesdefaultdir = new QLineEdit(); + lineeditsequencesdefaultdir->setText(globalpreferences.sequencesdefaultdir); + buttonsequencesdefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelsequencesdefaultdir, 3, 0); + gridlayout->addWidget(lineeditsequencesdefaultdir, 3, 1); + gridlayout->addWidget(buttonsequencesdefaultdir, 3, 2); + + labelmodificationsdefaultdir = new QLabel("Modifications : "); + lineeditmodificationsdefaultdir = new QLineEdit(); + lineeditmodificationsdefaultdir->setText(globalpreferences.modificationsdefaultdir); + buttonmodificationsdefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelmodificationsdefaultdir, 4, 0); + gridlayout->addWidget(lineeditmodificationsdefaultdir, 4, 1); + gridlayout->addWidget(buttonmodificationsdefaultdir, 4, 2); + + labelopenopticalimagedefaultdir = new QLabel("Optical Images : "); + lineeditopenopticalimagedefaultdir = new QLineEdit(); + lineeditopenopticalimagedefaultdir->setText(globalpreferences.openopticalimagedir); + buttonopenopticalimagedefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelopenopticalimagedefaultdir, 5, 0); + gridlayout->addWidget(lineeditopenopticalimagedefaultdir, 5, 1); + gridlayout->addWidget(buttonopenopticalimagedefaultdir, 5, 2); + + labelopenhistologyimagedefaultdir = new QLabel("Histology Images : "); + lineeditopenhistologyimagedefaultdir = new QLineEdit(); + lineeditopenhistologyimagedefaultdir->setText(globalpreferences.openhistologyimagedir); + buttonopenhistologyimagedefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelopenhistologyimagedefaultdir, 6, 0); + gridlayout->addWidget(lineeditopenhistologyimagedefaultdir, 6, 1); + gridlayout->addWidget(buttonopenhistologyimagedefaultdir, 6, 2); + + labelopenmicroscopyimagedefaultdir = new QLabel("Microscopy Images : "); + lineeditopenmicroscopyimagedefaultdir = new QLineEdit(); + lineeditopenmicroscopyimagedefaultdir->setText(globalpreferences.openmicroscopyimagedir); + buttonopenmicroscopyimagedefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelopenmicroscopyimagedefaultdir, 7, 0); + gridlayout->addWidget(lineeditopenmicroscopyimagedefaultdir, 7, 1); + gridlayout->addWidget(buttonopenmicroscopyimagedefaultdir, 7, 2); + + labelresultsdefaultdir = new QLabel("Results : "); + lineeditresultsdefaultdir = new QLineEdit(); + lineeditresultsdefaultdir->setText(globalpreferences.resultsdefaultdir); + buttonresultsdefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelresultsdefaultdir, 8, 0); + gridlayout->addWidget(lineeditresultsdefaultdir, 8, 1); + gridlayout->addWidget(buttonresultsdefaultdir, 8, 2); + + labelexportcsvdefaultdir = new QLabel("Export CSV : "); + lineeditexportcsvdefaultdir = new QLineEdit(); + lineeditexportcsvdefaultdir->setText(globalpreferences.exportcsvdefaultdir); + buttonexportcsvdefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelexportcsvdefaultdir, 9, 0); + gridlayout->addWidget(lineeditexportcsvdefaultdir, 9, 1); + gridlayout->addWidget(buttonexportcsvdefaultdir, 9, 2); + + labelexporthtmldefaultdir = new QLabel("Export HTML : "); + lineeditexporthtmldefaultdir = new QLineEdit(); + lineeditexporthtmldefaultdir->setText(globalpreferences.exporthtmldefaultdir); + buttonexporthtmldefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelexporthtmldefaultdir, 10, 0); + gridlayout->addWidget(lineeditexporthtmldefaultdir, 10, 1); + gridlayout->addWidget(buttonexporthtmldefaultdir, 10, 2); + + labelexportimagedefaultdir = new QLabel("Export Images : "); + lineeditexportimagedefaultdir = new QLineEdit(); + lineeditexportimagedefaultdir->setText(globalpreferences.exportimagedefaultdir); + buttonexportimagedefaultdir = new QPushButton("Browse"); + gridlayout->addWidget(labelexportimagedefaultdir, 11, 0); + gridlayout->addWidget(lineeditexportimagedefaultdir, 11, 1); + gridlayout->addWidget(buttonexportimagedefaultdir, 11, 2); + + gridlayoutwidget = new QWidget(); + gridlayoutwidget->setLayout(gridlayout); + + defaultbutton = new QPushButton("Default"); + hlayout = new QHBoxLayout(); + hlayout->addWidget(defaultbutton); + hlayout->addStretch(1); + hwidget = new QWidget(); + hwidget->setLayout(hlayout); + + mainlayout = new QVBoxLayout(); + mainlayout->addWidget(gridlayoutwidget); + mainlayout->addWidget(hwidget); + mainlayout->addStretch(1); + + setLayout(mainlayout); + + connect(buttonsettingsdefaultdir, SIGNAL(released()), this, SLOT(settingsButtonReleased())); + connect(buttonpeaklistsdefaultdir, SIGNAL(released()), this, SLOT(peaklistsButtonReleased())); + connect(buttonblocksdefaultdir, SIGNAL(released()), this, SLOT(blocksButtonReleased())); + connect(buttonsequencesdefaultdir, SIGNAL(released()), this, SLOT(sequencesButtonReleased())); + connect(buttonmodificationsdefaultdir, SIGNAL(released()), this, SLOT(modificationsButtonReleased())); + connect(buttonopenopticalimagedefaultdir, SIGNAL(released()), this, SLOT(openOpticalImageButtonReleased())); + connect(buttonopenhistologyimagedefaultdir, SIGNAL(released()), this, SLOT(openHistologyImageButtonReleased())); + connect(buttonopenmicroscopyimagedefaultdir, SIGNAL(released()), this, SLOT(openMicroscopyImageButtonReleased())); + connect(buttonresultsdefaultdir, SIGNAL(released()), this, SLOT(resultsButtonReleased())); + connect(buttonexportcsvdefaultdir, SIGNAL(released()), this, SLOT(exportCSVButtonReleased())); + connect(buttonexporthtmldefaultdir, SIGNAL(released()), this, SLOT(exportHTMLButtonReleased())); + connect(buttonexportimagedefaultdir, SIGNAL(released()), this, SLOT(exportImageButtonReleased())); + connect(defaultbutton, SIGNAL(released()), this, SLOT(defaultButtonReleased())); +} + + +void cPreferencesTabDirectories::setPreferences(cGlobalPreferences& globalpreferences) { + globalpreferences.settingsdefaultdir = lineeditsettingsdefaultdir->text(); + globalpreferences.peaklistsdefaultdir = lineeditpeaklistsdefaultdir->text(); + globalpreferences.blocksdefaultdir = lineeditblocksdefaultdir->text(); + globalpreferences.sequencesdefaultdir = lineeditsequencesdefaultdir->text(); + globalpreferences.modificationsdefaultdir = lineeditmodificationsdefaultdir->text(); + globalpreferences.openopticalimagedir = lineeditopenopticalimagedefaultdir->text(); + globalpreferences.openhistologyimagedir = lineeditopenhistologyimagedefaultdir->text(); + globalpreferences.openmicroscopyimagedir = lineeditopenmicroscopyimagedefaultdir->text(); + globalpreferences.resultsdefaultdir = lineeditresultsdefaultdir->text(); + globalpreferences.exportcsvdefaultdir = lineeditexportcsvdefaultdir->text(); + globalpreferences.exporthtmldefaultdir = lineeditexporthtmldefaultdir->text(); + globalpreferences.exportimagedefaultdir = lineeditexportimagedefaultdir->text(); +} + + +void cPreferencesTabDirectories::resetPreferences(cGlobalPreferences& globalpreferences) { + lineeditsettingsdefaultdir->setText(globalpreferences.settingsdefaultdir); + lineeditpeaklistsdefaultdir->setText(globalpreferences.peaklistsdefaultdir); + lineeditblocksdefaultdir->setText(globalpreferences.blocksdefaultdir); + lineeditsequencesdefaultdir->setText(globalpreferences.sequencesdefaultdir); + lineeditmodificationsdefaultdir->setText(globalpreferences.modificationsdefaultdir); + lineeditopenopticalimagedefaultdir->setText(globalpreferences.openopticalimagedir); + lineeditopenhistologyimagedefaultdir->setText(globalpreferences.openhistologyimagedir); + lineeditopenmicroscopyimagedefaultdir->setText(globalpreferences.openmicroscopyimagedir); + lineeditresultsdefaultdir->setText(globalpreferences.resultsdefaultdir); + lineeditexportcsvdefaultdir->setText(globalpreferences.exportcsvdefaultdir); + lineeditexporthtmldefaultdir->setText(globalpreferences.exporthtmldefaultdir); + lineeditexportimagedefaultdir->setText(globalpreferences.exportimagedefaultdir); +} + + +cPreferencesTabDirectories::~cPreferencesTabDirectories() { + delete labelsettingsdefaultdir; + delete lineeditsettingsdefaultdir; + delete buttonsettingsdefaultdir; + + delete labelpeaklistsdefaultdir; + delete lineeditpeaklistsdefaultdir; + delete buttonpeaklistsdefaultdir; + + delete labelblocksdefaultdir; + delete lineeditblocksdefaultdir; + delete buttonblocksdefaultdir; + + delete labelsequencesdefaultdir; + delete lineeditsequencesdefaultdir; + delete buttonsequencesdefaultdir; + + delete labelmodificationsdefaultdir; + delete lineeditmodificationsdefaultdir; + delete buttonmodificationsdefaultdir; + + delete labelopenopticalimagedefaultdir; + delete lineeditopenopticalimagedefaultdir; + delete buttonopenopticalimagedefaultdir; + + delete labelopenhistologyimagedefaultdir; + delete lineeditopenhistologyimagedefaultdir; + delete buttonopenhistologyimagedefaultdir; + + delete labelopenmicroscopyimagedefaultdir; + delete lineeditopenmicroscopyimagedefaultdir; + delete buttonopenmicroscopyimagedefaultdir; + + delete labelresultsdefaultdir; + delete lineeditresultsdefaultdir; + delete buttonresultsdefaultdir; + + delete labelexportcsvdefaultdir; + delete lineeditexportcsvdefaultdir; + delete buttonexportcsvdefaultdir; + + delete labelexporthtmldefaultdir; + delete lineeditexporthtmldefaultdir; + delete buttonexporthtmldefaultdir; + + delete labelexportimagedefaultdir; + delete lineeditexportimagedefaultdir; + delete buttonexportimagedefaultdir; + + delete defaultbutton; + delete hlayout; + delete hwidget; + + delete gridlayout; + delete gridlayoutwidget; + + delete mainlayout; +} + + +void cPreferencesTabDirectories::settingsButtonReleased() { + QString currentdir = lineeditsettingsdefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditsettingsdefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::peaklistsButtonReleased() { + QString currentdir = lineeditpeaklistsdefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditpeaklistsdefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::blocksButtonReleased() { + QString currentdir = lineeditblocksdefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditblocksdefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::sequencesButtonReleased() { + QString currentdir = lineeditsequencesdefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditsequencesdefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::modificationsButtonReleased() { + QString currentdir = lineeditmodificationsdefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditmodificationsdefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::openOpticalImageButtonReleased() { + QString currentdir = lineeditopenopticalimagedefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditopenopticalimagedefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::openHistologyImageButtonReleased() { + QString currentdir = lineeditopenhistologyimagedefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditopenhistologyimagedefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::openMicroscopyImageButtonReleased() { + QString currentdir = lineeditopenmicroscopyimagedefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditopenmicroscopyimagedefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::resultsButtonReleased() { + QString currentdir = lineeditresultsdefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditresultsdefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::exportCSVButtonReleased() { + QString currentdir = lineeditexportcsvdefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditexportcsvdefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::exportHTMLButtonReleased() { + QString currentdir = lineeditexporthtmldefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditexporthtmldefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::exportImageButtonReleased() { + QString currentdir = lineeditexportimagedefaultdir->text(); + QString newdir = QFileDialog::getExistingDirectory(this, tr("Select directory ..."), currentdir, QFileDialog::ShowDirsOnly); + if (!newdir.isEmpty()) { + lineeditexportimagedefaultdir->setText(newdir); + } +} + + +void cPreferencesTabDirectories::defaultButtonReleased() { + cGlobalPreferences gp; + lineeditsettingsdefaultdir->setText(gp.settingsdefaultdir); + lineeditpeaklistsdefaultdir->setText(gp.peaklistsdefaultdir); + lineeditblocksdefaultdir->setText(gp.blocksdefaultdir); + lineeditsequencesdefaultdir->setText(gp.sequencesdefaultdir); + lineeditmodificationsdefaultdir->setText(gp.modificationsdefaultdir); + lineeditopenopticalimagedefaultdir->setText(gp.openopticalimagedir); + lineeditopenhistologyimagedefaultdir->setText(gp.openhistologyimagedir); + lineeditopenmicroscopyimagedefaultdir->setText(gp.openmicroscopyimagedir); + lineeditresultsdefaultdir->setText(gp.resultsdefaultdir); + lineeditexportcsvdefaultdir->setText(gp.exportcsvdefaultdir); + lineeditexporthtmldefaultdir->setText(gp.exporthtmldefaultdir); + lineeditexportimagedefaultdir->setText(gp.exportimagedefaultdir); +} + diff --git a/CycloBranch/gui/cPreferencesTabDirectories.h b/CycloBranch/gui/cPreferencesTabDirectories.h new file mode 100644 index 0000000..65b944c --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabDirectories.h @@ -0,0 +1,165 @@ +/** + \file cPreferencesTabDirectories.h + \brief The implementation of a tab used to define default directories in preferences dialog. +*/ + + +#ifndef _CPREFERENCESTABDIRECTORIES_H +#define _CPREFERENCESTABDIRECTORIES_H + +#include "core/cGlobalPreferences.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +/** + \brief The class representing a tab of default directories. +*/ +class cPreferencesTabDirectories : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + explicit cPreferencesTabDirectories(cGlobalPreferences& globalpreferences, QWidget *parent = 0); + + + /** + \brief Set preferences. + \param globalpreferences global preferences of the application + */ + void setPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief Reset preferences. + \param globalpreferences global preferences of the application + */ + void resetPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief The destructor. + */ + ~cPreferencesTabDirectories(); + + +private: + + QVBoxLayout *mainlayout; + + QWidget* gridlayoutwidget; + QGridLayout* gridlayout; + + QLabel* labelsettingsdefaultdir; + QLineEdit* lineeditsettingsdefaultdir; + QPushButton* buttonsettingsdefaultdir; + + QLabel* labelpeaklistsdefaultdir; + QLineEdit* lineeditpeaklistsdefaultdir; + QPushButton* buttonpeaklistsdefaultdir; + + QLabel* labelblocksdefaultdir; + QLineEdit* lineeditblocksdefaultdir; + QPushButton* buttonblocksdefaultdir; + + QLabel* labelsequencesdefaultdir; + QLineEdit* lineeditsequencesdefaultdir; + QPushButton* buttonsequencesdefaultdir; + + QLabel* labelmodificationsdefaultdir; + QLineEdit* lineeditmodificationsdefaultdir; + QPushButton* buttonmodificationsdefaultdir; + + QLabel* labelopenopticalimagedefaultdir; + QLineEdit* lineeditopenopticalimagedefaultdir; + QPushButton* buttonopenopticalimagedefaultdir; + + QLabel* labelopenhistologyimagedefaultdir; + QLineEdit* lineeditopenhistologyimagedefaultdir; + QPushButton* buttonopenhistologyimagedefaultdir; + + QLabel* labelopenmicroscopyimagedefaultdir; + QLineEdit* lineeditopenmicroscopyimagedefaultdir; + QPushButton* buttonopenmicroscopyimagedefaultdir; + + QLabel* labelresultsdefaultdir; + QLineEdit* lineeditresultsdefaultdir; + QPushButton* buttonresultsdefaultdir; + + QLabel* labelexportcsvdefaultdir; + QLineEdit* lineeditexportcsvdefaultdir; + QPushButton* buttonexportcsvdefaultdir; + + QLabel* labelexporthtmldefaultdir; + QLineEdit* lineeditexporthtmldefaultdir; + QPushButton* buttonexporthtmldefaultdir; + + QLabel* labelexportimagedefaultdir; + QLineEdit* lineeditexportimagedefaultdir; + QPushButton* buttonexportimagedefaultdir; + + QWidget* hwidget; + QHBoxLayout* hlayout; + QPushButton* defaultbutton; + + +private slots: + + + void settingsButtonReleased(); + + + void peaklistsButtonReleased(); + + + void blocksButtonReleased(); + + + void sequencesButtonReleased(); + + + void modificationsButtonReleased(); + + + void openOpticalImageButtonReleased(); + + + void openHistologyImageButtonReleased(); + + + void openMicroscopyImageButtonReleased(); + + + void resultsButtonReleased(); + + + void exportCSVButtonReleased(); + + + void exportHTMLButtonReleased(); + + + void exportImageButtonReleased(); + + + void defaultButtonReleased(); + +}; + + +#endif + diff --git a/CycloBranch/gui/cPreferencesTabIonTypes.cpp b/CycloBranch/gui/cPreferencesTabIonTypes.cpp new file mode 100644 index 0000000..6f4a33c --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabIonTypes.cpp @@ -0,0 +1,209 @@ +#include "gui/cPreferencesTabIonTypes.h" + +#include "core/cFragmentIons.h" + + +cPreferencesTabIonTypes::cPreferencesTabIonTypes(cGlobalPreferences& globalpreferences, QWidget *parent) : QWidget(parent) { + list = new QListWidget(); + resetPreferences(globalpreferences); + + addbutton = new QPushButton("Add"); + addbutton->setToolTip("Add a new item."); + + editbutton = new QPushButton("Edit"); + editbutton->setToolTip("Edit selected item."); + + removebutton = new QPushButton("Remove"); + removebutton->setToolTip("Remove selected item."); + + defaultbutton = new QPushButton("Default"); + defaultbutton->setToolTip("Set default items."); + + hlayout = new QHBoxLayout(); + hlayout->addWidget(addbutton); + hlayout->addWidget(editbutton); + hlayout->addWidget(removebutton); + hlayout->addWidget(defaultbutton); + hlayout->addStretch(1); + + hwidget = new QWidget(); + hwidget->setLayout(hlayout); + + vlayout = new QVBoxLayout(); + vlayout->addWidget(list); + vlayout->addWidget(hwidget); + + setLayout(vlayout); + + connect(list, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(listItemDoubleClicked(QListWidgetItem*))); + connect(addbutton, SIGNAL(released()), this, SLOT(addButtonReleased())); + connect(editbutton, SIGNAL(released()), this, SLOT(editButtonReleased())); + connect(removebutton, SIGNAL(released()), this, SLOT(removeButtonReleased())); + connect(defaultbutton, SIGNAL(released()), this, SLOT(defaultButtonReleased())); + + iontypedialog = new cPreferencesIonTypeDialog(this); +} + + +void cPreferencesTabIonTypes::setPreferences(cGlobalPreferences& globalpreferences) { + globalpreferences.customions = localcustomions; +} + + +void cPreferencesTabIonTypes::resetPreferences(cGlobalPreferences& globalpreferences) { + localcustomions = globalpreferences.customions; + + list->clear(); + for (auto& it : localcustomions) { + list->addItem(it.name.c_str()); + } +} + + +cPreferencesTabIonTypes::~cPreferencesTabIonTypes() { + delete addbutton; + delete editbutton; + delete removebutton; + delete defaultbutton; + + delete hlayout; + delete hwidget; + + delete vlayout; + + delete iontypedialog; +} + + +bool cPreferencesTabIonTypes::isValid(cIonType& ion, int row, string& errormessage) { + errormessage = ""; + + if (ion.name.empty()) { + errormessage = "The name of ion is empty !"; + return false; + } + + if (ion.formula.empty()) { + errormessage = "The formula is empty !"; + return false; + } + + if (ion.name[0] != '[') { + errormessage = "The name of ion must begin with '[' !"; + return false; + } + + if ((ion.name.substr(ion.name.size() - 2).compare("]+") != 0) && (ion.name.substr(ion.name.size() - 2).compare("]-") != 0)) { + errormessage = "The name of ion must end with ']+' or ']-' !"; + return false; + } + + if ((ion.name.substr(ion.name.size() - 2).compare("]+") == 0) && !ion.positive) { + errormessage = "This ion cannot be defined in negative mode !"; + return false; + } + + if ((ion.name.substr(ion.name.size() - 2).compare("]-") == 0) && ion.positive) { + errormessage = "This ion cannot be defined in positive mode !"; + return false; + } + + cSummaryFormula formula; + formula.setFormula(ion.formula); + if (!formula.isValid(errormessage)) { + return false; + } + + for (int i = 0; i < (int)localcustomions.size(); i++) { + if (row != -1) { + if (i == row) { + continue; + } + } + + if (localcustomions[i].name.compare(ion.name) == 0) { + errormessage = "A ion with the same name "; + errormessage += ion.name.c_str(); + errormessage += " is already defined !"; + return false; + } + } + + return true; +} + + +void cPreferencesTabIonTypes::listItemDoubleClicked(QListWidgetItem* item) { + editButtonReleased(); +} + + +void cPreferencesTabIonTypes::addButtonReleased() { + cIonType ion; + iontypedialog->setValues(ion); + + string errormessage; + bool valid; + + do { + if (iontypedialog->exec() != QDialog::Accepted) { + return; + } + iontypedialog->getValues(ion); + valid = isValid(ion, -1, errormessage); + if (!valid) { + QMessageBox msgBox; + msgBox.setText(errormessage.c_str()); + msgBox.exec(); + } + } while (!valid); + + list->addItem(ion.name.c_str()); + localcustomions.push_back(ion); +} + + +void cPreferencesTabIonTypes::editButtonReleased() { + cIonType ion; + + string errormessage; + bool valid; + + int row = list->currentRow(); + + if ((list->count() > 0) && (row != -1)) { + iontypedialog->setValues(localcustomions[row]); + + do { + if (iontypedialog->exec() != QDialog::Accepted) { + return; + } + iontypedialog->getValues(ion); + valid = isValid(ion, row, errormessage); + if (!valid) { + QMessageBox msgBox; + msgBox.setText(errormessage.c_str()); + msgBox.exec(); + } + } while (!valid); + + localcustomions[row] = ion; + list->item(row)->setText(localcustomions[row].name.c_str()); + } +} + + +void cPreferencesTabIonTypes::removeButtonReleased() { + int row = list->currentRow(); + if ((list->count() > 0) && (row != -1)) { + delete list->takeItem(row); + localcustomions.erase(localcustomions.begin() + row); + } +} + + +void cPreferencesTabIonTypes::defaultButtonReleased() { + cGlobalPreferences gp; + resetPreferences(gp); +} + diff --git a/CycloBranch/gui/cPreferencesTabIonTypes.h b/CycloBranch/gui/cPreferencesTabIonTypes.h new file mode 100644 index 0000000..a8ead8e --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabIonTypes.h @@ -0,0 +1,101 @@ +/** + \file cPreferencesTabIonTypes.h + \brief The implementation of a tab used to define ion types in preferences dialog. +*/ + + +#ifndef _CPREFERENCESTABIONTYPES_H +#define _CPREFERENCESTABIONTYPES_H + +#include "core/cGlobalPreferences.h" +#include "gui/cPreferencesIonTypeDialog.h" + +#include +#include +#include +#include +#include +#include + + +/** + \brief The class representing a tab of ion types. +*/ +class cPreferencesTabIonTypes : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + explicit cPreferencesTabIonTypes(cGlobalPreferences& globalpreferences, QWidget *parent = 0); + + + /** + \brief Set preferences. + \param globalpreferences global preferences of the application + */ + void setPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief Reset preferences. + \param globalpreferences global preferences of the application + */ + void resetPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief The destructor. + */ + ~cPreferencesTabIonTypes(); + + +private: + + vector localcustomions; + + cPreferencesIonTypeDialog* iontypedialog; + + QListWidget* list; + + QHBoxLayout *hlayout; + QWidget* hwidget; + + QVBoxLayout *vlayout; + + QPushButton* addbutton; + QPushButton* editbutton; + QPushButton* removebutton; + QPushButton* defaultbutton; + + + bool isValid(cIonType& ion, int row, string& errormessage); + + +private slots: + + void listItemDoubleClicked(QListWidgetItem* item); + + + void addButtonReleased(); + + + void editButtonReleased(); + + + void removeButtonReleased(); + + + void defaultButtonReleased(); + +}; + + +#endif + diff --git a/CycloBranch/gui/cPreferencesTabURLs.cpp b/CycloBranch/gui/cPreferencesTabURLs.cpp new file mode 100644 index 0000000..107d7d5 --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabURLs.cpp @@ -0,0 +1,75 @@ +#include "gui/cPreferencesTabURLs.h" + + +cPreferencesTabURLs::cPreferencesTabURLs(cGlobalPreferences& globalpreferences, QWidget *parent) : QWidget(parent) { + gridlayout = new QGridLayout(); + + labelurl1 = new QLabel("Norine : "); + lineediturl1 = new QLineEdit(); + lineediturl1->setText(globalpreferences.bookmarkurl1); + gridlayout->addWidget(labelurl1, 0, 0); + gridlayout->addWidget(lineediturl1, 0, 1); + + labelurl2 = new QLabel("BBDGNC : "); + lineediturl2 = new QLineEdit(); + lineediturl2->setText(globalpreferences.bookmarkurl2); + gridlayout->addWidget(labelurl2, 1, 0); + gridlayout->addWidget(lineediturl2, 1, 1); + + gridlayoutwidget = new QWidget(); + gridlayoutwidget->setLayout(gridlayout); + + defaultbutton = new QPushButton("Default"); + hlayout = new QHBoxLayout(); + hlayout->addWidget(defaultbutton); + hlayout->addStretch(1); + hwidget = new QWidget(); + hwidget->setLayout(hlayout); + + mainlayout = new QVBoxLayout(); + mainlayout->addWidget(gridlayoutwidget); + mainlayout->addWidget(hwidget); + mainlayout->addStretch(1); + + setLayout(mainlayout); + + connect(defaultbutton, SIGNAL(released()), this, SLOT(defaultButtonReleased())); +} + + +void cPreferencesTabURLs::setPreferences(cGlobalPreferences& globalpreferences) { + globalpreferences.bookmarkurl1 = lineediturl1->text(); + globalpreferences.bookmarkurl2 = lineediturl2->text(); +} + + +void cPreferencesTabURLs::resetPreferences(cGlobalPreferences& globalpreferences) { + lineediturl1->setText(globalpreferences.bookmarkurl1); + lineediturl2->setText(globalpreferences.bookmarkurl2); +} + + +cPreferencesTabURLs::~cPreferencesTabURLs() { + delete labelurl1; + delete lineediturl1; + + delete labelurl2; + delete lineediturl2; + + delete defaultbutton; + delete hlayout; + delete hwidget; + + delete gridlayout; + delete gridlayoutwidget; + + delete mainlayout; +} + + +void cPreferencesTabURLs::defaultButtonReleased() { + cGlobalPreferences gp; + lineediturl1->setText(gp.bookmarkurl1); + lineediturl2->setText(gp.bookmarkurl2); +} + diff --git a/CycloBranch/gui/cPreferencesTabURLs.h b/CycloBranch/gui/cPreferencesTabURLs.h new file mode 100644 index 0000000..4b6a991 --- /dev/null +++ b/CycloBranch/gui/cPreferencesTabURLs.h @@ -0,0 +1,85 @@ +/** + \file cPreferencesTabURLs.h + \brief The implementation of a tab used to define URLs in preferences dialog. +*/ + + +#ifndef _CPREFERENCESTABURLS_H +#define _CPREFERENCESTABURLS_H + +#include "core/cGlobalPreferences.h" + +#include +#include +#include +#include +#include +#include +#include + + +/** + \brief The class representing a tab of URLs. +*/ +class cPreferencesTabURLs : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + explicit cPreferencesTabURLs(cGlobalPreferences& globalpreferences, QWidget *parent = 0); + + + /** + \brief Set preferences. + \param globalpreferences global preferences of the application + */ + void setPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief Reset preferences. + \param globalpreferences global preferences of the application + */ + void resetPreferences(cGlobalPreferences& globalpreferences); + + + /** + \brief The destructor. + */ + ~cPreferencesTabURLs(); + + +private: + + QVBoxLayout *mainlayout; + + QWidget* gridlayoutwidget; + QGridLayout* gridlayout; + + QLabel* labelurl1; + QLineEdit* lineediturl1; + + QLabel* labelurl2; + QLineEdit* lineediturl2; + + QWidget* hwidget; + QHBoxLayout* hlayout; + QPushButton* defaultbutton; + + +private slots: + + void defaultButtonReleased(); + +}; + + +#endif + diff --git a/CycloBranch/gui/cSequenceDatabaseWidget.cpp b/CycloBranch/gui/cSequenceDatabaseWidget.cpp index 904d9de..d8bfdc3 100644 --- a/CycloBranch/gui/cSequenceDatabaseWidget.cpp +++ b/CycloBranch/gui/cSequenceDatabaseWidget.cpp @@ -18,7 +18,8 @@ #include -cSequenceDatabaseWidget::cSequenceDatabaseWidget(QWidget* parent) { +cSequenceDatabaseWidget::cSequenceDatabaseWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { + this->globalpreferences = globalpreferences; this->parent = parent; editorname = "Sequence/Compound Database Editor"; @@ -245,11 +246,7 @@ cSequenceDatabaseWidget::cSequenceDatabaseWidget(QWidget* parent) { databasefile = ""; - #if OS_TYPE == WIN - lastdir = "./SequenceDatabases/"; - #else - lastdir = installdir + "SequenceDatabases/"; - #endif + applyGlobalPreferences(globalpreferences); sequences.clear(); @@ -321,6 +318,15 @@ void cSequenceDatabaseWidget::importSequence(int peptidetypeindex, QString seque } +void cSequenceDatabaseWidget::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if (lastdir.right(4).compare(".txt", Qt::CaseInsensitive) != 0) { + lastdir = globalpreferences->sequencesdefaultdir; + } + } +} + + void cSequenceDatabaseWidget::deleteTable() { for (int i = 0; i < databasemodel->columnCount(); i++) { if (database->itemDelegateForColumn(i)) { diff --git a/CycloBranch/gui/cSequenceDatabaseWidget.h b/CycloBranch/gui/cSequenceDatabaseWidget.h index c76a1a3..57c583b 100644 --- a/CycloBranch/gui/cSequenceDatabaseWidget.h +++ b/CycloBranch/gui/cSequenceDatabaseWidget.h @@ -20,6 +20,7 @@ #include #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "core/cSequenceDatabase.h" #include "gui/cSequenceDatabaseProxyModel.h" #include "gui/cViewButtonDelegate.h" @@ -48,9 +49,10 @@ class cSequenceDatabaseWidget : public QMainWindow /** \brief The constructor. + \param globalpreferences global preferences of the application \param parent pointer to a parent widget */ - cSequenceDatabaseWidget(QWidget* parent = (QWidget *)0); + cSequenceDatabaseWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0); /** @@ -74,12 +76,21 @@ class cSequenceDatabaseWidget : public QMainWindow void importSequence(int peptidetypeindex, QString sequence); + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + private: QString editorname; QWidget* parent; + cGlobalPreferences* globalpreferences; + QMenuBar* menuBar; QMenu* menuFile; QMenu* menuEdit; diff --git a/CycloBranch/gui/cSpectrumDetailWidget.cpp b/CycloBranch/gui/cSpectrumDetailWidget.cpp index 5551561..25126ee 100644 --- a/CycloBranch/gui/cSpectrumDetailWidget.cpp +++ b/CycloBranch/gui/cSpectrumDetailWidget.cpp @@ -55,7 +55,7 @@ cSpectrumDetailWidget& cSpectrumDetailWidget::operator=(const cSpectrumDetailWid theoreticalspectrum = new cTheoreticalSpectrum(); if (parameters && sd.theoreticalspectrum) { - initialize(rowid, parameters, *sd.theoreticalspectrum, sd.parent); + initialize(rowid, globalpreferences, parameters, *sd.theoreticalspectrum, sd.parent); } if (parameters && sd.preparedToShow) { @@ -68,11 +68,12 @@ cSpectrumDetailWidget& cSpectrumDetailWidget::operator=(const cSpectrumDetailWid } -void cSpectrumDetailWidget::initialize(int rowid, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent) { +void cSpectrumDetailWidget::initialize(int rowid, cGlobalPreferences* globalpreferences, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent) { this->rowid = rowid; - this->parent = parent; + this->globalpreferences = globalpreferences; this->parameters = parameters; *this->theoreticalspectrum = theoreticalspectrum; + this->parent = parent; } @@ -324,7 +325,7 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica tmp2 += 3; celltext = peak->description.substr(tmp1, rangle - tmp1 + 1).c_str(); - if (celltext.contains("https://www.ncbi.nlm.nih.gov/pccompound?term=")) { + if (celltext.contains("https://pubchem.ncbi.nlm.nih.gov/#query=")) { celltext += "search"; } else { @@ -511,7 +512,7 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo tmp2 += 3; celltext = peak->description.substr(tmp1, rangle - tmp1 + 1).c_str(); - if (celltext.contains("https://www.ncbi.nlm.nih.gov/pccompound?term=")) { + if (celltext.contains("https://pubchem.ncbi.nlm.nih.gov/#query=")) { celltext += "search"; } else { @@ -760,7 +761,7 @@ void cSpectrumDetailWidget::prepareToShow(QAction* actionShowIsomers, cPeakListS toolbarFile = addToolBar(tr("File")); - actionExportTable = new QAction(QIcon(":/images/icons/62.png"), tr("&Export Table to CSV"), this); + actionExportTable = new QAction(QIcon(":/images/icons/csv.png"), tr("&Export Table to CSV"), this); actionExportTable->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); actionExportTable->setToolTip("Export Table to CSV (Ctrl + E)"); toolbarFile->addAction(actionExportTable); @@ -1012,8 +1013,8 @@ void cSpectrumDetailWidget::prepareToShow(QAction* actionShowIsomers, cPeakListS toolbarIonSeries->addWidget(ionserieswidget); ionseriescombobox->addItem(tr("all")); - for (int i = 0; i < (int)parameters->ionsfortheoreticalspectra.size(); i++) { - ionseriescombobox->addItem(tr(parameters->iondefinitions[parameters->ionsfortheoreticalspectra[i]].name.c_str())); + for (int i = 0; i < (int)parameters->ionsfortheoreticalspectraMS2.size(); i++) { + ionseriescombobox->addItem(tr(parameters->iondefinitions[parameters->ionsfortheoreticalspectraMS2[i]].name.c_str())); } connect(ionseriescombobox, SIGNAL(currentIndexChanged(QString)), spectrumscene, SLOT(ionSeriesChanged(QString))); @@ -1833,10 +1834,15 @@ void cSpectrumDetailWidget::setMZInterval() { void cSpectrumDetailWidget::exportSpectrum() { + QString currentdir = "./"; + if (globalpreferences) { + currentdir = globalpreferences->exportimagedefaultdir; + } + #if OS_TYPE == WIN - QString filename = QFileDialog::getSaveFileName(this, tr("Export Spectrum..."), "./", "PDF Files (*.pdf);; PS Files (*.ps);; PNG Files (*.png);; SVG Files (*.svg)"); + QString filename = QFileDialog::getSaveFileName(this, tr("Export Spectrum..."), currentdir, "PDF Files (*.pdf);; PS Files (*.ps);; PNG Files (*.png);; SVG Files (*.svg)"); #else - QString filename = QFileDialog::getSaveFileName(this, tr("Export Spectrum..."), "./", "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); + QString filename = QFileDialog::getSaveFileName(this, tr("Export Spectrum..."), currentdir, "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); #endif if (!filename.isEmpty()) { regex rx; @@ -1879,10 +1885,15 @@ void cSpectrumDetailWidget::exportSpectrum() { void cSpectrumDetailWidget::exportPeptide() { + QString currentdir = "./"; + if (globalpreferences) { + currentdir = globalpreferences->exportimagedefaultdir; + } + #if OS_TYPE == WIN - QString filename = QFileDialog::getSaveFileName(this, tr("Export Peptide..."), "./", "PDF Files (*.pdf);; PS Files (*.ps);; PNG Files (*.png);; SVG Files (*.svg)"); + QString filename = QFileDialog::getSaveFileName(this, tr("Export Peptide..."), currentdir, "PDF Files (*.pdf);; PS Files (*.ps);; PNG Files (*.png);; SVG Files (*.svg)"); #else - QString filename = QFileDialog::getSaveFileName(this, tr("Export Peptide..."), "./", "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); + QString filename = QFileDialog::getSaveFileName(this, tr("Export Peptide..."), currentdir, "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); #endif if (!filename.isEmpty() && parameters) { regex rx; @@ -2031,7 +2042,12 @@ void cSpectrumDetailWidget::openExportImageDialog() { void cSpectrumDetailWidget::exportTableToCSV() { - QString filename = QFileDialog::getSaveFileName(this, tr("Export Table to CSV..."), "./", "Files (*.csv)"); + QString currentdir = "./"; + if (globalpreferences) { + currentdir = globalpreferences->exportcsvdefaultdir; + } + + QString filename = QFileDialog::getSaveFileName(this, tr("Export Table to CSV..."), currentdir, "Files (*.csv)"); if (!filename.isEmpty()) { @@ -2814,17 +2830,30 @@ void cSpectrumDetailWidget::closeWindow() { void cSpectrumDetailWidget::tableDoubleClicked(const QModelIndex& index) { + QStandardItem* item; + double value; + + int theoreticalmzcolumn = 1; + int experimentalmzcolumn = 2; if (parameters->generateisotopepattern) { experimentalmzcolumn = 3; } - QStandardItem* item = peakstablemodel->item(proxymodel->mapToSource(index).row(), experimentalmzcolumn); - double value; + item = peakstablemodel->item(proxymodel->mapToSource(index).row(), experimentalmzcolumn); + if (item) { + value = item->data(Qt::DisplayRole).toDouble(); + if (value > 0) { + emit emitMZInterval(max(0.0, value - 5.0), value + 5.0); + return; + } + } + + item = peakstablemodel->item(proxymodel->mapToSource(index).row(), theoreticalmzcolumn); if (item) { value = item->data(Qt::DisplayRole).toDouble(); if (value > 0) { - emit emitMZInterval(value - 5.0, value + 5.0); + emit emitMZInterval(max(0.0, value - 5.0), value + 5.0); } } } diff --git a/CycloBranch/gui/cSpectrumDetailWidget.h b/CycloBranch/gui/cSpectrumDetailWidget.h index 6093293..12e0cf9 100644 --- a/CycloBranch/gui/cSpectrumDetailWidget.h +++ b/CycloBranch/gui/cSpectrumDetailWidget.h @@ -22,6 +22,7 @@ #include #include #include +#include "core/cGlobalPreferences.h" #include "core/cTheoreticalSpectrum.h" #include "gui/cLinearWidget.h" #include "gui/cCyclicWidget.h" @@ -119,11 +120,12 @@ class cSpectrumDetailWidget : public QMainWindow /** \brief Initialize the widget. \param rowid id of a row + \param globalpreferences global preferences of the application \param parameters a pointer to parameters \param theoreticalspectrum a reference to a theoretical spectrum \param parent pointer to a parent widget */ - void initialize(int rowid, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent); + void initialize(int rowid, cGlobalPreferences* globalpreferences, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent); /** @@ -303,6 +305,7 @@ class cSpectrumDetailWidget : public QMainWindow set localneutralosses; + cGlobalPreferences* globalpreferences; cParameters* parameters; cPeakListSeries* rawdata; diff --git a/CycloBranch/gui/cSummaryPeaksTableWidget.cpp b/CycloBranch/gui/cSummaryPeaksTableWidget.cpp index cd01924..6968a5f 100644 --- a/CycloBranch/gui/cSummaryPeaksTableWidget.cpp +++ b/CycloBranch/gui/cSummaryPeaksTableWidget.cpp @@ -22,13 +22,14 @@ #include -cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(QWidget* parent) { +cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { title = "Summary Table of Matched Peaks"; + this->globalpreferences = globalpreferences; this->parent = parent; setWindowTitle(title); - setWindowIcon(QIcon(":/images/icons/43.png")); + setWindowIcon(QIcon(":/images/icons/table.png")); menuBar = new QMenuBar(this); menuBar->setNativeMenuBar(false); @@ -163,7 +164,7 @@ cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(QWidget* parent) { toolbarFile = addToolBar(tr("File")); - actionExportCSV = new QAction(QIcon(":/images/icons/62.png"), tr("&Export to CSV"), this); + actionExportCSV = new QAction(QIcon(":/images/icons/csv.png"), tr("&Export to CSV"), this); actionExportCSV->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); actionExportCSV->setToolTip("Export to CSV (Ctrl + E)"); toolbarFile->addAction(actionExportCSV); @@ -222,10 +223,7 @@ cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(QWidget* parent) { resize(defaultwinsizex, defaultwinsizey); - lastdirexporttocsv = "./"; - lastdirexportstatisticstocsv = "./"; - - coordinates.clear(); + applyGlobalPreferences(globalpreferences); } @@ -324,8 +322,6 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard deleteTable(); proxymodel->initialize(parameters->mode, parameters->peaklistfileformat, parameters->generateisotopepattern, rowsfilteroperator, rowsfiltercombobox1, rowsfiltercomparatorcombobox1, rowsfilterline1, rowsfiltercombobox2, rowsfiltercomparatorcombobox2, rowsfilterline2); - coordinates.clear(); - // prepare the header if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { @@ -536,7 +532,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard int currentrow; cPeaksList eicchromatogram; - eicchromatogram.clear(); + vector coordinateinfo; QBrush brush; brush.setColor(QColor(0, 0, 0)); @@ -558,7 +554,11 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard spectrumindex = resultsstandardmodel->item(i, 1)->data(Qt::DisplayRole).toInt() - 1; if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformat != mis) && (parameters->peaklistfileformat != imzML)) { - addEICPeak(eicchromatogram, (*spectralist)[spectrumindex].getExperimentalSpectrum()); + addEICPeak(eicchromatogram, (*spectralist)[spectrumindex], (*spectralist)[spectrumindex].getExperimentalSpectrum()); + } + + if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML))) { + addCoordinateInfo(spectrumindex, coordinateinfo, (*spectralist)[spectrumindex], (*spectralist)[spectrumindex].getExperimentalSpectrum()); } if ((*spectralist)[spectrumindex].getNumberOfMatchedPeaks() == 0) { @@ -606,8 +606,6 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard databasemodel->item(currentrow, currentcolumn)->setForeground(brush); databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue((*spectralist)[spectrumindex].getExperimentalSpectrum().getCoordinateY()), Qt::DisplayRole); currentcolumn++; - - coordinates.push_back(cCoordinates((*spectralist)[spectrumindex].getExperimentalSpectrum().getCoordinateX(), (*spectralist)[spectrumindex].getExperimentalSpectrum().getCoordinateY(), spectrumindex + 1, cropPrecisionToSixDecimals(peak->matchedmz), cropPrecisionToSixDecimals(peak->matchedrelativeintensity), peak->matchedabsoluteintensity)); } else { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); @@ -699,16 +697,6 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard databasemodel->item(currentrow, currentcolumn)->setText(stmp.c_str()); completernameset.insert(stmp.c_str()); - - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - coordinates.back().name = databasemodel->item(currentrow, iontypecol)->text().toStdString() + " "; - if (databasemodel->item(currentrow, currentcolumn)->text().length() > 40) { - coordinates.back().name += databasemodel->item(currentrow, currentcolumn)->text().toStdString().substr(0, 37) + "..."; - } - else { - coordinates.back().name += databasemodel->item(currentrow, currentcolumn)->text().toStdString(); - } - } currentcolumn++; tmp = (int)peak->description.find('<'); @@ -725,15 +713,6 @@ 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(secondspace + 1, peak->description.rfind('(') - secondspace - 2).c_str()); - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - coordinates.back().name = databasemodel->item(currentrow, iontypecol)->text().toStdString() + " "; - if (databasemodel->item(currentrow, currentcolumn)->text().length() > 40) { - coordinates.back().name += databasemodel->item(currentrow, currentcolumn)->text().toStdString().substr(0, 37) + "..."; - } - else { - coordinates.back().name += databasemodel->item(currentrow, currentcolumn)->text().toStdString(); - } - } currentcolumn++; databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); @@ -789,8 +768,9 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + origcoordinateinfo = coordinateinfo; emit resetRegion(); - emit sendFilterOptionsToImageWindow(coordinates, (bool)rowsfilteroperator->currentIndex(), rowsfiltercombobox1->currentText().toStdString(), rowsfiltercomparatorcombobox1->currentText().toStdString(), rowsfilterline1->text().toStdString(), rowsfiltercombobox2->currentText().toStdString(), rowsfiltercomparatorcombobox2->currentText().toStdString(), rowsfilterline2->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); + emit sendFilterOptionsToImageWindow(coordinateinfo, (bool)rowsfilteroperator->currentIndex(), rowsfiltercombobox1->currentText().toStdString(), rowsfiltercomparatorcombobox1->currentText().toStdString(), rowsfilterline1->text().toStdString(), rowsfiltercombobox2->currentText().toStdString(), rowsfiltercomparatorcombobox2->currentText().toStdString(), rowsfilterline2->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); if (parameters->generateisotopepattern) { database->setColumnWidth(12, min(400, database->columnWidth(12))); @@ -858,24 +838,129 @@ void cSummaryPeaksTableWidget::updateFilterBySelectedRegion(int xmin, int xmax, } -void cSummaryPeaksTableWidget::addEICPeak(cPeaksList& eicchromatogram, cPeaksList& experimentalspectrum) { - unsigned long long intensity = 0; - cPeak peak; +void cSummaryPeaksTableWidget::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if (lastdirexporttocsv.right(4).compare(".csv", Qt::CaseInsensitive) != 0) { + lastdirexporttocsv = globalpreferences->exportcsvdefaultdir; + } + if (lastdirexportstatisticstocsv.right(4).compare(".csv", Qt::CaseInsensitive) != 0) { + lastdirexportstatisticstocsv = globalpreferences->exportcsvdefaultdir; + } + } +} + + +void cSummaryPeaksTableWidget::addEICPeak(cPeaksList& eicchromatogram, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum) { + double intensity = 0; + int size; + + set matchedcompounds; + string matcheditem; + size_t pos; - int size = experimentalspectrum.size(); + size = experimentalspectrum.size(); for (int i = 0; i < size; i++) { - if (experimentalspectrum[i].matched == 0) { - continue; + if (experimentalspectrum[i].matched > 0) { + intensity += experimentalspectrum[i].absoluteintensity; + } + } + + size = theoreticalspectrum.getNumberOfPeaks(); + for (int i = 0; i < size; i++) { + if (theoreticalspectrum[i].matched > 0) { + matcheditem.clear(); + + pos = parameters->peakidtodesc[theoreticalspectrum[i].descriptionid].find(""); + if (pos != string::npos) { + matcheditem = parameters->peakidtodesc[theoreticalspectrum[i].descriptionid].substr(0, pos + 4); + } + + if (!matcheditem.empty()) { + matchedcompounds.insert(matcheditem); + } } - intensity += experimentalspectrum[i].absoluteintensity; } - peak.clear(); + + matcheditem.clear(); + for (auto& it : matchedcompounds) { + matcheditem += it; + matcheditem += "
"; + } + + cPeak peak; peak.mzratio = (double)(eicchromatogram.size() + 1); peak.absoluteintensity = intensity; + peak.description = matcheditem; eicchromatogram.add(peak); } +void cSummaryPeaksTableWidget::addCoordinateInfo(int spectrumindex, vector& coordinateinfo, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum) { + cCoordinateInfo item; + int size; + + set matchedcompounds; + string matcheditem, tmpstr; + size_t pos1, pos2; + + size = experimentalspectrum.size(); + for (int i = 0; i < size; i++) { + if (experimentalspectrum[i].matched > 0) { + item.relativeintensity += experimentalspectrum[i].relativeintensity; + item.absoluteintensity += experimentalspectrum[i].absoluteintensity; + } + } + + size = theoreticalspectrum.getNumberOfPeaks(); + for (int i = 0; i < size; i++) { + if (theoreticalspectrum[i].matched > 0) { + matcheditem.clear(); + + pos1 = parameters->peakidtodesc[theoreticalspectrum[i].descriptionid].find('<'); + if (pos1 != string::npos) { + matcheditem = parameters->peakidtodesc[theoreticalspectrum[i].descriptionid].substr(0, pos1 - 1); + + pos1 = parameters->peakidtodesc[theoreticalspectrum[i].descriptionid].rfind(""); + pos2 = parameters->peakidtodesc[theoreticalspectrum[i].descriptionid].find('>'); + if ((pos1 != string::npos) && (pos2 != string::npos)) { + tmpstr = parameters->peakidtodesc[theoreticalspectrum[i].descriptionid].substr(pos2 + 1, pos1 - pos2 - 1); + if (tmpstr.size() > 40) { + matcheditem += tmpstr.substr(0, 37) + "..."; + } + else { + matcheditem += tmpstr; + } + } + else { + matcheditem.clear(); + } + } + + if (!matcheditem.empty()) { + matchedcompounds.insert(matcheditem); + } + } + } + + matcheditem.clear(); + for (auto& it : matchedcompounds) { + if (!matcheditem.empty()) { + matcheditem += "\n"; + } + matcheditem += it; + } + + item.id = spectrumindex + 1; + item.x = experimentalspectrum.getCoordinateX(); + item.y = experimentalspectrum.getCoordinateY(); + item.description = matcheditem; + + if (item.absoluteintensity > 0) { + coordinateinfo.push_back(item); + } +} + + void cSummaryPeaksTableWidget::keyPressEvent(QKeyEvent *event) { if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { if (rowsfilterline1->hasFocus() || rowsfilterline2->hasFocus()) { @@ -943,7 +1028,7 @@ void cSummaryPeaksTableWidget::filterRows() { Qt::CaseSensitivity casesensitive = rowsfiltercasesensitive->isChecked()?Qt::CaseSensitive:Qt::CaseInsensitive; QString str = ""; int i, id, x, y; - int iontypecol, mzcol, relintcol, absintcol, namecol; + int iontypecol, mzcol, relintcol, absintcol, namecol, referencecol; cPeaksList eicchromatogram; eicchromatogram.clear(); @@ -965,17 +1050,25 @@ void cSummaryPeaksTableWidget::filterRows() { } } else { + iontypecol = 2; if (parameters->generateisotopepattern) { + mzcol = 5; absintcol = 7; + namecol = 12; + referencecol = 13; } else { + mzcol = 4; absintcol = 6; + namecol = 9; + referencecol = 10; } eicchromatogram = origeicchromatogram; for (i = 0; i < eicchromatogram.size(); i++) { eicchromatogram[i].absoluteintensity = 0; eicchromatogram[i].relativeintensity = 0; + eicchromatogram[i].description = ""; } } } @@ -994,7 +1087,11 @@ void cSummaryPeaksTableWidget::filterRows() { proxymodel->setFilterFixedString(str); // prepare data for visualization - coordinates.clear(); + vector coordinateinfo; + map coordinatemap; + map > experimentalmz; + string tmpdescription; + if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { int proxymodelrowcount = proxymodel->rowCount(); @@ -1003,21 +1100,40 @@ void cSummaryPeaksTableWidget::filterRows() { y = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 2)))->data(Qt::DisplayRole).toInt(); if (((proxymodel->xmin == -1) && (proxymodel->xmax == -1) && (proxymodel->ymin == -1) && (proxymodel->ymax == -1)) || ((x >= proxymodel->xmin) && (x <= proxymodel->xmax) && (y >= proxymodel->ymin) && (y <= proxymodel->ymax))) { - coordinates.push_back(cCoordinates( - x, - y, - databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 0)))->text().toInt(), - databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, mzcol)))->data(Qt::DisplayRole).toDouble(), - databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, relintcol)))->data(Qt::DisplayRole).toDouble(), - databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, absintcol)))->data(Qt::DisplayRole).toDouble() - )); - coordinates.back().name = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, iontypecol)))->text().toStdString() + " "; + + id = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 0)))->data(Qt::DisplayRole).toInt(); // ok + + tmpdescription = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, mzcol)))->data(Qt::DisplayRole).toString().toStdString(); + if (experimentalmz[id].count(tmpdescription) == 0) { + if (coordinatemap.count(id) == 1) { + coordinatemap[id].relativeintensity += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, relintcol)))->data(Qt::DisplayRole).toDouble(); + coordinatemap[id].absoluteintensity += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, absintcol)))->data(Qt::DisplayRole).toDouble(); + } + else { + coordinatemap[id].id = id; + coordinatemap[id].x = x; + coordinatemap[id].y = y; + coordinatemap[id].relativeintensity = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, relintcol)))->data(Qt::DisplayRole).toDouble(); + coordinatemap[id].absoluteintensity = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, absintcol)))->data(Qt::DisplayRole).toDouble(); + } + experimentalmz[id].insert(tmpdescription); + } + + tmpdescription = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, iontypecol)))->text().toStdString() + " "; if (databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol)))->text().length() > 40) { - coordinates.back().name += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol)))->text().toStdString().substr(0, 37) + "..."; + tmpdescription += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol)))->text().toStdString().substr(0, 37) + "..."; } else { - coordinates.back().name += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol)))->text().toStdString(); + tmpdescription += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol)))->text().toStdString(); } + + if (coordinatemap[id].description.find(tmpdescription) == string::npos) { + if (!coordinatemap[id].description.empty()) { + coordinatemap[id].description += "\n"; + } + coordinatemap[id].description += tmpdescription; + } + } progress.setValue(i); @@ -1027,12 +1143,37 @@ void cSummaryPeaksTableWidget::filterRows() { break; } } + + if (!progress.wasCanceled()) { + for (auto& it : coordinatemap) { + if (it.second.absoluteintensity > 0) { + coordinateinfo.push_back(it.second); + } + } + } } else { int proxymodelrowcount = proxymodel->rowCount(); for (i = 0; i < proxymodelrowcount; i++) { - id = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 0)))->data(Qt::DisplayRole).toInt() - 1; - eicchromatogram[id].absoluteintensity += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, absintcol)))->data(Qt::DisplayRole).toDouble(); + id = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 0)))->data(Qt::DisplayRole).toInt() - 1; // ok + + tmpdescription = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, mzcol)))->data(Qt::DisplayRole).toString().toStdString(); + if (experimentalmz[id].count(tmpdescription) == 0) { + eicchromatogram[id].absoluteintensity += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, absintcol)))->data(Qt::DisplayRole).toDouble(); + experimentalmz[id].insert(tmpdescription); + } + + tmpdescription = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, iontypecol)))->text().toStdString(); + tmpdescription += " itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, referencecol)))->text().toStdString(); + tmpdescription += "\">"; + tmpdescription += databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol)))->text().toStdString(); + tmpdescription += ""; + + if (eicchromatogram[id].description.find(tmpdescription) == string::npos) { + eicchromatogram[id].description += tmpdescription; + eicchromatogram[id].description += "
"; + } progress.setValue(i); @@ -1046,7 +1187,7 @@ void cSummaryPeaksTableWidget::filterRows() { if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && !progress.wasCanceled()) { if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - emit sendFilterOptionsToImageWindow(coordinates, (bool)rowsfilteroperator->currentIndex(), rowsfiltercombobox1->currentText().toStdString(), rowsfiltercomparatorcombobox1->currentText().toStdString(), rowsfilterline1->text().toStdString(), rowsfiltercombobox2->currentText().toStdString(), rowsfiltercomparatorcombobox2->currentText().toStdString(), rowsfilterline2->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); + emit sendFilterOptionsToImageWindow(coordinateinfo, (bool)rowsfilteroperator->currentIndex(), rowsfiltercombobox1->currentText().toStdString(), rowsfiltercomparatorcombobox1->currentText().toStdString(), rowsfilterline1->text().toStdString(), rowsfiltercombobox2->currentText().toStdString(), rowsfiltercomparatorcombobox2->currentText().toStdString(), rowsfilterline2->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); } else { eicchromatogram.normalizeIntenzity(); @@ -1064,70 +1205,20 @@ void cSummaryPeaksTableWidget::resetFilter() { rowsfilterline1->setText(""); rowsfilterline2->setText(""); - int rowcount = databasemodel->rowCount(); - int i, x, y; - int iontypecol, mzcol, relintcol, absintcol, namecol; - - cPeaksList eicchromatogram; - eicchromatogram.clear(); - - if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - iontypecol = 3; - if (parameters->generateisotopepattern) { - mzcol = 6; - relintcol = 7; - absintcol = 8; - namecol = 13; - } - else { - mzcol = 5; - relintcol = 6; - absintcol = 7; - namecol = 10; - } - } - } - - QProgressDialog progress("Updating...", 0, 0, rowcount, this); - progress.setMinimumWidth(250); - cEventFilter filter; - progress.installEventFilter(&filter); - progress.setMinimumDuration(0); - progress.setWindowModality(Qt::ApplicationModal); - - coordinates.clear(); if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - for (i = 0; i < rowcount; i++) { - x = databasemodel->item(i, 1)->data(Qt::DisplayRole).toInt(); - y = databasemodel->item(i, 2)->data(Qt::DisplayRole).toInt(); - - if (((proxymodel->xmin == -1) && (proxymodel->xmax == -1) && (proxymodel->ymin == -1) && (proxymodel->ymax == -1)) || ((x >= proxymodel->xmin) && (x <= proxymodel->xmax) && (y >= proxymodel->ymin) && (y <= proxymodel->ymax))) { - coordinates.push_back(cCoordinates( - x, - y, - databasemodel->item(i, 0)->text().toInt(), - databasemodel->item(i, mzcol)->data(Qt::DisplayRole).toDouble(), - databasemodel->item(i, relintcol)->data(Qt::DisplayRole).toDouble(), - databasemodel->item(i, absintcol)->data(Qt::DisplayRole).toDouble() - )); - coordinates.back().name = databasemodel->item(i, iontypecol)->text().toStdString() + " "; - if (databasemodel->item(i, namecol)->text().length() > 40) { - coordinates.back().name += databasemodel->item(i, namecol)->text().toStdString().substr(0, 37) + "..."; - } - else { - coordinates.back().name += databasemodel->item(i, namecol)->text().toStdString(); - } + vector coordinateinfo; + + for (auto& it : origcoordinateinfo) { + if (((proxymodel->xmin == -1) && (proxymodel->xmax == -1) && (proxymodel->ymin == -1) && (proxymodel->ymax == -1)) || ((it.x >= proxymodel->xmin) && (it.x <= proxymodel->xmax) && (it.y >= proxymodel->ymin) && (it.y <= proxymodel->ymax))) { + coordinateinfo.push_back(it); } - - progress.setValue(i); } - emit sendFilterOptionsToImageWindow(coordinates, (bool)rowsfilteroperator->currentIndex(), rowsfiltercombobox1->currentText().toStdString(), rowsfiltercomparatorcombobox1->currentText().toStdString(), rowsfilterline1->text().toStdString(), rowsfiltercombobox2->currentText().toStdString(), rowsfiltercomparatorcombobox2->currentText().toStdString(), rowsfilterline2->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); + + emit sendFilterOptionsToImageWindow(coordinateinfo, (bool)rowsfilteroperator->currentIndex(), rowsfiltercombobox1->currentText().toStdString(), rowsfiltercomparatorcombobox1->currentText().toStdString(), rowsfilterline1->text().toStdString(), rowsfiltercombobox2->currentText().toStdString(), rowsfiltercomparatorcombobox2->currentText().toStdString(), rowsfilterline2->text().toStdString(), rowsfiltercasesensitive->isChecked(), rowsfilterwholeword->isChecked()); } else { - eicchromatogram = origeicchromatogram; - emit sendFilterOptionsToChromatogram(eicchromatogram); + emit sendFilterOptionsToChromatogram(origeicchromatogram); } } @@ -1137,8 +1228,6 @@ void cSummaryPeaksTableWidget::resetFilter() { proxymodel->setWholeWord(false); proxymodel->setFilterKeyColumn(-1); proxymodel->setFilterFixedString(""); - - progress.setValue(rowcount); } diff --git a/CycloBranch/gui/cSummaryPeaksTableWidget.h b/CycloBranch/gui/cSummaryPeaksTableWidget.h index 52e7a30..035d3b0 100644 --- a/CycloBranch/gui/cSummaryPeaksTableWidget.h +++ b/CycloBranch/gui/cSummaryPeaksTableWidget.h @@ -24,6 +24,7 @@ #include #include #include "core/utilities.h" +#include "core/cGlobalPreferences.h" #include "gui/cViewButtonDelegate.h" #include "gui/cSummaryPeaksTableProxyModel.h" #include "gui/cMainWindowProxyModel.h" @@ -34,6 +35,7 @@ using namespace std; // forward declaration class cParameters; +class cTheoreticalSpectrum; class cTheoreticalSpectrumList; class QHBoxLayout; class QVBoxLayout; @@ -243,9 +245,10 @@ class cSummaryPeaksTableWidget : public QMainWindow /** \brief The constructor. + \param globalpreferences global preferences of the application \param parent pointer to a parent widget */ - cSummaryPeaksTableWidget(QWidget* parent = (QWidget *)0); + cSummaryPeaksTableWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0); /** @@ -289,10 +292,19 @@ class cSummaryPeaksTableWidget : public QMainWindow void updateFilterBySelectedRegion(int xmin, int xmax, int ymin, int ymax); + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + private: QString title; + cGlobalPreferences* globalpreferences; + cParameters* parameters; QWidget* parent; @@ -344,10 +356,12 @@ class cSummaryPeaksTableWidget : public QMainWindow QString lastdirexporttocsv; QString lastdirexportstatisticstocsv; - vector coordinates; + vector origcoordinateinfo; cPeaksList origeicchromatogram; - void addEICPeak(cPeaksList& eicchromatogram, cPeaksList& experimentalspectrum); + void addEICPeak(cPeaksList& eicchromatogram, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum); + + void addCoordinateInfo(int spectrumindex, vector& coordinateinfo, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum); protected: @@ -420,8 +434,8 @@ private slots: /** - \brief Send the vector of coordinates to image window. - \param coordinates a vector of coordinates x and y + \brief Send the vector of aggregated informations about coordinates to image window. + \param coordinateinfo a vector of aggregated informations about coordinates \param operatortype the type of operator (0 = or; 1 = and) \param columnname1 name of column which was compared \param comparatorname1 name of used comparator @@ -432,7 +446,7 @@ private slots: \param casesensitive true if the string was used as a casesensitive, false otherwise \param wholeword true if whole words only are compared, false otherwise */ - void sendFilterOptionsToImageWindow(vector coordinates, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword); + void sendFilterOptionsToImageWindow(vector coordinateinfo, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword); /** diff --git a/CycloBranch/gui/cViewButtonDelegate.cpp b/CycloBranch/gui/cViewButtonDelegate.cpp index 27586d3..40f67dc 100644 --- a/CycloBranch/gui/cViewButtonDelegate.cpp +++ b/CycloBranch/gui/cViewButtonDelegate.cpp @@ -23,7 +23,7 @@ void cViewButtonDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o QStyleOptionButton button; button.rect = option.rect; - if (index.data(Qt::DisplayRole).toString().contains("https://www.ncbi.nlm.nih.gov/pccompound?term=")) { + if (index.data(Qt::DisplayRole).toString().contains("https://pubchem.ncbi.nlm.nih.gov/#query=")) { button.text = "search"; } else { diff --git a/CycloBranch/images.qrc b/CycloBranch/images.qrc index cddf636..e9e88e5 100644 --- a/CycloBranch/images.qrc +++ b/CycloBranch/images.qrc @@ -10,7 +10,6 @@ images/icons/48.png images/icons/52.png images/icons/61.png - images/icons/62.png images/icons/68.png images/icons/73.png images/icons/77.png @@ -30,11 +29,8 @@ images/icons/95.png images/icons/65.png images/icons/56.png - images/icons/66.png images/icons/5.png images/icons/25.png - images/icons/43.png - images/icons/23.png images/icons/63.png images/icons/13.png images/icons/14.png @@ -51,5 +47,10 @@ images/icons/chromatography.png images/icons/79.png images/icons/12.png + images/icons/preferences.png + images/icons/table.png + images/icons/image.png + images/icons/csv.png + images/icons/66.png diff --git a/CycloBranch/images/icons/23.png b/CycloBranch/images/icons/23.png deleted file mode 100644 index 6c9f7f481ad20048fc0d6836aab48ca5f2825e63..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1103 zcmV-V1hD&wP)ODWYE5FlKz)?JVXt>>_4lHoN{kd+kB-N6XWeM_+7c%sd$d z(UX}3G*to`hOg*jusQ1wiT)!cc=Xf3|5TbUHzdMeatJJOL!$_Xit$)z011~z;c+?; zOmZW8o(n0n9JqKzMduJl*Ch#&>k7ES!8wO4)8sO(=G1L6`4uE&W#L4b9}CKwz>>>a z#QBCItog79-pCky_d1d7_aHOT30M3K^o(fW9K9nF6h+YiWRrlK;F3Zznv28E`NeqPg%e;4D^7}&udYDhYiDtPAc3@ZBQx0rm*Wof zj%ox7`ZRe|6$&@>j{<9wNHVtwxJeLqPa;}(=3?c}Q($R3z80<3599IbZ&A1`2}?-- zw7D}u?}@PXxI{2KChG*;B#hz&jE<{Dd2((m(OBks^~gqfYJQdG_-GuO>(^mR{V!lkUvC$CpUuMh zEr;>m?o|lPj>mu|57mC(BRrN}{Hh2R~`%CcL2fu>l z)^&(CHm0L^(?NR=oY1lu?S;J$ST3gfVrFJEEm|5IO7T*t1MI%~E>TmGdMoUkTPSY! zi%Cr}y01JO23!7qkEnVgFd^nvqpGFXSn2$f{d*F5RdX*`UPGU#%%2}SGgW4`AOTxj zkA~PjgiVE-whLeneKcUin7!Vvik*)~B+Q^r8%y?f?tD8ZXv``&P)bY4W*Vaz96r9W zf7%2|Pc^yX;@EFTsvk*8pP!)HzB)UIin>P)tbHP&g*0s4Ha)@6(o`sisFz>|!XB&{3I38V@FP{-V z6>SgT1p!1Ipw&{NUN#u9EV&Am2czJ$0rob)(GEDBG^XaDa9VUmY|N=bSw<8zB8dsq zXkPvSjPeFNBY>tmz_=4Zo&<;DP5%%izN!Kvfc%rh3D8dBj6^iF^VwkX85n|<&#Ryn zlzHYL-)}&uH{dA&?1C~Oc5|PEfS}&Vqo*OW(+@S#9c_1V){rlc-a+7YS%KJFfH2t$ z(8TY6oJFl$oG((UoFwQVF9-E@E>6OFt+M8cn#9}abZs_8OH1Q1-Y016puK`8W30e zh2>A{g8_68Jt@cHA5y`y(9V1d|Dcx;NC7Uq(Ts{Yfoi~liVtjWbP%G8g8hpAQ`&nZ zT>Xfvaf8%=`R87Yb8m z%r}3dCuvTVaG}5i9i?*74yluW(&b5i$8}^O051>-ALg zovt}S5MVSKVYAt2vrI)$>-rz06Cii^;68qDL0!#Vj1C`(g(C)I-hw}?tKgNCq3K=|m2M3pW<_9Z9|H{JGCR_Orh2OyFkzB~ zZ8(+W+Wh+jUD>-2&5*w|BXB@3goTB9#CfR*k4QnogF-dnybkQIs$G?9FI#3)JbwW< W8h0o$V_}B?0000=+5@J04>>I<0C*OYTyZ>c7P^#f=na(8!A^;;U38}uT2Nw9t+Pf<8 zqKLo!_J?83^^Xi|uYde>?)mp^K%p|AWsga+0O<0dJ~yegar%OIU3dHScZQ{BUNWpW z|K`OTR?bqOMN5dXzjE(u2sWG%Y6&tM9r(|?!LaZAvx+ZMoI81Q_h$e9 z|K9~D{N~FPmsAY(D$S?vTqrkH1{(&%Oi+WFpemW5F$c30 zq$Ywe26Qb*dXHOH2L73geu1T&!e1eSCe zp>g6;xPIH?c|qPdEpTl(r5f@-r|3}cje*a~#ieK3K zXJ>K=P7C-vXXo2lYj%eR8nX%saDZLTj1>ONjA%&{WHvNa-FftmA-;G;$=`$7y##}Z z*Lm7ZXBYkC;6P($K5llnMa)nY%upM^uKx#NZ`pl~VZ!v?p8t*)>>w(V8BMx)_yxEZ zI=L7I`TH6(@Nlz%^8<3x0E=*tU`yv_h7%`m^Zq+k{DmkB;DUzj;(UDE>)n0LEq%NV z88|pt!Fd53ME@b-bo=%ThU%(iZ~mMt7G=N#@D}%s`fVD5!h9RO{LR(eJq;PyS((8; zdGz2lLsP@5f1f`8u>OCxlLFfpJeMA0aiXf%E-AreF4jS+)4UN{nr(FDydFn|)3jTp?rX6L@TX-8SNZfz+& zE$yingGsTh8;Sqqy?CGZdCu=V&+~r3|11IEjU&hFoF#IXQIeAR0+dA3ej}xZ4?X|% z14{vD0YnYPb&a0NmZk=4zJT67FIR)J9R2*{<=6M^T9eOTT*_bEspd5`w6!$Xe{}rh zz_J0c8`p^>qbMl_041dmNk$jOEj89v36E`T_T+=)0K|wSqr}tmfOtALU;)z7v?wGu zAQ8#VAQ4#@0R2Pb^!9n_?emgMrG%nFljpn!jr9Q z1&yfH=knJA#PoB{bG~1UgE4PjKo9+QSVjN{i9z|UfRvDy2Sda9!4Q;LODQ(X3{Q;{ zOT+=N7z$ZkT+Wqnkg3QF<+77RDoHRJqS~>FtC49mnSz{vtP<6)sOI3-y)>_C;N6`s zAqWCy$wX(ztJJxwcxU^5svH$GRn*hov>8zlIka^jlCI#c8EbE!tdyM$2FCc}=Wlql z_8~Nah}~o*gUYv;e&Diyh)5y7t1O!UVHUvRHr`2-K z+sm6@AEn&pq^Y6~HKQ^Z7^Tg#p3&(EuK#h3(eo4b9lKxbY2Ci((p>=&B}SR-q}8*I z_u5}Z6a<__CA{Bpfc5T1iVSAL@%h8n?;obbY-4E3$Lv&;hc|8!+n?IC*5N44YIar+ zE{yz6h76?^JBPnNMp{*wn3?3$vt4*xZn`d)OWh4>~o3BM8-S_k!0C+rZ_B`8x)mF@d zEsy+budkOkZQkM*L}C1@F8;zj0{|X>q6NK>VmdgrV9Tf~r@K%2!l7WtaCdj&KP7S) zOS0y2ffczR`z6(hI?4-I0Pxmp`#JdbVG0Y)NCpGv&z`w58=Bes>zVKTaI*($n(G() z{`3zFP573Zg(OM(&D*xQPJDU7=qjs7`2Bx>{8RT=XO{b&ylUOHdsExaJtyw8{{vPT VlpcK;&PMNn;(!FZpj|qUxWJ8nWeAB11S*V-KOOxCZ5PsZ+S1TA*|Pj`Y;#Db zwM|k$DPPHw_5A$(yx-G%w(#ot@ua5t&T@cq9LHHN6yAOF#j%{EX}+^(Mh4&LGJ^*O zn4Vw0{Y`3m639saU1pGIBz$0i%=N5&_g>ohVB%VP#z6%hjqZ+#?OFb_{&#@1Hy{Ym zA%muXQrWC@fVQB8rG1Fj3IQjc}2;5bmV!FKA< zngebV;4XmA+a$qLzxGNL!Mmfu3e8W{(4xC4RUH;HRTeT8dev+6^>{I&M{ylk&6ddA zDAOPFV+Q0_7R>>F6Hx%U%if`XcR+FvMN80C7b-ZP$1FkW8@(N zP4#T&3#|d4epev7QERB8s>KmJULNU>5((erxAZvqa)lo{USc5)ORIMnIMPXfytAR^ zU1QqJ96%IBHoODe*QI0Xeh!68oH}9fl=K=RRcbYtpXLgDIhEVLMUjYrU2_|fY)j&H zQKJY9{i`UuA-D`zmnhYHaasQ3Ckg)bY!7~r~ zTS8Kv5CFFQGSf5fF>qYOFiik-LudFnEH9tONxsq=5cW0MsBMM(9ay$qf2D7fxw(rZ z`$6A^1Pq;c94>wIHo@LA_W+erCH29?*I%@BZXr=PArvo94h{`HUFG<~t}U#WqfR1`6ahA~H-(t!>fMSm-uD0C&A(krR;Y}Q?zokf|u z%4ttUR8)1StrqRnh0#&X>U(%4Cc64*PepVchd-vKemO7zz=!9~DMu{pqN1v&tZMa+ cTP!~JH$00TRjQ{7l>h($07*qoM6N<$g7^id!2kdN literal 0 HcmV?d00001 diff --git a/CycloBranch/images/icons/preferences.png b/CycloBranch/images/icons/preferences.png new file mode 100644 index 0000000000000000000000000000000000000000..e9c11006b963e581e02958e336cd88f96b2af9dc GIT binary patch literal 536 zcmV+z0_XjSP)yy}NbKA1pWXJkNcfnP;Dw zr9WN6Y%-t0)jpYRdWTJ1#5ru>!~cR0;1#mM^CJ3cYZ~wIGJ&pQJ((}y4W{ZOxFeJz zhdn?OLwKCnH!)Xt7nhTj?@a7XtVQ1yXw*!wy@NeV#w#`1=7jC%rDzGeXyQ>~-@xr| zpi!Z|#h@El)c%s!Y?UU%bD>?Q(?1ql>p~1()?Uhilp6@ z>89}l=p*h4U9z0mU)O;TVLpL8#g4>(sF36YwpE3H@pl=Hl*F|PF)O&+3*Nwi68oS2t4v`;_=wn8d*<338oI0IM;{D30P;;#<=BF6yeYdbenXuh{*s z@csB%F+nDr_)5yJiVQzul1ZEq&Oxqu92PD=_@>5ZaUVvK`E^^@?ykf>RtH|DiJ0JX aKaf8co~^#QE>({J0000("cParameters"); qRegisterMetaType >("vector"); qRegisterMetaType("ePeptideType"); - qRegisterMetaType >("vector"); + qRegisterMetaType >("vector"); qRegisterMetaType("string"); qRegisterMetaType("cFragmentIons"); - qRegisterMetaType >("vector"); + qRegisterMetaType >("vector"); qRegisterMetaType("cPeaksList"); QPixmap pixmap(":/images/splash.png"); diff --git a/CycloBranch/parallel/cSpectrumComparatorThread.cpp b/CycloBranch/parallel/cSpectrumComparatorThread.cpp index b6d6a17..c4574b6 100644 --- a/CycloBranch/parallel/cSpectrumComparatorThread.cpp +++ b/CycloBranch/parallel/cSpectrumComparatorThread.cpp @@ -162,6 +162,28 @@ bool compareNumberOfMatchedPeaksDesc(const cTheoreticalSpectrum& a, const cTheor } +bool compareWeightedRatioDesc(const cTheoreticalSpectrum& a, const cTheoreticalSpectrum& b) { + if (a.getWeightedRatioOfMatchedPeaks() > b.getWeightedRatioOfMatchedPeaks()) { + return true; + } + if (a.getWeightedRatioOfMatchedPeaks() < b.getWeightedRatioOfMatchedPeaks()) { + return false; + } + + if (a.getPathId() < b.getPathId()) { + return true; + } + 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 currentworstscore, bool* terminatecomputation) { this->candidate = candidate; this->peaklist = peaklist; @@ -262,6 +284,9 @@ void cSpectrumComparatorThread::run() { case number_of_b_and_y_ions: score = tsp.getNumberOfMatchedPeaksYB(); break; + case weighted_ratio_of_matched_peaks: + score = tsp.getWeightedRatioOfMatchedPeaks(); + break; default: break; } diff --git a/CycloBranch/parallel/cSpectrumComparatorThread.h b/CycloBranch/parallel/cSpectrumComparatorThread.h index 56d4476..2df8fae 100644 --- a/CycloBranch/parallel/cSpectrumComparatorThread.h +++ b/CycloBranch/parallel/cSpectrumComparatorThread.h @@ -69,6 +69,15 @@ bool compareSumOfRelIntDesc(const cTheoreticalSpectrum& a, const cTheoreticalSpe bool compareNumberOfMatchedPeaksDesc(const cTheoreticalSpectrum& a, const cTheoreticalSpectrum& b); +/** + \brief Compare scores of two theoretical spectra (weighted ratio of matched peaks). + \param a first theoretical spectrum + \param b second theoretical spectrum + \retval bool true if the score of \a a is greater than the score of \a b +*/ +bool compareWeightedRatioDesc(const cTheoreticalSpectrum& a, const cTheoreticalSpectrum& b); + + /** \brief The class representing a thread for comparison of a theoretical spectrum with a peak list. */
" + to_string(k + 1) + " 
" + tempseries.name + " " + to_string(series[parameters->ionsfortheoreticalspectra[i]][losstype][k]) + "" + to_string(series[parameters->ionsfortheoreticalspectraMS2[i]][losstype][k]) + "