diff --git a/CycloBranch/CycloBranch-Linux.pro b/CycloBranch/CycloBranch-Linux.pro index ec8cf46..2b6dbe8 100644 --- a/CycloBranch/CycloBranch-Linux.pro +++ b/CycloBranch/CycloBranch-Linux.pro @@ -4,9 +4,9 @@ TEMPLATE = app TARGET = CycloBranch -QT += core gui widgets printsupport svg +QT += core gui widgets printsupport svg network concurrent INCLUDEPATH += . core gui parallel -QMAKE_CXXFLAGS += -std=c++11 -DLINUX -m64 +QMAKE_CXXFLAGS += -std=c++17 -DLINUX -m64 QMAKE_LIBS += -lboost_regex -lboost_iostreams -lxerces-c OBJECTS_DIR = build/ MOC_DIR = moc/ @@ -39,20 +39,28 @@ HEADERS += core/cBrick.h \ gui/cBranchedWidget.h \ gui/cBricksDatabaseProxyModel.h \ gui/cBricksDatabaseWidget.h \ + gui/cCalibrationChart.h \ + gui/cCalibrationChartProxyModel.h \ + gui/cCalibrationChartScene.h \ gui/cCheckBoxDelegate.h \ gui/cChromatogramWindow.h \ gui/cChromatogramWindowWidget.h \ gui/cComboBoxDelegate.h \ gui/cCyclicWidget.h \ + gui/cDefineCalibrationWidget.h \ gui/cDrawPeptideWidget.h \ gui/cEventFilter.h \ gui/cExportDialog.h \ gui/cFindDialog.h \ + gui/cFormulaPredictor.h \ gui/cFragmentIonsListWidget.h \ gui/cGraphWidget.h \ gui/cHTMLDelegate.h \ gui/cHTMLExportDialog.h \ gui/cImageWindow.h \ + gui/cImageWindowImportDialog.h \ + gui/cImageWindowTabElectron.h \ + gui/cImageWindowTabOptical.h \ gui/cImageWindowWidget.h \ gui/cLinearWidget.h \ gui/cMainThread.h \ @@ -61,14 +69,19 @@ HEADERS += core/cBrick.h \ gui/cModificationsProxyModel.h \ gui/cModificationsWidget.h \ gui/cMultipleButtonDelegate.h \ + gui/cMultipleDatasetsTableProxyModel.h \ + gui/cMultipleDatasetsTableWidget.h \ gui/cNeutralLossesListWidget.h \ gui/cParametersWidget.h \ + gui/cPatternSimulatorSceneWidget.h \ + gui/cPatternSimulatorWidget.h \ gui/cPreferencesDialog.h \ gui/cPreferencesIonTypeDialog.h \ gui/cPreferencesTabDataProcessing.h \ gui/cPreferencesTabDirectories.h \ gui/cPreferencesTabIonTypes.h \ gui/cPreferencesTabURLs.h \ + gui/cPubChemSearchWidget.h \ gui/cSequenceDatabaseProxyModel.h \ gui/cSequenceDatabaseWidget.h \ gui/cSpectrumDetailProxyModel.h \ @@ -77,8 +90,12 @@ HEADERS += core/cBrick.h \ gui/cSummaryPeaksTableProxyModel.h \ gui/cSummaryPeaksTableWidget.h \ gui/cViewButtonDelegate.h \ + parallel/cFormulaPredictorThread.h \ parallel/cGraphReaderThread.h \ - parallel/cSpectrumComparatorThread.h + parallel/cSpectrumAnalyzerThreadMS1.h \ + parallel/cSpectrumComparatorThreadMS1.h \ + parallel/cSpectrumComparatorThreadMS2.h \ + parallel/cSpectrumGeneratorThreadMS1.h SOURCES += core/cBrick.cpp \ core/cBricksDatabase.cpp \ core/cCandidate.cpp \ @@ -105,20 +122,28 @@ SOURCES += core/cBrick.cpp \ gui/cBranchedWidget.cpp \ gui/cBricksDatabaseProxyModel.cpp \ gui/cBricksDatabaseWidget.cpp \ + gui/cCalibrationChart.cpp \ + gui/cCalibrationChartProxyModel.cpp \ + gui/cCalibrationChartScene.cpp \ gui/cCheckBoxDelegate.cpp \ gui/cChromatogramWindow.cpp \ gui/cChromatogramWindowWidget.cpp \ gui/cComboBoxDelegate.cpp \ gui/cCyclicWidget.cpp \ + gui/cDefineCalibrationWidget.cpp \ gui/cDrawPeptideWidget.cpp \ gui/cEventFilter.cpp \ gui/cExportDialog.cpp \ gui/cFindDialog.cpp \ + gui/cFormulaPredictor.cpp \ gui/cFragmentIonsListWidget.cpp \ gui/cGraphWidget.cpp \ gui/cHTMLDelegate.cpp \ gui/cHTMLExportDialog.cpp \ gui/cImageWindow.cpp \ + gui/cImageWindowImportDialog.cpp \ + gui/cImageWindowTabElectron.cpp \ + gui/cImageWindowTabOptical.cpp \ gui/cImageWindowWidget.cpp \ gui/cLinearWidget.cpp \ gui/cMainThread.cpp \ @@ -127,14 +152,19 @@ SOURCES += core/cBrick.cpp \ gui/cModificationsProxyModel.cpp \ gui/cModificationsWidget.cpp \ gui/cMultipleButtonDelegate.cpp \ + gui/cMultipleDatasetsTableProxyModel.cpp \ + gui/cMultipleDatasetsTableWidget.cpp \ gui/cNeutralLossesListWidget.cpp \ gui/cParametersWidget.cpp \ + gui/cPatternSimulatorSceneWidget.cpp \ + gui/cPatternSimulatorWidget.cpp \ gui/cPreferencesDialog.cpp \ gui/cPreferencesIonTypeDialog.cpp \ gui/cPreferencesTabDataProcessing.cpp \ gui/cPreferencesTabDirectories.cpp \ gui/cPreferencesTabIonTypes.cpp \ gui/cPreferencesTabURLs.cpp \ + gui/cPubChemSearchWidget.cpp \ gui/cSequenceDatabaseProxyModel.cpp \ gui/cSequenceDatabaseWidget.cpp \ gui/cSpectrumDetailProxyModel.cpp \ @@ -143,6 +173,10 @@ SOURCES += core/cBrick.cpp \ gui/cSummaryPeaksTableProxyModel.cpp \ gui/cSummaryPeaksTableWidget.cpp \ gui/cViewButtonDelegate.cpp \ + parallel/cFormulaPredictorThread.cpp \ parallel/cGraphReaderThread.cpp \ - parallel/cSpectrumComparatorThread.cpp \ + parallel/cSpectrumAnalyzerThreadMS1.cpp \ + parallel/cSpectrumComparatorThreadMS1.cpp \ + parallel/cSpectrumComparatorThreadMS2.cpp \ + parallel/cSpectrumGeneratorThreadMS1.cpp \ main.cpp diff --git a/CycloBranch/CycloBranch-MacOSX.pro b/CycloBranch/CycloBranch-MacOSX.pro index 879d9d2..ffac9d5 100644 --- a/CycloBranch/CycloBranch-MacOSX.pro +++ b/CycloBranch/CycloBranch-MacOSX.pro @@ -4,7 +4,7 @@ TEMPLATE = app TARGET = CycloBranch -QT += core gui widgets printsupport svg +QT += core gui widgets printsupport svg network concurrent INCLUDEPATH += . core gui parallel /usr/local/opt/boost/include /usr/local/opt/xerces-c/include QMAKE_CXXFLAGS += -std=c++11 -DMACOSX -m64 QMAKE_LIBS += -lboost_regex -lboost_iostreams -lxerces-c @@ -41,20 +41,28 @@ HEADERS += core/cBrick.h \ gui/cBranchedWidget.h \ gui/cBricksDatabaseProxyModel.h \ gui/cBricksDatabaseWidget.h \ + gui/cCalibrationChart.h \ + gui/cCalibrationChartProxyModel.h \ + gui/cCalibrationChartScene.h \ gui/cCheckBoxDelegate.h \ gui/cChromatogramWindow.h \ gui/cChromatogramWindowWidget.h \ gui/cComboBoxDelegate.h \ gui/cCyclicWidget.h \ + gui/cDefineCalibrationWidget.h \ gui/cDrawPeptideWidget.h \ gui/cEventFilter.h \ gui/cExportDialog.h \ gui/cFindDialog.h \ + gui/cFormulaPredictor.h \ gui/cFragmentIonsListWidget.h \ gui/cGraphWidget.h \ gui/cHTMLDelegate.h \ gui/cHTMLExportDialog.h \ gui/cImageWindow.h \ + gui/cImageWindowImportDialog.h \ + gui/cImageWindowTabElectron.h \ + gui/cImageWindowTabOptical.h \ gui/cImageWindowWidget.h \ gui/cLinearWidget.h \ gui/cMainThread.h \ @@ -63,14 +71,19 @@ HEADERS += core/cBrick.h \ gui/cModificationsProxyModel.h \ gui/cModificationsWidget.h \ gui/cMultipleButtonDelegate.h \ + gui/cMultipleDatasetsTableProxyModel.h \ + gui/cMultipleDatasetsTableWidget.h \ gui/cNeutralLossesListWidget.h \ gui/cParametersWidget.h \ + gui/cPatternSimulatorSceneWidget.h \ + gui/cPatternSimulatorWidget.h \ gui/cPreferencesDialog.h \ gui/cPreferencesIonTypeDialog.h \ gui/cPreferencesTabDataProcessing.h \ gui/cPreferencesTabDirectories.h \ gui/cPreferencesTabIonTypes.h \ gui/cPreferencesTabURLs.h \ + gui/cPubChemSearchWidget.h \ gui/cSequenceDatabaseProxyModel.h \ gui/cSequenceDatabaseWidget.h \ gui/cSpectrumDetailProxyModel.h \ @@ -79,8 +92,12 @@ HEADERS += core/cBrick.h \ gui/cSummaryPeaksTableProxyModel.h \ gui/cSummaryPeaksTableWidget.h \ gui/cViewButtonDelegate.h \ + parallel/cFormulaPredictorThread.h \ parallel/cGraphReaderThread.h \ - parallel/cSpectrumComparatorThread.h + parallel/cSpectrumAnalyzerThreadMS1.h \ + parallel/cSpectrumComparatorThreadMS1.h \ + parallel/cSpectrumComparatorThreadMS2.h \ + parallel/cSpectrumGeneratorThreadMS1.h SOURCES += core/cBrick.cpp \ core/cBricksDatabase.cpp \ core/cCandidate.cpp \ @@ -107,20 +124,28 @@ SOURCES += core/cBrick.cpp \ gui/cBranchedWidget.cpp \ gui/cBricksDatabaseProxyModel.cpp \ gui/cBricksDatabaseWidget.cpp \ + gui/cCalibrationChart.cpp \ + gui/cCalibrationChartProxyModel.cpp \ + gui/cCalibrationChartScene.cpp \ gui/cCheckBoxDelegate.cpp \ gui/cChromatogramWindow.cpp \ gui/cChromatogramWindowWidget.cpp \ gui/cComboBoxDelegate.cpp \ gui/cCyclicWidget.cpp \ + gui/cDefineCalibrationWidget.cpp \ gui/cDrawPeptideWidget.cpp \ gui/cEventFilter.cpp \ gui/cExportDialog.cpp \ gui/cFindDialog.cpp \ + gui/cFormulaPredictor.cpp \ gui/cFragmentIonsListWidget.cpp \ gui/cGraphWidget.cpp \ gui/cHTMLDelegate.cpp \ gui/cHTMLExportDialog.cpp \ gui/cImageWindow.cpp \ + gui/cImageWindowImportDialog.cpp \ + gui/cImageWindowTabElectron.cpp \ + gui/cImageWindowTabOptical.cpp \ gui/cImageWindowWidget.cpp \ gui/cLinearWidget.cpp \ gui/cMainThread.cpp \ @@ -129,14 +154,19 @@ SOURCES += core/cBrick.cpp \ gui/cModificationsProxyModel.cpp \ gui/cModificationsWidget.cpp \ gui/cMultipleButtonDelegate.cpp \ + gui/cMultipleDatasetsTableProxyModel.cpp \ + gui/cMultipleDatasetsTableWidget.cpp \ gui/cNeutralLossesListWidget.cpp \ gui/cParametersWidget.cpp \ + gui/cPatternSimulatorSceneWidget.cpp \ + gui/cPatternSimulatorWidget.cpp \ gui/cPreferencesDialog.cpp \ gui/cPreferencesIonTypeDialog.cpp \ gui/cPreferencesTabDataProcessing.cpp \ gui/cPreferencesTabDirectories.cpp \ gui/cPreferencesTabIonTypes.cpp \ gui/cPreferencesTabURLs.cpp \ + gui/cPubChemSearchWidget.cpp \ gui/cSequenceDatabaseProxyModel.cpp \ gui/cSequenceDatabaseWidget.cpp \ gui/cSpectrumDetailProxyModel.cpp \ @@ -145,6 +175,10 @@ SOURCES += core/cBrick.cpp \ gui/cSummaryPeaksTableProxyModel.cpp \ gui/cSummaryPeaksTableWidget.cpp \ gui/cViewButtonDelegate.cpp\ + parallel/cFormulaPredictorThread.cpp \ parallel/cGraphReaderThread.cpp \ - parallel/cSpectrumComparatorThread.cpp \ + parallel/cSpectrumAnalyzerThreadMS1.cpp \ + parallel/cSpectrumComparatorThreadMS1.cpp \ + parallel/cSpectrumComparatorThreadMS2.cpp \ + parallel/cSpectrumGeneratorThreadMS1.cpp \ main.cpp diff --git a/CycloBranch/CycloBranch.vcxproj b/CycloBranch/CycloBranch.vcxproj index d1c499e..8879f53 100644 --- a/CycloBranch/CycloBranch.vcxproj +++ b/CycloBranch/CycloBranch.vcxproj @@ -75,8 +75,8 @@ - UNICODE;WIN32;WIN64;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;%(PreprocessorDefinitions) - .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtSvg;%(AdditionalIncludeDirectories) + UNICODE;WIN32;WIN64;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;QT_NETWORK_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtNetwork;%(AdditionalIncludeDirectories) Disabled ProgramDatabase MultiThreadedDebugDLL @@ -87,13 +87,13 @@ $(OutDir)\$(ProjectName).exe $(QTDIR)\lib;%(AdditionalLibraryDirectories) true - qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5PrintSupportd.lib;Qt5Svgd.lib;%(AdditionalDependencies) + qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5PrintSupportd.lib;Qt5Svgd.lib;Qt5Networkd.lib;%(AdditionalDependencies) - UNICODE;WIN32;WIN64;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;%(PreprocessorDefinitions) - .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtSvg;%(AdditionalIncludeDirectories) + UNICODE;WIN32;WIN64;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;QT_NETWORK_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtNetwork;%(AdditionalIncludeDirectories) Disabled ProgramDatabase MultiThreadedDebugDLL @@ -104,13 +104,13 @@ $(OutDir)\$(ProjectName).exe $(QTDIR)\lib;%(AdditionalLibraryDirectories) true - qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5PrintSupportd.lib;Qt5Svgd.lib;%(AdditionalDependencies) + qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5PrintSupportd.lib;Qt5Svgd.lib;Qt5Networkd.lib;%(AdditionalDependencies) - UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;%(PreprocessorDefinitions) - .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtSvg;%(AdditionalIncludeDirectories) + UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;QT_NETWORK_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtNetwork;%(AdditionalIncludeDirectories) MultiThreadedDLL false @@ -120,13 +120,13 @@ $(OutDir)\$(ProjectName).exe $(QTDIR)\lib;%(AdditionalLibraryDirectories) false - qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5PrintSupport.lib;Qt5Svg.lib;%(AdditionalDependencies) + qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5PrintSupport.lib;Qt5Svg.lib;Qt5Network.lib;%(AdditionalDependencies) - UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;%(PreprocessorDefinitions) - .;.\GeneratedFiles;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtPrintSupport;C:\boost_1_71_0;C:\xerces-c-3.1.1\include;%(AdditionalIncludeDirectories) + UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_PRINTSUPPORT_LIB;QT_SVG_LIB;QT_NETWORK_LIB;QT_CONCURRENT_LIB;%(PreprocessorDefinitions) + .;.\GeneratedFiles;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtConcurrent;C:\boost_1_71_0;C:\xerces-c-3.1.1\include;%(AdditionalIncludeDirectories) ProgramDatabase MultiThreadedDLL true @@ -135,13 +135,14 @@ true true true + stdcpp17 Windows $(OutDir)\$(ProjectName).exe $(QTDIR)\lib;C:\boost_1_71_0\lib64-msvc-14.1;C:\xerces-c-3.1.1\lib;%(AdditionalLibraryDirectories) false - shell32.lib;qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5Svg.lib;Qt5PrintSupport.lib;xerces-c_3.lib + shell32.lib;qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5Svg.lib;Qt5PrintSupport.lib;Qt5Network.lib;Qt5Concurrent.lib;xerces-c_3.lib true true UseLinkTimeCodeGeneration @@ -189,6 +190,18 @@ true true + + true + true + + + true + true + + + true + true + true true @@ -209,6 +222,10 @@ true true + + true + true + true true @@ -225,6 +242,14 @@ true true + + true + true + + + true + true + true true @@ -249,6 +274,18 @@ true true + + true + true + + + true + true + + + true + true + true true @@ -281,6 +318,14 @@ true true + + true + true + + + true + true + true true @@ -289,6 +334,14 @@ true true + + true + true + + + true + true + true true @@ -313,6 +366,10 @@ true true + + true + true + true true @@ -321,7 +378,15 @@ true true - + + true + true + + + true + true + + true true @@ -333,6 +398,10 @@ true true + + true + true + true true @@ -379,6 +448,18 @@ true true + + true + true + + + true + true + + + true + true + true true @@ -399,6 +480,10 @@ true true + + true + true + true true @@ -415,6 +500,14 @@ true true + + true + true + + + true + true + true true @@ -439,6 +532,18 @@ true true + + true + true + + + true + true + + + true + true + true true @@ -471,6 +576,14 @@ true true + + true + true + + + true + true + true true @@ -479,6 +592,14 @@ true true + + true + true + + + true + true + true true @@ -503,6 +624,10 @@ true true + + true + true + true true @@ -511,7 +636,15 @@ true true - + + true + true + + + true + true + + true true @@ -523,6 +656,10 @@ true true + + true + true + true true @@ -544,20 +681,28 @@ + + + + + + + + @@ -566,14 +711,19 @@ + + + + + @@ -583,8 +733,12 @@ + - + + + + @@ -606,527 +760,851 @@ + + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" + $(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cNeutralLossesListWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cNeutralLossesListWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cNeutralLossesListWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cNeutralLossesListWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindowWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindowWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindowWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindowWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindow.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindow.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindow.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cChromatogramWindow.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLDelegate.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLDelegate.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseProxyModel.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseProxyModel.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMultipleButtonDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMultipleButtonDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMultipleButtonDelegate.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMultipleButtonDelegate.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsProxyModel.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsProxyModel.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cViewButtonDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cViewButtonDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cViewButtonDelegate.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cViewButtonDelegate.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cComboBoxDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cComboBoxDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cComboBoxDelegate.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cComboBoxDelegate.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCheckBoxDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCheckBoxDelegate.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCheckBoxDelegate.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCheckBoxDelegate.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseProxyModel.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseProxyModel.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindowProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindowProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindowProxyModel.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindowProxyModel.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailProxyModel.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailProxyModel.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableProxyModel.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableProxyModel.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableProxyModel.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindowWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindowWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindowWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindowWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindow.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindow.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindow.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cImageWindow.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSummaryPeaksTableWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLExportDialog.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLExportDialog.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLExportDialog.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cHTMLExportDialog.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchCyclicWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchCyclicWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchCyclicWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchCyclicWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cExportDialog.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cExportDialog.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cExportDialog.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cExportDialog.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFindDialog.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFindDialog.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFindDialog.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFindDialog.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumSceneWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumSceneWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumSceneWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumSceneWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cEventFilter.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cEventFilter.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cEventFilter.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cEventFilter.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" @@ -1158,199 +1636,181 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cDrawPeptideWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cDrawPeptideWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cDrawPeptideWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cDrawPeptideWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cModificationsWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSequenceDatabaseWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBricksDatabaseWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cLinearWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cLinearWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cLinearWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cLinearWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCyclicWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCyclicWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCyclicWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cCyclicWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchedWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchedWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchedWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cBranchedWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFragmentIonsListWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFragmentIonsListWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFragmentIonsListWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cFragmentIonsListWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphReaderThread.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphReaderThread.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphReaderThread.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphReaderThread.h... .\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" - - - Moc%27ing cSpectrumComparatorThread.h... - .\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" - Moc%27ing cSpectrumComparatorThread.h... - .\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" - Moc%27ing cSpectrumComparatorThread.h... - .\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" - Moc%27ing cSpectrumComparatorThread.h... - .\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) - $(QTDIR)\bin\moc.exe;%(FullPath) - $(QTDIR)\bin\moc.exe;%(FullPath) - $(QTDIR)\bin\moc.exe;%(FullPath) + "$(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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cSpectrumDetailWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" @@ -1382,91 +1842,91 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindow.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindow.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindow.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainWindow.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainThread.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainThread.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainThread.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cMainThread.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cParametersWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cParametersWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cParametersWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cParametersWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cGraphWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cAboutWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cAboutWidget.h... .\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)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cAboutWidget.h... .\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)" -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 -DQT_NETWORK_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" "-I$(QTDIR)\include\QtNetwork" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing cAboutWidget.h... .\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)" -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 -DQT_NETWORK_LIB -DQT_CONCURRENT_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" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtConcurrent" "-IC:\boost_1_71_0" "-IC:\xerces-c-3.1.1\include" diff --git a/CycloBranch/CycloBranch.vcxproj.filters b/CycloBranch/CycloBranch.vcxproj.filters index 5acf206..d2bbf53 100644 --- a/CycloBranch/CycloBranch.vcxproj.filters +++ b/CycloBranch/CycloBranch.vcxproj.filters @@ -140,15 +140,6 @@ Source Files\core - - Source Files\parallel - - - Generated Files\Debug - - - Generated Files\Release - Generated Files\Debug @@ -521,6 +512,168 @@ Generated Files\Release + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\gui + + + Source Files\gui + + + Source Files\gui + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\parallel + + + Source Files\parallel + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\parallel + + + Source Files\parallel + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + 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 + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\parallel + + + Generated Files\Debug + + + Generated Files\Release + + + 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 + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\gui + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files\gui + @@ -544,9 +697,6 @@ Header Files\gui - - Header Files\parallel - Header Files\parallel @@ -667,6 +817,60 @@ Header Files\gui + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\parallel + + + Header Files\parallel + + + Header Files\parallel + + + Header Files\parallel + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\parallel + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + + + Header Files\gui + diff --git a/CycloBranch/core/cDeNovoGraph.cpp b/CycloBranch/core/cDeNovoGraph.cpp index 8d83a8c..1fbd6b8 100644 --- a/CycloBranch/core/cDeNovoGraph.cpp +++ b/CycloBranch/core/cDeNovoGraph.cpp @@ -146,7 +146,7 @@ int cDeNovoGraph::createGraph(bool& terminatecomputation) { double unchargedprecursormass = charge(uncharge(parameters->precursormass, parameters->precursorcharge), (parameters->precursorcharge > 0)?1:-1); double unchargedmz; - sortedpeaklist = parameters->peaklistseries[parameters->scannumber - 1]; + sortedpeaklist = parameters->peaklistseriesvector[0][parameters->scannumber - 1]; // insert the single charged precursor, if neccessary sortedpeaklist.sortbyMass(); sortedpeaklist.cropMaximumMZRatio(unchargedprecursormass, parameters->precursormasserrortolerance); diff --git a/CycloBranch/core/cFragmentIons.cpp b/CycloBranch/core/cFragmentIons.cpp index f5a8763..e23626a 100644 --- a/CycloBranch/core/cFragmentIons.cpp +++ b/CycloBranch/core/cFragmentIons.cpp @@ -1481,7 +1481,6 @@ cFragmentIonType &cFragmentIons::operator[](eFragmentIonType iontype) { void cFragmentIons::recalculateFragments(bool cyclicnterminus, bool cycliccterminus, string& precursoradduct) { - fragmentions.clear(); double nterminusshift = cyclicnterminus?-H2O:0; diff --git a/CycloBranch/core/cGlobalPreferences.cpp b/CycloBranch/core/cGlobalPreferences.cpp index 411acbe..4b02900 100644 --- a/CycloBranch/core/cGlobalPreferences.cpp +++ b/CycloBranch/core/cGlobalPreferences.cpp @@ -52,8 +52,12 @@ void cGlobalPreferences::loadSettings() { customions.push_back(ion); } - if (settings.contains("bafprocessingmethod")) { - bafprocessingmethod = settings.value("bafprocessingmethod").toInt(); + if (settings.contains("linebafprocessingmethod")) { + linebafprocessingmethod = settings.value("linebafprocessingmethod").toInt(); + } + + if (settings.contains("profilebafprocessingmethod")) { + profilebafprocessingmethod = settings.value("profilebafprocessingmethod").toInt(); } if (settings.contains("rawdataprocessingmethod")) { @@ -108,13 +112,87 @@ void cGlobalPreferences::loadSettings() { exportimagedefaultdir = settings.value("exportimagedefaultdir ").toString(); } + if (settings.contains("bookmarkname1")) { + bookmarkname1 = settings.value("bookmarkname1").toString(); + } + if (settings.contains("bookmarkurl1")) { bookmarkurl1 = settings.value("bookmarkurl1").toString(); } + if (settings.contains("bookmarkname2")) { + bookmarkname2 = settings.value("bookmarkname2").toString(); + } + if (settings.contains("bookmarkurl2")) { bookmarkurl2 = settings.value("bookmarkurl2").toString(); } + + if (settings.contains("bookmarkname3")) { + bookmarkname3 = settings.value("bookmarkname3").toString(); + } + + if (settings.contains("bookmarkurl3")) { + bookmarkurl3 = settings.value("bookmarkurl3").toString(); + } + + if (settings.contains("bookmarkname4")) { + bookmarkname4 = settings.value("bookmarkname4").toString(); + } + + if (settings.contains("bookmarkurl4")) { + bookmarkurl4 = settings.value("bookmarkurl4").toString(); + } + + if (settings.contains("bookmarkname5")) { + bookmarkname5 = settings.value("bookmarkname5").toString(); + } + + if (settings.contains("bookmarkurl5")) { + bookmarkurl5 = settings.value("bookmarkurl5").toString(); + } + + if (settings.contains("bookmarkname6")) { + bookmarkname6 = settings.value("bookmarkname6").toString(); + } + + if (settings.contains("bookmarkurl6")) { + bookmarkurl6 = settings.value("bookmarkurl6").toString(); + } + + if (settings.contains("bookmarkname7")) { + bookmarkname7 = settings.value("bookmarkname7").toString(); + } + + if (settings.contains("bookmarkurl7")) { + bookmarkurl7 = settings.value("bookmarkurl7").toString(); + } + + if (settings.contains("bookmarkname8")) { + bookmarkname8 = settings.value("bookmarkname8").toString(); + } + + if (settings.contains("bookmarkurl8")) { + bookmarkurl8 = settings.value("bookmarkurl8").toString(); + } + + if (settings.contains("bookmarkname9")) { + bookmarkname9 = settings.value("bookmarkname9").toString(); + } + + if (settings.contains("bookmarkurl9")) { + bookmarkurl9 = settings.value("bookmarkurl9").toString(); + } + + if (settings.contains("bookmarkname10")) { + bookmarkname10 = settings.value("bookmarkname10").toString(); + } + + if (settings.contains("bookmarkurl10")) { + bookmarkurl10 = settings.value("bookmarkurl10").toString(); + } + + viewbookmarks = settings.value("viewbookmarks", 0).toInt() == 0 ? false : true; } @@ -139,7 +217,9 @@ void cGlobalPreferences::saveSettings() { settings.setValue(customionvalue, customions[i].multiplier); } - settings.setValue("bafprocessingmethod", bafprocessingmethod); + settings.setValue("linebafprocessingmethod", linebafprocessingmethod); + settings.setValue("profilebafprocessingmethod", profilebafprocessingmethod); + settings.setValue("rawdataprocessingmethod", rawdataprocessingmethod); settings.setValue("settingsdefaultdir", settingsdefaultdir); @@ -155,8 +235,37 @@ void cGlobalPreferences::saveSettings() { settings.setValue("exporthtmldefaultdir", exporthtmldefaultdir); settings.setValue("exportimagedefaultdir", exportimagedefaultdir); + settings.setValue("bookmarkname1", bookmarkname1); settings.setValue("bookmarkurl1", bookmarkurl1); + + settings.setValue("bookmarkname2", bookmarkname2); settings.setValue("bookmarkurl2", bookmarkurl2); + + settings.setValue("bookmarkname3", bookmarkname3); + settings.setValue("bookmarkurl3", bookmarkurl3); + + settings.setValue("bookmarkname4", bookmarkname4); + settings.setValue("bookmarkurl4", bookmarkurl4); + + settings.setValue("bookmarkname5", bookmarkname5); + settings.setValue("bookmarkurl5", bookmarkurl5); + + settings.setValue("bookmarkname6", bookmarkname6); + settings.setValue("bookmarkurl6", bookmarkurl6); + + settings.setValue("bookmarkname7", bookmarkname7); + settings.setValue("bookmarkurl7", bookmarkurl7); + + settings.setValue("bookmarkname8", bookmarkname8); + settings.setValue("bookmarkurl8", bookmarkurl8); + + settings.setValue("bookmarkname9", bookmarkname9); + settings.setValue("bookmarkurl9", bookmarkurl9); + + settings.setValue("bookmarkname10", bookmarkname10); + settings.setValue("bookmarkurl10", bookmarkurl10); + + viewbookmarks ? settings.setValue("viewbookmarks", 1) : settings.setValue("viewbookmarks", 0); } @@ -859,7 +968,9 @@ void cGlobalPreferences::setDefaultIonTypes() { void cGlobalPreferences::setDefaultDataProcessingMethods() { - bafprocessingmethod = 0; + linebafprocessingmethod = 0; + profilebafprocessingmethod = 0; + rawdataprocessingmethod = 0; } @@ -896,7 +1007,36 @@ void cGlobalPreferences::setDefaultDirectories() { void cGlobalPreferences::setDefaultURLs() { - bookmarkurl1 = "https://bioinfo.lifl.fr/norine/"; - bookmarkurl2 = "https://ms.biomed.cas.cz/bbdgnc/"; + bookmarkname1 = appname; + bookmarkurl1 = "https://ms.biomed.cas.cz/cyclobranch/"; + + bookmarkname2 = "MassSpecBlocks"; + bookmarkurl2 = "https://ms.biomed.cas.cz/msb/"; + + bookmarkname3 = "PubChem"; + bookmarkurl3 = "https://pubchem.ncbi.nlm.nih.gov/"; + + bookmarkname4 = "ChemSpider"; + bookmarkurl4 = "https://www.chemspider.com/"; + + bookmarkname5 = "ChEBI"; + bookmarkurl5 = "https://www.ebi.ac.uk/chebi/"; + + bookmarkname6 = "Lipid Maps"; + bookmarkurl6 = "https://lipidmaps.org/"; + + bookmarkname7 = "Reaxys"; + bookmarkurl7 = "https://www.reaxys.com/"; + + bookmarkname8 = "Norine"; + bookmarkurl8 = "https://bioinfo.lifl.fr/norine/"; + + bookmarkname9 = ""; + bookmarkurl9 = ""; + + bookmarkname10 = ""; + bookmarkurl10 = ""; + + viewbookmarks = false; } diff --git a/CycloBranch/core/cGlobalPreferences.h b/CycloBranch/core/cGlobalPreferences.h index 90ccfb2..c9d0767 100644 --- a/CycloBranch/core/cGlobalPreferences.h +++ b/CycloBranch/core/cGlobalPreferences.h @@ -69,6 +69,32 @@ struct cIonType { multiplier = 1; } + + /** + \brief Store the structure into an output stream. + \param os an output stream + */ + void store(ofstream& os) { + storeString(name, os); + storeString(formula, os); + os.write((char *)&massdifference, sizeof(double)); + os.write((char *)&positive, sizeof(bool)); + os.write((char *)&multiplier, sizeof(int)); + } + + + /** + \brief Load the structure from an input stream. + \param is an input stream + */ + void load(ifstream& is) { + loadString(name, is); + loadString(formula, is); + is.read((char *)&massdifference, sizeof(double)); + is.read((char *)&positive, sizeof(bool)); + is.read((char *)&multiplier, sizeof(int)); + } + }; @@ -83,7 +109,9 @@ class cGlobalPreferences { vector customions; - int bafprocessingmethod; + int linebafprocessingmethod; + int profilebafprocessingmethod; + int rawdataprocessingmethod; QString settingsdefaultdir; @@ -99,9 +127,38 @@ class cGlobalPreferences { QString exporthtmldefaultdir; QString exportimagedefaultdir; + QString bookmarkname1; QString bookmarkurl1; + + QString bookmarkname2; QString bookmarkurl2; + QString bookmarkname3; + QString bookmarkurl3; + + QString bookmarkname4; + QString bookmarkurl4; + + QString bookmarkname5; + QString bookmarkurl5; + + QString bookmarkname6; + QString bookmarkurl6; + + QString bookmarkname7; + QString bookmarkurl7; + + QString bookmarkname8; + QString bookmarkurl8; + + QString bookmarkname9; + QString bookmarkurl9; + + QString bookmarkname10; + QString bookmarkurl10; + + bool viewbookmarks; + /** \brief The constructor. diff --git a/CycloBranch/core/cImzML.cpp b/CycloBranch/core/cImzML.cpp index e55049b..00bdfa4 100644 --- a/CycloBranch/core/cImzML.cpp +++ b/CycloBranch/core/cImzML.cpp @@ -336,22 +336,22 @@ int cImzML::parse(string& filename, int& defaultmaxx, int& defaultmaxy, int& def // max count of pixel x if (accession.compare("IMS:1000042") == 0) { - defaultmaxx = stoi(value); + defaultmaxx = QVariant(value.c_str()).toInt(); } // max count of pixel y if (accession.compare("IMS:1000043") == 0) { - defaultmaxy = stoi(value); + defaultmaxy = QVariant(value.c_str()).toInt(); } // pixel size x if (accession.compare("IMS:1000046") == 0) { - defaultpixelsizex = stoi(value); + defaultpixelsizex = QVariant(value.c_str()).toInt(); } // pixel size y if (accession.compare("IMS:1000047") == 0) { - defaultpixelsizey = stoi(value); + defaultpixelsizey = QVariant(value.c_str()).toInt(); } } diff --git a/CycloBranch/core/cMzML.cpp b/CycloBranch/core/cMzML.cpp index e4cb643..ac61271 100644 --- a/CycloBranch/core/cMzML.cpp +++ b/CycloBranch/core/cMzML.cpp @@ -221,6 +221,16 @@ int cMzML::parse(string& filename, vector& peaklists, int profilespe if (accession.compare("MS:1000016") == 0) { double rt = atof(getAttribute(currentElement6, "value").c_str()); peaklist.setRetentionTime(rt); + + string rtunit = getAttribute(currentElement6, "unitAccession"); + if (rtunit.compare("UO:0000010") == 0) { + // set second + peaklist.setRetentionTimeUnit(0); + } + else { + // set minute + peaklist.setRetentionTimeUnit(1); + } } @@ -461,6 +471,8 @@ int cMzML::parse(string& filename, vector& peaklists, int profilespe if ((profilespectrumid == -1) || (profilespectrumid == count)) { cPeaksList emptypeaklist; emptypeaklist.setTitle(title); + emptypeaklist.setRetentionTime(peaklist.getRetentionTime()); + emptypeaklist.setRetentionTimeUnit(peaklist.getRetentionTimeUnit()); peaklists.push_back(emptypeaklist); } diff --git a/CycloBranch/core/cParameters.cpp b/CycloBranch/core/cParameters.cpp index 8f38709..882888f 100644 --- a/CycloBranch/core/cParameters.cpp +++ b/CycloBranch/core/cParameters.cpp @@ -1,9 +1,365 @@ #include "core/cParameters.h" +#include +#include +#include + #include "gui/cMainThread.h" #include "core/cSummaryFormula.h" +bool checkSeniorRules(vector& combarray, vector& valences, int maxcomponents) { + int totalvalence = 0; + int i, size; + + i = 0; + size = (int)combarray.size(); + while ((i < size) && (combarray[i] > 0)) { + totalvalence += valences[combarray[i] - 1]; + i++; + } + + // SENIOR rule 1 - the sum of valences must be even + // SENIOR rule 3 - the sum of valences >= 2 * (atomscount - maximum number of allowed components in the graph); edges - nodes + components >= 0 + if ((totalvalence % 2 == 1) || (totalvalence < 2 * (i - maxcomponents))) { + return false; + } + + return true; +} + + +bool checkAdvancedFilteringRules(bool noratiocheck, double sumofmasses, vector& countsofelements, vector& namesofelements) { + int countH = 0; + int countC = 0; + int countO = 0; + int countN = 0; + int countS = 0; + int countP = 0; + int countF = 0; + int countCl = 0; + int countBr = 0; + int countSi = 0; + + double elementsratio; + + int size = (int)countsofelements.size(); + for (int j = 0; j < size; j++) { + if (countsofelements[j] > 0) { + if (namesofelements[j].compare("H") == 0) { + countH = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("C") == 0) { + countC = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("O") == 0) { + countO = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("N") == 0) { + countN = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("S") == 0) { + countS = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("P") == 0) { + countP = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("F") == 0) { + countF = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("Cl") == 0) { + countCl = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("Br") == 0) { + countBr = countsofelements[j]; + continue; + } + if (namesofelements[j].compare("Si") == 0) { + countSi = countsofelements[j]; + continue; + } + } + } + + if ((countH == 0) || (countC == 0)) { + return true; + } + + if (noratiocheck) { + if (countN > countO) { + return true; + } + } + + if (sumofmasses < 500.0) { + + if (countC > 39) { + return true; + } + if (countH > 72) { + return true; + } + if (countN > 20) { + return true; + } + if (countO > 20) { + return true; + } + if (countP > 9) { + return true; + } + if (countS > 10) { + return true; + } + if (countF > 16) { + return true; + } + if (countCl > 10) { + return true; + } + if (countBr > 5) { + return true; + } + if (countSi > 8) { + return true; + } + + } + else if (sumofmasses < 1000.0) { + + if (countC > 78) { + return true; + } + if (countH > 126) { + return true; + } + if (countN > 25) { + return true; + } + if (countO > 27) { + return true; + } + if (countP > 9) { + return true; + } + if (countS > 14) { + return true; + } + if (countF > 34) { + return true; + } + if (countCl > 12) { + return true; + } + if (countBr > 8) { + return true; + } + if (countSi > 14) { + return true; + } + + } + else if (sumofmasses < 2000.0) { + + if (countC > 156) { + return true; + } + if (countH > 236) { + return true; + } + if (countN > 32) { + return true; + } + if (countO > 63) { + return true; + } + if (countP > 9) { + return true; + } + if (countS > 14) { + return true; + } + if (countF > 48) { + return true; + } + if (countCl > 12) { + return true; + } + if (countBr > 10) { + return true; + } + if (countSi > 15) { + return true; + } + + } + else if (sumofmasses < 3000.0) { + + if (countC > 162) { + return true; + } + if (countH > 208) { + return true; + } + if (countN > 48) { + return true; + } + if (countO > 78) { + return true; + } + if (countP > 9) { + return true; + } + if (countS > 14) { + return true; + } + if (countF > 48) { + return true; + } + if (countCl > 12) { + return true; + } + if (countBr > 10) { + return true; + } + if (countSi > 15) { + return true; + } + + } + + if ((countH > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countH)) / ((double)(countC)); + if ((elementsratio < 0.2) || (elementsratio > 3.1)) { + return true; + } + } + + if ((countN > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countN)) / ((double)(countC)); + if (elementsratio > 1.3) { + return true; + } + } + + if ((countO > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countO)) / ((double)(countC)); + if (elementsratio > 1.2) { + return true; + } + } + + if ((countP > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countP)) / ((double)(countC)); + if (elementsratio > 0.3) { + return true; + } + } + + if ((countS > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countS)) / ((double)(countC)); + if (elementsratio > 0.8) { + return true; + } + } + + if ((countF > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countF)) / ((double)(countC)); + if (elementsratio > 1.5) { + return true; + } + } + + if ((countCl > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countCl)) / ((double)(countC)); + if (elementsratio > 0.8) { + return true; + } + } + + if ((countBr > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countBr)) / ((double)(countC)); + if (elementsratio > 0.8) { + return true; + } + } + + if ((countSi > 0) && (countC >= 0)) { + if (countC == 0) { + return true; + } + elementsratio = ((double)(countSi)) / ((double)(countC)); + if (elementsratio > 0.5) { + return true; + } + } + + if ((countN > 1) && (countO > 1) && (countP > 1) && (countS > 1)) { + if ((countN >= 10) || (countO >= 20) || (countP >= 4) || (countS >= 3)) { + return true; + } + } + + if ((countN > 3) && (countO > 3) && (countP > 3)) { + if ((countN >= 11) || (countO >= 22) || (countP >= 6)) { + return true; + } + } + + if ((countO > 1) && (countP > 1) && (countS > 1)) { + if ((countO >= 14) || (countP >= 3) || (countS >= 3)) { + return true; + } + } + + if ((countP > 1) && (countS > 1) && (countN > 1)) { + if ((countP >= 3) || (countS >= 3) || (countN >= 4)) { + return true; + } + } + + if ((countN > 6) && (countO > 6) && (countS > 6)) { + if ((countN >= 19) || (countO >= 14) || (countS >= 8)) { + return true; + } + } + + return false; +} + + void cParameters::fixIntensities(cPeaksList& centroidspectrum, cPeaksList& profilespectrum) { if ((centroidspectrum.size() == 0) || (profilespectrum.size() == 0)) { return; @@ -28,24 +384,24 @@ void cParameters::fixIntensities(cPeaksList& centroidspectrum, cPeaksList& profi } -bool cParameters::checkSeniorRules(vector& combarray, vector& valences, int maxcomponents) { - int totalvalence = 0; - int i, size; - - i = 0; - size = (int)combarray.size(); - while ((i < size) && (combarray[i] > 0)) { - totalvalence += valences[combarray[i] - 1]; - i++; +void cParameters::pushLossItem(vector& lossitems, string lossstr) { + string shortstr; + size_t pos = lossstr.find(':'); + if (pos == string::npos) { + shortstr = lossstr; } - - // SENIOR rule 1 - the sum of valences must be even - // SENIOR rule 3 - the sum of valences >= 2 * (atomscount - maximum number of allowed components in the graph); edges - nodes + components >= 0 - if ((totalvalence % 2 == 1) || (totalvalence < 2 * (i - maxcomponents))) { - return false; + else { + shortstr = lossstr.substr(0, pos); } - return true; + cSummaryFormula tmpformula; + neutralLoss lossitem; + + lossitem.summary = lossstr; + addStringFormulaToMap(shortstr, lossitem.summarymap); + tmpformula.setFormula(shortstr); + lossitem.massdifference = tmpformula.getMass(); + lossitems.push_back(lossitem); } @@ -87,12 +443,14 @@ void cParameters::clear() { os = 0; iondefinitions.recalculateFragments(false, false, s); peptidetype = linear; - peaklistfilename = ""; + peaklistfilenames.clear(); + originalpeaklistfilenames.clear(); useprofiledata = false; convertprofiledata = true; profiledatafilename = ""; - peaklistfileformat = txt; - peaklistseries.clear(); + linebafprocessing = 0; + peaklistfileformats.clear(); + peaklistseriesvector.clear(); scannumber = 1; precursormass = 0; precursoradduct = ""; @@ -104,7 +462,11 @@ void cParameters::clear() { minimumabsoluteintensitythreshold = 0; minimummz = 150; maximummz = 0; + minimumrt = 0; + maximumrt = 0; fwhm = 0.05; + minratio54Fe56Fe = 0.01; + maxratio54Fe56Fe = 0.1; bricksdatabasefilename = ""; bricksdatabase.clear(); maximumbricksincombinationbegin = 1; @@ -118,10 +480,14 @@ void cParameters::clear() { mode = dereplication; scoretype = number_of_matched_peaks; maximumcombinedlosses = 2; + maximumcombinedelements = 200; //clearhitswithoutparent = false; basicformulacheck = true; advancedformulacheck = true; noratiocheck = true; + calculatefdrs = true; + minimumannotationintensityrelative = 0; + minimumannotationintensityabsolute = 0; mzdifftolerance = 0; intensitytolerance = 0; reportunmatchedtheoreticalpeaks = false; @@ -152,16 +518,12 @@ void cParameters::clear() { ionsfortheoreticalspectraMS1.clear(); ionsfortheoreticalspectraMS2.clear(); - neutrallossesdefinitions.clear(); - neutralLoss loss; cSummaryFormula tmpformula; + neutralLoss lossitem; + + neutrallossesdefinitions.clear(); for (int i = 0; i < (int)defaultneutrallosses.getNeutralLosses().size(); i++) { - loss.clear(); - loss.summary = defaultneutrallosses.getNeutralLosses()[i]; - addStringFormulaToMap(loss.summary, loss.summarymap); - tmpformula.setFormula(loss.summary); - loss.massdifference = tmpformula.getMass(); - neutrallossesdefinitions.push_back(loss); + pushLossItem(neutrallossesdefinitions, defaultneutrallosses.getNeutralLosses()[i]); } neutrallossesfortheoreticalspectra.clear(); numberofgeneratedneutrallosses = 0; @@ -169,8 +531,24 @@ void cParameters::clear() { originalneutrallossesdefinitions = neutrallossesdefinitions; originalneutrallossesfortheoreticalspectra = neutrallossesfortheoreticalspectra; + originalelementsdefinitions.clear(); + originalelementsfortheoreticalspectra.clear(); + + pushLossItem(originalelementsdefinitions, "H"); + pushLossItem(originalelementsdefinitions, "C"); + pushLossItem(originalelementsdefinitions, "O"); + pushLossItem(originalelementsdefinitions, "N"); + pushLossItem(originalelementsdefinitions, "S:1"); + pushLossItem(originalelementsdefinitions, "P:1"); + + originalelementsfortheoreticalspectra.push_back(0); + originalelementsfortheoreticalspectra.push_back(1); + originalelementsfortheoreticalspectra.push_back(2); + originalelementsfortheoreticalspectra.push_back(3); + peakidtodesc.clear(); isotopeformulaidtodesc.clear(); + pchemresults.clear(); defaultmaxx = 1; defaultmaxy = 1; @@ -196,6 +574,7 @@ int cParameters::checkAndPrepare(bool& terminatecomputation) { string foldername; string ibdfilename; string mzmlname; + string linespectramgfname; cPeaksList profilelist; ifstream profilestream; @@ -206,600 +585,768 @@ int cParameters::checkAndPrepare(bool& terminatecomputation) { QTime time; bool good; - if (peaklistfilename.empty()) { + if (peaklistfilenames.empty()) { error = true; - errormessage = "A peaklist is not specified. Have you configured the engine (Search -> Settings...) ?\n"; + errormessage = "A peaklist must be selected. Have you configured the engine (Search -> Settings...) ?\n"; } + peaklistseriesvector.clear(); + peaklistseriesvector.resize(peaklistfilenames.size()); + peaklistfileformats.resize(peaklistfilenames.size()); + // peaklist check if (!error) { - peaklistfileformat = txt; - - try { + for (int h = 0; h < (int)peaklistfilenames.size(); h++) { - rx = "\\.[mM][gG][fF]$"; - // Mascot Generic Format - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = mgf; + if (terminatecomputation) { + error = true; + errormessage = "Aborted by user.\n"; + break; } + + peaklistfileformats[h] = txt; - rx = "\\.[mM][zZ][mM][lL]$"; - // mzML - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = mzML; - } + try { + + rx = "\\.[mM][gG][fF]$"; + // Mascot Generic Format + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = mgf; + } - rx = "\\.[mM][zZ][xX][mM][lL]$"; - // mzXML - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = mzXML; - } + rx = "\\.[mM][zZ][mM][lL]$"; + // mzML + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = mzML; + } - #if OS_TYPE == WIN - rx = "\\.[bB][aA][fF]$"; - // Bruker Analysis File - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = baf; + rx = "\\.[mM][zZ][xX][mM][lL]$"; + // mzXML + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = mzXML; } + + #if OS_TYPE == WIN + rx = "\\.[bB][aA][fF]$"; + // Bruker Analysis File + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = baf; + } - rx = "\\.[rR][aA][wW]$"; - // Thermo RAW file - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = raw; - } + rx = "\\.[rR][aA][wW]$"; + // Thermo RAW file + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = raw; + } - rx = "\\.[dD][aA][tT]$"; - // dat file in Waters raw directory - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = dat; - } + rx = "\\.[dD][aA][tT]$"; + // dat file in Waters raw directory + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = dat; + } - rx = "\\.[mM][iI][sS]$"; - // flexImaging File - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = mis; - } + rx = "\\.[mM][iI][sS]$"; + // flexImaging File + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = mis; + } + + rx = "ser$"; + // apex File + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = ser; + } + #endif - rx = "ser$"; - // apex File - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = ser; + rx = "\\.[iI][mM][zZ][mM][lL]$"; + // imzML File + if (regex_search(peaklistfilenames[h], rx)) { + peaklistfileformats[h] = imzML; } - #endif - rx = "\\.[iI][mM][zZ][mM][lL]$"; - // imzML File - if (regex_search(peaklistfilename, rx)) { - peaklistfileformat = imzML; + } + catch (regex_error& e) { + error = true; + errormessage = "cParameters::checkAndPrepare: regex_search failed, error no. " + to_string((int)e.code()) + "\n"; } - } - catch (regex_error& e) { - error = true; - errormessage = "cParameters::checkAndPrepare: regex_search failed, error no. " + to_string((int)e.code()) + "\n"; - } + if (!error) { - if (!error) { + QDir peaksdir; - switch (peaklistfileformat) { - case txt: - peakliststream.open(peaklistfilename); - break; - case mgf: - peakliststream.open(peaklistfilename); - break; - case mzXML: - *os << "Converting the file " + peaklistfilename + " to mzML ... "; + switch (peaklistfileformats[h]) { + case txt: + peakliststream.open(peaklistfilenames[h]); + break; + case mgf: + peakliststream.open(peaklistfilenames[h]); + break; + case mzXML: + *os << "Converting the file " + peaklistfilenames[h] + " to mzML ... "; - #if OS_TYPE == UNX - s = installdir.toStdString() + "External/linux/any2mzml.sh " + peaklistfilename; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The file cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have FileConverter installed (OpenMS 2.x must be installed) ?\n"; - errormessage += "Do you have 'any2mzml.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; - errormessage += "Is the file 'any2mzml.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/any2mzml.sh) ? \n"; - } - #else - #if OS_TYPE == OSX - s = installdir.toStdString() + "External/macosx/any2mzml.sh " + peaklistfilename; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The file cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have FileConverter installed (OpenMS 2.x must be installed) ?\n"; - errormessage += "Do you have 'any2mzml.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; - errormessage += "Is the file 'any2mzml.sh' executable ? \n"; - } - #else - s = "External\\windows\\any2mzml.bat \"" + peaklistfilename + "\""; + #if OS_TYPE == UNX + s = installdir.toStdString() + "External/linux/any2mzml.sh " + peaklistfilenames[h]; if (system(s.c_str()) != 0) { error = true; errormessage = "The file cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; errormessage += "Do you have FileConverter installed (OpenMS 2.x must be installed) ?\n"; - errormessage += "Do you have a path to FileConverter in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; - errormessage += "Do you have 'any2mzml.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + errormessage += "Do you have 'any2mzml.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; + errormessage += "Is the file 'any2mzml.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/any2mzml.sh) ? \n"; } + #else + #if OS_TYPE == OSX + s = installdir.toStdString() + "External/macosx/any2mzml.sh " + peaklistfilenames[h]; + if (system(s.c_str()) != 0) { + error = true; + errormessage = "The file cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have FileConverter installed (OpenMS 2.x must be installed) ?\n"; + errormessage += "Do you have 'any2mzml.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; + errormessage += "Is the file 'any2mzml.sh' executable ? \n"; + } + #else + s = "External\\windows\\any2mzml.bat \"" + peaklistfilenames[h] + "\""; + if (system(s.c_str()) != 0) { + error = true; + errormessage = "The file cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have FileConverter installed (OpenMS 2.x must be installed) ?\n"; + errormessage += "Do you have a path to FileConverter in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; + errormessage += "Do you have 'any2mzml.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + } + #endif #endif - #endif - - if (!error) { - *os << "ok" << endl << endl; - mzmlname = peaklistfilename + ".mzML"; - peakliststream.open(mzmlname); - } - break; - case baf: - #if OS_TYPE == WIN - time.start(); - - *os << "Processing the file " + peaklistfilename + ":" << endl; - - /* - s = "External\\windows\\baf2csv.bat \"" + peaklistfilename + "\""; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The file cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; - errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have 'baf2csv.bat' file located in the 'External/windows' folder ?\n"; - } if (!error) { - *os << "ok" << endl; - peakliststream.open(peaklistfilename + ".csv"); + *os << "ok" << endl << endl; + mzmlname = peaklistfilenames[h] + ".mzML"; + peakliststream.open(mzmlname); } - */ + break; + case baf: + #if OS_TYPE == WIN + time.start(); - mzmlname = peaklistfilename + ".mzML"; - peakliststream.open(mzmlname); - good = peakliststream.good(); - peakliststream.close(); + *os << "Processing the file " + peaklistfilenames[h] + ":" << endl; - if (good) { - *os << "The previously converted centroid spectra were found." << endl; - *os << "The following file was used: " << mzmlname << endl; - } - else { - *os << "centroid spectra ... "; - - s = "External\\windows\\baf2mzml.bat \"" + peaklistfilename + "\""; + /* + s = "External\\windows\\baf2csv.bat \"" + peaklistfilenames[h] + "\""; if (system(s.c_str()) != 0) { error = true; errormessage = "The file cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have 'baf2mzml.bat' file located in the 'External/windows' folder ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have 'baf2csv.bat' file located in the 'External/windows' folder ?\n"; } + if (!error) { *os << "ok" << endl; + peakliststream.open(peaklistfilenames[h] + ".csv"); } - } - - if (!error) { - peakliststream.open(mzmlname); - } - - if (!error && useprofiledata && convertprofiledata) { - *os << "profile spectra ... "; - s = "External\\windows\\baf2profile.bat \"" + peaklistfilename + "\""; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The file cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; - errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have 'baf2profile.bat' file located in the 'External/windows' folder ?\n"; + */ + + if (linebafprocessing == 0) { + mzmlname = peaklistfilenames[h] + ".mzML"; + peakliststream.open(mzmlname); + good = peakliststream.good(); + peakliststream.close(); + + if (good) { + *os << "The previously converted centroid spectra were found." << endl; + *os << "The following file was used: " << mzmlname << endl; + } + else { + *os << "centroid spectra ... "; + + //s = "External\\windows\\baf2mzml.bat \"" + peaklistfilenames[h] + "\""; + //if (system(s.c_str()) != 0) { + // error = true; + // errormessage = "The file cannot be converted.\n"; + // errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + // errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; + // errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; + // errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + // errormessage += "Do you have 'baf2mzml.bat' file located in the 'External/windows' folder ?\n"; + //} + + QString command = "External\\windows\\baf2mzml.bat"; + QString param = peaklistfilenames[h].c_str(); + + QStringList params; + params << param; + + QProcess convert; + convert.start(command, params); + + if (!convert.waitForStarted(-1)) { + error = true; + } + + if (!error) { + convert.closeWriteChannel(); + if (!convert.waitForFinished(-1)) { + error = true; + } + } + + if (!error) { + *os << "ok" << endl; + } + else { + errormessage = "The file cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; + errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have 'baf2mzml.bat' file located in the 'External/windows' folder ?\n"; + } + } + + if (!error) { + peakliststream.open(mzmlname); + } + } + else { + linespectramgfname = peaklistfilenames[h] + ".mgf"; + + peakliststream.open(linespectramgfname, ifstream::binary); + good = peakliststream.good(); + + string endstr; + if (good) { + peakliststream.seekg(0, ios::end); + unsigned long long spos = (unsigned long long)peakliststream.tellg(); + if (spos > 12) { + spos -= 12; + peakliststream.seekg(spos, ios::beg); + } + + char c; + while (peakliststream.good()) { + peakliststream.get(c); + endstr += c; + } + } + + peakliststream.close(); + peakliststream.clear(); + + if (endstr.find("END IONS") != string::npos) { + *os << "The previously converted centroid spectra were found." << endl; + *os << "The following file was used: " << linespectramgfname << endl; + } + else { + *os << "centroid spectra ... "; + + if (!QFile(peaklistfilenames[h].c_str()).exists()) { + error = true; + errormessage = "The file '" + peaklistfilenames[h] + "' does not exist.\n"; + } + else { + //s = "External\\windows\\linespectrumreader.exe \"" + peaklistfilenames[h] + "\""; + //if (system(s.c_str()) != 0) { + // error = true; + // errormessage = "The file cannot be converted.\n"; + // errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + // errormessage += "Do you have Bruker Daltonik's CompassXtract installed ?\n"; + // //errormessage += "Do you have path to the CompassXtract.exe in your PATH variable ?\n"; + // errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + // errormessage += "Do you have 'linespectrumreader.exe' file located in the 'External/windows' folder ?\n"; + //} + + QString command = "External\\windows\\linespectrumreader.exe"; + QString param = peaklistfilenames[h].c_str(); + + QStringList params; + params << param; + + QProcess convert; + convert.start(command, params); + + if (!convert.waitForStarted(-1)) { + error = true; + } + + if (!error) { + convert.closeWriteChannel(); + if (!convert.waitForFinished(-1)) { + error = true; + } + } + + if (error) { + errormessage = "The file cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Do you have Bruker Daltonik's CompassXtract installed ?\n"; + //errormessage += "Do you have path to the CompassXtract.exe in your PATH variable ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have 'linespectrumreader.exe' file located in the 'External/windows' folder ?\n"; + } + } + + if (!error) { + *os << "ok" << endl; + } + } + + if (!error) { + peakliststream.open(linespectramgfname); + } } - if (!error) { - *os << "ok" << endl; + if (!error && useprofiledata && convertprofiledata) { + *os << "profile spectra ... "; + + s = "External\\windows\\baf2profile.bat \"" + peaklistfilenames[h] + "\""; + if (system(s.c_str()) != 0) { + error = true; + errormessage = "The file cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; + errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have 'baf2profile.bat' file located in the 'External/windows' folder ?\n"; + } + + if (!error) { + *os << "ok" << endl; + } } - } - *os << endl; + *os << endl; - secs = time.elapsed() / 1000; - mins = (secs / 60) % 60; - hrs = (secs / 3600); - secs = secs % 60; + secs = time.elapsed() / 1000; + mins = (secs / 60) % 60; + hrs = (secs / 3600); + secs = secs % 60; - *os << "The data conversion took: " << to_string(hrs) << " hrs, " << to_string(mins) << " min, " << to_string(secs) << " sec." << endl << endl; - #endif - break; - case raw: - #if OS_TYPE == WIN - *os << "Converting the file " + peaklistfilename + " ... "; - - s = "External\\windows\\raw2mzmlpeaks.bat \"" + peaklistfilename + "\""; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The file cannot be converted.\n"; - errormessage += "Is the file '" + peaklistfilename + "' opened elsewhere ?\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have msconvert.exe installed (OpenMS 2.x including ProteoWizard must be installed) ?\n"; - errormessage += "Do you have a path to msconvert.exe in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/share/OpenMS/THIRDPARTY/pwiz-bin') ?\n"; - errormessage += "Do you have 'raw2mzmlpeaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; - } + *os << "The data conversion took: " << to_string(hrs) << " hrs, " << to_string(mins) << " min, " << to_string(secs) << " sec." << endl << endl; + #endif + break; + case raw: + #if OS_TYPE == WIN + *os << "Converting the file " + peaklistfilenames[h] + " ... "; - if (!error && useprofiledata) { - s = "External\\windows\\raw2mzml.bat \"" + peaklistfilename + "\""; + s = "External\\windows\\raw2mzmlpeaks.bat \"" + peaklistfilenames[h] + "\""; if (system(s.c_str()) != 0) { error = true; errormessage = "The file cannot be converted.\n"; - errormessage += "Is the file '" + peaklistfilename + "' opened elsewhere ?\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; + errormessage += "Is the file '" + peaklistfilenames[h] + "' opened elsewhere ?\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; errormessage += "Do you have msconvert.exe installed (OpenMS 2.x including ProteoWizard must be installed) ?\n"; errormessage += "Do you have a path to msconvert.exe in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/share/OpenMS/THIRDPARTY/pwiz-bin') ?\n"; - errormessage += "Do you have 'raw2mzml.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + errormessage += "Do you have 'raw2mzmlpeaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; } - } - if (!error) { - *os << "ok" << endl << endl; - mzmlname = peaklistfilename.substr(0, peaklistfilename.rfind('.')) + "_converted.mzML"; - peakliststream.open(mzmlname); - } - #endif - break; - case dat: - #if OS_TYPE == WIN - foldername = peaklistfilename.substr(0, peaklistfilename.rfind('/')); - peaksfoldername = foldername.substr(0, foldername.size() - 4) + "_PEAKS.raw"; - - *os << "Generating centroid data folder from " + foldername + " ... "; - s = "External\\windows\\waters\\profile2peaks.exe \"" + foldername + "\""; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The raw data folder cannot be converted.\n"; - errormessage += "Does the folder '" + foldername + "' exist ?\n"; - errormessage += "Is the folder with the folder '" + foldername + "' writable ?\n"; - errormessage += "Do you have 'profile2peaks.exe' file located in the 'External/windows/waters' folder ?\n"; - } - else { - *os << "ok" << endl << endl; - *os << "Centroid data folder " + peaksfoldername + " successfully created." << endl << endl; - } + if (!error && useprofiledata) { + s = "External\\windows\\raw2mzml.bat \"" + peaklistfilenames[h] + "\""; + if (system(s.c_str()) != 0) { + error = true; + errormessage = "The file cannot be converted.\n"; + errormessage += "Is the file '" + peaklistfilenames[h] + "' opened elsewhere ?\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have msconvert.exe installed (OpenMS 2.x including ProteoWizard must be installed) ?\n"; + errormessage += "Do you have a path to msconvert.exe in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/share/OpenMS/THIRDPARTY/pwiz-bin') ?\n"; + errormessage += "Do you have 'raw2mzml.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + } + } - if (!error) { - *os << "Converting profile data " + foldername + " ... "; - s = "External\\windows\\waters\\raw2mgf.exe \"" + foldername + "\""; + if (!error) { + *os << "ok" << endl << endl; + mzmlname = peaklistfilenames[h].substr(0, peaklistfilenames[h].rfind('.')) + "_converted.mzML"; + peakliststream.open(mzmlname); + } + #endif + break; + case dat: + #if OS_TYPE == WIN + foldername = peaklistfilenames[h].substr(0, peaklistfilenames[h].rfind('/')); + peaksfoldername = foldername.substr(0, foldername.size() - 4) + "_PEAKS.raw"; + + peaksdir.setPath(peaksfoldername.c_str()); + if (!peaksdir.exists()) { + *os << "Generating centroid data folder from " + foldername + " ... "; + s = "External\\windows\\waters\\profile2peaks.exe \"" + foldername + "\""; + if (system(s.c_str()) != 0) { + error = true; + errormessage = "The raw data folder cannot be converted.\n"; + errormessage += "Does the folder '" + foldername + "' exist ?\n"; + errormessage += "Is the folder with the folder '" + foldername + "' writable ?\n"; + errormessage += "Do you have 'profile2peaks.exe' file located in the 'External/windows/waters' folder ?\n"; + } + else { + *os << "ok" << endl << endl; + *os << "Centroid data folder " + peaksfoldername + " successfully created." << endl << endl; + } + } + else { + *os << "Previously generated centroid data folder " + peaksfoldername + " has been found." << endl << endl; + } + + if (!error) { + string tmpfilename = foldername.substr(0, foldername.rfind('.')) + ".mgf"; + if (!QFile(tmpfilename.c_str()).exists()) { + *os << "Converting profile data " + foldername + " ... "; + s = "External\\windows\\waters\\raw2mgf.exe \"" + foldername + "\""; + if (system(s.c_str()) != 0) { + error = true; + errormessage = "The raw data folder cannot be converted.\n"; + errormessage += "Does the folder '" + foldername + "' exist ?\n"; + errormessage += "Is the folder with the folder '" + foldername + "' writable ?\n"; + errormessage += "Do you have 'raw2mgf.exe' file located in the 'External/windows/waters' folder ?\n"; + } + else { + *os << "ok" << endl << endl; + } + } + else { + *os << "Previously converted profile data file " + tmpfilename + " has been found." << endl << endl; + } + } + + if (!error) { + string mgfname = peaksfoldername.substr(0, peaksfoldername.rfind('.')) + ".mgf"; + if (!QFile(mgfname.c_str()).exists()) { + *os << "Converting centroid data " + peaksfoldername + " ... "; + s = "External\\windows\\waters\\raw2mgf.exe \"" + peaksfoldername + "\""; + if (system(s.c_str()) != 0) { + error = true; + errormessage = "The raw data folder cannot be converted.\n"; + errormessage += "Does the folder '" + peaksfoldername + "' exist ?\n"; + errormessage += "Is the folder with the folder '" + peaksfoldername + "' writable ?\n"; + errormessage += "Do you have 'raw2mgf.exe' file located in the 'External/windows/waters' folder ?\n"; + } + else { + *os << "ok" << endl << endl; + } + } + else { + *os << "Previously converted centroid data file " + mgfname + " has been found." << endl << endl; + } + } + + if (!error) { + string mgfname = peaksfoldername.substr(0, peaksfoldername.rfind('.')) + ".mgf"; + peakliststream.open(mgfname); + } + #endif + break; + case mis: + #if OS_TYPE == WIN + foldername = peaklistfilenames[h].substr(0, peaklistfilenames[h].rfind('.')); + *os << "Converting flexImaging data folder " + foldername + " ... "; + s = "External\\windows\\mis2csv.bat \"" + foldername + "\""; if (system(s.c_str()) != 0) { error = true; - errormessage = "The raw data folder cannot be converted.\n"; + errormessage = "The folder cannot be converted.\n"; errormessage += "Does the folder '" + foldername + "' exist ?\n"; - errormessage += "Is the folder with the folder '" + foldername + "' writable ?\n"; - errormessage += "Do you have 'raw2mgf.exe' file located in the 'External/windows/waters' folder ?\n"; + errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; + errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have 'mis2csv.bat' file located in the 'External/windows' folder ?\n"; } - else { + + if (!error) { *os << "ok" << endl << endl; + peakliststream.open(foldername + ".baf.csv"); + spotliststream.open(foldername + ".baf.txt"); } - } - - if (!error) { - *os << "Converting centroid data " + peaksfoldername + " ... "; - s = "External\\windows\\waters\\raw2mgf.exe \"" + peaksfoldername + "\""; + #endif + break; + case ser: + #if OS_TYPE == WIN + foldername = peaklistfilenames[h].substr(0, peaklistfilenames[h].length() - 4); + *os << "Converting apex data folder " + foldername + " ... "; + s = "External\\windows\\ser2csv.bat \"" + foldername + "\""; if (system(s.c_str()) != 0) { error = true; - errormessage = "The raw data folder cannot be converted.\n"; - errormessage += "Does the folder '" + peaksfoldername + "' exist ?\n"; - errormessage += "Is the folder with the folder '" + peaksfoldername + "' writable ?\n"; - errormessage += "Do you have 'raw2mgf.exe' file located in the 'External/windows/waters' folder ?\n"; + errormessage = "The folder cannot be converted.\n"; + errormessage += "Does the folder '" + foldername + "' exist ?\n"; + errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; + errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have 'ser2csv.bat' file located in the 'External/windows' folder ?\n"; } - else { + + if (!error) { *os << "ok" << endl << endl; + peakliststream.open(foldername + ".csv"); + titleliststream.open(foldername + ".txt"); } - } - - if (!error) { - string mgfname = peaksfoldername.substr(0, peaksfoldername.rfind('.')) + ".mgf"; - peakliststream.open(mgfname); - } - #endif - break; - case mis: - #if OS_TYPE == WIN - foldername = peaklistfilename.substr(0, peaklistfilename.rfind('.')); - *os << "Converting flexImaging data folder " + foldername + " ... "; - s = "External\\windows\\mis2csv.bat \"" + foldername + "\""; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The folder cannot be converted.\n"; - errormessage += "Does the folder '" + foldername + "' exist ?\n"; - errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; - errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have 'mis2csv.bat' file located in the 'External/windows' folder ?\n"; - } - - if (!error) { - *os << "ok" << endl << endl; - peakliststream.open(foldername + ".baf.csv"); - spotliststream.open(foldername + ".baf.txt"); - } - #endif - break; - case ser: - #if OS_TYPE == WIN - foldername = peaklistfilename.substr(0, peaklistfilename.length() - 4); - *os << "Converting apex data folder " + foldername + " ... "; - s = "External\\windows\\ser2csv.bat \"" + foldername + "\""; - if (system(s.c_str()) != 0) { - error = true; - errormessage = "The folder cannot be converted.\n"; - errormessage += "Does the folder '" + foldername + "' exist ?\n"; - errormessage += "Do you have Bruker Daltonik's CompassXport installed ?\n"; - errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have 'ser2csv.bat' file located in the 'External/windows' folder ?\n"; - } + #endif + break; + case mzML: + peakliststream.open(peaklistfilenames[h]); + break; + case imzML: + ibdfilename = peaklistfilenames[h].substr(0, (int)peaklistfilenames[h].size() - 5); + ibdfilename += "ibd"; + peakliststream.open(ibdfilename, std::ifstream::binary); + break; + default: + break; + } - if (!error) { - *os << "ok" << endl << endl; - peakliststream.open(foldername + ".csv"); - titleliststream.open(foldername + ".txt"); - } - #endif - break; - case mzML: - peakliststream.open(peaklistfilename); - break; - case imzML: - ibdfilename = peaklistfilename.substr(0, (int)peaklistfilename.size() - 5); - ibdfilename += "ibd"; - peakliststream.open(ibdfilename, std::ifstream::binary); - break; - default: - break; } - - } - if (!error) { - if (!peakliststream.good()) { - error = true; - if ((peaklistfileformat == mis) || (peaklistfileformat == ser) || (peaklistfileformat == dat)) { - errormessage = "Cannot open the folder '" + foldername + "'."; - } - else { - errormessage = "Cannot open the file '" + peaklistfilename + "'."; - if (peaklistfileformat == baf) { - errormessage += "\n\nDo you have Bruker Daltonik's CompassXport installed ?\n"; - errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; + if (!error) { + if (!peakliststream.good()) { + error = true; + if ((peaklistfileformats[h] == mis) || (peaklistfileformats[h] == ser) || (peaklistfileformats[h] == dat)) { + errormessage = "Cannot open the folder '" + foldername + "'."; + } + else { + errormessage = "Cannot open the file '" + peaklistfilenames[h] + "'."; + if (peaklistfileformats[h] == baf) { + if (linebafprocessing == 0) { + errormessage += "\n\nDo you have Bruker Daltonik's CompassXport installed ?\n"; + errormessage += "Do you have path to the CompassXport.exe in your PATH variable ?\n"; + } + else { + errormessage += "\n\nDoes the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Do you have Bruker Daltonik's CompassXtract installed ?\n"; + //errormessage += "Do you have path to the CompassXtract.exe in your PATH variable ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have 'linespectrumreader.exe' file located in the 'External/windows' folder ?\n"; + } + } } } - } - else { - if (os && (peaklistfileformat != mzML) && (peaklistfileformat != mzXML) && (peaklistfileformat != imzML) && (peaklistfileformat != baf) && (peaklistfileformat != raw) && (peaklistfileformat != ser)) { - *os << "Loading the peaklist(s)... "; - } - switch (peaklistfileformat) { - case txt: - peaklistseries.loadFromPlainTextStream(peakliststream); - break; - case mzXML: - errtype = peaklistseries.loadFromMZMLStream(mzmlname, peakliststream, fwhm, mode, os, terminatecomputation); - if (errtype == -1) { - error = true; - errormessage = "Aborted by user.\n"; + else { + if (os && (peaklistfileformats[h] != mzML) && (peaklistfileformats[h] != mzXML) && (peaklistfileformats[h] != imzML) && (peaklistfileformats[h] != baf) && (peaklistfileformats[h] != raw) && (peaklistfileformats[h] != ser)) { + *os << "Loading the peaklist(s)... "; } - if (errtype == -2) { - error = true; - #if OS_TYPE == UNX - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + mzmlname + "' exist ?\n"; - errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; - errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/raw2peaks.sh) ? \n"; - #else - #if OS_TYPE == OSX - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + mzmlname + "' exist ?\n"; - errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; - errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/macosx/raw2peaks.sh) ? \n"; - #else - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + mzmlname + "' exist ?\n"; - errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; - errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + switch (peaklistfileformats[h]) { + case txt: + peaklistseriesvector[h].loadFromPlainTextStream(peakliststream); + break; + case mzXML: + errtype = peaklistseriesvector[h].loadFromMZMLStream(mzmlname, peakliststream, fwhm, mode, os, terminatecomputation); + if (errtype == -1) { + error = true; + errormessage = "Aborted by user.\n"; + } + if (errtype == -2) { + error = true; + #if OS_TYPE == UNX + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + mzmlname + "' exist ?\n"; + errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; + errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/raw2peaks.sh) ? \n"; + #else + #if OS_TYPE == OSX + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + mzmlname + "' exist ?\n"; + errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; + errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/macosx/raw2peaks.sh) ? \n"; + #else + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + mzmlname + "' exist ?\n"; + errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; + errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + #endif + #endif + } + break; + case mgf: + peaklistseriesvector[h].loadFromMGFStream(peakliststream, 0); + break; + case baf: + /* + #if OS_TYPE == WIN + peaklistseries.loadFromBAFStream(peakliststream); #endif - #endif - } - break; - case mgf: - peaklistseries.loadFromMGFStream(peakliststream); - break; - case baf: - /* - #if OS_TYPE == WIN - peaklistseries.loadFromBAFStream(peakliststream); - #endif - */ - #if OS_TYPE == WIN - errtype = peaklistseries.loadFromMZMLStream(mzmlname, peakliststream, fwhm, mode, os, terminatecomputation); - if (errtype == -1) { - error = true; - errormessage = "Aborted by user.\n"; - } - #endif - break; - case raw: - #if OS_TYPE == WIN - errtype = peaklistseries.loadFromMZMLStream(mzmlname, peakliststream, fwhm, mode, os, terminatecomputation); - if (errtype == -1) { - error = true; - errormessage = "Aborted by user.\n"; - } - if (errtype == -2) { - error = true; - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + mzmlname + "' exist ?\n"; - errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; - errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; - } - #endif - break; - case dat: - #if OS_TYPE == WIN - peaklistseries.loadFromMGFStream(peakliststream); + */ + #if OS_TYPE == WIN + if (linebafprocessing == 0) { + errtype = peaklistseriesvector[h].loadFromMZMLStream(mzmlname, peakliststream, fwhm, mode, os, terminatecomputation); + if (errtype == -1) { + error = true; + errormessage = "Aborted by user.\n"; + } + } + else { + peaklistseriesvector[h].loadFromMGFStream(peakliststream, 1); + } + #endif + break; + case raw: + #if OS_TYPE == WIN + errtype = peaklistseriesvector[h].loadFromMZMLStream(mzmlname, peakliststream, fwhm, mode, os, terminatecomputation); + if (errtype == -1) { + error = true; + errormessage = "Aborted by user.\n"; + } + if (errtype == -2) { + error = true; + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + mzmlname + "' exist ?\n"; + errormessage += "Is the directory with the file '" + mzmlname + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; + errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + } + #endif + break; + case dat: + #if OS_TYPE == WIN + peaklistseriesvector[h].loadFromMGFStream(peakliststream, 1); - profilemgfname = foldername.substr(0, foldername.rfind('.')) + ".mgf"; - profilestream.open(profilemgfname); + profilemgfname = foldername.substr(0, foldername.rfind('.')) + ".mgf"; + profilestream.open(profilemgfname); - for (int i = 0; i < peaklistseries.size(); i++) { - profilelist.clear(); - profilelist.loadFromMGFStream(profilestream); + for (int i = 0; i < peaklistseriesvector[h].size(); i++) { + profilelist.clear(); + profilelist.loadFromMGFStream(profilestream, 1); - if (peaklistseries[i].getTitle().compare(profilelist.getTitle()) != 0) { - error = true; - errormessage = "The number of spectra in " + foldername + " and " + peaksfoldername + " is different.\n"; - break; - } + if (peaklistseriesvector[h][i].getTitle().compare(profilelist.getTitle()) != 0) { + error = true; + errormessage = "The number of spectra in " + foldername + " and " + peaksfoldername + " is different.\n"; + break; + } - fixIntensities(peaklistseries[i], profilelist); - } + fixIntensities(peaklistseriesvector[h][i], profilelist); + } - profilestream.close(); - #endif - break; - case mis: - #if OS_TYPE == WIN - peaklistseries.loadFromBAFStream(peakliststream); - peaklistseries.loadSpotList(spotliststream); - spotliststream.close(); - #endif - break; - case ser: - #if OS_TYPE == WIN - errtype = peaklistseries.loadFromProfileApexStream(peaklistfilename, peakliststream, titleliststream, fwhm, os, terminatecomputation); - titleliststream.close(); - if (errtype == -1) { - error = true; - errormessage = "Aborted by user.\n"; - } - if (errtype == -2) { - error = true; - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the folder '" + peaklistfilename.substr(0, peaklistfilename.length() - 4) + "' exist ?\n"; - errormessage += "Is the directory '" + peaklistfilename.substr(0, peaklistfilename.length() - 4) + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; - errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; - } - #endif - break; - case mzML: - errtype = peaklistseries.loadFromMZMLStream(peaklistfilename, peakliststream, fwhm, mode, os, terminatecomputation); - if (errtype == -1) { - error = true; - errormessage = "Aborted by user.\n"; - } - if (errtype == -2) { - error = true; - #if OS_TYPE == UNX - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; - errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/raw2peaks.sh) ? \n"; - #else - #if OS_TYPE == OSX - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; - errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/macosx/raw2peaks.sh) ? \n"; - #else - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; - errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + profilestream.close(); #endif - #endif - } - break; - case imzML: - errtype = peaklistseries.loadFromIMZMLStream(peaklistfilename, peakliststream, fwhm, defaultmaxx, defaultmaxy, defaultpixelsizex, defaultpixelsizey, vendor, os, terminatecomputation); - if (errtype == -1) { - error = true; - errormessage = "Aborted by user.\n"; - } - if (errtype == -2) { - error = true; - #if OS_TYPE == UNX - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; - errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/raw2peaks.sh) ? \n"; - #else - #if OS_TYPE == OSX - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; - errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/macosx/raw2peaks.sh) ? \n"; - #else - errormessage = "Raw data cannot be converted.\n"; - errormessage += "Does the file '" + peaklistfilename + "' exist ?\n"; - errormessage += "Is the directory with the file '" + peaklistfilename + "' writable ?\n"; - errormessage += "Do you have enough space on your hard drive ?\n"; - errormessage += "Do you have OpenMS 2.x installed ?\n"; - errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; - errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + break; + case mis: + #if OS_TYPE == WIN + peaklistseriesvector[h].loadFromBAFStream(peakliststream); + peaklistseriesvector[h].loadSpotList(spotliststream); + spotliststream.close(); #endif - #endif + break; + case ser: + #if OS_TYPE == WIN + errtype = peaklistseriesvector[h].loadFromProfileApexStream(peaklistfilenames[h], peakliststream, titleliststream, fwhm, os, terminatecomputation); + titleliststream.close(); + if (errtype == -1) { + error = true; + errormessage = "Aborted by user.\n"; + } + if (errtype == -2) { + error = true; + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the folder '" + peaklistfilenames[h].substr(0, peaklistfilenames[h].length() - 4) + "' exist ?\n"; + errormessage += "Is the directory '" + peaklistfilenames[h].substr(0, peaklistfilenames[h].length() - 4) + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; + errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + } + #endif + break; + case mzML: + errtype = peaklistseriesvector[h].loadFromMZMLStream(peaklistfilenames[h], peakliststream, fwhm, mode, os, terminatecomputation); + if (errtype == -1) { + error = true; + errormessage = "Aborted by user.\n"; + } + if (errtype == -2) { + error = true; + #if OS_TYPE == UNX + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; + errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/raw2peaks.sh) ? \n"; + #else + #if OS_TYPE == OSX + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; + errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/macosx/raw2peaks.sh) ? \n"; + #else + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; + errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + #endif + #endif + } + break; + case imzML: + errtype = peaklistseriesvector[h].loadFromIMZMLStream(peaklistfilenames[h], peakliststream, fwhm, defaultmaxx, defaultmaxy, defaultpixelsizex, defaultpixelsizey, vendor, os, terminatecomputation); + if (errtype == -1) { + error = true; + errormessage = "Aborted by user.\n"; + } + if (errtype == -2) { + error = true; + #if OS_TYPE == UNX + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/linux' folder ?\n"; + errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/linux/raw2peaks.sh) ? \n"; + #else + #if OS_TYPE == OSX + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have 'raw2peaks.sh' file located in '" + installdir.toStdString() + "External/macosx' folder ?\n"; + errormessage += "Is the file 'raw2peaks.sh' executable (sudo chmod +x " + installdir.toStdString() + "External/macosx/raw2peaks.sh) ? \n"; + #else + errormessage = "Raw data cannot be converted.\n"; + errormessage += "Does the file '" + peaklistfilenames[h] + "' exist ?\n"; + errormessage += "Is the directory with the file '" + peaklistfilenames[h] + "' writable ?\n"; + errormessage += "Do you have enough space on your hard drive ?\n"; + errormessage += "Do you have OpenMS 2.x installed ?\n"; + errormessage += "Do you have a path to OpenMS binaries folder in your PATH variable (e.g., 'C:/Program Files/OpenMS-2.3.0/bin') ?\n"; + errormessage += "Do you have 'raw2peaks.bat' file located in the '" + appname.toStdString() + "/External/windows' folder ?\n"; + #endif + #endif + } + if (errtype == -3) { + error = true; + errormessage = "Failed to load the imzML file, zlib compression is not supported. The spectra must be stored in the imzML file with the attribute \"no compression\".\n"; + } + break; + default: + break; } - if (errtype == -3) { - error = true; - errormessage = "Failed to load the imzML file, zlib compression is not supported. The spectra must be stored in the imzML file with the attribute \"no compression\".\n"; + if (os && (peaklistfileformats[h] != mzML) && (peaklistfileformats[h] != mzXML) && (peaklistfileformats[h] != imzML) && (peaklistfileformats[h] != baf) && (peaklistfileformats[h] != raw) && (peaklistfileformats[h] != ser)) { + *os << "ok" << endl << endl; } - break; - default: - break; - } - if (os && (peaklistfileformat != mzML) && (peaklistfileformat != mzXML) && (peaklistfileformat != imzML) && (peaklistfileformat != baf) && (peaklistfileformat != raw) && (peaklistfileformat != ser)) { - *os << "ok" << endl << endl; } + peakliststream.close(); + } - peakliststream.close(); + } } @@ -924,7 +1471,7 @@ int cParameters::checkAndPrepare(bool& terminatecomputation) { if (os) { *os << "Loading the database of sequences... "; } - sequencedatabase.loadFromPlainTextStream(sequencedatabasestream); + sequencedatabase.loadFromPlainTextStream(sequencedatabasestream, false); if (os) { *os << "ok" << endl << endl; } @@ -1153,7 +1700,10 @@ string cParameters::printToString() { } s += "\n"; - s += "File: " + peaklistfilename + "\n"; + s += "File(s): \n"; + for (int i = 0; i < (int)peaklistfilenames.size(); i++) { + s += peaklistfilenames[i] + "\n"; + } s += "Use Profile Data: "; s += useprofiledata ? "on" : "off"; @@ -1169,7 +1719,11 @@ string cParameters::printToString() { s += "Minimum Threshold of Absolute Intensity: " + to_string(minimumabsoluteintensitythreshold) + "\n"; s += "Minimum m/z Ratio: " + to_string(minimummz) + "\n"; s += "Maximum m/z Ratio: " + to_string(maximummz) + "\n"; + s += "Minimum Retention Time: " + to_string(minimumrt) + "\n"; + s += "Maximum Retention Time: " + to_string(maximumrt) + "\n"; s += "FWHM: " + to_string(fwhm) + "\n"; + s += "Minimum Ratio 54Fe/56Fe: " + to_string(minratio54Fe56Fe) + "\n"; + s += "Maximum Ratio 54Fe/56Fe: " + to_string(maxratio54Fe56Fe) + "\n"; s += "Building Blocks Database File: " + bricksdatabasefilename + "\n"; s += "Maximum Number of Combined Blocks (start, middle, end): " + to_string(maximumbricksincombinationbegin) + ", " + to_string(maximumbricksincombinationmiddle) + ", " + to_string(maximumbricksincombinationend) + "\n"; @@ -1266,7 +1820,7 @@ string cParameters::printToString() { } s += "\n"; - s += "Neutral Losses / Chemical Elements: "; + s += "Neutral Losses: "; for (int i = 0; i < (int)originalneutrallossesfortheoreticalspectra.size(); i++) { s += originalneutrallossesdefinitions[originalneutrallossesfortheoreticalspectra[i]].summary; if (i < (int)originalneutrallossesfortheoreticalspectra.size() - 1) { @@ -1275,7 +1829,18 @@ string cParameters::printToString() { } s += "\n"; - s += "Maximum Number of Combined Neutral Losses/Elements: " + to_string(maximumcombinedlosses) + "\n"; + s += "Maximum Number of Combined Losses: " + to_string(maximumcombinedlosses) + "\n"; + + s += "Chemical Elements: "; + for (int i = 0; i < (int)originalelementsfortheoreticalspectra.size(); i++) { + s += originalelementsdefinitions[originalelementsfortheoreticalspectra[i]].summary; + if (i < (int)originalelementsfortheoreticalspectra.size() - 1) { + s += ", "; + } + } + s += "\n"; + + s += "Maximum Number of Combined Elements: " + to_string(maximumcombinedelements) + "\n"; //s += "Remove Hits of Fragments without Hits of Parent Fragments: "; //s += clearhitswithoutparent ? "on" : "off"; @@ -1307,6 +1872,13 @@ string cParameters::printToString() { s += noratiocheck ? "on" : "off"; s += "\n"; + s += "Calculate FDRs: "; + s += calculatefdrs ? "on" : "off"; + s += "\n"; + + s += "Minimum Relative Intensity of Highest Peak in Isotopic Cluster: " + to_string(minimumannotationintensityrelative) + "\n"; + s += "Minimum Absolute Intensity of Highest Peak in Isotopic Cluster: " + to_string(minimumannotationintensityabsolute) + "\n"; + s += "Isotope m/z Tolerance: " + to_string(mzdifftolerance) + "\n"; s += "Isotope Intensity Tolerance: " + to_string(intensitytolerance) + "\n"; @@ -1758,7 +2330,7 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess errormessage = ""; - if (maximumcombinedlosses == 0) { + if (maximumcombinedelements == 0) { return 0; } @@ -1776,7 +2348,6 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess vector countsofelements; vector massesofelements; vector namesofelements; - double elementsratio; int numberofbasicbricks = 0; @@ -1790,25 +2361,18 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess double minadd = 0; //double maxadd = 0; - int countH; - int countC; - int countO; - int countN; - int countS; - int countP; - int countF; - int countCl; - int countBr; - int countSi; + bool lcms; + bool rtavailable; - bool lcms = (peaklistseries.size() > 1) && !((peaklistfileformat == mis) || (peaklistfileformat == imzML)); + int kstart; + int kend; if (os) { *os << "Generating compounds... " << endl; } - for (int i = 0; i < (int)originalneutrallossesfortheoreticalspectra.size(); i++) { - tmpstr = originalneutrallossesdefinitions[originalneutrallossesfortheoreticalspectra[i]].summary; + for (int i = 0; i < (int)originalelementsfortheoreticalspectra.size(); i++) { + tmpstr = originalelementsdefinitions[originalelementsfortheoreticalspectra[i]].summary; if (tmpstr.rfind(':') != string::npos) { tmpstr = tmpstr.substr(0, tmpstr.rfind(':')); @@ -1817,7 +2381,7 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess tmpformula.setFormula(tmpstr, false); tmpbrick.clear(); - tmpbrick.setName(originalneutrallossesdefinitions[originalneutrallossesfortheoreticalspectra[i]].summary); + tmpbrick.setName(originalelementsdefinitions[originalelementsfortheoreticalspectra[i]].summary); tmpbrick.setComposition(to_string(numberofbasicbricks + 1), false); tmpbrick.setMass(tmpformula.getMass()); tmpbrick.setSummary(tmpstr); @@ -1927,7 +2491,7 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess } vector combarray; - for (int i = 0; i < maximumcombinedlosses; i++) { + for (int i = 0; i < maximumcombinedelements; i++) { combarray.push_back(0); } @@ -1944,9 +2508,12 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess } } + double unchargedmaximummz = charge(uncharge(maximummz, precursorcharge), (precursorcharge > 0) ? 1 : -1) - minadd; + //double unchargedmaximummz = maximummz - minadd; + //bool skipcombination; - //while (elementsbrickdatabase.nextCombinationFast(combarray, countsofelements, massesofelements, sumofmasses, numberofbasicbricks, maximumcombinedlosses, 0, maximummz)) { - while (elementsbrickdatabase.nextCombinationFastLimited(combarray, countsofelements, limitsofelements, massesofelements, sumofmasses, numberofbasicbricks, maximumcombinedlosses, 0, maximummz - minadd)) { + //while (elementsbrickdatabase.nextCombinationFast(combarray, countsofelements, massesofelements, sumofmasses, numberofbasicbricks, maximumcombinedelements, 0, maximummz)) { + while (elementsbrickdatabase.nextCombinationFastLimited(combarray, countsofelements, limitsofelements, massesofelements, sumofmasses, numberofbasicbricks, maximumcombinedelements, 0, unchargedmaximummz)) { if (terminatecomputation) { sequencedatabase.clear(); errormessage = "Aborted by user."; @@ -2000,383 +2567,106 @@ int cParameters::generateCompounds(bool& terminatecomputation, string& errormess } if (advancedformulacheck) { - - countH = 0; - countC = 0; - countO = 0; - countN = 0; - countS = 0; - countP = 0; - countF = 0; - countCl = 0; - countBr = 0; - countSi = 0; - - size = (int)countsofelements.size(); - for (int j = 0; j < size; j++) { - if (countsofelements[j] > 0) { - if (namesofelements[j].compare("H") == 0) { - countH = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("C") == 0) { - countC = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("O") == 0) { - countO = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("N") == 0) { - countN = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("S") == 0) { - countS = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("P") == 0) { - countP = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("F") == 0) { - countF = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("Cl") == 0) { - countCl = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("Br") == 0) { - countBr = countsofelements[j]; - continue; - } - if (namesofelements[j].compare("Si") == 0) { - countSi = countsofelements[j]; - continue; - } - } - } - - if ((countH == 0) || (countC == 0)) { + if (checkAdvancedFilteringRules(noratiocheck, sumofmasses, countsofelements, namesofelements)) { continue; } + } - if (noratiocheck) { - if (countN > countO) { - continue; - } - } - - if (sumofmasses < 500.0) { - - if (countC > 39) { - continue; - } - if (countH > 72) { - continue; - } - if (countN > 20) { - continue; - } - if (countO > 20) { - continue; - } - if (countP > 9) { - continue; - } - if (countS > 10) { - continue; - } - if (countF > 16) { - continue; - } - if (countCl > 10) { - continue; - } - if (countBr > 5) { - continue; - } - if (countSi > 8) { - continue; - } - - } - else if (sumofmasses < 1000.0) { - - if (countC > 78) { - continue; - } - if (countH > 126) { - continue; - } - if (countN > 25) { - continue; - } - if (countO > 27) { - continue; - } - if (countP > 9) { - continue; - } - if (countS > 14) { - continue; - } - if (countF > 34) { - continue; - } - if (countCl > 12) { - continue; - } - if (countBr > 8) { - continue; - } - if (countSi > 14) { - continue; - } - - } - else if (sumofmasses < 2000.0) { - - if (countC > 156) { - continue; - } - if (countH > 236) { - continue; - } - if (countN > 32) { - continue; - } - if (countO > 63) { - continue; - } - if (countP > 9) { - continue; - } - if (countS > 14) { - continue; - } - if (countF > 48) { - continue; - } - if (countCl > 12) { - continue; - } - if (countBr > 10) { - continue; - } - if (countSi > 15) { - continue; - } - - } - else if (sumofmasses < 3000.0) { - - if (countC > 162) { - continue; - } - if (countH > 208) { - continue; - } - if (countN > 48) { - continue; - } - if (countO > 78) { - continue; - } - if (countP > 9) { - continue; - } - if (countS > 14) { - continue; - } - if (countF > 48) { - continue; - } - if (countCl > 12) { - continue; - } - if (countBr > 10) { - continue; - } - if (countSi > 15) { - continue; - } - - } - - if ((countH > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countH)) / ((double)(countC)); - if ((elementsratio < 0.2) || (elementsratio > 3.1)) { - continue; - } - } - - if ((countN > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countN)) / ((double)(countC)); - if (elementsratio > 1.3) { - continue; - } - } + compoundsgenerated++; - if ((countO > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countO)) / ((double)(countC)); - if (elementsratio > 1.2) { - continue; - } - } + if (!reportunmatchedtheoreticalpeaks) { - if ((countP > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countP)) / ((double)(countC)); - if (elementsratio > 0.3) { - continue; - } - } + for (int h = 0; h < (int)peaklistseriesvector.size(); h++) { - if ((countS > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countS)) / ((double)(countC)); - if (elementsratio > 0.8) { - continue; - } - } + lcms = (peaklistseriesvector[h].size() > 1) && !((peaklistfileformats[h] == mis) || (peaklistfileformats[h] == imzML)); + rtavailable = (peaklistseriesvector[h].size() > 1) && (peaklistseriesvector[h][peaklistseriesvector[h].size() - 1].getRetentionTime() > 0); - if ((countF > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countF)) / ((double)(countC)); - if (elementsratio > 1.5) { - continue; - } - } + compoundshint = 0; - if ((countCl > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countCl)) / ((double)(countC)); - if (elementsratio > 0.8) { - continue; - } - } + size = peaklistseriesvector[h].size(); - if ((countBr > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countBr)) / ((double)(countC)); - if (elementsratio > 0.8) { - continue; - } - } + kstart = 0; + kend = size; - if ((countSi > 0) && (countC >= 0)) { - if (countC == 0) { - continue; - } - elementsratio = ((double)(countSi)) / ((double)(countC)); - if (elementsratio > 0.5) { - continue; - } - } + if (lcms && rtavailable) { - if ((countN > 1) && (countO > 1) && (countP > 1) && (countS > 1)) { - if ((countN >= 10) || (countO >= 20) || (countP >= 4) || (countS >= 3)) { - continue; - } - } + if (minimumrt != 0) { + while (kstart < size) { + if (peaklistseriesvector[h][kstart].getRetentionTime() >= minimumrt) { + break; + } + kstart++; + } - if ((countN > 3) && (countO > 3) && (countP > 3)) { - if ((countN >= 11) || (countO >= 22) || (countP >= 6)) { - continue; - } - } + if (kstart == size) { + kstart--; + } + } - if ((countO > 1) && (countP > 1) && (countS > 1)) { - if ((countO >= 14) || (countP >= 3) || (countS >= 3)) { - continue; - } - } + if (maximumrt != 0) { + while (kend >= 0) { + if (peaklistseriesvector[h][kend].getRetentionTime() <= maximumrt) { + break; + } + kend--; + } - if ((countP > 1) && (countS > 1) && (countN > 1)) { - if ((countP >= 3) || (countS >= 3) || (countN >= 4)) { - continue; - } - } + if (kend == -1) { + kend++; + } + } - if ((countN > 6) && (countO > 6) && (countS > 6)) { - if ((countN >= 19) || (countO >= 14) || (countS >= 8)) { - continue; } - } - - } - compoundsgenerated++; - - if (!reportunmatchedtheoreticalpeaks) { - - compoundshint = 0; + for (auto& it : ionsfortheoreticalspectraMS1) { - for (auto& it : ionsfortheoreticalspectraMS1) { + for (int j = 0; j < abs(precursorcharge); j++) { - for (int j = 0; j < abs(precursorcharge); j++) { - - tmpmzdifference = sumofmasses + it.massdifference; - if (precursorcharge > 0) { - tmpmzdifference += j * (H - e); - } - else { - tmpmzdifference -= j * (H - e); - } - if (j > 0) { - tmpmzdifference /= (double)(j + 1); - } + tmpmzdifference = sumofmasses + it.massdifference; + if (precursorcharge > 0) { + tmpmzdifference += j * (H - e); + } + else { + tmpmzdifference -= j * (H - e); + } + if (j > 0) { + tmpmzdifference /= (double)(j + 1); + } - featureshint = 0; + featureshint = 0; - size = peaklistseries.size(); - for (int k = 0; k < size; k++) { + for (int k = kstart; k < kend; k++) { - if (searchHint(tmpmzdifference, peaklistseries[k], fragmentmasserrortolerance)) { - featureshint++; - } - else { - if (lcms) { - featureshint = 0; + if (searchHint(tmpmzdifference, peaklistseriesvector[h][k], fragmentmasserrortolerance)) { + featureshint++; + } + else { + if (lcms) { + featureshint = 0; + } } - } - hintend = false; - if (lcms || (peaklistfileformat == imzML) || (peaklistfileformat == mis)) { - if (featureshint >= minimumfeaturesize) { - compoundshint++; - hintend = true; + hintend = false; + if (lcms || (peaklistfileformats[h] == imzML) || (peaklistfileformats[h] == mis)) { + if (featureshint >= minimumfeaturesize) { + compoundshint++; + hintend = true; + } } - } - else { - if (featureshint > 0) { - compoundshint++; - hintend = true; + else { + if (featureshint > 0) { + compoundshint++; + hintend = true; + } + } + + if (hintend) { + break; } + } - if (hintend) { + if (compoundshint >= minimumiontypes) { break; } @@ -2453,15 +2743,33 @@ void cParameters::store(ofstream& os) { os.write((char *)&peptidetype, sizeof(ePeptideType)); - storeString(peaklistfilename, os); - os.write((char *)&peaklistfileformat, sizeof(ePeakListFileFormat)); - peaklistseries.store(os); + size = (int)peaklistfilenames.size(); + os.write((char *)&size, sizeof(int)); + for (int i = 0; i < size; i++) { + storeString(peaklistfilenames[i], os); + } + + storeString(originalpeaklistfilenames, os); + + size = (int)peaklistfileformats.size(); + os.write((char *)&size, sizeof(int)); + for (int i = 0; i < size; i++) { + os.write((char *)&peaklistfileformats[i], sizeof(ePeakListFileFormat)); + } + + size = (int)peaklistseriesvector.size(); + os.write((char *)&size, sizeof(int)); + for (int i = 0; i < size; i++) { + peaklistseriesvector[i].store(os); + } os.write((char *)&useprofiledata, sizeof(bool)); os.write((char *)&convertprofiledata, sizeof(bool)); storeString(profiledatafilename, os); + os.write((char *)&linebafprocessing, sizeof(int)); + os.write((char *)&scannumber, sizeof(int)); os.write((char *)&precursormass, sizeof(double)); @@ -2475,8 +2783,13 @@ void cParameters::store(ofstream& os) { os.write((char *)&minimumabsoluteintensitythreshold, sizeof(unsigned)); os.write((char *)&minimummz, sizeof(double)); os.write((char *)&maximummz, sizeof(double)); + os.write((char *)&minimumrt, sizeof(double)); + os.write((char *)&maximumrt, sizeof(double)); os.write((char *)&fwhm, sizeof(double)); + os.write((char *)&minratio54Fe56Fe, sizeof(double)); + os.write((char *)&maxratio54Fe56Fe, sizeof(double)); + storeString(bricksdatabasefilename, os); bricksdatabase.store(os); @@ -2497,6 +2810,7 @@ void cParameters::store(ofstream& os) { os.write((char *)&mode, sizeof(eModeType)); os.write((char *)&scoretype, sizeof(eScoreType)); os.write((char *)&maximumcombinedlosses, sizeof(int)); + os.write((char *)&maximumcombinedelements, sizeof(int)); //os.write((char *)&clearhitswithoutparent, sizeof(bool)); os.write((char *)&reportunmatchedtheoreticalpeaks, sizeof(bool)); os.write((char *)&generateisotopepattern, sizeof(bool)); @@ -2506,6 +2820,9 @@ void cParameters::store(ofstream& os) { os.write((char *)&basicformulacheck, sizeof(bool)); os.write((char *)&advancedformulacheck, sizeof(bool)); os.write((char *)&noratiocheck, sizeof(bool)); + os.write((char *)&calculatefdrs, sizeof(bool)); + os.write((char *)&minimumannotationintensityrelative, sizeof(double)); + os.write((char *)&minimumannotationintensityabsolute, sizeof(unsigned)); os.write((char *)&mzdifftolerance, sizeof(double)); os.write((char *)&intensitytolerance, sizeof(double)); os.write((char *)&cyclicnterminus, sizeof(bool)); @@ -2540,7 +2857,7 @@ void cParameters::store(ofstream& os) { size = (int)ionsfortheoreticalspectraMS1.size(); os.write((char *)&size, sizeof(int)); for (int i = 0; i < (int)ionsfortheoreticalspectraMS1.size(); i++) { - os.write((char *)&ionsfortheoreticalspectraMS1[i], sizeof(cIonType)); + ionsfortheoreticalspectraMS1[i].store(os); } size = (int)ionsfortheoreticalspectraMS2.size(); @@ -2575,8 +2892,21 @@ void cParameters::store(ofstream& os) { os.write((char *)&numberofgeneratedneutrallosses, sizeof(int)); + size = (int)originalelementsdefinitions.size(); + os.write((char *)&size, sizeof(int)); + for (int i = 0; i < (int)originalelementsdefinitions.size(); i++) { + originalelementsdefinitions[i].store(os); + } + + size = (int)originalelementsfortheoreticalspectra.size(); + os.write((char *)&size, sizeof(int)); + for (int i = 0; i < (int)originalelementsfortheoreticalspectra.size(); i++) { + os.write((char *)&originalelementsfortheoreticalspectra[i], sizeof(int)); + } + storeStringVector(peakidtodesc, os); storeStringVector(isotopeformulaidtodesc, os); + storeStringIntMap(pchemresults, os); os.write((char *)&defaultmaxx, sizeof(int)); os.write((char *)&defaultmaxy, sizeof(int)); @@ -2586,7 +2916,7 @@ void cParameters::store(ofstream& os) { } -void cParameters::load(ifstream& is) { +void cParameters::load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3) { int size; string s; @@ -2596,15 +2926,52 @@ void cParameters::load(ifstream& is) { is.read((char *)&peptidetype, sizeof(ePeptideType)); - loadString(peaklistfilename, is); - is.read((char *)&peaklistfileformat, sizeof(ePeakListFileFormat)); - peaklistseries.load(is); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 0)) { + is.read((char *)&size, sizeof(int)); + peaklistfilenames.resize(size); + for (int i = 0; i < size; i++) { + loadString(peaklistfilenames[i], is); + } + + loadString(originalpeaklistfilenames, is); + + is.read((char *)&size, sizeof(int)); + peaklistfileformats.resize(size); + for (int i = 0; i < size; i++) { + is.read((char *)&peaklistfileformats[i], sizeof(ePeakListFileFormat)); + } + + is.read((char *)&size, sizeof(int)); + peaklistseriesvector.resize(size); + for (int i = 0; i < size; i++) { + peaklistseriesvector[i].load(is, fileversionpart1, fileversionpart2, fileversionpart3); + } + } + else { + peaklistfilenames.resize(1); + loadString(peaklistfilenames[0], is); + + originalpeaklistfilenames = peaklistfilenames[0]; + + peaklistfileformats.resize(1); + is.read((char *)&peaklistfileformats[0], sizeof(ePeakListFileFormat)); + + peaklistseriesvector.resize(1); + peaklistseriesvector[0].load(is, fileversionpart1, fileversionpart2, fileversionpart3); + } is.read((char *)&useprofiledata, sizeof(bool)); is.read((char *)&convertprofiledata, sizeof(bool)); loadString(profiledatafilename, is); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 18)) { + is.read((char *)&linebafprocessing, sizeof(int)); + } + else { + linebafprocessing = 0; + } + is.read((char *)&scannumber, sizeof(int)); is.read((char *)&precursormass, sizeof(double)); @@ -2618,8 +2985,27 @@ void cParameters::load(ifstream& is) { is.read((char *)&minimumabsoluteintensitythreshold, sizeof(unsigned)); is.read((char *)&minimummz, sizeof(double)); is.read((char *)&maximummz, sizeof(double)); + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 29)) { + is.read((char *)&minimumrt, sizeof(double)); + is.read((char *)&maximumrt, sizeof(double)); + } + else { + minimumrt = 0; + maximumrt = 0; + } + is.read((char *)&fwhm, sizeof(double)); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 37)) { + is.read((char *)&minratio54Fe56Fe, sizeof(double)); + is.read((char *)&maxratio54Fe56Fe, sizeof(double)); + } + else { + minratio54Fe56Fe = 0; + maxratio54Fe56Fe = 0.1; + } + loadString(bricksdatabasefilename, is); bricksdatabase.load(is); @@ -2640,6 +3026,19 @@ void cParameters::load(ifstream& is) { is.read((char *)&mode, sizeof(eModeType)); is.read((char *)&scoretype, sizeof(eScoreType)); is.read((char *)&maximumcombinedlosses, sizeof(int)); + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 33)) { + is.read((char *)&maximumcombinedelements, sizeof(int)); + } + else { + if (mode == compoundsearch) { + maximumcombinedelements = maximumcombinedlosses; + } + else { + maximumcombinedelements = 200; + } + } + //is.read((char *)&clearhitswithoutparent, sizeof(bool)); is.read((char *)&reportunmatchedtheoreticalpeaks, sizeof(bool)); is.read((char *)&generateisotopepattern, sizeof(bool)); @@ -2649,6 +3048,23 @@ void cParameters::load(ifstream& is) { is.read((char *)&basicformulacheck, sizeof(bool)); is.read((char *)&advancedformulacheck, sizeof(bool)); is.read((char *)&noratiocheck, sizeof(bool)); + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 11)) { + is.read((char *)&calculatefdrs, sizeof(bool)); + } + else { + calculatefdrs = true; + } + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 1)) { + is.read((char *)&minimumannotationintensityrelative, sizeof(double)); + is.read((char *)&minimumannotationintensityabsolute, sizeof(unsigned)); + } + else { + minimumannotationintensityrelative = 0; + minimumannotationintensityabsolute = 0; + } + is.read((char *)&mzdifftolerance, sizeof(double)); is.read((char *)&intensitytolerance, sizeof(double)); is.read((char *)&cyclicnterminus, sizeof(bool)); @@ -2672,7 +3088,7 @@ void cParameters::load(ifstream& is) { is.read((char *)&blindedges, sizeof(int)); loadString(sequencedatabasefilename, is); - sequencedatabase.load(is); + sequencedatabase.load(is, fileversionpart1, fileversionpart2, fileversionpart3); is.read((char *)&size, sizeof(int)); fragmentionsfordenovograph.resize(size); @@ -2683,7 +3099,13 @@ void cParameters::load(ifstream& is) { is.read((char *)&size, sizeof(int)); ionsfortheoreticalspectraMS1.resize(size); for (int i = 0; i < (int)ionsfortheoreticalspectraMS1.size(); i++) { - is.read((char *)&ionsfortheoreticalspectraMS1[i], sizeof(cIonType)); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 23)) { + ionsfortheoreticalspectraMS1[i].load(is); + } + else { + // bug before version 2.0.23 + is.read((char *)&ionsfortheoreticalspectraMS1[i], sizeof(cIonType)); + } } is.read((char *)&size, sizeof(int)); @@ -2718,9 +3140,56 @@ void cParameters::load(ifstream& is) { is.read((char *)&numberofgeneratedneutrallosses, sizeof(int)); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 34)) { + is.read((char *)&size, sizeof(int)); + originalelementsdefinitions.resize(size); + for (int i = 0; i < (int)originalelementsdefinitions.size(); i++) { + originalelementsdefinitions[i].load(is); + } + + is.read((char *)&size, sizeof(int)); + originalelementsfortheoreticalspectra.resize(size); + for (int i = 0; i < (int)originalelementsfortheoreticalspectra.size(); i++) { + is.read((char *)&originalelementsfortheoreticalspectra[i], sizeof(int)); + } + } + else { + if (mode == compoundsearch) { + originalelementsdefinitions = originalneutrallossesdefinitions; + originalelementsfortheoreticalspectra = originalneutrallossesfortheoreticalspectra; + + originalneutrallossesdefinitions.clear(); + originalneutrallossesfortheoreticalspectra.clear(); + maximumcombinedlosses = 0; + } + else { + originalelementsdefinitions.clear(); + originalelementsfortheoreticalspectra.clear(); + + pushLossItem(originalelementsdefinitions, "H"); + pushLossItem(originalelementsdefinitions, "C"); + pushLossItem(originalelementsdefinitions, "O"); + pushLossItem(originalelementsdefinitions, "N"); + pushLossItem(originalelementsdefinitions, "S:1"); + pushLossItem(originalelementsdefinitions, "P:1"); + + originalelementsfortheoreticalspectra.push_back(0); + originalelementsfortheoreticalspectra.push_back(1); + originalelementsfortheoreticalspectra.push_back(2); + originalelementsfortheoreticalspectra.push_back(3); + } + } + loadStringVector(peakidtodesc, is); loadStringVector(isotopeformulaidtodesc, is); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 21)) { + loadStringIntMap(pchemresults, is); + } + else { + pchemresults.clear(); + } + is.read((char *)&defaultmaxx, sizeof(int)); is.read((char *)&defaultmaxy, sizeof(int)); is.read((char *)&defaultpixelsizex, sizeof(int)); diff --git a/CycloBranch/core/cParameters.h b/CycloBranch/core/cParameters.h index aaa03ad..c3cbdf2 100644 --- a/CycloBranch/core/cParameters.h +++ b/CycloBranch/core/cParameters.h @@ -53,6 +53,27 @@ enum eScoreType { }; +/** + \brief Check Senior's filtering rules. + \param combarray current combination of elements + \param valences vector of valences + \param maxcomponents maximum number of components in a graph + \retval bool true, if Senior's rules are ok +*/ +bool checkSeniorRules(vector& combarray, vector& valences, int maxcomponents); + + +/** + \brief Check advanced filtering rules. + \brief noratiocheck if true, N/O ratio check is enabled + \brief sumofmasses sum of masses + \brief countsofelements counts of elements + \brief namesofelelements names of elements + \retval bool true, if advanced filtering rules are NOT ok +*/ +bool checkAdvancedFilteringRules(bool noratiocheck, double sumofmasses, vector& countsofelements, vector& namesofelements); + + /** \brief The class storing parameters of the application. */ @@ -62,7 +83,7 @@ class cParameters { void fixIntensities(cPeaksList& centroidspectrum, cPeaksList& profilespectrum); - bool checkSeniorRules(vector& combarray, vector& valences, int maxcomponents); + void pushLossItem(vector& lossitems, string lossstr); //double getMassAndCounts(vector& combarray, vector& countsofelements, vector& massesofelements); @@ -80,12 +101,18 @@ class cParameters { \brief The type of analyzed peptide. */ ePeptideType peptidetype; - + /** - \brief A filename with a peak list. + \brief The filenames of peaklists. */ - string peaklistfilename; + vector peaklistfilenames; + + + /** + \brief Original input line with peaklist(s). + */ + string originalpeaklistfilenames; /** @@ -107,15 +134,21 @@ class cParameters { /** - \brief A file format of peak list. + \brief Line spectra processing method (baf). + */ + int linebafprocessing; + + + /** + \brief The file formats of peaklists. */ - ePeakListFileFormat peaklistfileformat; + vector peaklistfileformats; /** - \brief A structure representing a series of peaklists. + \brief A structure representing a vector of series of peaklists. */ - cPeakListSeries peaklistseries; + vector peaklistseriesvector; /** @@ -184,12 +217,36 @@ class cParameters { double maximummz; + /** + \brief Minimum retention time. + */ + double minimumrt; + + + /** + \brief Maximum retention time. + */ + double maximumrt; + + /** \brief FWHM. */ double fwhm; + /** + \brief Minimum ratio 54Fe/56Fe. + */ + double minratio54Fe56Fe; + + + /** + \brief Maximum ratio 54Fe/56Fe. + */ + double maxratio54Fe56Fe; + + /** \brief A file name of a bricks database. */ @@ -262,6 +319,12 @@ class cParameters { int maximumcombinedlosses; + /** + \brief Maximum number of combined chemical elements. + */ + int maximumcombinedelements; + + /** \brief True when matches of peaks which do not have parent peaks are removed. */ @@ -316,6 +379,24 @@ class cParameters { bool noratiocheck; + /** + \brief Calculate FDRs. + */ + bool calculatefdrs; + + + /** + \brief Minimum relative intensity of the most intense peak in an isotopic pattern. + */ + double minimumannotationintensityrelative; + + + /** + \brief Minimum absolute intensity of the most intense peak in an isotopic pattern. + */ + unsigned minimumannotationintensityabsolute; + + /** \brief Maximum m/z tolerance of matched isotopes. */ @@ -496,6 +577,18 @@ class cParameters { vector originalneutrallossesfortheoreticalspectra; + /** + \brief A vector of all elements (without combinations). + */ + vector originalelementsdefinitions; + + + /** + \brief A vector of elements used when generating compounds (without combinations). + */ + vector originalelementsfortheoreticalspectra; + + /** \brief A vector of peak descriptions. */ @@ -508,6 +601,12 @@ class cParameters { vector isotopeformulaidtodesc; + /** + \brief An auxiliary map to store search results from PubChem in Compound Search mode. + */ + map pchemresults; + + /** \brief Max count of pixel x - parsed from imzML file. */ @@ -626,8 +725,11 @@ class cParameters { /** \brief Load the structure from an input stream. \param is an input stream - */ - void load(ifstream& is); + \param fileversionpart1 first number of .res the file version + \param fileversionpart2 second number of .res the file version + \param fileversionpart3 third number of .res the file version + */ + void load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3); }; diff --git a/CycloBranch/core/cPeak.cpp b/CycloBranch/core/cPeak.cpp index cc6b3a8..421f055 100644 --- a/CycloBranch/core/cPeak.cpp +++ b/CycloBranch/core/cPeak.cpp @@ -140,3 +140,139 @@ void cPeak::load(ifstream& is) { is.read((char *)&orderid, sizeof(int)); } + +bool cPeak::equals(cPeak& secondpeak) { + if (!formula.equals(secondpeak.formula)) { + cout << "formula does not match" << endl; + return false; + } + + if (isotopeformula.compare(secondpeak.isotopeformula) != 0) { + cout << "isotopeformula does not match" << endl; + return false; + } + + if (isotopeformulaid != secondpeak.isotopeformulaid) { + cout << "isotopeformulaid does not match" << endl; + return false; + } + + if (!compareDoubles(mzratio, secondpeak.mzratio)) { + cout << mzratio << " " << secondpeak.mzratio << endl; + cout << "mzratio does not match" << endl; + return false; + } + + if (!compareDoubles(relativeintensity, secondpeak.relativeintensity)) { + cout << "relativeintensity does not match" << endl; + return false; + } + + if (!compareDoubles(absoluteintensity, secondpeak.absoluteintensity)) { + cout << "absoluteintensity does not match" << endl; + return false; + } + + if (description.compare(secondpeak.description) != 0) { + cout << "description does not match" << endl; + return false; + } + + if (descriptionid != secondpeak.descriptionid) { + cout << "descriptionid does not match" << endl; + return false; + } + + if (!compareDoubles(matchedmz, secondpeak.matchedmz)) { + cout << "matchedmz does not match" << endl; + return false; + } + + if (!compareDoubles(matchedrelativeintensity, secondpeak.matchedrelativeintensity)) { + cout << "matchedrelativeintensity does not match" << endl; + return false; + } + + if (!compareDoubles(matchedabsoluteintensity, secondpeak.matchedabsoluteintensity)) { + cout << "matchedabsoluteintensity does not match" << endl; + return false; + } + + if (!compareDoubles(matchedppm, secondpeak.matchedppm)) { + cout << "matchedppm does not match" << endl; + return false; + } + + if (iontype != secondpeak.iontype) { + cout << "iontype does not match" << endl; + return false; + } + + if (neutrallosstype != secondpeak.neutrallosstype) { + cout << "neutrallosstype does not match" << endl; + return false; + } + + if (matched != secondpeak.matched) { + cout << "matched does not match" << endl; + return false; + } + + if (matchedid != secondpeak.matchedid) { + cout << "matchedid does not match" << endl; + return false; + } + + if (charge != secondpeak.charge) { + cout << "charge does not match" << endl; + return false; + } + + if (rotationid != secondpeak.rotationid) { + cout << "rotationid does not match" << endl; + return false; + } + + if (seriesid != secondpeak.seriesid) { + cout << "seriesid does not match" << endl; + return false; + } + + if (groupid != secondpeak.groupid) { + cout << "groupid does not match" << endl; + return false; + } + + if (compoundid != secondpeak.compoundid) { + cout << "compoundid does not match" << endl; + return false; + } + + if (isotope != secondpeak.isotope) { + cout << "isotope does not match" << endl; + return false; + } + + if (removeme != secondpeak.removeme) { + cout << "removeme does not match" << endl; + return false; + } + + if (scrambled != secondpeak.scrambled) { + cout << "scrambled does not match" << endl; + return false; + } + + if (decoy != secondpeak.decoy) { + cout << "decoy does not match" << endl; + return false; + } + + if (orderid != secondpeak.orderid) { + cout << "orderid does not match" << endl; + return false; + } + + return true; +} + diff --git a/CycloBranch/core/cPeak.h b/CycloBranch/core/cPeak.h index 558fc43..9dab1d6 100644 --- a/CycloBranch/core/cPeak.h +++ b/CycloBranch/core/cPeak.h @@ -220,6 +220,14 @@ struct cPeak { */ void load(ifstream& is); + + /** + \brief Check if the object equals to another object. + \param secondpeak object for comparison + \retval bool true if the objects are equals + */ + bool equals(cPeak& secondpeak); + }; diff --git a/CycloBranch/core/cPeakListSeries.cpp b/CycloBranch/core/cPeakListSeries.cpp index 5c4b937..2d1ae92 100644 --- a/CycloBranch/core/cPeakListSeries.cpp +++ b/CycloBranch/core/cPeakListSeries.cpp @@ -160,7 +160,7 @@ int cPeakListSeries::loadFromProfileApexStream(string& filename, ifstream &strea mgfifstream.open(mgfname); while (mgfifstream.good() && ((int)temppeaklists.size() < oldpeaklistscount)) { cPeaksList peaklist; - peaklist.loadFromMGFStream(mgfifstream); + peaklist.loadFromMGFStream(mgfifstream, 1); temppeaklists.push_back(peaklist); } mgfifstream.close(); @@ -231,7 +231,7 @@ int cPeakListSeries::loadFromMZMLStream(string& mzmlfilename, ifstream &mzmlstre mgfifstream.open(mgfname); while (mgfifstream.good() && ((int)temppeaklists.size() < oldpeaklistscount)) { cPeaksList peaklist; - peaklist.loadFromMGFStream(mgfifstream); + peaklist.loadFromMGFStream(mgfifstream, 1); temppeaklists.push_back(peaklist); } mgfifstream.close(); @@ -243,6 +243,8 @@ int cPeakListSeries::loadFromMZMLStream(string& mzmlfilename, ifstream &mzmlstre for (int i = 0; i < (int)temppeaklists.size(); i++) { temppeaklists[i].setTitle(peaklists[i].getTitle()); + temppeaklists[i].setRetentionTime(peaklists[i].getRetentionTime()); + temppeaklists[i].setRetentionTimeUnit(peaklists[i].getRetentionTimeUnit()); } peaklists = temppeaklists; @@ -378,7 +380,7 @@ int cPeakListSeries::loadFromIMZMLStream(string& imzmlfilename, ifstream &ibdstr mgfifstream.open(mgfname); while (mgfifstream.good() && (peaklists.size() < imzml.getItems().size())) { cPeaksList peaklist; - peaklist.loadFromMGFStream(mgfifstream); + peaklist.loadFromMGFStream(mgfifstream, 1); peaklists.push_back(peaklist); } mgfifstream.close(); @@ -460,10 +462,10 @@ void cPeakListSeries::loadSpotList(ifstream &stream) { } -void cPeakListSeries::loadFromMGFStream(ifstream &stream) { +void cPeakListSeries::loadFromMGFStream(ifstream &stream, int timeunit) { while (stream.good()) { cPeaksList peaklist; - peaklist.loadFromMGFStream(stream); + peaklist.loadFromMGFStream(stream, timeunit); if ((peaklist.size() > 0) || stream.good()) { peaklists.push_back(peaklist); } @@ -488,14 +490,14 @@ void cPeakListSeries::store(ofstream& os) { } -void cPeakListSeries::load(ifstream& is) { +void cPeakListSeries::load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3) { int size; is.read((char *)&size, sizeof(int)); peaklists.resize(size); for (int i = 0; i < size; i++) { - peaklists[i].load(is); + peaklists[i].load(is, fileversionpart1, fileversionpart2, fileversionpart3); } } diff --git a/CycloBranch/core/cPeakListSeries.h b/CycloBranch/core/cPeakListSeries.h index f274138..53e2424 100644 --- a/CycloBranch/core/cPeakListSeries.h +++ b/CycloBranch/core/cPeakListSeries.h @@ -140,8 +140,9 @@ class cPeakListSeries { /** \brief Load the series of peaklists from a .mgf file. \param stream source stream + \param timeunit rt unit */ - void loadFromMGFStream(ifstream &stream); + void loadFromMGFStream(ifstream &stream, int timeunit); /** @@ -161,8 +162,11 @@ class cPeakListSeries { /** \brief Load the structure from an input stream. \param is an input stream - */ - void load(ifstream& is); + \param fileversionpart1 first number of .res the file version + \param fileversionpart2 second number of .res the file version + \param fileversionpart3 third number of .res the file version + */ + void load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3); }; diff --git a/CycloBranch/core/cPeaksList.cpp b/CycloBranch/core/cPeaksList.cpp index 548d059..0e75eb7 100644 --- a/CycloBranch/core/cPeaksList.cpp +++ b/CycloBranch/core/cPeaksList.cpp @@ -53,6 +53,7 @@ cPeaksList::cPeaksList(const cPeaksList& peakslist) { cPeaksList& cPeaksList::operator=(const cPeaksList& peakslist) { peaks = peakslist.peaks; rt = peakslist.rt; + rtunit = peakslist.rtunit; x = peakslist.x; y = peakslist.y; title = peakslist.title; @@ -63,6 +64,7 @@ cPeaksList& cPeaksList::operator=(const cPeaksList& peakslist) { void cPeaksList::clear() { peaks.clear(); rt = 0; + rtunit = 1; x = 0; y = 0; title = ""; @@ -226,7 +228,7 @@ void cPeaksList::storeToIBDStream(ofstream &ibdstream, bool use_64bit_float_mz_p } -void cPeaksList::loadFromMGFStream(ifstream &stream) { +void cPeaksList::loadFromMGFStream(ifstream &stream, int timeunit) { string s, tmps; cPeak p; size_t pos; @@ -255,6 +257,7 @@ void cPeaksList::loadFromMGFStream(ifstream &stream) { tmps = tmps.substr(0, pos); } rt = atof(tmps.c_str()); + rtunit = timeunit; } } } @@ -291,7 +294,7 @@ int cPeaksList::size() { } -string cPeaksList::print(bool htmlterminatelines) { +string cPeaksList::print(bool htmlterminatelines, bool printgroupid) { string s = ""; for (int i = 0; i < size(); i++) { @@ -312,6 +315,11 @@ string cPeaksList::print(bool htmlterminatelines) { s += to_string((unsigned long long)peaks[i].absoluteintensity); } + if (printgroupid) { + s += " "; + s += to_string(peaks[i].groupid); + } + if (htmlterminatelines) { s += "
"; } @@ -775,6 +783,16 @@ double cPeaksList::getRetentionTime() { } +void cPeaksList::setRetentionTimeUnit(int unit) { + rtunit = unit; +} + + +int cPeaksList::getRetentionTimeUnit() { + return rtunit; +} + + void cPeaksList::setCoordinates(int x, int y) { this->x = x; this->y = y; @@ -803,6 +821,8 @@ void cPeaksList::store(ofstream& os) { os.write((char *)&rt, sizeof(double)); + os.write((char *)&rtunit, sizeof(int)); + os.write((char *)&x, sizeof(int)); os.write((char *)&y, sizeof(int)); @@ -810,7 +830,7 @@ void cPeaksList::store(ofstream& os) { } -void cPeaksList::load(ifstream& is) { +void cPeaksList::load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3) { int size; is.read((char *)&size, sizeof(int)); @@ -822,6 +842,13 @@ void cPeaksList::load(ifstream& is) { is.read((char *)&rt, sizeof(double)); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 12)) { + is.read((char *)&rtunit, sizeof(int)); + } + else { + rtunit = 1; + } + is.read((char *)&x, sizeof(int)); is.read((char *)&y, sizeof(int)); @@ -939,3 +966,57 @@ void cPeaksList::markIsotopes() { } } + +bool cPeaksList::equals(cPeaksList& secondpeaklist) { + if (rt != secondpeaklist.rt) { + cout << "rt does not match" << endl; + return false; + } + + if (rtunit != secondpeaklist.rtunit) { + cout << "rt unit does not match" << endl; + return false; + } + + if (x != secondpeaklist.x) { + cout << "x does not match" << endl; + return false; + } + + if (y != secondpeaklist.y) { + cout << "y does not match" << endl; + return false; + } + + if (title.compare(secondpeaklist.title) != 0) { + cout << "title does not match" << endl; + return false; + } + + if (peaks.size() != secondpeaklist.peaks.size()) { + cout << "peaks.size() does not match" << endl; + cout << "peaks.size(): " << peaks.size() << endl; + cout << "secondpeaklist.peaks.size(): " << secondpeaklist.peaks.size() << endl; + cout << "first peaklist:" << endl; + for (size_t i = 0; i < peaks.size(); i++) { + cout << peaks[i].mzratio << " " << peaks[i].absoluteintensity << " " << peaks[i].relativeintensity << endl; + } + cout << endl; + cout << "second peaklist:" << endl; + for (size_t i = 0; i < secondpeaklist.peaks.size(); i++) { + cout << secondpeaklist.peaks[i].mzratio << " " << secondpeaklist.peaks[i].absoluteintensity << " " << secondpeaklist.peaks[i].relativeintensity << endl; + } + cout << endl; + return false; + } + + for (size_t i = 0; i < peaks.size(); i++) { + if (!peaks[i].equals(secondpeaklist.peaks[i])) { + cout << "peak " << i << " does not equal" << endl; + return false; + } + } + + return true; +} + diff --git a/CycloBranch/core/cPeaksList.h b/CycloBranch/core/cPeaksList.h index a8bb2c8..190d86b 100644 --- a/CycloBranch/core/cPeaksList.h +++ b/CycloBranch/core/cPeaksList.h @@ -71,6 +71,8 @@ class cPeaksList { double rt; + int rtunit; + int x, y; string title; @@ -154,8 +156,9 @@ class cPeaksList { /** \brief Load the spectrum from a .mgf file. \param stream source stream - */ - void loadFromMGFStream(ifstream &stream); + \param timeunit rt unit + */ + void loadFromMGFStream(ifstream &stream, int timeunit); /** @@ -167,10 +170,11 @@ class cPeaksList { /** \brief Print the spectrum. - \param htmlterminatelines true when html line endings must used + \param htmlterminatelines true if the html line endings should be used + \param printgroupid true if the groupid should be printed \retval string string with a printed spectrum */ - string print(bool htmlterminatelines = false); + string print(bool htmlterminatelines = false, bool printgroupid = false); /** @@ -387,6 +391,20 @@ class cPeaksList { double getRetentionTime(); + /** + \brief Set the retention time unit. + \param unit 0 == second, 1 == minute + */ + void setRetentionTimeUnit(int unit); + + + /** + \brief Get the retention time unit. + \retval int 0 == second, 1 == minute + */ + int getRetentionTimeUnit(); + + /** \brief Set the coordinates. \param x X coordinate @@ -419,8 +437,11 @@ class cPeaksList { /** \brief Load the structure from an input stream. \param is an input stream + \param fileversionpart1 first number of .res the file version + \param fileversionpart2 second number of .res the file version + \param fileversionpart3 third number of .res the file version */ - void load(ifstream& is); + void load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3); /** @@ -469,6 +490,14 @@ class cPeaksList { */ void markIsotopes(); + + /** + \brief Check if the object equals to another object. + \param secondpeaklist object for comparison + \retval bool true if the objects are equals + */ + bool equals(cPeaksList& secondpeaklist); + }; diff --git a/CycloBranch/core/cSequence.cpp b/CycloBranch/core/cSequence.cpp index ab7b115..13a6887 100644 --- a/CycloBranch/core/cSequence.cpp +++ b/CycloBranch/core/cSequence.cpp @@ -15,6 +15,8 @@ void cSequence::clear() { name = ""; summary.clear(); reference = ""; + rtmin = 0; + rtmax = 0; decoy = false; } @@ -28,11 +30,13 @@ void cSequence::store(ofstream& os) { storeString(name, os); summary.store(os); storeString(reference, os); + os.write((char *)&rtmin, sizeof(double)); + os.write((char *)&rtmax, sizeof(double)); os.write((char *)&decoy, sizeof(bool)); } -void cSequence::load(ifstream& is) { +void cSequence::load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3) { is.read((char *)&peptidetype, sizeof(ePeptideType)); loadString(sequence, is); loadString(nterminalmodification, is); @@ -41,6 +45,14 @@ void cSequence::load(ifstream& is) { loadString(name, is); summary.load(is); loadString(reference, is); + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 2)) { + is.read((char *)&rtmin, sizeof(double)); + is.read((char *)&rtmax, sizeof(double)); + } + else { + rtmin = 0; + rtmax = 0; + } is.read((char *)&decoy, sizeof(bool)); } @@ -60,6 +72,16 @@ string& cSequence::getName() { } +double cSequence::getMinimumRetentionTime() { + return rtmin; +} + + +double cSequence::getMaximumRetentionTime() { + return rtmax; +} + + string& cSequence::getReference() { return reference; } @@ -80,6 +102,12 @@ void cSequence::setName(const string& name) { } +void cSequence::setRetentionTime(double rtmin, double rtmax) { + this->rtmin = rtmin; + this->rtmax = rtmax; +} + + void cSequence::setReference(const string& reference) { this->reference = reference; } @@ -164,6 +192,28 @@ string cSequence::getNameWithReferenceAsHTMLString() { } } + // NP Atlas + if (!correctreference) { + rx = "^NPA[0-9]+$"; + if (regex_search(reference, rx)) { + s += ""; + s += name; + s += ""; + correctreference = true; + } + } + + // COCONUT + if (!correctreference) { + rx = "^CNP[0-9]+$"; + if (regex_search(reference, rx)) { + s += ""; + s += name; + s += ""; + correctreference = true; + } + } + // Norine if (!correctreference) { rx = "^NOR[0-9]+$"; diff --git a/CycloBranch/core/cSequence.h b/CycloBranch/core/cSequence.h index 0bd57f0..1675f99 100644 --- a/CycloBranch/core/cSequence.h +++ b/CycloBranch/core/cSequence.h @@ -33,6 +33,8 @@ class cSequence { string name; cSummaryFormula summary; string reference; + double rtmin; + double rtmax; bool decoy; public: @@ -60,8 +62,11 @@ class cSequence { /** \brief Load the structure from an input stream. \param is an input stream + \param fileversionpart1 first number of .res the file version + \param fileversionpart2 second number of .res the file version + \param fileversionpart3 third number of .res the file version */ - void load(ifstream& is); + void load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3); /** @@ -85,6 +90,20 @@ class cSequence { string& getName(); + /** + \brief Get minimum retention time. + \retval double minimum retention time + */ + double getMinimumRetentionTime(); + + + /** + \brief Get maximum retention time. + \retval double maximum retention time + */ + double getMaximumRetentionTime(); + + /** \brief Get reference. \retval string reference @@ -113,6 +132,14 @@ class cSequence { void setName(const string& name); + /** + \brief Set retention time. + \param rtmin minimum retention time + \param rtmax maximum retention time + */ + void setRetentionTime(double rtmin, double rtmax); + + /** \brief Set reference. \param reference reference diff --git a/CycloBranch/core/cSequenceDatabase.cpp b/CycloBranch/core/cSequenceDatabase.cpp index e0472df..c0afd87 100644 --- a/CycloBranch/core/cSequenceDatabase.cpp +++ b/CycloBranch/core/cSequenceDatabase.cpp @@ -4,12 +4,63 @@ #include "gui/cMainThread.h" +void cSequenceDatabase::parseRT(bool keeprt) { + double rtmin, rtmax, rttmp; + string s; + string tmp; + size_t pos; + + for (auto& it : sequences) { + s = it.getName(); + pos = s.find("@RT"); + if (pos != string::npos) { + s = s.substr(pos + 3); + + tmp = s; + s.clear(); + for (auto& it2 : tmp) { + if (!isspace(it2)) { + s.push_back(it2); + } + } + + sscanf_s(s.c_str(), "%lf-%lf", &rtmin, &rtmax); + + if (rtmin > rtmax) { + rttmp = rtmin; + rtmin = rtmax; + rtmax = rttmp; + } + + s = it.getName(); + s = s.substr(0, pos); + + if (keeprt) { + std::ostringstream out; + out.precision(2); + out << std::fixed << s; + out << "@RT"; + out << rtmin; + out << "-"; + out << rtmax; + + s = out.str(); + } + + it.setName(s); + + it.setRetentionTime(rtmin, rtmax); + } + } +} + + cSequenceDatabase::cSequenceDatabase() { clear(); } -void cSequenceDatabase::loadFromPlainTextStream(ifstream &stream) { +void cSequenceDatabase::loadFromPlainTextStream(ifstream &stream, bool keeprt) { string s, type; cSequence sequence; size_t pos; @@ -117,10 +168,13 @@ void cSequenceDatabase::loadFromPlainTextStream(ifstream &stream) { sequences.push_back(sequence); } + parseRT(keeprt); } -void cSequenceDatabase::storeToPlainTextStream(ofstream &stream) { +void cSequenceDatabase::storeToPlainTextStream(ofstream &stream, bool keeprt) { + parseRT(keeprt); + cSummaryFormula formula; for (int i = 0; i < (int)sequences.size(); i++) { stream << getStringFromPeptideType(sequences[i].getPeptideType()) << "\t"; @@ -176,14 +230,35 @@ void cSequenceDatabase::store(ofstream& os) { } -void cSequenceDatabase::load(ifstream& is) { +void cSequenceDatabase::load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3) { int size; is.read((char *)&size, sizeof(int)); sequences.resize(size); for (int i = 0; i < (int)sequences.size(); i++) { - sequences[i].load(is); + sequences[i].load(is, fileversionpart1, fileversionpart2, fileversionpart3); + } +} + + +void cSequenceDatabase::attachDecoys(bool& terminatecomputation) { + cSequence sequence; + string summary; + + int seqdbsize = (int)sequences.size(); + sequence.setPeptideType(other); + sequence.setDecoy(true); + + for (int i = 0; i < seqdbsize; i++) { + if (terminatecomputation) { + sequences.clear(); + return; + } + + summary = sequences[i].getSummaryFormula() + "H"; + sequence.setSummaryFormula(summary); + sequences.push_back(sequence); } } diff --git a/CycloBranch/core/cSequenceDatabase.h b/CycloBranch/core/cSequenceDatabase.h index 5d7e7bd..0febf66 100644 --- a/CycloBranch/core/cSequenceDatabase.h +++ b/CycloBranch/core/cSequenceDatabase.h @@ -28,6 +28,9 @@ class cSequenceDatabase { vector sequences; + void parseRT(bool keeprt); + + public: @@ -40,15 +43,17 @@ class cSequenceDatabase { /** \brief Load the database of sequences from a plain text stream. \param stream reference to an input file stream + \param keeprt keep retention time as a part of the compound name */ - void loadFromPlainTextStream(ifstream &stream); + void loadFromPlainTextStream(ifstream &stream, bool keeprt); /** \brief Store the database of sequences into a plain text stream. \param stream reference to an output file stream - */ - void storeToPlainTextStream(ofstream &stream); + \param keeprt keep retention time as a part of the compound name + */ + void storeToPlainTextStream(ofstream &stream, bool keeprt); /** @@ -96,8 +101,18 @@ class cSequenceDatabase { /** \brief Load the structure from an input stream. \param is an input stream + \param fileversionpart1 first number of .res the file version + \param fileversionpart2 second number of .res the file version + \param fileversionpart3 third number of .res the file version */ - void load(ifstream& is); + void load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3); + + + /** + \brief Attach decoys. + \param terminatecomputation reference to a variable determining that the computation must be stopped + */ + void attachDecoys(bool& terminatecomputation); }; diff --git a/CycloBranch/core/cSummaryFormula.cpp b/CycloBranch/core/cSummaryFormula.cpp index c558dd7..f59163b 100644 --- a/CycloBranch/core/cSummaryFormula.cpp +++ b/CycloBranch/core/cSummaryFormula.cpp @@ -139,22 +139,28 @@ void rechargeMap(int charge, map& atoms) { } -void cSummaryFormula::combineAtoms(cPeakListSeries& peaklistseries, int peaklistseriessize, vector& peaklistseriessizes, cPeaksList& isotopeprofile, vector& depthvector, int depth, double mass, double intensity, int charge, double minimumabsoluteintensity) { +void cSummaryFormula::combineAtoms(cPeakListSeries& peaklistseries, int peaklistseriessize, vector& peaklistseriessizes, cPeaksList& isotopeprofile, vector& depthvector, int depth, double mass, double intensity, double charge, double minimumabsoluteintensity, double& localmaximumintensity, double minimumrelativeintensity) { if (depth < peaklistseriessize) { for (int i = 0; i < peaklistseriessizes[depth]; i++) { depthvector[depth] = i; - combineAtoms(peaklistseries, peaklistseriessize, peaklistseriessizes, isotopeprofile, depthvector, depth + 1, mass + peaklistseries[depth][i].mzratio, intensity * peaklistseries[depth][i].absoluteintensity, charge, minimumabsoluteintensity); + combineAtoms(peaklistseries, peaklistseriessize, peaklistseriessizes, isotopeprofile, depthvector, depth + 1, mass + peaklistseries[depth][i].mzratio, intensity * peaklistseries[depth][i].absoluteintensity, charge, minimumabsoluteintensity, localmaximumintensity, minimumrelativeintensity); } } else { + if (intensity > localmaximumintensity) { + localmaximumintensity = intensity; + } + if (intensity >= minimumabsoluteintensity) { - cPeak p; - p.mzratio = mass/(double)charge; - p.absoluteintensity = intensity; - for (int i = 0; i < peaklistseriessize; i++) { - p.description += peaklistseries[i][depthvector[i]].description; + if (intensity >= localmaximumintensity * minimumrelativeintensity) { + cPeak p; + p.mzratio = mass / charge; + p.absoluteintensity = intensity; + for (int i = 0; i < peaklistseriessize; i++) { + p.description += peaklistseries[i][depthvector[i]].description; + } + isotopeprofile.add(p); } - isotopeprofile.add(p); } } } @@ -514,7 +520,7 @@ double cSummaryFormula::getMass() { } -cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool positive, bool writedescription) { +cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool positive, int maxchangedatoms, bool writedescription) { map atoms; addStringFormulaToMap(formula, atoms); @@ -528,6 +534,8 @@ cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool posi double mostintense; int mostintenseid; + double basemass; + cPeakListSeries peaklistseries; for (auto it = atoms.begin(); it != atoms.end(); ++it) { cPeaksList peaklist; @@ -541,7 +549,7 @@ cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool posi mostintenseid = 0; bricksdatabase.clear(); bricksprobabilities.clear(); - for (auto it2 = atomisotopes.begin(); it2 != atomisotopes.end(); ++it2) { + for (auto it2 = atomisotopes.rbegin(); it2 != atomisotopes.rend(); ++it2) { brick.clear(); brick.setComposition(to_string(numberofbasicbricks + 1), false); brick.setMass(it2->second.mass); @@ -561,16 +569,17 @@ cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool posi numberofbasicbricks++; } - maximumbricksincombination = min(5, atomcount); + maximumbricksincombination = min(maxchangedatoms, atomcount); combarray.clear(); for (int i = 0; i < maximumbricksincombination; i++) { combarray.push_back(1); } + basemass = periodictablemap[atom] * (atomcount - maximumbricksincombination); do { cPeak peak; - peak.mzratio = bricksdatabase.getMassOfComposition(combarray, numberofbasicbricks) + periodictablemap[atom] * (atomcount - maximumbricksincombination); + peak.mzratio = bricksdatabase.getMassOfComposition(combarray, numberofbasicbricks) + basemass; if (it->second < 0) { peak.mzratio = -peak.mzratio; } @@ -596,14 +605,18 @@ cPeaksList cSummaryFormula::getIsotopePattern(double fwhm, int charge, bool posi depthvector.resize(peaklistseriessize); cPeaksList isotopeprofile; - combineAtoms(peaklistseries, peaklistseriessize, peaklistseriessizes, isotopeprofile, depthvector, 0, 0, 1, charge, 0.00001); + double localmaximumintensity = 0; + double relativeintensitythreshold = 0.1; + + combineAtoms(peaklistseries, peaklistseriessize, peaklistseriessizes, isotopeprofile, depthvector, 0, 0, 1, (double)charge, 0.00001, localmaximumintensity, relativeintensitythreshold / 100.0); + isotopeprofile.normalizeIntenzity(); - isotopeprofile.cropRelativeIntenzity(0.1); + isotopeprofile.cropRelativeIntenzity(relativeintensitythreshold); cPeaksList reducedprofile; reduceIsotopeProfile(isotopeprofile, reducedprofile, fwhm); reducedprofile.normalizeIntenzity(); - reducedprofile.cropRelativeIntenzity(0.1); + reducedprofile.cropRelativeIntenzity(relativeintensitythreshold); return reducedprofile; } @@ -620,3 +633,11 @@ void cSummaryFormula::load(ifstream& is) { is.read((char *)&partial, sizeof(bool)); } + +bool cSummaryFormula::equals(cSummaryFormula& secondformula) { + if ((partial == secondformula.partial) && (formula.compare(secondformula.formula) == 0)) { + return true; + } + return false; +} + diff --git a/CycloBranch/core/cSummaryFormula.h b/CycloBranch/core/cSummaryFormula.h index 420d717..b0f8b93 100644 --- a/CycloBranch/core/cSummaryFormula.h +++ b/CycloBranch/core/cSummaryFormula.h @@ -62,7 +62,7 @@ class cSummaryFormula { string formula; - void combineAtoms(cPeakListSeries& peaklistseries, int peaklistseriessize, vector& peaklistseriessizes, cPeaksList& isotopeprofile, vector& depthvector, int depth, double mass, double intensity, int charge, double minimumabsoluteintensity); + void combineAtoms(cPeakListSeries& peaklistseries, int peaklistseriessize, vector& peaklistseriessizes, cPeaksList& isotopeprofile, vector& depthvector, int depth, double mass, double intensity, double charge, double minimumabsoluteintensity, double& localmaximumintensity, double minimumrelativeintensity); double getIntensity(cBricksDatabase& bricksprobabilities, vector& combarray, int mostintenseid, int mostintenseatomscount, int isotopecount); @@ -180,10 +180,11 @@ class cSummaryFormula { \param fwhm FWHM \param charge charge \param positive true if the charge is positive charge, false if the charge is negative + \param maxchangedatoms maximum number of atoms of an element which are replaced with isotopic variants \param writedescription if true then string descriptions of peaks are filled \retval cPeaksList isotopic pattern of the formula */ - cPeaksList getIsotopePattern(double fwhm, int charge, bool positive, bool writedescription); + cPeaksList getIsotopePattern(double fwhm, int charge, bool positive, int maxchangedatoms, bool writedescription); /** @@ -199,6 +200,14 @@ class cSummaryFormula { */ void load(ifstream& is); + + /** + \brief Check if the object equals to another object. + \param secondformula object for comparison + \retval bool true if the objects are equals + */ + bool equals(cSummaryFormula& secondformula); + }; diff --git a/CycloBranch/core/cTheoreticalSpectrum.cpp b/CycloBranch/core/cTheoreticalSpectrum.cpp index 5a78d59..e6e41a3 100644 --- a/CycloBranch/core/cTheoreticalSpectrum.cpp +++ b/CycloBranch/core/cTheoreticalSpectrum.cpp @@ -81,7 +81,7 @@ void cTheoreticalSpectrum::clearFalseHits(map 0) && isInPpmMassErrorTolerance(experimentalpeaks[middle - 1].mzratio, theoreticalpeaks[i].mzratio, fragmentmasserrortolerance)) { - currentppm = abs(ppmError(experimentalpeaks[middle - 1].mzratio, theoreticalpeaks[i].mzratio)); + tmp = middle; + while (middle > 0) { + currentppm = fabs(ppmError(experimentalpeaks[middle - 1].mzratio, theoreticalpeaks[i].mzratio)); if (currentppm < bestppm) { best = middle - 1; bestppm = currentppm; } + else { + break; + } middle--; } - while ((middle < experimentalpeakssize - 1) && isInPpmMassErrorTolerance(experimentalpeaks[middle + 1].mzratio, theoreticalpeaks[i].mzratio, fragmentmasserrortolerance)) { - currentppm = abs(ppmError(experimentalpeaks[middle + 1].mzratio, theoreticalpeaks[i].mzratio)); + middle = tmp; + while (middle < experimentalpeakssize - 1) { + currentppm = fabs(ppmError(experimentalpeaks[middle + 1].mzratio, theoreticalpeaks[i].mzratio)); if (currentppm < bestppm) { best = middle + 1; bestppm = currentppm; } + else { + break; + } middle++; } @@ -1256,7 +1264,13 @@ void cTheoreticalSpectrum::addMetalPeaks(cPeak& peak, vector& metals, in void cTheoreticalSpectrum::removeUnmatchedMetalIsotopes(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks) { int lastparent = 0; + + size_t pos; + double ratio; + for (int i = 0; i < theoreticalpeaksrealsize; i++) { + //cout << parameters->peakidtodesc[theoreticalpeaks[i].descriptionid] << endl; + if (!theoreticalpeaks[i].isotope) { lastparent = i; continue; @@ -1269,6 +1283,44 @@ void cTheoreticalSpectrum::removeUnmatchedMetalIsotopes(cPeaksList& theoreticalp theoreticalpeaks[i].matched--; theoreticalpeaks[i].matchedid = -1; } + + if ((theoreticalpeaks[lastparent].matched > 0) && (theoreticalpeaks[i].matched == 0)) { + pos = parameters->peakidtodesc[theoreticalpeaks[i].descriptionid].find("54Fe"); + if ((pos != string::npos) && (parameters->minratio54Fe56Fe > 0)) { + // remove 56Fe + experimentalmatches[theoreticalpeaks[lastparent].matchedid].erase(experimentalmatches[theoreticalpeaks[lastparent].matchedid].find(lastparent)); + experimentalpeaks[theoreticalpeaks[lastparent].matchedid].matched--; + + theoreticalpeaks[lastparent].matched--; + theoreticalpeaks[lastparent].matchedid = -1; + } + } + + // to do + // other elements + // multiple Fe atoms in a molecule + // 54Fe vs. 56Fe m/z difference + charged variants + if ((theoreticalpeaks[lastparent].matched > 0) && (theoreticalpeaks[i].matched > 0)) { + pos = parameters->peakidtodesc[theoreticalpeaks[i].descriptionid].find("54Fe"); + if ((pos != string::npos) && (experimentalpeaks[theoreticalpeaks[lastparent].matchedid].relativeintensity > 0)) { + ratio = experimentalpeaks[theoreticalpeaks[i].matchedid].relativeintensity / experimentalpeaks[theoreticalpeaks[lastparent].matchedid].relativeintensity; + if ((ratio < parameters->minratio54Fe56Fe) || (ratio > parameters->maxratio54Fe56Fe)) { + // remove 56Fe + experimentalmatches[theoreticalpeaks[lastparent].matchedid].erase(experimentalmatches[theoreticalpeaks[lastparent].matchedid].find(lastparent)); + experimentalpeaks[theoreticalpeaks[lastparent].matchedid].matched--; + + theoreticalpeaks[lastparent].matched--; + theoreticalpeaks[lastparent].matchedid = -1; + + // remove 54Fe + experimentalmatches[theoreticalpeaks[i].matchedid].erase(experimentalmatches[theoreticalpeaks[i].matchedid].find(i)); + experimentalpeaks[theoreticalpeaks[i].matchedid].matched--; + + theoreticalpeaks[i].matched--; + theoreticalpeaks[i].matchedid = -1; + } + } + } } } @@ -1409,12 +1461,12 @@ void cTheoreticalSpectrum::removeUnmatchedIsotopePatterns(cPeaksList& theoretica } -int cTheoreticalSpectrum::removeUnmatchedFeatures(bool lcms, cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, vector< vector >& hintsindex/*, int id*/) { +int cTheoreticalSpectrum::removeUnmatchedFeatures(bool lcms, int peaklistseriesvectorid, cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, vector< vector >& hintsindex/*, int id*/) { if (theoreticalpeaksrealsize == 0) { return 0; } - int size = parameters->peaklistseries.size(); + int size = parameters->peaklistseriesvector[peaklistseriesvectorid].size(); int k; int peaksremoved = 0; @@ -1428,7 +1480,9 @@ int cTheoreticalSpectrum::removeUnmatchedFeatures(bool lcms, cPeaksList& theoret int stop = 0; int currid = theoreticalpeaks[0].compoundid; int compoundsize = 0; - int msize; + //int msize; + + int left, right, middle; for (int i = 0; i < theoreticalpeaksrealsize; i++) { @@ -1484,13 +1538,29 @@ int cTheoreticalSpectrum::removeUnmatchedFeatures(bool lcms, cPeaksList& theoret patternsize = 0; while ((k < theoreticalpeaksrealsize) && (theoreticalpeaks[k].groupid == theoreticalpeaks[i].groupid)) { - msize = (int)hintsindex[k].size(); - for (int m = 0; m < msize; m++) { - if (hintsindex[k][m] == hintsindex[i][j]) { + left = 0; + right = (int)hintsindex[k].size() - 1; + while (left <= right) { + middle = (left + right) / 2; + if (hintsindex[k][middle] == hintsindex[i][j]) { patternsize++; break; } - } + if (hintsindex[i][j] < hintsindex[k][middle]) { + right = middle - 1; + } + else { + left = middle + 1; + } + } + + //msize = (int)hintsindex[k].size(); + //for (int m = 0; m < msize; m++) { + // if (hintsindex[k][m] == hintsindex[i][j]) { + // patternsize++; + // break; + // } + //} if (patternsize >= parameters->minimumpatternsize) { break; @@ -1595,6 +1665,117 @@ int cTheoreticalSpectrum::removeUnmatchedCompounds(cPeaksList& theoreticalpeaks, } +void cTheoreticalSpectrum::removeCompoundsOutsideRTRange(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks) { + double currentrt = experimentalpeaks.getRetentionTime(); + cSequence* compound; + + for (int i = 0; i < theoreticalpeaksrealsize; i++) { + if (theoreticalpeaks[i].matched > 0) { + compound = &(parameters->sequencedatabase[theoreticalpeaks[i].compoundid]); + if (compound->getMaximumRetentionTime() > 0) { + if ((currentrt < compound->getMinimumRetentionTime()) || (currentrt > compound->getMaximumRetentionTime())) { + experimentalmatches[theoreticalpeaks[i].matchedid].erase(experimentalmatches[theoreticalpeaks[i].matchedid].find(i)); + experimentalpeaks[theoreticalpeaks[i].matchedid].matched--; + + theoreticalpeaks[i].matched--; + theoreticalpeaks[i].matchedid = -1; + } + } + } + } +} + + +void cTheoreticalSpectrum::removePeaksUnderAnnotationThreshold(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks) { + for (int i = 0; i < theoreticalpeaksrealsize; i++) { + if (theoreticalpeaks[i].isotope) { + continue; + } + + if (theoreticalpeaks[i].matched > 0) { + if ((experimentalpeaks[theoreticalpeaks[i].matchedid].relativeintensity < parameters->minimumannotationintensityrelative) || (experimentalpeaks[theoreticalpeaks[i].matchedid].absoluteintensity < parameters->minimumannotationintensityabsolute)) { + experimentalmatches[theoreticalpeaks[i].matchedid].erase(experimentalmatches[theoreticalpeaks[i].matchedid].find(i)); + experimentalpeaks[theoreticalpeaks[i].matchedid].matched--; + + theoreticalpeaks[i].matched--; + theoreticalpeaks[i].matchedid = -1; + } + } + } +} + + +void cTheoreticalSpectrum::removePatternsUnderAnnotationThreshold(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks) { + if (theoreticalpeaksrealsize == 0) { + return; + } + + int groupid = theoreticalpeaks[0].groupid; + int start = 0; + int stop = 0; + int maximumintensityid = 0; + double maximumintensity = theoreticalpeaks[0].relativeintensity; + bool cleargroup = false; + + double maximumexperimentalintensityrelative; + double maximumexperimentalintensityabsolute; + if (theoreticalpeaks[maximumintensityid].matched) { + maximumexperimentalintensityrelative = experimentalpeaks[theoreticalpeaks[maximumintensityid].matchedid].relativeintensity; + maximumexperimentalintensityabsolute = experimentalpeaks[theoreticalpeaks[maximumintensityid].matchedid].absoluteintensity; + } + + for (int i = 0; i < theoreticalpeaksrealsize; i++) { + if (groupid == theoreticalpeaks[i].groupid) { + if (theoreticalpeaks[i].relativeintensity > maximumintensity) { + maximumintensityid = i; + maximumintensity = theoreticalpeaks[i].relativeintensity; + if (theoreticalpeaks[i].matched) { + maximumexperimentalintensityrelative = experimentalpeaks[theoreticalpeaks[i].matchedid].relativeintensity; + maximumexperimentalintensityabsolute = experimentalpeaks[theoreticalpeaks[i].matchedid].absoluteintensity; + } + } + + stop = i; + } + + if ((groupid != theoreticalpeaks[i].groupid) || (i == theoreticalpeaksrealsize - 1)) { + + if (theoreticalpeaks[maximumintensityid].matched > 0) { + if ((maximumexperimentalintensityrelative < parameters->minimumannotationintensityrelative) || (maximumexperimentalintensityabsolute < parameters->minimumannotationintensityabsolute)) { + cleargroup = true; + } + } + else { + cleargroup = true; + } + + if (cleargroup) { + for (int j = start; j <= stop; j++) { + if (theoreticalpeaks[j].matched > 0) { + experimentalmatches[theoreticalpeaks[j].matchedid].erase(experimentalmatches[theoreticalpeaks[j].matchedid].find(j)); + experimentalpeaks[theoreticalpeaks[j].matchedid].matched--; + + theoreticalpeaks[j].matched--; + theoreticalpeaks[j].matchedid = -1; + } + } + } + + groupid = theoreticalpeaks[i].groupid; + start = i; + stop = i; + maximumintensityid = i; + maximumintensity = theoreticalpeaks[i].relativeintensity; + cleargroup = false; + if (theoreticalpeaks[i].matched) { + maximumexperimentalintensityrelative = experimentalpeaks[theoreticalpeaks[i].matchedid].relativeintensity; + maximumexperimentalintensityabsolute = experimentalpeaks[theoreticalpeaks[i].matchedid].absoluteintensity; + } + } + } +} + + void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks) { if (theoreticalpeaksrealsize == 0) { return; @@ -1795,38 +1976,38 @@ void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theore // lithium if (hasLi) { - if (checkIsotope(elementLi, isotopeLi6, Li6, Li7, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementLi, isotopeLi6, Li6, Li7, 0.000001, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // boron if (hasB) { - if (checkIsotope(elementB, isotopeB10, B10, B11, 0.3, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementB, isotopeB10, B10, B11, 0.000001, 0.3, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // titanium (part 1) if (hasTi) { - if (checkIsotope(elementTi, isotopeTi46, Ti46, Ti48, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementTi, isotopeTi46, Ti46, Ti48, 0.000001, 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)) { + if (checkIsotope(elementTi, isotopeTi47, Ti47, Ti48, 0.000001, 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)) { + if (checkIsotope(elementCr, isotopeCr50, Cr50, Cr52, 0.000001, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // iron if (hasFe) { - if (checkIsotope(elementFe, isotopeFe54, Fe54, Fe56, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementFe, isotopeFe54, Fe54, Fe56, parameters->minratio54Fe56Fe, parameters->maxratio54Fe56Fe, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } @@ -1835,95 +2016,95 @@ void cTheoreticalSpectrum::removeUnmatchedPatternsFineSpectra(cPeaksList& theore // magnesium if (hasMg) { - if (checkIsotope(elementMg, isotopeMg25, Mg25, Mg24, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementMg, isotopeMg25, Mg25, Mg24, 0.000001, 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)) { + if (checkIsotope(elementMg, isotopeMg26, Mg26, Mg24, 0.000001, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // silicon if (hasSi) { - if (checkIsotope(elementSi, isotopeSi29, Si29, Si28, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementSi, isotopeSi29, Si29, Si28, 0.000001, 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)) { + if (checkIsotope(elementSi, isotopeSi30, Si30, Si28, 0.000001, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // sulfur if (hasS) { - if (checkIsotope(elementS, isotopeS34, S34, S32, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementS, isotopeS34, S34, S32, 0.000001, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // chlorine if (hasCl) { - if (checkIsotope(elementCl, isotopeCl37, Cl37, Cl35, 0.4, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementCl, isotopeCl37, Cl37, Cl35, 0.000001, 0.4, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // potassium if (hasK) { - if (checkIsotope(elementK, isotopeK41, K41, K39, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementK, isotopeK41, K41, K39, 0.000001, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // titanium (part 2) if (hasTi) { - if (checkIsotope(elementTi, isotopeTi49, Ti49, Ti48, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementTi, isotopeTi49, Ti49, Ti48, 0.000001, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } - if (checkIsotope(elementTi, isotopeTi50, Ti50, Ti48, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementTi, isotopeTi50, Ti50, Ti48, 0.000001, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // chromium (part 2) if (hasCr) { - if (checkIsotope(elementCr, isotopeCr53, Cr53, Cr52, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementCr, isotopeCr53, Cr53, Cr52, 0.000001, 0.2, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } // nickel if (hasNi) { - if (checkIsotope(elementNi, isotopeNi60, Ni60, Ni58, 0.5, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementNi, isotopeNi60, Ni60, Ni58, 0.000001, 0.5, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } - if (checkIsotope(elementNi, isotopeNi62, Ni62, Ni58, 0.1, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { + if (checkIsotope(elementNi, isotopeNi62, Ni62, Ni58, 0.000001, 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)) { + if (checkIsotope(elementCu, isotopeCu65, Cu65, Cu63, 0.000001, 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)) { + if (checkIsotope(elementZn, isotopeZn66, Zn66, Zn64, 0.000001, 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)) { + if (checkIsotope(elementZn, isotopeZn67, Zn67, Zn64, 0.000001, 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)) { + if (checkIsotope(elementZn, isotopeZn68, Zn68, Zn64, 0.000001, 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)) { + if (checkIsotope(elementGa, isotopeGa71, Ga71, Ga69, 0.000001, 0.8, theoreticalpeaks, theoreticalpeaksrealsize, experimentalpeaks, start, stop, maximumintensityid, maximumexperimentalintensity)) { cleargroup = true; } } @@ -2667,7 +2848,7 @@ void cTheoreticalSpectrum::generateFragmentIsotopePatterns(int& theoreticalpeaks isotopepatterncache.unlock(); if (!hit) { - isotopepattern = tmppeaklist[i].formula.getIsotopePattern(parameters->fwhm, abs(tmppeaklist[i].charge), (tmppeaklist[i].charge < 0) ? false : true, writedescription); + isotopepattern = tmppeaklist[i].formula.getIsotopePattern(parameters->fwhm, abs(tmppeaklist[i].charge), (tmppeaklist[i].charge < 0) ? false : true, 5, writedescription); isotopepatterncache.lock(); isotopepatterncache.put(hashedformula, isotopepattern); @@ -2807,7 +2988,7 @@ 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 cTheoreticalSpectrum::checkIsotope(string& elementstring, string& isotopestring, double isotopemass1, double isotopemass2, double minintensityratio, double maxintensityratio, cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, int start, int stop, int maximumintensityid, double maximumexperimentalintensity) { bool notdetected = false; int isotopeposition = -1; double intensitymultiplier = 1.0; @@ -2835,13 +3016,18 @@ bool cTheoreticalSpectrum::checkIsotope(string& elementstring, string& isotopest } if (isotopeposition == -1) { - notdetected = true; + if (minintensityratio > 0) { + 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) { + if (experimentalpeaks[theoreticalpeaks[isotopeposition].matchedid].relativeintensity > maxintensityratio * intensitymultiplier * maximumexperimentalintensity) { + notdetected = true; + } + if (experimentalpeaks[theoreticalpeaks[isotopeposition].matchedid].relativeintensity < minintensityratio * intensitymultiplier * maximumexperimentalintensity) { notdetected = true; } } @@ -4212,7 +4398,7 @@ int cTheoreticalSpectrum::compareOther(cPeaksList& sortedpeaklist, bool writedes } -void cTheoreticalSpectrum::generateMSSpectrum(bool& terminatecomputation, bool writedescription) { +void cTheoreticalSpectrum::generateMSSpectrum(int sequencestart, int sequencestop, bool& terminatecomputation, bool writedescription) { cPeak peak; cSummaryFormula formula; regex rx; @@ -4232,7 +4418,7 @@ void cTheoreticalSpectrum::generateMSSpectrum(bool& terminatecomputation, bool w } int theoreticalpeaksrealsize = 0; - for (int i = 0; i < parameters->sequencedatabase.size(); i++) { + for (int i = sequencestart; i < sequencestop; i++) { if (terminatecomputation) { theoreticalpeaks.clear(); @@ -4270,7 +4456,7 @@ void cTheoreticalSpectrum::generateMSSpectrum(bool& terminatecomputation, bool w peak.mzratio = peak.mzratio / (double)(m + 1); if (writedescription) { - peak.description = parameters->ionsfortheoreticalspectraMS1[j].name.substr(0, parameters->ionsfortheoreticalspectraMS1[j].name.size() - 1) + " "; + peak.description = fixLabelCharge(parameters->ionsfortheoreticalspectraMS1[j].name, (parameters->precursorcharge > 0) ? 1 : -1, m + 1) + " "; peak.description += to_string(m + 1); if (parameters->ionsfortheoreticalspectraMS1[j].positive) { peak.description += "+"; @@ -4299,7 +4485,7 @@ void cTheoreticalSpectrum::generateMSSpectrum(bool& terminatecomputation, bool w } -void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { +void cTheoreticalSpectrum::generateFineMSSpectrum(int sequencestart, int sequencestop, bool& terminatecomputation) { cSummaryFormula formula; string proton = "H+"; string description; @@ -4308,26 +4494,7 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { int theoreticalpeaksrealsize = 0; int groupid = 0; - cSequence sequence; - string summary; - string name; - - int seqdbsize = parameters->sequencedatabase.size(); - sequence.setPeptideType(other); - sequence.setDecoy(true); - - for (int i = 0; i < seqdbsize; i++) { - if (terminatecomputation) { - parameters->sequencedatabase.clear(); - return; - } - - summary = parameters->sequencedatabase[i].getSummaryFormula() + "H"; - sequence.setSummaryFormula(summary); - parameters->sequencedatabase.push_back(sequence); - } - - for (int i = 0; i < parameters->sequencedatabase.size(); i++) { + for (int i = sequencestart; i < sequencestop; i++) { if (terminatecomputation) { theoreticalpeaks.clear(); @@ -4344,7 +4511,7 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { cSummaryFormula ionformula; - for (int m = 0; m < (double)parameters->ionsfortheoreticalspectraMS1[j].multiplier; m++) { + for (int m = 0; m < parameters->ionsfortheoreticalspectraMS1[j].multiplier; m++) { tmp = formula.getSummary(); ionformula.addFormula(tmp); } @@ -4370,7 +4537,7 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { } } - description = parameters->ionsfortheoreticalspectraMS1[j].name.substr(0, parameters->ionsfortheoreticalspectraMS1[j].name.size() - 1) + " "; + description = fixLabelCharge(parameters->ionsfortheoreticalspectraMS1[j].name, (parameters->precursorcharge > 0) ? 1 : -1, n + 1) + " "; description += to_string(n + 1); if (parameters->ionsfortheoreticalspectraMS1[j].positive) { description += "+"; @@ -4383,7 +4550,7 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { } description += " " + parameters->sequencedatabase[i].getNameWithReferenceAsHTMLString() + " ("; - cPeaksList isotopepattern = chargedformula.getIsotopePattern(parameters->fwhm, n + 1, parameters->ionsfortheoreticalspectraMS1[j].positive, true); + cPeaksList isotopepattern = chargedformula.getIsotopePattern(parameters->fwhm, n + 1, parameters->ionsfortheoreticalspectraMS1[j].positive, 5, true); for (int p = 0; p < isotopepattern.size(); p++) { isotopepattern[p].description = description + isotopepattern[p].description + "): "; //isotopepattern[p].iontype = parameters->ionsfortheoreticalspectra[j]; // unused @@ -4408,15 +4575,28 @@ void cTheoreticalSpectrum::generateFineMSSpectrum(bool& terminatecomputation) { } -void cTheoreticalSpectrum::getHintsIndex(int id, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex) { - experimentalpeaks = parameters->peaklistseries[id]; +void cTheoreticalSpectrum::getHintsIndex(int id, int peaklistseriesvectorid, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex, bool lcmsrt, bool skipcomparison) { + experimentalpeaks = parameters->peaklistseriesvector[peaklistseriesvectorid][id]; cPeaksList* tsfullpeaklist = tsfull.getTheoreticalPeaks(); experimentalmatches.clear(); - searchForPeakPairs(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, parameters->fragmentmasserrortolerance); + + if (!skipcomparison) { + searchForPeakPairs(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, parameters->fragmentmasserrortolerance); + } + else { + experimentalmatches.resize(experimentalpeaks.size()); + } + + if (lcmsrt) { + removeCompoundsOutsideRTRange(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); + } if (parameters->generateisotopepattern) { + if ((parameters->minimumannotationintensityrelative > parameters->minimumrelativeintensitythreshold) || (parameters->minimumannotationintensityabsolute > parameters->minimumabsoluteintensitythreshold)) { + removePatternsUnderAnnotationThreshold(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); + } if (parameters->minimumpatternsize > 1) { removeUnmatchedPatternsFineSpectra(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); } @@ -4427,6 +4607,11 @@ void cTheoreticalSpectrum::getHintsIndex(int id, cTheoreticalSpectrum& tsfull, c removeUnmatchedPatternsByMZDifference(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); } } + else { + if ((parameters->minimumannotationintensityrelative > parameters->minimumrelativeintensitythreshold) || (parameters->minimumannotationintensityabsolute > parameters->minimumabsoluteintensitythreshold)) { + removePeaksUnderAnnotationThreshold(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); + } + } // clear matched isotopes of unmatched monoisotopic peaks unmatchedpeaksinmatchedpatterns.clear(); @@ -4452,15 +4637,28 @@ void cTheoreticalSpectrum::getHintsIndex(int id, cTheoreticalSpectrum& tsfull, c } -void cTheoreticalSpectrum::compareMSSpectrum(int id, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex) { - experimentalpeaks = parameters->peaklistseries[id]; +void cTheoreticalSpectrum::compareMSSpectrum(int id, int peaklistseriesvectorid, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex, bool lcmsrt, bool skipcomparison) { + experimentalpeaks = parameters->peaklistseriesvector[peaklistseriesvectorid][id]; cPeaksList* tsfullpeaklist = tsfull.getTheoreticalPeaks(); experimentalmatches.clear(); - searchForPeakPairs(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, parameters->fragmentmasserrortolerance); + + if (!skipcomparison) { + searchForPeakPairs(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, parameters->fragmentmasserrortolerance); + } + else { + experimentalmatches.resize(experimentalpeaks.size()); + } + + if (lcmsrt) { + removeCompoundsOutsideRTRange(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); + } if (parameters->generateisotopepattern) { + if ((parameters->minimumannotationintensityrelative > parameters->minimumrelativeintensitythreshold) || (parameters->minimumannotationintensityabsolute > parameters->minimumabsoluteintensitythreshold)) { + removePatternsUnderAnnotationThreshold(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); + } if (parameters->minimumpatternsize > 1) { removeUnmatchedPatternsFineSpectra(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); } @@ -4471,8 +4669,13 @@ void cTheoreticalSpectrum::compareMSSpectrum(int id, cTheoreticalSpectrum& tsful removeUnmatchedPatternsByMZDifference(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); } } + else { + if ((parameters->minimumannotationintensityrelative > parameters->minimumrelativeintensitythreshold) || (parameters->minimumannotationintensityabsolute > parameters->minimumabsoluteintensitythreshold)) { + removePeaksUnderAnnotationThreshold(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); + } + } - bool lcms = (parameters->peaklistseries.size() > 1) && !((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)); + bool lcms = (parameters->peaklistseriesvector[peaklistseriesvectorid].size() > 1) && !((parameters->peaklistfileformats[peaklistseriesvectorid] == mis) || (parameters->peaklistfileformats[peaklistseriesvectorid] == imzML)); // pre-cleaning (relative intensity threshold, minimumpatternsize) if (parameters->generateisotopepattern) { @@ -4489,8 +4692,8 @@ void cTheoreticalSpectrum::compareMSSpectrum(int id, cTheoreticalSpectrum& tsful } // LC-MS data or MSI data - if (lcms || (parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { - removeUnmatchedFeatures(lcms, *tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, hintsindex/*, id*/); + if (lcms || (parameters->peaklistfileformats[peaklistseriesvectorid] == mis) || (parameters->peaklistfileformats[peaklistseriesvectorid] == imzML)) { + removeUnmatchedFeatures(lcms, peaklistseriesvectorid, *tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks, hintsindex/*, id*/); } // direct MS else { @@ -4516,7 +4719,7 @@ void cTheoreticalSpectrum::compareMSSpectrum(int id, cTheoreticalSpectrum& tsful } // calculate scores - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { targetscores.clear(); decoyscores.clear(); calculateEnvelopeScores(*tsfullpeaklist, tsfull.getNumberOfPeaks(), experimentalpeaks); @@ -5595,7 +5798,7 @@ void cTheoreticalSpectrum::store(ofstream& os) { } -void cTheoreticalSpectrum::load(ifstream& is) { +void cTheoreticalSpectrum::load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3) { int size, size2; eFragmentIonType iontype; int losstype; @@ -5605,8 +5808,8 @@ void cTheoreticalSpectrum::load(ifstream& is) { parameters = 0; - theoreticalpeaks.load(is); - experimentalpeaks.load(is); + theoreticalpeaks.load(is, fileversionpart1, fileversionpart2, fileversionpart3); + experimentalpeaks.load(is, fileversionpart1, fileversionpart2, fileversionpart3); candidate.load(is); is.read((char *)&experimentalpeaksmatched, sizeof(int)); @@ -5680,3 +5883,136 @@ void cTheoreticalSpectrum::load(ifstream& is) { } } + +bool cTheoreticalSpectrum::equals(cTheoreticalSpectrum& secondtheoreticalspectrum) { + if (!theoreticalpeaks.equals(secondtheoreticalspectrum.theoreticalpeaks)) { + cout << "theoreticalpeaks does not match" << endl; + return false; + } + + if (!experimentalpeaks.equals(secondtheoreticalspectrum.experimentalpeaks)) { + cout << "experimentalpeaks does not match" << endl; + return false; + } + + // to do - check candidate + + if (experimentalpeaksmatched != secondtheoreticalspectrum.experimentalpeaksmatched) { + cout << "experimentalpeaksmatched does not match" << endl; + return false; + } + + if (experimentalmatches != secondtheoreticalspectrum.experimentalmatches) { + cout << "experimentalmatches does not match" << endl; + return false; + } + + if (scrambledpeaksmatched != secondtheoreticalspectrum.scrambledpeaksmatched) { + cout << "scrambledpeaksmatched does not match" << endl; + return false; + } + + if (matchedions != secondtheoreticalspectrum.matchedions) { + cout << "matchedions does not match" << endl; + return false; + } + + if (peakstested != secondtheoreticalspectrum.peakstested) { + cout << "peakstested does not match" << endl; + return false; + } + + if (!compareDoubles(experimentalpeaksmatchedratio, secondtheoreticalspectrum.experimentalpeaksmatchedratio)) { + cout << "experimentalpeaksmatchedratio does not match" << endl; + return false; + } + + if (!compareDoubles(weightedpeaksratio, secondtheoreticalspectrum.weightedpeaksratio)) { + cout << "weightedpeaksratio does not match" << endl; + return false; + } + + if (unmatchedexperimentalpeakscount != secondtheoreticalspectrum.unmatchedexperimentalpeakscount) { + cout << "unmatchedexperimentalpeakscount does not match" << endl; + return false; + } + + if (coveragebyseries.compare(secondtheoreticalspectrum.coveragebyseries) != 0) { + cout << "coveragebyseries does not match" << endl; + return false; + } + + if (valid != secondtheoreticalspectrum.valid) { + cout << "valid does not match" << endl; + return false; + } + + if (!compareDoubles(sumofrelativeintensities, secondtheoreticalspectrum.sumofrelativeintensities)) { + cout << "sumofrelativeintensities does not match" << endl; + return false; + } + + // to do - check rotationslabels + + if (validposition != secondtheoreticalspectrum.validposition) { + cout << "validposition does not match" << endl; + return false; + } + + if (reversevalidposition != secondtheoreticalspectrum.reversevalidposition) { + cout << "reversevalidposition does not match" << endl; + return false; + } + + if (seriescompleted != secondtheoreticalspectrum.seriescompleted) { + cout << "seriescompleted does not match" << endl; + return false; + } + + if (pathid != secondtheoreticalspectrum.pathid) { + cout << "pathid does not match" << endl; + return false; + } + + if (!compareMapsIntDouble(targetscores, secondtheoreticalspectrum.targetscores)) { + cout << "targetscores does not match" << endl; + return false; + } + + if (!compareMapsIntDouble(decoyscores, secondtheoreticalspectrum.decoyscores)) { + cout << "decoyscores does not match" << endl; + return false; + } + + if (!compareMapsIntDouble(fdrscores, secondtheoreticalspectrum.fdrscores)) { + cout << "fdrscores does not match" << endl; + return false; + } + + return true; +} + + +void cTheoreticalSpectrum::attach(cTheoreticalSpectrum& secondtheoreticalspectrum) { + int numberoftheoreticalpeaks = theoreticalpeaks.size(); + + theoreticalpeaks.attach(secondtheoreticalspectrum.theoreticalpeaks); + + if (experimentalpeaks.size() == secondtheoreticalspectrum.experimentalpeaks.size()) { + for (int i = 0; i < experimentalpeaks.size(); i++) { + experimentalpeaks[i].matched += secondtheoreticalspectrum.experimentalpeaks[i].matched; + } + } + + if (experimentalmatches.size() == secondtheoreticalspectrum.experimentalmatches.size()) { + for (int i = 0; i < experimentalmatches.size(); i++) { + for (auto& it : secondtheoreticalspectrum.experimentalmatches[i]) { + experimentalmatches[i].insert(it + numberoftheoreticalpeaks); + } + } + } + + targetscores.insert(secondtheoreticalspectrum.targetscores.begin(), secondtheoreticalspectrum.targetscores.end()); + decoyscores.insert(secondtheoreticalspectrum.decoyscores.begin(), secondtheoreticalspectrum.decoyscores.end()); +} + diff --git a/CycloBranch/core/cTheoreticalSpectrum.h b/CycloBranch/core/cTheoreticalSpectrum.h index 4bd2656..80cb173 100644 --- a/CycloBranch/core/cTheoreticalSpectrum.h +++ b/CycloBranch/core/cTheoreticalSpectrum.h @@ -178,11 +178,20 @@ class cTheoreticalSpectrum { void removeUnmatchedIsotopePatterns(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, cPeaksList& outputtheoreticalpeaks, bool storeunmatchedpeaks); // remove unmatched features - int removeUnmatchedFeatures(bool lcms, cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, vector< vector >& hintsindex/*, int id*/); + int removeUnmatchedFeatures(bool lcms, int peaklistseriesvectorid, cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, vector< vector >& hintsindex/*, int id*/); // remove unmatched compounds int removeUnmatchedCompounds(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks, int minimumiontypes); + // remove compounds outside RT range + void removeCompoundsOutsideRTRange(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks); + + // remove peaks under annotation threshold + void removePeaksUnderAnnotationThreshold(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks); + + // remove isotopic patterns under annotation threshold + void removePatternsUnderAnnotationThreshold(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks); + // remove unmatched patterns in fine isotopic patterns void removeUnmatchedPatternsFineSpectra(cPeaksList& theoreticalpeaks, int theoreticalpeaksrealsize, cPeaksList& experimentalpeaks); @@ -223,7 +232,7 @@ class cTheoreticalSpectrum { 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); + bool checkIsotope(string& elementstring, string& isotopestring, double isotopemass1, double isotopemass2, double minintensityratio, double maxintensityratio, 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); @@ -371,37 +380,47 @@ class cTheoreticalSpectrum { /** \brief Generate a simple mass spectrum. + \param sequencestart index of the first item to be processed + \param sequencestop index of the last item to be processed (excluding the last item) \param terminatecomputation reference to a variable determining that the computation must be stopped \param writedescription if true then string descriptions of peaks are filled */ - void generateMSSpectrum(bool& terminatecomputation, bool writedescription); + void generateMSSpectrum(int sequencestart, int sequencestop, bool& terminatecomputation, bool writedescription); /** \brief Generate a simple mass spectrum with fine isotopic patterns. + \param sequencestart index of the first item to be processed + \param sequencestop index of the last item to be processed (excluding the last item) \param terminatecomputation reference to a variable determining that the computation must be stopped */ - void generateFineMSSpectrum(bool& terminatecomputation); + void generateFineMSSpectrum(int sequencestart, int sequencestop, bool& terminatecomputation); /** \brief Get a map of search hints to identify features in LC-MS data. \param id identifier of an experimental spectrum + \param peaklistseriesvectorid id of a peaklistseriesvector \param tsfull theoretical spectrum \param unmatchedpeaksinmatchedpatterns unmatched peaks in matched isotope patterns \param hintsindex index of experimental spectra for every matched theoretical peak + \param lcmsrt true if LC-MS data are processed and retention time is available + \param skipcomparison if true, the peak comparison is skipped */ - void getHintsIndex(int id, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex); + void getHintsIndex(int id, int peaklistseriesvectorid, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex, bool lcmsrt, bool skipcomparison); /** \brief Compare theoretical peaks with an experimental spectrum. \param id identifier of an experimental spectrum + \param peaklistseriesvectorid id of a peaklistseriesvector \param tsfull theoretical spectrum with descriptions of peaks \param unmatchedpeaksinmatchedpatterns unmatched peaks in matched isotope patterns \param hintsindex index of experimental spectra for every matched theoretical peak + \param lcmsrt true if LC-MS data are processed and retention time is available + \param skipcomparison if true, the peak comparison is skipped */ - void compareMSSpectrum(int id, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex); + void compareMSSpectrum(int id, int peaklistseriesvectorid, cTheoreticalSpectrum& tsfull, cPeaksList& unmatchedpeaksinmatchedpatterns, vector< vector >& hintsindex, bool lcmsrt, bool skipcomparison); /** @@ -695,8 +714,26 @@ class cTheoreticalSpectrum { /** \brief Load the structure from an input stream. \param is an input stream - */ - void load(ifstream& is); + \param fileversionpart1 first number of .res the file version + \param fileversionpart2 second number of .res the file version + \param fileversionpart3 third number of .res the file version + */ + void load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3); + + + /** + \brief Check if the object equals to another object. + \param secondtheoreticalspectrum object for comparison + \retval bool true if the objects are equals + */ + bool equals(cTheoreticalSpectrum& secondtheoreticalspectrum); + + + /** + \brief Attach another spectrum. + \param secondtheoreticalspectrum spectrum to be attached + */ + void attach(cTheoreticalSpectrum& secondtheoreticalspectrum); }; diff --git a/CycloBranch/core/cTheoreticalSpectrumList.cpp b/CycloBranch/core/cTheoreticalSpectrumList.cpp index 72ea477..06daac4 100644 --- a/CycloBranch/core/cTheoreticalSpectrumList.cpp +++ b/CycloBranch/core/cTheoreticalSpectrumList.cpp @@ -9,12 +9,12 @@ double cTheoreticalSpectrumList::getCurrentWorstScore() { } -void cTheoreticalSpectrumList::computeNumbersOfCompletedSeries() { - for (int i = 0; i < (int)theoreticalspectra.size(); i++) { - for (int j = i + 1; j < (int)theoreticalspectra.size(); j++) {\ - if (theoreticalspectra[i].getCandidate().hasEqualTPermutations(theoreticalspectra[j].getCandidate())) { - theoreticalspectra[i].setNumberOfCompletedSeries(theoreticalspectra[i].getNumberOfCompletedSeries() + 1); - theoreticalspectra[j].setNumberOfCompletedSeries(theoreticalspectra[j].getNumberOfCompletedSeries() + 1); +void cTheoreticalSpectrumList::computeNumbersOfCompletedSeries(int fileid) { + for (int i = 0; i < (int)theoreticalspectra[fileid].size(); i++) { + for (int j = i + 1; j < (int)theoreticalspectra[fileid].size(); j++) {\ + if (theoreticalspectra[fileid][i].getCandidate().hasEqualTPermutations(theoreticalspectra[fileid][j].getCandidate())) { + theoreticalspectra[fileid][i].setNumberOfCompletedSeries(theoreticalspectra[fileid][i].getNumberOfCompletedSeries() + 1); + theoreticalspectra[fileid][j].setNumberOfCompletedSeries(theoreticalspectra[fileid][j].getNumberOfCompletedSeries() + 1); } } } @@ -63,6 +63,11 @@ void cTheoreticalSpectrumList::clear() { } +void cTheoreticalSpectrumList::clear(int fileid) { + theoreticalspectra[fileid].clear(); +} + + void cTheoreticalSpectrumList::initialize(cMainThread& os, cParameters& parameters, cDeNovoGraph* graph) { this->os = &os; this->parameters = ¶meters; @@ -70,8 +75,13 @@ void cTheoreticalSpectrumList::initialize(cMainThread& os, cParameters& paramete } -void cTheoreticalSpectrumList::add(cTheoreticalSpectrum& theoreticalspectrum) { - theoreticalspectra.push_back(theoreticalspectrum); +void cTheoreticalSpectrumList::add(int fileid, cTheoreticalSpectrum& theoreticalspectrum) { + theoreticalspectra[fileid].push_back(theoreticalspectrum); +} + + +cTheoreticalSpectrum& cTheoreticalSpectrumList::get(int fileid, int order) { + return theoreticalspectra[fileid][order]; } @@ -80,18 +90,28 @@ int cTheoreticalSpectrumList::size() { } -cTheoreticalSpectrum& cTheoreticalSpectrumList::operator[](int position) { - return theoreticalspectra[position]; +int cTheoreticalSpectrumList::size(int fileid) { + return (int)theoreticalspectra[fileid].size(); +} + + +void cTheoreticalSpectrumList::resize(int size) { + theoreticalspectra.resize(size); } -int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, bool& terminatecomputation) { - cPeaksList peaklist = parameters->peaklistseries[parameters->scannumber - 1]; +void cTheoreticalSpectrumList::resize(int fileid, int size) { + theoreticalspectra[fileid].resize(size); +} + + +int cTheoreticalSpectrumList::parallelCompareAndStore(int fileid, cCandidateSet& candidates, bool& terminatecomputation) { + cPeaksList peaklist = parameters->peaklistseriesvector[0][parameters->scannumber - 1]; peaklist.sortbyMass(); cCandidateSet permutations; - theoreticalspectra.clear(); + theoreticalspectra[fileid].clear(); regex rxsequencetag, rxsearchedsequence; - cSpectrumComparatorThread* comparatorthread; + cSpectrumComparatorThreadMS2* comparatorthread; string stmp; cBricksDatabase* bricksdb = 0; @@ -181,7 +201,7 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, } if ((QThreadPool::globalInstance()->activeThreadCount() < QThreadPool::globalInstance()->maxThreadCount()) && (size > 0)) { - comparatorthread = new cSpectrumComparatorThread(); + comparatorthread = new cSpectrumComparatorThreadMS2(); candidates.lock(); auto x = candidates.getSet().begin(); comparatorthread->initialize((cCandidate&)(*x), peaklist, bricksdb, this, parameters, &rxsequencetag, &rxsearchedsequence, getCurrentWorstScore(), &terminatecomputation); @@ -221,17 +241,17 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, } // move the list to vector - theoreticalspectra.clear(); - theoreticalspectra.insert(theoreticalspectra.end(), make_move_iterator(spectrumbuffer.begin()), make_move_iterator(spectrumbuffer.end())); + theoreticalspectra[fileid].clear(); + theoreticalspectra[fileid].insert(theoreticalspectra[fileid].end(), make_move_iterator(spectrumbuffer.begin()), make_move_iterator(spectrumbuffer.end())); spectrumbuffer.clear(); } else { cTheoreticalSpectrum t(parameters, (cCandidate &)(*candidates.getSet().begin())); - int cnt = parameters->peaklistseries.size(); + int cnt = parameters->peaklistseriesvector[0].size(); for (int i = 0; i < cnt; i++) { - theoreticalspectra.push_back(t); + theoreticalspectra[fileid].push_back(t); } } @@ -254,19 +274,19 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, // fill descriptions of peaks cPeaksList unmatchedpeaksinmatchedpatterns; cPeaksList tmppeaklist; - resultspectra.resize(theoreticalspectra.size()); - for (int i = 0; i < (int)theoreticalspectra.size(); i++) { + resultspectra.resize(theoreticalspectra[fileid].size()); + for (int i = 0; i < (int)theoreticalspectra[fileid].size(); i++) { tsp.clear(false); tsp.setParameters(parameters); - tsp.setCandidate(theoreticalspectra[i].getCandidate()); + tsp.setCandidate(theoreticalspectra[fileid][i].getCandidate()); - theoreticalspectra[i].clear(true); + theoreticalspectra[fileid][i].clear(true); unmatchedpeaksinmatchedpatterns.clear(); if (parameters->mode == singlecomparison) { - tmppeaklist = parameters->peaklistseries[i]; + tmppeaklist = parameters->peaklistseriesvector[0][i]; tmppeaklist.sortbyMass(); } else { @@ -330,8 +350,8 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, isotopepatterncache.clear(); isotopepatterncache.unlock(); - theoreticalspectra.clear(); - theoreticalspectra.insert(theoreticalspectra.end(), make_move_iterator(resultspectra.begin()), make_move_iterator(resultspectra.end())); + theoreticalspectra[fileid].clear(); + theoreticalspectra[fileid].insert(theoreticalspectra[fileid].end(), make_move_iterator(resultspectra.begin()), make_move_iterator(resultspectra.end())); resultspectra.clear(); //computeNumbersOfCompletedSeries(); @@ -339,35 +359,35 @@ int cTheoreticalSpectrumList::parallelCompareAndStore(cCandidateSet& candidates, // sort peaks in theoretical spectra by mass and set real names of peptides vector paths; string tmps; - for (int i = 0; i < (int)theoreticalspectra.size(); i++) { - theoreticalspectra[i].sortByMass(); + for (int i = 0; i < (int)theoreticalspectra[fileid].size(); i++) { + theoreticalspectra[fileid][i].sortByMass(); if (parameters->peptidetype != other) { - theoreticalspectra[i].getCandidate().setRealPeptideName(*bricksdb, parameters->peptidetype); - theoreticalspectra[i].getCandidate().setAcronymPeptideNameWithHTMLReferences(*bricksdb, parameters->peptidetype); - theoreticalspectra[i].getCandidate().setAcronyms(*bricksdb); + theoreticalspectra[fileid][i].getCandidate().setRealPeptideName(*bricksdb, parameters->peptidetype); + theoreticalspectra[fileid][i].getCandidate().setAcronymPeptideNameWithHTMLReferences(*bricksdb, parameters->peptidetype); + theoreticalspectra[fileid][i].getCandidate().setAcronyms(*bricksdb); } if ((parameters->peptidetype == branched) || (parameters->peptidetype == branchcyclic)) { - theoreticalspectra[i].getCandidate().setBackboneAcronyms(*bricksdb); - theoreticalspectra[i].getCandidate().setBranchAcronyms(*bricksdb); + theoreticalspectra[fileid][i].getCandidate().setBackboneAcronyms(*bricksdb); + theoreticalspectra[fileid][i].getCandidate().setBranchAcronyms(*bricksdb); } if (parameters->mode == denovoengine) { - theoreticalspectra[i].getCandidate().setPath(*graph, parameters); - tmps = theoreticalspectra[i].getCandidate().getPathAsString(); + theoreticalspectra[fileid][i].getCandidate().setPath(*graph, parameters); + tmps = theoreticalspectra[fileid][i].getCandidate().getPathAsString(); auto it = std::find(paths.begin(), paths.end(), tmps); if (it == paths.end()) { - theoreticalspectra[i].setPathId((int)paths.size()); + theoreticalspectra[fileid][i].setPathId((int)paths.size()); paths.push_back(tmps); } else { - theoreticalspectra[i].setPathId(it - paths.begin()); + theoreticalspectra[fileid][i].setPathId(it - paths.begin()); } } // parameters must not be used by viewer, they are not stored/loaded - theoreticalspectra[i].setParameters(0); + theoreticalspectra[fileid][i].setParameters(0); } if ((parameters->mode == denovoengine) || (parameters->mode == databasesearch)) { - sortAndFitSize(); + sortAndFitSize(fileid); } // -1 = partial results, aborted by user @@ -480,34 +500,34 @@ double cTheoreticalSpectrumList::updatekNNList(cTheoreticalSpectrum& theoretical } -void cTheoreticalSpectrumList::sortAndFitSize() { +void cTheoreticalSpectrumList::sortAndFitSize(int fileid) { switch (parameters->scoretype) { case number_of_matched_peaks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareNumberOfMatchedPeaksDesc); + sort(theoreticalspectra[fileid].begin(), theoreticalspectra[fileid].end(), compareNumberOfMatchedPeaksDesc); break; case sum_of_relative_intensities: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareSumOfRelIntDesc); + sort(theoreticalspectra[fileid].begin(), theoreticalspectra[fileid].end(), compareSumOfRelIntDesc); break; case number_of_b_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareBandAllIonsDesc); + sort(theoreticalspectra[fileid].begin(), theoreticalspectra[fileid].end(), compareBandAllIonsDesc); break; case number_of_y_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYandAllIonsDesc); + sort(theoreticalspectra[fileid].begin(), theoreticalspectra[fileid].end(), compareYandAllIonsDesc); break; case number_of_b_and_y_ions: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareYBandAllIonsDesc); + sort(theoreticalspectra[fileid].begin(), theoreticalspectra[fileid].end(), compareYBandAllIonsDesc); break; case weighted_ratio_of_matched_peaks: - sort(theoreticalspectra.begin(), theoreticalspectra.end(), compareWeightedRatioDesc); + sort(theoreticalspectra[fileid].begin(), theoreticalspectra[fileid].end(), compareWeightedRatioDesc); break; default: break; } // might be useful for databasesearch mode - if ((int)theoreticalspectra.size() > parameters->hitsreported) { - theoreticalspectra.resize(parameters->hitsreported); + if ((int)theoreticalspectra[fileid].size() > parameters->hitsreported) { + theoreticalspectra[fileid].resize(parameters->hitsreported); } } diff --git a/CycloBranch/core/cTheoreticalSpectrumList.h b/CycloBranch/core/cTheoreticalSpectrumList.h index 27a6829..42c9781 100644 --- a/CycloBranch/core/cTheoreticalSpectrumList.h +++ b/CycloBranch/core/cTheoreticalSpectrumList.h @@ -1,6 +1,6 @@ /** \file cTheoreticalSpectrumList.h - \brief The representation of a list of theoretical mass spectra. + \brief The representation of lists of theoretical spectra. */ @@ -11,17 +11,20 @@ #include #include -#include "parallel/cSpectrumComparatorThread.h" +#include "parallel/cSpectrumAnalyzerThreadMS1.h" +#include "parallel/cSpectrumComparatorThreadMS1.h" +#include "parallel/cSpectrumComparatorThreadMS2.h" +#include "parallel/cSpectrumGeneratorThreadMS1.h" class cMainThread; /** - \brief The class representing a list of theoretical spectra. + \brief The class representing lists of theoretical spectra. */ class cTheoreticalSpectrumList { - vector theoreticalspectra; + vector > theoreticalspectra; list spectrumbuffer; cMainThread* os; cParameters* parameters; @@ -33,7 +36,7 @@ class cTheoreticalSpectrumList { double getCurrentWorstScore(); - void computeNumbersOfCompletedSeries(); + void computeNumbersOfCompletedSeries(int fileid); void fixRegularExpression(string& s); @@ -52,6 +55,13 @@ class cTheoreticalSpectrumList { void clear(); + /** + \brief Clear a specified file id. + \param fileid file id + */ + void clear(int fileid); + + /** \brief Initialize the list. \param os reference to the main thread of the application @@ -63,33 +73,59 @@ class cTheoreticalSpectrumList { /** \brief Add a spectrum to the list. + \param fileid file id \param theoreticalspectrum reference to a spectrum */ - void add(cTheoreticalSpectrum& theoreticalspectrum); + void add(int fileid, cTheoreticalSpectrum& theoreticalspectrum); /** - \brief Get the number of spectra. - \retval int number of spectra - */ + \brief Get a reference to a spectrum. + \param fileid file id + \param order id of a spectrum + \retval cTheoreticalSpectrum reference to a spectrum + */ + cTheoreticalSpectrum& get(int fileid, int order); + + + /** + \brief Get the number of files. + \retval int number of files + */ int size(); /** - \brief Overloaded operator []. - \param position position of a spectrum in the vector - \retval reference to the spectrum + \brief Get the number of spectra in a file. + \param fileid file id + \retval int number of spectra */ - cTheoreticalSpectrum& operator[](int position); + int size(int fileid); + + + /** + \brief Resize the vector of files. + \param size size + */ + void resize(int size); + + + /** + \brief Resize a file id vector. + \param fileid file id + \param size size + */ + void resize(int fileid, int size); /** \brief Parallel comparison of theoretical spectra with an experimental spectrum. + \param fileid file id \param candidates reference to a set of peptide sequence candidates \param terminatecomputation reference to a variable determining that the computation must be stopped \retval int 0 when successfully finished; -1 when an error occurred */ - int parallelCompareAndStore(cCandidateSet& candidates, bool& terminatecomputation); + int parallelCompareAndStore(int fileid, cCandidateSet& candidates, bool& terminatecomputation); /** @@ -105,8 +141,9 @@ class cTheoreticalSpectrumList { /** \brief Sort the list according to a score defined by cParameters::scoretype and crop the list according cParameters::hitsreported. - */ - void sortAndFitSize(); + \param fileid file id + */ + void sortAndFitSize(int fileid); }; diff --git a/CycloBranch/core/utilities.cpp b/CycloBranch/core/utilities.cpp index 26a0f73..2ae12b7 100644 --- a/CycloBranch/core/utilities.cpp +++ b/CycloBranch/core/utilities.cpp @@ -4,7 +4,9 @@ QString appname = "CycloBranch"; -QString appversion = "v. 2.0.8 (64-bit)"; +QString appversion = "v. 2.1.21 (64-bit)"; + +QString lastcompatibleappversion = "v. 2.0.8 (64-bit)"; #if OS_TYPE == UNX @@ -238,6 +240,58 @@ bool checkFile(string filename) { } +bool compareDoubles(double& first, double& second, double epsilon) { + if (fabs(first - second) < epsilon) { + return true; + } + return false; + + //if (first == second) { + // return true; + //} + //return false; +} + + +bool compareStringVectors(vector& first, vector& second) { + if (first.size() != second.size()) { + return false; + } + + size_t size = first.size(); + for (size_t i = 0; i < size; i++) { + if (first[i].compare(second[i]) != 0) { + return false; + } + } + + return true; +} + + +bool compareMapsIntDouble(map& first, map& second, double epsilon) { + if (first.size() != second.size()) { + return false; + } + for (auto& it : first) { + if (second.count(it.first) == 1) { + if (!compareDoubles(it.second, second[it.first], epsilon)) { + return false; + } + } + else { + return false; + } + } + return true; + + //if (first == second) { + // return true; + //} + //return false; +} + + void parseBranch(ePeptideType peptidetype, string& composition, vector& vectorcomposition, int& branchstart, int& branchend) { string s = composition; cBrick b; @@ -374,10 +428,19 @@ QByteArray cropPrecisionToSixDecimalsByteArray(double value) { } +string getShortFileName(string filename) { + size_t pos = filename.rfind('/'); + if (pos != string::npos) { + filename = filename.substr(pos + 1); + } + return filename; +} + + double fact(int value) { - double result = 1; + double result = 1.0; while (value > 1) { - result *= value; + result *= (double)value; value--; } return result; @@ -574,3 +637,118 @@ bool proxyModelCheckString(QAbstractItemModel* model, int index, int row, int co return false; } + +bool isCompatibleVersion(int fileversionpart1, int fileversionpart2, int fileversionpart3, int lastcompatiblepart1, int lastcompatiblepart2, int lastcompatiblepart3) { + bool compatible = true; + if (lastcompatiblepart3 < fileversionpart3) { + compatible = true; + } + if (lastcompatiblepart3 > fileversionpart3) { + compatible = false; + } + if (lastcompatiblepart2 < fileversionpart2) { + compatible = true; + } + if (lastcompatiblepart2 > fileversionpart2) { + compatible = false; + } + if (lastcompatiblepart1 < fileversionpart1) { + compatible = true; + } + if (lastcompatiblepart1 > fileversionpart1) { + compatible = false; + } + return compatible; +} + + +string fixLabelCharge(string& str, int sourcecharge, int targetcharge) { + string newlabel = str.substr(0, str.size() - 1); + + if (abs(sourcecharge) == targetcharge) { + return newlabel; + } + + size_t size = str.size(); + bool positive = true; + int number = 0; + string origstr = ""; + + for (int i = 0; i < size; i++) { + if (newlabel[i] == '+') { + positive = true; + number = 0; + origstr = "+"; + continue; + } + if (newlabel[i] == '-') { + positive = false; + number = 0; + origstr = "-"; + continue; + } + if (newlabel[i] == 'H') { + if (i + 1 < size) { + if ((newlabel[i + 1] == ']') || (newlabel[i + 1] == '+') || (newlabel[i + 1] == '-')) { + if (number == 0) { + number = 1; + } + origstr += 'H'; + break; + } + } + } + if ((newlabel[i] >= '0') && (newlabel[i] <= '9')) { + number *= 10; + number += newlabel[i] - '0'; + origstr += newlabel[i]; + } + } + + if (!positive) { + number = -number; + } + + if (sourcecharge < 0) { + targetcharge = -targetcharge; + } + + int newnumber = number + targetcharge - sourcecharge; + + string newstr; + if (newnumber == 0) { + newstr = ""; + } + else if (newnumber == 1) { + newstr = "+H"; + } + else if (newnumber == -1) { + newstr = "-H"; + } + else { + if (newnumber > 0) { + newstr += "+"; + } + newstr += to_string(newnumber); + newstr += "H"; + } + + size_t pos; + + if (number == 0) { + pos = newlabel.find(']'); + if (pos != string::npos) { + newstr += "]"; + newlabel.replace(pos, 1, newstr); + } + } + else { + pos = newlabel.find(origstr); + if (pos != string::npos) { + newlabel.replace(pos, origstr.size(), newstr); + } + } + + return newlabel; +} + diff --git a/CycloBranch/core/utilities.h b/CycloBranch/core/utilities.h index 35c97d2..7355021 100644 --- a/CycloBranch/core/utilities.h +++ b/CycloBranch/core/utilities.h @@ -48,9 +48,6 @@ class cBrick; #endif -#define MICROSCOPY_IMAGES - - using namespace std; using namespace boost; @@ -61,6 +58,12 @@ using namespace boost; const double pi = 3.141592653589793; +/** + \brief The e constant. +*/ +const double econst = 2.718281828459045; + + /** \brief Default window size x. */ @@ -121,6 +124,12 @@ extern QString appname; extern QString appversion; +/** + \brief Last compatible version of the application. +*/ +extern QString lastcompatibleappversion; + + /** \brief A directory where the application is installed under Linux or OSX. */ @@ -289,6 +298,35 @@ bool checkRegex(ePeptideType peptidetype, string& sequence, string& errormessage bool checkFile(string filename); +/** + \brief Check if two doubles are equal. + \param first first value + \param second second value + \param epsilon epsilon value for comparison + \retval bool true if the values are equal +*/ +bool compareDoubles(double& first, double& second, double epsilon = 0.0000001f); + + +/** + \brief Check if two vectors of strings are equal. + \param first first vector + \param second second vector + \retval bool true if the vectors are equal +*/ +bool compareStringVectors(vector& first, vector& second); + + +/** + \brief Check if two maps of doubles are equal. + \param first first map + \param second second map + \param epsilon epsilon value for double comparison + \retval bool true if the maps are equal +*/ +bool compareMapsIntDouble(map& first, map& second, double epsilon = 0.0000001f); + + /** \brief Parse a position of a branch from a peptide sequence. \param peptidetype peptide type @@ -340,6 +378,14 @@ QByteArray cropDecimalsByteArray(double value); QByteArray cropPrecisionToSixDecimalsByteArray(double value); +/** + \brief Get a short filename from a string. + \param filename long filename + \retval string short filename +*/ +string getShortFileName(string filename); + + /** \brief Store aggregated information about a coordinate. */ @@ -508,5 +554,28 @@ bool proxyModelCheckDouble(QAbstractItemModel* model, int index, int row, int co bool proxyModelCheckString(QAbstractItemModel* model, int index, int row, int column, QString& itemstr, QString str, const QModelIndex& parent, bool wholeword, Qt::CaseSensitivity casesensitive); +/** + \brief Check the compatibility of CycloBranch version. + \param fileversionpart1 tested version (part 1) + \param fileversionpart2 tested version (part 2) + \param fileversionpart3 tested version (part 3) + \param lastcompatiblepart1 last compatible version (part 1) + \param lastcompatiblepart2 last compatible version (part 2) + \param lastcompatiblepart3 last compatible version (part 3) + \retval bool true if the versions are compatible +*/ +bool isCompatibleVersion(int fileversionpart1, int fileversionpart2, int fileversionpart3, int lastcompatiblepart1, int lastcompatiblepart2, int lastcompatiblepart3); + + +/** + \brief Fix the name of a multiply charged ion in MS mode. + \param str original ion name + \param sourcecharge source charge + \param targetcharge target charge + \retval string fixed name +*/ +string fixLabelCharge(string& str, int sourcecharge, int targetcharge); + + #endif diff --git a/CycloBranch/docs/cyclobranch_2_bib.txt b/CycloBranch/docs/cyclobranch_2_bib.txt new file mode 100644 index 0000000..34e9dfa --- /dev/null +++ b/CycloBranch/docs/cyclobranch_2_bib.txt @@ -0,0 +1,10 @@ +@ARTICLE{CycloBranch-2-AC-2020, +author={Novak, Jiri and Skriba, Anton and Havlicek, Vladimir}, +title={CycloBranch 2: Molecular Formula Annotations Applied to imzML Data Sets in Bimodal Fusion and LC-MS Data Files}, +journal={Anal. Chem.}, +volume={92}, +number={10}, +year={2020}, +pages={6844--6849}, +doi={10.1021/acs.analchem.0c00170} +} diff --git a/CycloBranch/docs/cyclobranch_2_ris.txt b/CycloBranch/docs/cyclobranch_2_ris.txt new file mode 100644 index 0000000..0247698 --- /dev/null +++ b/CycloBranch/docs/cyclobranch_2_ris.txt @@ -0,0 +1,14 @@ +TY - JOUR +TI - CycloBranch 2: Molecular Formula Annotations Applied to imzML Data Sets in Bimodal Fusion and LC-MS Data Files +T2 - Anal. Chem. +VL - 92 +IS - 10 +SP - 6844-6849 +PY - 2020 +AU - Novak,Jiri +AU - Skriba,Anton +AU - Havlicek,Vladimir +N1 - +DB - +DO - 10.1021/acs.analchem.0c00170 +ER - diff --git a/CycloBranch/gui/cAboutWidget.cpp b/CycloBranch/gui/cAboutWidget.cpp index 9a16f13..66925af 100644 --- a/CycloBranch/gui/cAboutWidget.cpp +++ b/CycloBranch/gui/cAboutWidget.cpp @@ -16,12 +16,22 @@ cAboutWidget::cAboutWidget(QWidget* parent) { layout = new QVBoxLayout(); + QString splash = "



"; + QString homepage = "https://ms.biomed.cas.cz/cyclobranch/
https://github.com/novak-jiri/cyclobranch/

"; - QString citations = "Any work based on CycloBranch shall cite any of the following references:

"; + QString citations = "If you use CycloBranch in your work, please cite us using:

"; + + citations += "Jiri Novak, Anton Skriba, Vladimir Havlicek:
"; + citations += "CycloBranch 2: Molecular Formula Annotations Applied to imzML Data Sets in Bimodal Fusion and LC-MS Data Files,
"; + citations += "Anal. Chem., vol. 92, no. 10, pp. 6844-6849, 2020. DOI: 10.1021/acs.analchem.0c00170.
"; + citations += "Download citation: [ ris ], [ bib ]

"; + + citations += "Other publications to cite:

"; + citations += "Jiri Novak, Karel Lemr, Kevin A. Schug, Vladimir Havlicek:
"; citations += "CycloBranch: De Novo Sequencing of Nonribosomal Peptides from Accurate Product Ion Mass Spectra,
"; - citations += "J. Am. Soc. Mass Spectrom., vol. 26, no. 10, pp. 1780-1786, 2015. DOI: 10.1007/s13361-015-1211-1.
"; + citations += "J. Am. Soc. Mass Spectrom., vol. 26, no. 10, pp. 1780-1786, 2015. DOI: 10.1007/s13361-015-1211-1.
"; citations += "Download citation: [ ris ], [ bib ]

"; citations += "Jiri Novak, Lucie Sokolova, Karel Lemr, Tomas Pluhacek, Andrea Palyzova, Vladimir Havlicek:
"; @@ -34,13 +44,11 @@ cAboutWidget::cAboutWidget(QWidget* parent) { citations += "J. Mass Spectrom., vol. 53, no. 11, pp. 1097-1103, 2018. DOI: 10.1002/jms.4285.
"; citations += "Download citation: [ ris ], [ bib ]


"; - QString licence = "Licence:

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

"; - 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 - 2020


"; + 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 - 2022


"; - QString splash = "



"; + QString license = "License:

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

"; + license += "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.

"; + license += "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 acknowledgement = "Acknowledgements:

This application uses Qt library under LGPLv3 license. Thanks to Aha-soft and Icons8 for icons.


"; @@ -48,7 +56,7 @@ cAboutWidget::cAboutWidget(QWidget* parent) { message->setReadOnly(true); message->setAcceptRichText(true); message->setOpenExternalLinks(true); - message->setHtml("
" + splash + "" + appname + " " + appversion + "

" + homepage + citations + developers + licence + acknowledgement); + message->setHtml("
" + splash + "" + appname + " " + appversion + "

" + homepage + citations + developers + license + acknowledgement); buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok); //buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); diff --git a/CycloBranch/gui/cAboutWidget.h b/CycloBranch/gui/cAboutWidget.h index e8ef446..4b9edf6 100644 --- a/CycloBranch/gui/cAboutWidget.h +++ b/CycloBranch/gui/cAboutWidget.h @@ -8,6 +8,7 @@ #define _CABOUTWIDGET_H #include +#include // forward declaration diff --git a/CycloBranch/gui/cBricksDatabaseWidget.cpp b/CycloBranch/gui/cBricksDatabaseWidget.cpp index af3fa41..b428c4b 100644 --- a/CycloBranch/gui/cBricksDatabaseWidget.cpp +++ b/CycloBranch/gui/cBricksDatabaseWidget.cpp @@ -15,6 +15,8 @@ #include #include #include +#include +#include int numberOfOccurrences(const string& s, char c) { @@ -475,6 +477,34 @@ void cBricksDatabaseWidget::keyPressEvent(QKeyEvent *event) { rowsfilterwholeword->setChecked(!rowsfilterwholeword->isChecked()); } + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C)) { + QModelIndexList selectedindexes = database->selectionModel()->selectedIndexes(); + QStandardItem* item; + + QString selectedtext; + string itemtext; + + int selectedcount = selectedindexes.count(); + for (int i = 0; i < selectedcount; i++) { + if (i > 0) { + if (proxymodel->mapToSource(selectedindexes[i - 1]).row() != proxymodel->mapToSource(selectedindexes[i]).row()) { + selectedtext += "\n"; + } + else { + selectedtext += "\t"; + } + } + + item = databasemodel->itemFromIndex(proxymodel->mapToSource(selectedindexes[i])); + if (item) { + itemtext = item->text().toStdString(); + selectedtext += stripHTML(itemtext).c_str(); + } + } + selectedtext += "\n"; + QApplication::clipboard()->setText(selectedtext); + } + event->accept(); } @@ -527,6 +557,7 @@ void cBricksDatabaseWidget::openDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); database->setModel(0); proxymodel->setSourceModel(0); @@ -620,6 +651,7 @@ bool cBricksDatabaseWidget::saveDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); cBrick b; bricks.clear(); @@ -855,6 +887,7 @@ void cBricksDatabaseWidget::importDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); database->setModel(0); proxymodel->setSourceModel(0); diff --git a/CycloBranch/gui/cCalibrationChart.cpp b/CycloBranch/gui/cCalibrationChart.cpp new file mode 100644 index 0000000..9ebc477 --- /dev/null +++ b/CycloBranch/gui/cCalibrationChart.cpp @@ -0,0 +1,581 @@ +#include "gui/cCalibrationChart.h" + +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +cCalibrationChart::cCalibrationChart(cGlobalPreferences* globalpreferences, QWidget *parent) { + this->parent = parent; + this->globalpreferences = globalpreferences; + + setWindowTitle("Calibration Curve"); + setWindowIcon(QIcon(":/images/icons/features.png")); + + vsplitter = new QSplitter(); + vsplitter->setOrientation(Qt::Vertical); + + chartscene = new cCalibrationChartScene(this); + + menuBar = new QMenuBar(this); + menuBar->setNativeMenuBar(false); + menuFile = new QMenu(tr("&File"), this); + menuView = new QMenu(tr("&View"), this); + menuHelp = new QMenu(tr("&Help"), this); + + toolbarFile = addToolBar(tr("File")); + + 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); + connect(actionExportCSV, SIGNAL(triggered()), this, SLOT(exportToCsv())); + + actionExportSpectrum = new QAction(QIcon(":/images/icons/66.png"), tr("Export Ima&ge"), this); + actionExportSpectrum->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_G)); + actionExportSpectrum->setToolTip("Export Image (Ctrl + G)"); + toolbarFile->addAction(actionExportSpectrum); + connect(actionExportSpectrum, SIGNAL(triggered()), this, SLOT(exportScene())); + + actionCloseWindow = new QAction(QIcon(":/images/icons/33.png"), tr("&Close"), this); + actionCloseWindow->setShortcut(QKeySequence(Qt::Key_Escape)); + actionCloseWindow->setToolTip("Close (Esc)"); + toolbarFile->addAction(actionCloseWindow); + connect(actionCloseWindow, SIGNAL(triggered()), this, SLOT(closeWindow())); + + toolbarView = addToolBar(tr("View")); + + actionZoomIn = new QAction(QIcon(":/images/icons/83.png"), tr("Zoom &In"), this); + actionZoomIn->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Plus)); + actionZoomIn->setToolTip("Zoom In (Ctrl +)"); + toolbarView->addAction(actionZoomIn); + connect(actionZoomIn, SIGNAL(triggered()), chartscene, SLOT(zoomIn())); + + actionZoomOut = new QAction(QIcon(":/images/icons/82.png"), tr("Zoom &Out"), this); + actionZoomOut->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Minus)); + actionZoomOut->setToolTip("Zoom Out (Ctrl -)"); + toolbarView->addAction(actionZoomOut); + connect(actionZoomOut, SIGNAL(triggered()), chartscene, SLOT(zoomOut())); + + actionZoomReset = new QAction(QIcon(":/images/icons/84.png"), tr("&Reset Zoom"), this); + actionZoomReset->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R)); + actionZoomReset->setToolTip("Zoom Reset (Ctrl + R)"); + toolbarView->addAction(actionZoomReset); + connect(actionZoomReset, SIGNAL(triggered()), chartscene, SLOT(normalSize())); + + toolbarView->addSeparator(); + + 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)), this, SLOT(hideLabels(bool))); + + toolbarHelp = addToolBar(tr("Help")); + + actionHTMLDocumentation = new QAction(QIcon(":/images/icons/3.png"), tr("&HTML Documentation"), this); + actionHTMLDocumentation->setShortcut(QKeySequence(Qt::Key_F1)); + actionHTMLDocumentation->setToolTip("Show HTML Documentation (F1)"); + toolbarHelp->addAction(actionHTMLDocumentation); + connect(actionHTMLDocumentation, SIGNAL(triggered()), this, SLOT(showHTMLDocumentation())); + + labelconcentration = new QLabel(tr("Concentration: ")); + + minconcentration = new QDoubleSpinBox(); + minconcentration->setDecimals(6); + minconcentration->setRange(0, 1000000); + minconcentration->setSingleStep(1); + + labelseparator = new QLabel(tr("-")); + + maxconcentration = new QDoubleSpinBox(); + maxconcentration->setDecimals(6); + maxconcentration->setRange(0, 1000000); + maxconcentration->setSingleStep(1); + + setconcentrationinterval = new QPushButton("Set"); + setconcentrationinterval->setMinimumWidth(75); + connect(setconcentrationinterval, SIGNAL(released()), this, SLOT(setConcentrationInterval())); + connect(this, SIGNAL(emitConcentrationInterval(double, double)), chartscene, SLOT(setConcentrationInterval(double, double))); + + resetconcentrationinterval = new QPushButton("Reset"); + resetconcentrationinterval->setMinimumWidth(75); + connect(resetconcentrationinterval, SIGNAL(released()), chartscene, SLOT(resetConcentrationInterval())); + connect(chartscene, SIGNAL(updateConcentrationInterval(double, double)), this, SLOT(updateConcentrationInterval(double, double))); + + hboxconcentration = new QHBoxLayout(); + hboxconcentration->addWidget(labelconcentration); + hboxconcentration->addWidget(minconcentration); + hboxconcentration->addWidget(labelseparator); + hboxconcentration->addWidget(maxconcentration); + hboxconcentration->addSpacing(5); + hboxconcentration->addWidget(setconcentrationinterval); + hboxconcentration->addSpacing(5); + hboxconcentration->addWidget(resetconcentrationinterval); + + widgetconcentration = new QWidget(); + widgetconcentration->setLayout(hboxconcentration); + + toolbarConcentration = addToolBar(tr("Concentration")); + + //actionMouseConcentrationSelection = new QAction(QIcon(":/images/icons/64.png"), tr("Mouse Concentration Selection Tool"), this); + //actionMouseConcentrationSelection->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_T)); + //actionMouseConcentrationSelection->setToolTip("Mouse Concentration Selection Tool (Ctrl + T)"); + //actionMouseConcentrationSelection->setCheckable(true); + //actionMouseConcentrationSelection->setChecked(true); + //actionMouseConcentrationSelection->setEnabled(true); + //toolbarConcentration->addAction(actionMouseConcentrationSelection); + //connect(actionMouseConcentrationSelection, SIGNAL(toggled(bool)), chartscene, SLOT(enableMouseConcentrationSelectionTool(bool))); + + toolbarConcentration->addWidget(widgetconcentration); + + database = new QTableView(this); + databasemodel = new QStandardItemModel(0, 0, this); + proxymodel = new cCalibrationChartProxyModel(this); + proxymodel->setSourceModel(databasemodel); + proxymodel->setDynamicSortFilter(false); + database->setModel(proxymodel); + database->setSortingEnabled(true); + database->setSelectionBehavior(QAbstractItemView::SelectItems); + database->setSelectionMode(QAbstractItemView::ContiguousSelection); + database->setEditTriggers(QAbstractItemView::NoEditTriggers); + database->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); + database->horizontalHeader()->setSectionsMovable(true); + //database->verticalHeader()->setDefaultSectionSize(30); + + QList sizes; + sizes.push_back(400); + sizes.push_back(200); + + vsplitter->addWidget(chartscene); + vsplitter->addWidget(database); + + vsplitter->setSizes(sizes); + + setCentralWidget(vsplitter); + //centralWidget()->setContentsMargins(5, 5, 5, 5); + + menuFile->addAction(actionExportCSV); + menuFile->addAction(actionExportSpectrum); + menuFile->addSeparator(); + menuFile->addAction(actionCloseWindow); + + menuView->addAction(actionZoomIn); + menuView->addAction(actionZoomOut); + menuView->addAction(actionZoomReset); + menuView->addSeparator(); + menuView->addAction(actionHideLabels); + + menuHelp->addAction(actionHTMLDocumentation); + + menuBar->addMenu(menuFile); + menuBar->addMenu(menuView); + menuBar->addMenu(menuHelp); + + setMenuBar(menuBar); + + resize(750, defaultwinsizey); + + //applyGlobalPreferences(globalpreferences); +} + + +cCalibrationChart::~cCalibrationChart() { + delete labelconcentration; + delete minconcentration; + delete labelseparator; + delete maxconcentration; + delete setconcentrationinterval; + delete resetconcentrationinterval; + delete hboxconcentration; + delete widgetconcentration; + + delete chartscene; + + delete databasemodel; + delete proxymodel; + delete database; + + delete vsplitter; + + delete actionExportCSV; + delete actionExportSpectrum; + delete actionCloseWindow; + delete actionZoomIn; + delete actionZoomOut; + delete actionZoomReset; + delete actionHideLabels; + //delete actionMouseConcentrationSelection; + delete actionHTMLDocumentation; + + delete menuFile; + delete menuView; + delete menuHelp; + + delete menuBar; +} + + +void cCalibrationChart::closeEvent(QCloseEvent *event) { + hide(); + event->accept(); +} + + +void cCalibrationChart::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if (lastdirexporttocsv.right(4).compare(".csv", Qt::CaseInsensitive) != 0) { + lastdirexporttocsv = globalpreferences->exportcsvdefaultdir; + } + } +} + + +void cCalibrationChart::setLineParameters(int equationtype, double a, double b, vector xvalues, vector yvalues, vector sd) { + if (chartscene) { + chartscene->setLineParameters(equationtype, a, b, xvalues, yvalues, sd); + } + + deleteTable(); +} + + +void cCalibrationChart::setData(vector xvalues, vector yvalues, vector sd, vector datagroups) { + if (chartscene) { + chartscene->setData(xvalues, yvalues, sd, datagroups); + } +} + + +void cCalibrationChart::createTable(double a, double b, vector& calibrationxvalues, vector& calibrationyvalues, vector& calibrationsd, vector& datagroups, vector& dataxvalues, vector& datayvalues, vector& datasd) { + int currentrow = 0; + int currentcolumn = 0; + size_t size; + string s; + double value; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Data Point"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Total (x-axis)"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Std. Dev. (x-axis)"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Total (y-axis)"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Std. Dev. (y-axis)"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + size = calibrationxvalues.size(); + for (size_t i = 0; i < size; i++) { + currentrow = databasemodel->rowCount(); + databasemodel->insertRow(currentrow); + + currentcolumn = 0; + + s = "Calib. "; + s += to_string(calibrationxvalues[i]); + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setText(s.c_str()); + currentcolumn++; + + if (a != 0) { + value = (calibrationyvalues[i] - b) / a; + } + else { + value = 0; + } + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + if (a != 0) { + value = (calibrationsd[i] - b) / a; + } + else { + value = 0; + } + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + value = calibrationyvalues[i]; + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + value = calibrationsd[i]; + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + } + + size = dataxvalues.size(); + for (size_t i = 0; i < size; i++) { + currentrow = databasemodel->rowCount(); + databasemodel->insertRow(currentrow); + + currentcolumn = 0; + + s = "Group "; + s += to_string(datagroups[i]); + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setText(s.c_str()); + currentcolumn++; + + value = dataxvalues[i]; + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + if (a != 0) { + value = (datasd[i] - b) / a; + } + else { + value = 0; + } + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + value = datayvalues[i]; + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + value = datasd[i]; + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + } + + for (int i = 0; i < databasemodel->columnCount(); i++) { + database->resizeColumnToContents(i); + } +} + + +void cCalibrationChart::deleteTable() { + for (int i = 0; i < databasemodel->columnCount(); i++) { + if (database->itemDelegateForColumn(i)) { + delete database->itemDelegateForColumn(i); + } + } + databasemodel->clear(); +} + + +void cCalibrationChart::keyPressEvent(QKeyEvent *event) { + if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { + if (minconcentration->hasFocus() || maxconcentration->hasFocus() || setconcentrationinterval->hasFocus()) { + setConcentrationInterval(); + } + } + + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C)) { + QModelIndexList selectedindexes = database->selectionModel()->selectedIndexes(); + QStandardItem* item; + + QString selectedtext; + string itemtext; + + int selectedcount = selectedindexes.count(); + for (int i = 0; i < selectedcount; i++) { + if (i > 0) { + if (proxymodel->mapToSource(selectedindexes[i - 1]).row() != proxymodel->mapToSource(selectedindexes[i]).row()) { + selectedtext += "\n"; + } + else { + selectedtext += "\t"; + } + } + + item = databasemodel->itemFromIndex(proxymodel->mapToSource(selectedindexes[i])); + if (item) { + itemtext = item->text().toStdString(); + selectedtext += stripHTML(itemtext).c_str(); + } + } + selectedtext += "\n"; + QApplication::clipboard()->setText(selectedtext); + } + + event->accept(); +} + + +void cCalibrationChart::exportToCsv() { + QString filename = QFileDialog::getSaveFileName(this, tr("Export to CSV"), lastdirexporttocsv, tr("Files (*.csv)")); + + if (!filename.isEmpty()) { + lastdirexporttocsv = filename; + + QProgressDialog progress("Exporting CSV file...", "Cancel", 0, proxymodel->rowCount(), this); + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + + bool removefile = false; + QFile file(filename); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + return; + } + + QTextStream out(&file); + + for (int i = 0; i < databasemodel->columnCount(); i++) { + out << "\"" << databasemodel->horizontalHeaderItem(i)->text() << "\""; + if (i < databasemodel->columnCount() - 1) { + out << ","; + } + } + out << endl; + + QStandardItem* item; + string str; + for (int i = 0; i < proxymodel->rowCount(); i++) { + + for (int j = 0; j < databasemodel->columnCount(); j++) { + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, j))); + if (item) { + str = item->data(Qt::DisplayRole).toString().toStdString(); + out << "\"" << stripHTML(str).c_str() << "\""; + if (j < databasemodel->columnCount() - 1) { + out << ","; + } + } + else { + if (j < databasemodel->columnCount() - 1) { + out << ","; + } + } + } + out << endl; + + progress.setValue(i); + if (progress.wasCanceled()) { + removefile = true; + break; + } + + } + + file.close(); + + if (removefile) { + file.remove(); + } + + progress.setValue(proxymodel->rowCount()); + } +} + + +void cCalibrationChart::updateConcentrationInterval(double minconcentration, double maxconcentration) { + this->minconcentration->setValue(minconcentration); + this->maxconcentration->setValue(maxconcentration); +} + + +void cCalibrationChart::setConcentrationInterval() { + emit emitConcentrationInterval(minconcentration->value(), maxconcentration->value()); +} + + +void cCalibrationChart::exportScene() { + QString currentdir = "./"; + if (globalpreferences) { + currentdir = globalpreferences->exportimagedefaultdir; + } + + #if OS_TYPE == WIN + QString filename = QFileDialog::getSaveFileName(this, tr("Export Image..."), currentdir, "PDF Files (*.pdf);; PS Files (*.ps);; PNG Files (*.png);; SVG Files (*.svg)"); + #else + QString filename = QFileDialog::getSaveFileName(this, tr("Export Image..."), currentdir, "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); + #endif + if (!filename.isEmpty()) { + regex rx; + bool selected = false; + + rx = ".+\\.pdf$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + chartscene->exportToPDF(filename, false); + selected = true; + } + + #if OS_TYPE == WIN + rx = ".+\\.ps$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + chartscene->exportToPDF(filename, true); + selected = true; + } + #endif + + rx = ".+\\.png$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + chartscene->exportToPNG(filename); + selected = true; + } + + rx = ".+\\.svg$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + chartscene->exportToSVG(filename); + selected = true; + } + + if (!selected) { + QMessageBox msgBox; + QString errstr = "Unsupported file format."; + msgBox.setText(errstr); + msgBox.exec(); + } + } +} + + +void cCalibrationChart::hideLabels(bool state) { + chartscene->hideLabels(state); +} + + +void cCalibrationChart::showHTMLDocumentation() { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/annotatedfeatures.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/annotatedfeatures.html").absoluteFilePath())); + #endif +} + + +void cCalibrationChart::closeWindow() { + hide(); +} + diff --git a/CycloBranch/gui/cCalibrationChart.h b/CycloBranch/gui/cCalibrationChart.h new file mode 100644 index 0000000..fa91abb --- /dev/null +++ b/CycloBranch/gui/cCalibrationChart.h @@ -0,0 +1,212 @@ +/** + \file cCalibrationChart.h + \brief Calibration chart. +*/ + + +#ifndef _CCALIBRATIONCHART_H +#define _CCALIBRATIONCHART_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core/cGlobalPreferences.h" +#include "gui/cCalibrationChartScene.h" +#include "gui/cEventFilter.h" +#include "gui/cCalibrationChartProxyModel.h" + + +// forward declaration +class QHBoxLayout; +//class QVBoxLayout; +class QPushButton; +class QSplitter; +class QDoubleSpinBox; +class QAction; +class QLabel; +class QTableView; + + +/** + \brief Calibration chart. +*/ +class cCalibrationChart : public QMainWindow +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + cCalibrationChart(cGlobalPreferences* globalpreferences, QWidget *parent); + + + /** + \brief The destructor. + */ + ~cCalibrationChart(); + + + /** + \brief Handle the window close event. + \param event pointer to QCloseEvent + */ + void closeEvent(QCloseEvent *event); + + + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + + /** + \brief Set parameters of calibration curve. + \param equationtype 0 (y = a*x), 1 (y = a*x + b), 2 (manual mode) + \param a a + \param b b + \param xvalues x coordinates of points + \param yvalues y coordinates of points + \param sd standard deviation of y-values + */ + void setLineParameters(int equationtype, double a, double b, vector xvalues, vector yvalues, vector sd); + + + /** + \brief Set data points. + \param xvalues x coordinates of points + \param yvalues y coordinates of points + \param sd standard deviation of y-values + \param datagroups vector of group ids + */ + void setData(vector xvalues, vector yvalues, vector sd, vector datagroups); + + + /** + \brief Create the table content. + \param a a + \param b b + \param calibrationxvalues x coordinates of calibration points + \param calibrationyvalues y coordinates of calibration points + \param calibrationsd standard deviation of y-values of calibration points + \param datagroups ids of groups of data points + \param dataxvalues x coordinates of data points + \param datayvalues y coordinates of data points + \param datasd standard deviation of y-values of data points + */ + void createTable(double a, double b, vector& calibrationxvalues, vector& calibrationyvalues, vector& calibrationsd, vector& datagroups, vector& dataxvalues, vector& datayvalues, vector& datasd); + + + /** + \brief Delete the table content. + */ + void deleteTable(); + + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + void keyPressEvent(QKeyEvent *event); + + +private: + + cGlobalPreferences* globalpreferences; + QWidget* parent; + + QMenuBar* menuBar; + QMenu* menuFile; + QMenu* menuView; + QMenu* menuHelp; + + QToolBar* toolbarFile; + QToolBar* toolbarView; + QToolBar* toolbarHelp; + QToolBar* toolbarConcentration; + + QAction* actionExportCSV; + QAction* actionExportSpectrum; + QAction* actionCloseWindow; + QAction* actionZoomIn; + QAction* actionZoomOut; + QAction* actionZoomReset; + QAction* actionHideLabels; + //QAction* actionMouseConcentrationSelection; + QAction* actionHTMLDocumentation; + + QWidget* widgetconcentration; + QHBoxLayout* hboxconcentration; + QLabel* labelconcentration; + QDoubleSpinBox* minconcentration; + QLabel* labelseparator; + QDoubleSpinBox* maxconcentration; + QPushButton* setconcentrationinterval; + QPushButton* resetconcentrationinterval; + + cCalibrationChartScene* chartscene; + + QTableView* database; + QStandardItemModel* databasemodel; + cCalibrationChartProxyModel* proxymodel; + + QSplitter* vsplitter; + + QString lastdirexporttocsv; + +signals: + + + /** + \brief The signal is emitted when the range of concentration is changed. + \param minconcentration a minimum threshold of concentration + \param maxconcentration a maximum threshold of concentration + */ + void emitConcentrationInterval(double minconcentration, double maxconcentration); + + +private slots: + + + void exportToCsv(); + + + void updateConcentrationInterval(double minconcentration, double maxconcentration); + + + void setConcentrationInterval(); + + + void exportScene(); + + + void hideLabels(bool state); + + + void showHTMLDocumentation(); + + + void closeWindow(); + +}; + +#endif + diff --git a/CycloBranch/gui/cCalibrationChartProxyModel.cpp b/CycloBranch/gui/cCalibrationChartProxyModel.cpp new file mode 100644 index 0000000..d3c8ab4 --- /dev/null +++ b/CycloBranch/gui/cCalibrationChartProxyModel.cpp @@ -0,0 +1,35 @@ +#include "gui/cCalibrationChartProxyModel.h" + + +cCalibrationChartProxyModel::cCalibrationChartProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { + // nothing to do +} + + +bool cCalibrationChartProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { + QVariant leftData = sourceModel()->data(left); + QVariant rightData = sourceModel()->data(right); + + if (leftData.toString().isEmpty()) { + return (sortOrder() == Qt::AscendingOrder) ? false : true; + } + + if (rightData.toString().isEmpty()) { + return (sortOrder() == Qt::AscendingOrder) ? true : false; + } + + if (leftData.type() == QVariant::ByteArray) { + return leftData.toDouble() < rightData.toDouble(); + } + + if (leftData.type() == QVariant::String) { + return leftData.toString().toLower() < rightData.toString().toLower(); + } + + if (leftData.type() == QVariant::Int) { + return leftData.toInt() < rightData.toInt(); + } + + return QSortFilterProxyModel::lessThan(left, right); +} + diff --git a/CycloBranch/gui/cCalibrationChartProxyModel.h b/CycloBranch/gui/cCalibrationChartProxyModel.h new file mode 100644 index 0000000..43d4122 --- /dev/null +++ b/CycloBranch/gui/cCalibrationChartProxyModel.h @@ -0,0 +1,47 @@ +/** + \file cCalibrationChartProxyModel.h + \brief A table proxy model. +*/ + + +#ifndef _CCALIBRATIONCHARTPROXYMODEL_H +#define _CCALIBRATIONCHARTPROXYMODEL_H + +#include +#include +#include +#include +#include +#include "core/cParameters.h" + + +/** + \brief A table proxy model. +*/ +class cCalibrationChartProxyModel : public QSortFilterProxyModel { + + Q_OBJECT + +public: + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + cCalibrationChartProxyModel(QObject *parent = 0); + +protected: + + /** + \brief Reimplementation of lessThan. + \param left QModelIndex + \param right QModelIndex + \retval bool bool + */ + bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; + +}; + + +#endif + diff --git a/CycloBranch/gui/cCalibrationChartScene.cpp b/CycloBranch/gui/cCalibrationChartScene.cpp new file mode 100644 index 0000000..7d4be0c --- /dev/null +++ b/CycloBranch/gui/cCalibrationChartScene.cpp @@ -0,0 +1,958 @@ +#include "gui/cCalibrationChartScene.h" + +//#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include + + +double calculateR2Value(double a, double b, vector xvalues, vector yvalues) { + if (xvalues.empty() || yvalues.empty()) { + return 0; + } + + double avg = 0; + for (int i = 0; i < (int)yvalues.size(); i++) { + avg += yvalues[i]; + } + avg /= (double)(yvalues.size()); + + double sqsumres = 0; + double sqsumtot = 0; + double tmpval; + + for (int i = 0; i < (int)yvalues.size(); i++) { + tmpval = a * xvalues[i] + b; + tmpval = tmpval - yvalues[i]; + sqsumres += tmpval * tmpval; + + tmpval = yvalues[i] - avg; + sqsumtot += tmpval * tmpval; + } + + return 1.0 - sqsumres / sqsumtot; +} + + +double calculateLOD(double a, vector xvalues, vector yvalues) { + if ((a == 0) || (xvalues.size() < 3) || (xvalues.size() != yvalues.size())) { + return 0; + } + + double slope = a; + double stddevy = 0; + + int size = (int)xvalues.size(); + + double avgx = 0; + double avgy = 0; + + for (int i = 0; i < size; i++) { + avgx += xvalues[i]; + avgy += yvalues[i]; + } + avgx /= (double)(size); + avgy /= (double)(size); + + double part1 = 0; + double part2 = 0; + double part3 = 0; + double xdiff; + double ydiff; + + for (int i = 0; i < size; i++) { + xdiff = xvalues[i] - avgx; + ydiff = yvalues[i] - avgy; + + part1 += ydiff * ydiff; + part2 += xdiff * ydiff; + part3 += xdiff * xdiff; + } + + stddevy = sqrt(1.0 / ((double)(size - 2)) * (part1 - part2 * part2 / part3)); + + return max(0.0, 3.3 * stddevy / slope); +} + + +double calculateLOQ(double a, vector xvalues, vector yvalues) { + return 10.0 / 3.3 * calculateLOD(a, xvalues, yvalues); +} + + +cCalibrationChartScene::cCalibrationChartScene(QWidget* parent) { + this->parent = parent; + origwidth = 0; + origheight = 0; + calledbyresizeevent = false; + oldwidth.clear(); + oldheight.clear(); + currentscale = 1; + factor = 0.2; + pressedx = -1; + pressedy = -1; + currentx = 0; + currenty = 0; + minconcentration = 0; + maxconcentration = 0; + + topmargin = 0; + bottommargin = 0; + leftmargin = 0; + rightmargin = 0; + + firstshow = true; + enablemouseconcentrationselection = true; + + equationtype = 0; + + a = 1; + b = 0; + + xvalues.clear(); + yvalues.clear(); + + sd.clear(); + + datax.clear(); + datay.clear(); + + datasd.clear(); + datagroups.clear(); + + hidelabels = false; + + scene = new QGraphicsScene(this); + + zoomgroup = new QGraphicsItemGroup(); + zoomrect = new QGraphicsRectItem(); + zoomgroup->addToGroup(zoomrect); + zoomsimpletextitem = new QGraphicsSimpleTextItem(); + zoomgroup->addToGroup(zoomsimpletextitem); + scene->addItem(zoomgroup); + + cursorsimpletextitem = new QGraphicsSimpleTextItem(); + scene->addItem(cursorsimpletextitem); +} + + +cCalibrationChartScene::~cCalibrationChartScene() { + delete scene; +} + + +void cCalibrationChartScene::initialize() { + minconcentration = 0; + maxconcentration = 1000; + emit updateConcentrationInterval(minconcentration, maxconcentration); + + setScene(scene); + + origwidth = viewport()->width() * 4 / 5; + origheight = viewport()->height() * 3 / 5; + + // a visualization fix + origwidth = (origwidth / 10) * 10; + origheight = (origheight / 10) * 10; + + originalmatrix = matrix(); + + datax.clear(); + datay.clear(); + + datasd.clear(); + datagroups.clear(); + + redrawScene(); +} + + +void cCalibrationChartScene::exportToPDF(QString filename, bool postscript) { + QPrinter printer; + if (postscript) { + printer.setPaperSize(QSizeF(scene->width() + 100, scene->height() + 100), QPrinter::DevicePixel); + printer.setPageMargins (50, 50, 50, 50, QPrinter::DevicePixel); + } + else { + printer.setPaperSize(QSizeF(scene->width(), scene->height()), QPrinter::DevicePixel); + printer.setPageMargins (0, 0, 0, 0, QPrinter::DevicePixel); + } + printer.setOutputFormat(QPrinter::NativeFormat); + printer.setOutputFileName(filename); + + QPainter painter; + 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 + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + painter.setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing|QPainter::SmoothPixmapTransform); + scene->render(&painter); + painter.end(); +} + + +void cCalibrationChartScene::exportToSVG(QString filename) { + QSvgGenerator generator; + generator.setFileName(filename); + generator.setSize(QSize(scene->width(), scene->height())); + generator.setViewBox(QRect(0, 0, scene->width(), scene->height())); + + QPainter painter; + if (!painter.begin(&generator)) { + QMessageBox msgBox; + QString errstr = "The file cannot be created."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + painter.fillRect(QRect(0, 0, scene->width(), scene->height()), Qt::white); + scene->render(&painter); + painter.end(); +} + + +void cCalibrationChartScene::exportToPNG(QString filename) { + QImage image(scene->width(), scene->height(), QImage::Format_ARGB32); + image.fill(Qt::white); + + QPainter painter; + if (!painter.begin(&image)) { + QMessageBox msgBox; + QString errstr = "The file cannot be created."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + scene->render(&painter); + painter.end(); + image.save(filename); +} + + +void cCalibrationChartScene::hideLabels(bool state) { + hidelabels = state; + redrawScene(); +} + + +void cCalibrationChartScene::setLineParameters(int equationtype, double a, double b, vector xvalues, vector yvalues, vector sd) { + this->equationtype = equationtype; + + this->a = a; + this->b = b; + + this->xvalues = xvalues; + this->yvalues = yvalues; + + this->sd = sd; + + initialize(); +} + + +void cCalibrationChartScene::setData(vector datax, vector datay, vector datasd, vector datagroups) { + this->datax = datax; + this->datay = datay; + + this->datasd = datasd; + this->datagroups = datagroups; + + redrawScene(); +} + + +void cCalibrationChartScene::wheelEvent(QWheelEvent *event) { + double part, newmin, newmax; + + if (event->delta() > 0) { + part = fabs(maxconcentration - minconcentration) / 10.0; + newmin = minconcentration + part; + newmax = maxconcentration - part; + } + else { + part = fabs(maxconcentration - minconcentration) / 8.0; + newmin = max(minconcentration - part, 0.0); + newmax = min(maxconcentration + part, 1000000.0); + } + + if (newmin < newmax) { + minconcentration = newmin; + maxconcentration = newmax; + emit updateConcentrationInterval(minconcentration, maxconcentration); + redrawScene(); + viewport()->update(); + } + + event->accept(); +} + + +void cCalibrationChartScene::mouseMoveEvent(QMouseEvent *event) { + QGraphicsView::mouseMoveEvent(event); + + QPointF p = mapToScene(event->x(), event->y()); + + QPointF curpos; + curpos.setX(p.x() + 15); + curpos.setY(p.y() - 2); + + double concentration = getConcentrationFromXPosition((int)p.x(), origwidth); + double intensity = getIntensityFromYPosition((int)p.y(), origheight); + QString curtext = "x: " + QString::number(concentration) + ", y: " + QString::number(intensity); + + cursorsimpletextitem->setPos(curpos); + cursorsimpletextitem->setText(curtext); + + if ((pressedx != -1) && (pressedy != -1)) { + cursorsimpletextitem->setVisible(false); + + currentx = (int)p.x(); + currenty = (int)p.y(); + + if (enablemouseconcentrationselection) { + updateZoomGroup(); + } + else { + calculateMinMaxConcentration(); + + emit updateConcentrationInterval(minconcentration, maxconcentration); + + pressedx = currentx; + pressedy = currenty; + + redrawScene(); + } + } + else { + if (((int)p.x() >= leftmargin) && ((int)p.x() <= origwidth - rightmargin) && ((int)p.y() >= topmargin) && ((int)p.y() <= origheight - bottommargin)) { + cursorsimpletextitem->setVisible(true); + } + else { + cursorsimpletextitem->setVisible(false); + } + } + + event->accept(); +} + + +void cCalibrationChartScene::mouseReleaseEvent(QMouseEvent *event) { + QGraphicsView::mouseReleaseEvent(event); + + if (pressedx == currentx) { + pressedx = -1; + currentx = -1; + + redrawScene(); + } + + if ((event->button() == Qt::LeftButton) && (pressedx != -1) && (pressedy != -1)) { + calculateMinMaxConcentration(); + + emit updateConcentrationInterval(minconcentration, maxconcentration); + + pressedx = -1; + pressedy = -1; + + redrawScene(); + } + + QPointF p = mapToScene(event->x(), event->y()); + + QPointF curpos; + curpos.setX(p.x() + 15); + curpos.setY(p.y() - 2); + + double concentration = getConcentrationFromXPosition((int)p.x(), origwidth); + double intensity = getIntensityFromYPosition((int)p.y(), origheight); + QString curtext = "x: " + QString::number(concentration) + ", y: " + QString::number(intensity); + + cursorsimpletextitem->setPos(curpos); + cursorsimpletextitem->setText(curtext); + + if (((int)p.x() >= leftmargin) && ((int)p.x() <= origwidth - rightmargin) && ((int)p.y() >= topmargin) && ((int)p.y() <= origheight - bottommargin)) { + cursorsimpletextitem->setVisible(true); + } + else { + cursorsimpletextitem->setVisible(false); + } + + event->accept(); +} + + +void cCalibrationChartScene::mousePressEvent(QMouseEvent *event) { + QGraphicsView::mousePressEvent(event); + + cursorsimpletextitem->setVisible(false); + + if (event->button() == Qt::LeftButton) { + QPointF p = mapToScene(event->x(), event->y()); + pressedx = (int)p.x(); + pressedy = (int)p.y(); + + currentx = pressedx; + currenty = pressedy; + + if (enablemouseconcentrationselection) { + updateZoomGroup(); + } + } + + if (event->button() == Qt::RightButton) { + pressedx = -1; + pressedy = -1; + + redrawScene(); + } + + //if (enablemouseconcentrationselection) { + if (event->button() == Qt::MiddleButton) { + pressedx = -1; + pressedy = -1; + + resetConcentrationInterval(); + + redrawScene(); + } + //} + + event->accept(); +} + + +void cCalibrationChartScene::showEvent(QShowEvent *event) { + QGraphicsView::showEvent(event); + + if (firstshow) { + normalSize(); + firstshow = false; + } +} + + +void cCalibrationChartScene::resizeEvent(QResizeEvent *event) { + QGraphicsView::resizeEvent(event); + + origwidth = viewport()->width() * 4 / 5; + origheight = viewport()->height() * 3 / 5; + + // a visualization fix + origwidth = (origwidth / 10) * 10; + origheight = (origheight / 10) * 10; + + calledbyresizeevent = true; + + redrawScene(); +} + + +double cCalibrationChartScene::getConcentrationFromXPosition(int x, int w) { + double concentration = (double)(x - leftmargin) / (double)(w - leftmargin - rightmargin) * (maxconcentration - minconcentration) + minconcentration; + return max(0.0, concentration); +} + + +int cCalibrationChartScene::getXPositionFromConcentration(double concentration, int w) { + double val = concentration - minconcentration; + val /= maxconcentration - minconcentration; + val *= double(w - leftmargin - rightmargin); + return (int)val + leftmargin; +} + + +double cCalibrationChartScene::getIntensityFromYPosition(int y, int h) { + double maximumintensity = getMaximumIntensity(); + double intensity = (double)(y - topmargin) / (double)(h - topmargin - bottommargin) * maximumintensity; + intensity = maximumintensity - intensity; + return max(0.0, intensity); +} + + +int cCalibrationChartScene::getYPositionFromIntensity(double intensity, int h) { + double maximumintensity = getMaximumIntensity(); + double val = maximumintensity - intensity; + val /= maximumintensity; + val *= double(h - topmargin - bottommargin); + return max(0, (int)val + topmargin); +} + + +void cCalibrationChartScene::redrawScene() { + QGraphicsSimpleTextItem* simpletext; + QGraphicsTextItem* htmltext; + + QGraphicsLineItem* line; + + int xstep, ystep; + int w = origwidth; + int h = origheight; + int rulergranularity = 10; + + QFont myFont("Arial", 8); + QFontMetrics fm(myFont); + + QList usedtextitems; + + double maxintensity = getMaximumIntensity(); + + scene->removeItem(zoomgroup); + scene->removeItem(cursorsimpletextitem); + + scene->clear(); + + zoomgroup->setVisible(false); + scene->addItem(zoomgroup); + + cursorsimpletextitem->setVisible(false); + scene->addItem(cursorsimpletextitem); + + // bug fix - mouseMoveEvent is not fired if any QGraphicsTextItem is not in the scene + scene->addText(""); + + // x axis + line = scene->addLine(leftmargin, h - bottommargin, w - rightmargin, h - bottommargin, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + // x axis ruler + xstep = (w - leftmargin - rightmargin) / rulergranularity; + for (int i = 0; i < rulergranularity; i++) { + line = scene->addLine(leftmargin + xstep * i, h - bottommargin, leftmargin + xstep * i, h - bottommargin + 10, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + } + line = scene->addLine(w - rightmargin, h - bottommargin, w - rightmargin, h - bottommargin + 10, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + simpletext = scene->addSimpleText(QString::number(minconcentration), myFont); + simpletext->setPos(QPointF(leftmargin - simpletext->boundingRect().width() / 2, h - bottommargin + 12)); + simpletext->setZValue(1); + + if (maxconcentration - minconcentration > 0.01) { + xstep = (w - leftmargin - rightmargin) / rulergranularity; + for (int i = 1; i < rulergranularity; i++) { + simpletext = scene->addSimpleText(QString::number(minconcentration + (maxconcentration - minconcentration) / (double)rulergranularity * (double)i), myFont); + simpletext->setPos(QPointF(leftmargin + xstep * i - simpletext->boundingRect().width() / 2, h - bottommargin + 12)); + simpletext->setZValue(1); + } + } + + simpletext = scene->addSimpleText(QString::number(maxconcentration), myFont); + simpletext->setPos(QPointF(w - rightmargin - simpletext->boundingRect().width() / 2, h - bottommargin + 12)); + simpletext->setZValue(1); + + + // y axis + line = scene->addLine(leftmargin, h - bottommargin, leftmargin, h - bottommargin - std::max(h - topmargin - bottommargin, 0), QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + // y axis ruler + ystep = (h - topmargin - bottommargin) / rulergranularity; + for (int i = 0; i < rulergranularity; i++) { + line = scene->addLine(leftmargin - 10, h - bottommargin - ystep * i, leftmargin, h - bottommargin - ystep * i, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + } + line = scene->addLine(leftmargin - 10, h - bottommargin - std::max(h - topmargin - bottommargin, 0), leftmargin, h - bottommargin - std::max(h - topmargin - bottommargin, 0), QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + simpletext = scene->addSimpleText(QString::number(0), myFont); + simpletext->setPos(QPointF(leftmargin - 15 - simpletext->boundingRect().width(), h - bottommargin - simpletext->boundingRect().height() / 2)); + simpletext->setZValue(1); + + ystep = (h - topmargin - bottommargin) / rulergranularity; + if (maxintensity > 0) { + for (int i = 1; i < rulergranularity; i++) { + simpletext = scene->addSimpleText(QString::number(maxintensity / (double)rulergranularity * (double)i), myFont); + simpletext->setPos(QPointF(leftmargin - 15 - simpletext->boundingRect().width(), h - bottommargin - simpletext->boundingRect().height() / 2 - ystep * i)); + simpletext->setZValue(1); + } + } + + if (maxintensity > 0) { + simpletext = scene->addSimpleText(QString::number(maxintensity), myFont); + simpletext->setPos(QPointF(leftmargin - 15 - simpletext->boundingRect().width(), h - bottommargin - std::max(h - topmargin - bottommargin, 0) - simpletext->boundingRect().height() / 2)); + simpletext->setZValue(1); + } + + QPainterPath rpath; + const int step = 1; + + int xmin = getXPositionFromConcentration(minconcentration, w); + int xmax = getXPositionFromConcentration(maxconcentration, w); + int xval, yval, tmpyval1, tmpyval2; + + for (int i = xmin; i < xmax; i += step) { + yval = getYPositionFromIntensity(a * getConcentrationFromXPosition(i, w) + b, h); + + if (rpath.elementCount() == 0) { + if (yval <= h - bottommargin) { + rpath.moveTo(i, yval); + } + } + else { + if (yval >= topmargin) { + rpath.lineTo(i, yval); + } + } + } + + scene->addPath(rpath, QPen(Qt::red, 2, Qt::SolidLine)); + + for (int i = 0; i < (int)xvalues.size(); i++) { + xval = getXPositionFromConcentration(xvalues[i], w); + yval = getYPositionFromIntensity(yvalues[i], h); + + if ((xval >= xmin) && (xval <= xmax) && (yval >= topmargin) && (yval <= h - bottommargin)) { + tmpyval1 = getYPositionFromIntensity(min(getMaximumIntensity(), yvalues[i] + sd[i]), h); + tmpyval2 = max(topmargin, tmpyval1); + scene->addLine(xval, yval, xval, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + + if (tmpyval1 > topmargin) { + scene->addLine(xval - 2, tmpyval2, xval + 2, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + } + + tmpyval1 = getYPositionFromIntensity(min(getMaximumIntensity(), yvalues[i] - sd[i]), h); + tmpyval2 = min(h - bottommargin, tmpyval1); + scene->addLine(xval, yval, xval, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + + if (tmpyval1 < h - bottommargin) { + scene->addLine(xval - 2, tmpyval2, xval + 2, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + } + + scene->addEllipse(QRectF(xval - 4, yval - 4, 8, 8), QPen(Qt::blue, 1, Qt::SolidLine), QBrush(Qt::blue)); + } + } + + for (int i = 0; i < (int)datax.size(); i++) { + xval = getXPositionFromConcentration(datax[i], w); + yval = getYPositionFromIntensity(datay[i], h); + + if ((xval >= xmin) && (xval <= xmax) && (yval >= topmargin) && (yval <= h - bottommargin)) { + tmpyval1 = getYPositionFromIntensity(min(getMaximumIntensity(), datay[i] + datasd[i]), h); + tmpyval2 = max(topmargin, tmpyval1); + scene->addLine(xval, yval, xval, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + + if (tmpyval1 > topmargin) { + scene->addLine(xval - 2, tmpyval2, xval + 2, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + } + + tmpyval1 = getYPositionFromIntensity(min(getMaximumIntensity(), datay[i] - datasd[i]), h); + tmpyval2 = min(h - bottommargin, tmpyval1); + scene->addLine(xval, yval, xval, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + + if (tmpyval1 < h - bottommargin) { + scene->addLine(xval - 2, tmpyval2, xval + 2, tmpyval2, QPen(Qt::gray, 2, Qt::SolidLine)); + } + + scene->addEllipse(QRectF(xval - 4, yval - 4, 8, 8), QPen(Qt::green, 1, Qt::SolidLine), QBrush(Qt::green)); + } + } + + string graphlabel; + if (!hidelabels) { + graphlabel = "y = " + to_string(a) + "x"; + if (b != 0) { + if (b > 0) { + graphlabel += " + " + to_string(b); + } + else { + graphlabel += " - " + to_string(fabs(b)); + } + } + } + + htmltext = scene->addText("", myFont); + htmltext->setHtml(graphlabel.c_str()); + htmltext->setPos(QPointF(leftmargin + 10, topmargin)); + htmltext->setZValue(1); + + int linespace = 16; + + if (!xvalues.empty() && (equationtype < 2)) { + if (!hidelabels) { + graphlabel = "R2 = " + to_string(calculateR2Value(a, b, xvalues, yvalues)); + + htmltext = scene->addText("", myFont); + htmltext->setHtml(graphlabel.c_str()); + htmltext->setPos(QPointF(leftmargin + 10, topmargin + linespace)); + htmltext->setZValue(1); + + graphlabel = "LOD = " + to_string(calculateLOD(a, xvalues, yvalues)); + + htmltext = scene->addText("", myFont); + htmltext->setHtml(graphlabel.c_str()); + htmltext->setPos(QPointF(leftmargin + 10, topmargin + 3 * linespace)); + htmltext->setZValue(1); + + graphlabel = "LOQ = " + to_string(calculateLOQ(a, xvalues, yvalues)); + + htmltext = scene->addText("", myFont); + htmltext->setHtml(graphlabel.c_str()); + htmltext->setPos(QPointF(leftmargin + 10, topmargin + 4 * linespace)); + htmltext->setZValue(1); + } + } + + if (!hidelabels) { + + usedtextitems.clear(); + + for (int i = (int)xvalues.size() - 1; i >= 0; i--) { + xval = getXPositionFromConcentration(xvalues[i], w); + yval = getYPositionFromIntensity(yvalues[i], h); + + if ((xval >= xmin) && (xval <= xmax) && (yval >= topmargin) && (yval <= h - bottommargin)) { + graphlabel = "Calib. " + to_string(xvalues[i]); + simpletext = scene->addSimpleText(graphlabel.c_str(), myFont); + simpletext->setPos(QPointF(xval + 10, yval - 5)); + simpletext->setZValue(1); + + for (auto& it : usedtextitems) { + if (simpletext->collidesWithItem(it, Qt::IntersectsItemBoundingRect)) { + scene->removeItem(simpletext); + simpletext = 0; + break; + } + } + + if (simpletext) { + usedtextitems.append(simpletext); + } + } + } + + for (int i = (int)datax.size() - 1; i >= 0; i--) { + xval = getXPositionFromConcentration(datax[i], w); + yval = getYPositionFromIntensity(datay[i], h); + + if ((xval >= xmin) && (xval <= xmax) && (yval >= topmargin) && (yval <= h - bottommargin)) { + graphlabel = "Group " + to_string(datagroups[i]); + simpletext = scene->addSimpleText(graphlabel.c_str(), myFont); + simpletext->setPos(QPointF(xval + 10, yval - 5)); + simpletext->setZValue(1); + + for (auto& it : usedtextitems) { + if (simpletext->collidesWithItem(it, Qt::IntersectsItemBoundingRect)) { + scene->removeItem(simpletext); + simpletext = 0; + break; + } + } + + if (simpletext) { + usedtextitems.append(simpletext); + } + } + } + + } + + scene->removeItem(zoomgroup); + scene->removeItem(cursorsimpletextitem); + + if (calledbyresizeevent) { + oldwidth.push_back(origwidth); + oldheight.push_back(origheight); + } + else { + oldwidth.clear(); + oldheight.clear(); + } + + bool blocksignal = false; + // detection of cyclic calls redrawScene<->resizeEvent + if ((oldwidth.size() == 4) && (oldheight.size() == 4)) { + if ((oldwidth[3] == oldwidth[1]) && (oldheight[3] == oldheight[1]) && (oldwidth[2] == oldwidth[0]) && (oldheight[2] == oldheight[0])) { + blocksignal = true; + } + } + + if (blocksignal) { + scene->blockSignals(true); + } + + scene->setSceneRect(scene->itemsBoundingRect()); + + if (blocksignal) { + scene->blockSignals(false); + } + + zoomgroup->setVisible(false); + scene->addItem(zoomgroup); + + cursorsimpletextitem->setVisible(false); + scene->addItem(cursorsimpletextitem); + + while (oldwidth.size() > 3) { + oldwidth.pop_front(); + } + + while (oldheight.size() > 3) { + oldheight.pop_front(); + } + + calledbyresizeevent = false; +} + + +void cCalibrationChartScene::updateZoomGroup() { + qreal rx1, rx2, ry1, ry2; + QFont myFont("Arial", 8); + + if (currentx < pressedx) { + rx1 = currentx; + rx2 = pressedx; + } + else { + rx1 = pressedx; + rx2 = currentx; + } + + if (currenty < pressedy) { + ry1 = currenty; + ry2 = pressedy; + } + else { + ry1 = pressedy; + ry2 = currenty; + } + + zoomrect->setPen(QPen(Qt::black, 1, Qt::DashLine)); + zoomrect->setRect(QRectF(QPointF(rx1, ry1), QPointF(rx2, ry2))); + + QString qstr = "x: "; + qstr += QString::number(getConcentrationFromXPosition((pressedx < currentx)?pressedx:currentx, origwidth)); + qstr += "-"; + qstr += QString::number(getConcentrationFromXPosition((pressedx < currentx)?currentx:pressedx, origwidth)); + qstr += "\ndiff: "; + qstr += QString::number(getConcentrationFromXPosition((pressedx < currentx)?currentx:pressedx, origwidth) - getConcentrationFromXPosition((pressedx < currentx)?pressedx:currentx, origwidth)); + + zoomsimpletextitem->setFont(myFont); + zoomsimpletextitem->setText(qstr); + zoomsimpletextitem->setPos(QPointF(pressedx, pressedy - 2)); + + zoomgroup->setVisible(true); +} + + +void cCalibrationChartScene::calculateMinMaxConcentration() { + if (pressedx < leftmargin) { + pressedx = leftmargin; + } + + if (pressedx > origwidth - rightmargin) { + pressedx = origwidth - rightmargin; + } + + if (currentx < leftmargin) { + currentx = leftmargin; + } + + if (currentx > origwidth - rightmargin) { + currentx = origwidth - rightmargin; + } + + double tmpminconcentration = getConcentrationFromXPosition((pressedx < currentx) ? pressedx : currentx, origwidth); + double tmpmaxconcentration = getConcentrationFromXPosition((pressedx < currentx) ? currentx : pressedx, origwidth); + + if (enablemouseconcentrationselection) { + minconcentration = tmpminconcentration; + maxconcentration = tmpmaxconcentration; + } + else { + if (pressedx > currentx) { + minconcentration = min(minconcentration + tmpmaxconcentration - tmpminconcentration, 1000000.0); + maxconcentration = min(maxconcentration + tmpmaxconcentration - tmpminconcentration, 1000000.0); + } + else { + minconcentration = max(0.0, minconcentration - tmpmaxconcentration + tmpminconcentration); + maxconcentration = max(0.0, maxconcentration - tmpmaxconcentration + tmpminconcentration); + } + } +} + + +double cCalibrationChartScene::getMaximumIntensity() { + return a * maxconcentration + b; +} + + +void cCalibrationChartScene::zoomIn() { + if (currentscale < 32) { + currentscale += factor; + setMatrix(originalmatrix); + scale(currentscale, currentscale); + verticalScrollBar()->setSliderPosition(verticalScrollBar()->maximum()); + } +} + + +void cCalibrationChartScene::zoomOut() { + if (currentscale > 1) { + currentscale -= factor; + setMatrix(originalmatrix); + scale(currentscale, currentscale); + verticalScrollBar()->setSliderPosition(verticalScrollBar()->maximum()); + } +} + + +void cCalibrationChartScene::normalSize() { + currentscale = 1; + setMatrix(originalmatrix); + verticalScrollBar()->setSliderPosition(verticalScrollBar()->maximum()); +} + + +void cCalibrationChartScene::setConcentrationInterval(double minconcentration, double maxconcentration) { + if (maxconcentration < minconcentration) { + double tmp = maxconcentration; + maxconcentration = minconcentration; + minconcentration = tmp; + } + + this->minconcentration = std::max(0.0, minconcentration); + this->maxconcentration = std::min(maxconcentration, 1000000.0); + emit updateConcentrationInterval(this->minconcentration, this->maxconcentration); + + redrawScene(); + viewport()->update(); +} + + +void cCalibrationChartScene::resetConcentrationInterval() { + minconcentration = 0; + maxconcentration = 1000; + emit updateConcentrationInterval(minconcentration, maxconcentration); + + redrawScene(); +} + + +//void cCalibrationChartScene::enableMouseConcentrationSelectionTool(bool enable) { +// enablemouseconcentrationselection = enable; +// pressedx = -1; +// pressedy = -1; +// +// redrawScene(); +//} + diff --git a/CycloBranch/gui/cCalibrationChartScene.h b/CycloBranch/gui/cCalibrationChartScene.h new file mode 100644 index 0000000..7d4a49f --- /dev/null +++ b/CycloBranch/gui/cCalibrationChartScene.h @@ -0,0 +1,303 @@ +/** + \file cCalibrationChartScene.h + \brief Calibration chart scene. +*/ + + +#ifndef _CCALIBRATIONCHARTSCENE_H +#define _CCALIBRATIONCHARTSCENE_H + +#include +#include +#include +#include +#include +#include + + +using namespace std; + + +// forward declaration +class QPaintEvent; +class QGraphicsScene; +class QMatrix; +class QGraphicsItemGroup; +class QGraphicsRectItem; +class QGraphicsSimpleTextItem; + + +/** + \brief Calculate the coefficient of determination R^2. + \param a a + \param b b + \param xvalues x coordinates of points + \param yvalues y coordinates of points + \retval double R^2 +*/ +double calculateR2Value(double a, double b, vector xvalues, vector yvalues); + + +/** + \brief Calculate limit of detection. + \param a a + \param xvalues x coordinates of points + \param yvalues y coordinates of points + \retval double limit of detection +*/ +double calculateLOD(double a, vector xvalues, vector yvalues); + + +/** + \brief Calculate limit of quantitation. + \param a a + \param xvalues x coordinates of points + \param yvalues y coordinates of points + \retval double limit of quantitation +*/ +double calculateLOQ(double a, vector xvalues, vector yvalues); + + +/** + \brief The implementation of an isotopic pattern simulator (graphics). +*/ +class cCalibrationChartScene : public QGraphicsView +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + cCalibrationChartScene(QWidget* parent = 0); + + + /** + \brief The destructor. + */ + ~cCalibrationChartScene(); + + + /** + \brief Initialize the widget. + */ + void initialize(); + + + /** + \brief Export spectrum scene into a PDF or a PS file. + \param filename filename + \param postscript if true then PS file is generated instead of PDF + */ + void exportToPDF(QString filename, bool postscript); + + + /** + \brief Export spectrum scene into a SVG file. + \param filename filename + */ + void exportToSVG(QString filename); + + + /** + \brief Export spectrum scene into a PNG file. + \param filename filename + */ + void exportToPNG(QString filename); + + + /** + \brief Hide labels of calibration points. + \param state state of labels + */ + void hideLabels(bool state); + + + /** + \brief Set parameters of calibration curve. + \param equationtype 0 (y = a*x), 1 (y = a*x + b), 2 (manual mode) + \param a a + \param b b + \param xvalues x coordinates of points + \param yvalues y coordinates of points + \param sd standard deviation of y-values + */ + void setLineParameters(int equationtype, double a, double b, vector xvalues, vector yvalues, vector sd); + + + /** + \brief Set parameters of calibration curve. + \param datax x coordinates of data points + \param datay y coordinates of data points + \param datasd standard deviation of y-values + \param datagroups vector of group ids + */ + void setData(vector datax, vector datay, vector datasd, vector datagroups); + + +protected: + + + /** + \brief Handle the mouse wheel event. + \param event pointer to QWheelEvent + */ + void wheelEvent(QWheelEvent *event); + + + /** + \brief Handle the mouse move event. + \param event pointer to QMouseEvent + */ + void mouseMoveEvent(QMouseEvent *event); + + + /** + \brief Handle the mouse release event. + \param event pointer to QMouseEvent + */ + void mouseReleaseEvent(QMouseEvent *event); + + + /** + \brief Handle the mouse press event. + \param event pointer to QMouseEvent + */ + void mousePressEvent(QMouseEvent *event); + + + /** + \brief Handle the widget show event. + \param event pointer to QShowEvent + */ + void showEvent(QShowEvent *event); + + + /** + \brief Handle the widget resize event. + \param event pointer to QResizeEvent + */ + void resizeEvent(QResizeEvent *event); + + +private: + + QWidget* parent; + QGraphicsScene* scene; + QMatrix originalmatrix; + + QGraphicsItemGroup* zoomgroup; + QGraphicsRectItem* zoomrect; + QGraphicsSimpleTextItem* zoomsimpletextitem; + + QGraphicsSimpleTextItem* cursorsimpletextitem; + + //cPeaksList isotopicpattern; + + qreal currentscale; + qreal factor; + + int origwidth; + int origheight; + + bool calledbyresizeevent; + deque oldwidth; + deque oldheight; + + int pressedx; + int pressedy; + + int currentx; + int currenty; + + double minconcentration; + double maxconcentration; + + int topmargin; + int bottommargin; + int leftmargin; + int rightmargin; + + bool firstshow; + bool enablemouseconcentrationselection; + + int equationtype; + + double a; + double b; + + vector xvalues; + vector yvalues; + + vector sd; + + vector datax; + vector datay; + + vector datasd; + vector datagroups; + + bool hidelabels; + + + double getConcentrationFromXPosition(int x, int w); + + + int getXPositionFromConcentration(double concentration, int w); + + + double getIntensityFromYPosition(int y, int h); + + + int getYPositionFromIntensity(double intensity, int h); + + + void redrawScene(); + + + void updateZoomGroup(); + + + void calculateMinMaxConcentration(); + + + double getMaximumIntensity(); + + +signals: + + + /** + \brief The signal is emitted when the range of concentration has been changed. + \param minconcentration a minimum threshold of concentration + \param maxconcentration a maximum threshold of concentration + */ + void updateConcentrationInterval(double minconcentration, double maxconcentration); + + +private slots: + + + void zoomIn(); + + + void zoomOut(); + + + void normalSize(); + + + void setConcentrationInterval(double minconcentration, double maxconcentration); + + + void resetConcentrationInterval(); + + + //void enableMouseConcentrationSelectionTool(bool enable); + +}; + +#endif diff --git a/CycloBranch/gui/cChromatogramWindow.cpp b/CycloBranch/gui/cChromatogramWindow.cpp index 3b59b34..60913d5 100644 --- a/CycloBranch/gui/cChromatogramWindow.cpp +++ b/CycloBranch/gui/cChromatogramWindow.cpp @@ -2,9 +2,9 @@ #include "gui/cEventFilter.h" -cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent) { +cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, cTheoreticalSpectrumList& listoftheoreticalspectra, QWidget* parent) { this->globalpreferences = globalpreferences; - this->theoreticalspectrumlist = &theoreticalspectrumlist; + this->listoftheoreticalspectra = &listoftheoreticalspectra; this->parent = parent; setWindowTitle("Chromatogram"); @@ -16,7 +16,7 @@ cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, menuView = new QMenu(tr("&View"), this); menuHelp = new QMenu(tr("&Help"), this); - chromatogramwindowwidget = new cChromatogramWindowWidget(theoreticalspectrumlist, this); + chromatogramwindowwidget = new cChromatogramWindowWidget(listoftheoreticalspectra, this); connect(chromatogramwindowwidget, SIGNAL(chromatogramWidgetDoubleClicked(int)), this, SLOT(chromatogramDoubleClickedSlot(int))); @@ -82,12 +82,39 @@ cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, toolbarView->addAction(actionAbsoluteIntensity); connect(actionAbsoluteIntensity, SIGNAL(toggled(bool)), chromatogramwindowwidget, SLOT(absoluteIntensityStateChanged(bool))); + actionRawData = new QAction(QIcon(":/images/icons/chromatography.png"), tr("&Profile Chromatogram"), this); + actionRawData->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); + actionRawData->setToolTip("Profile Chromatogram (Ctrl + P)"); + actionRawData->setCheckable(true); + toolbarView->addAction(actionRawData); + connect(actionRawData, SIGNAL(toggled(bool)), chromatogramwindowwidget, SLOT(rawDataStateChanged(bool))); + + peakshapelabel = new QLabel(); + peakshapelabel->setText("Peak Shape: "); + + comboboxpeakshape = new QComboBox(); + comboboxpeakshape->setToolTip("Select chromatographic peak shape to be used for area and concentration calculations:\nGaussian = basic Gaussian function,\nex-Gaussian (tailing) = Exponentially Modified Gaussian for chromatographic peaks with tailing,\nex-Gaussian (fronting) = Exponentially Modified Gaussian for chromatographic peaks with fronting."); + comboboxpeakshape->setSizeAdjustPolicy(QComboBox::AdjustToContents); + comboboxpeakshape->addItem("Gaussian"); + comboboxpeakshape->addItem("ex-Gaussian (tailing)"); + comboboxpeakshape->addItem("ex-Gaussian (fronting)"); + connect(comboboxpeakshape, SIGNAL(currentIndexChanged(int)), chromatogramwindowwidget, SLOT(peakShapeChanged(int))); + + peakshapehboxlayout = new QHBoxLayout(); + peakshapehboxlayout->addWidget(peakshapelabel); + peakshapehboxlayout->addWidget(comboboxpeakshape); + + peakshapewidget = new QWidget(); + peakshapewidget->setLayout(peakshapehboxlayout); + toolbarView->addWidget(peakshapewidget); + toolbarView->addSeparator(); actionHideTIC = new QAction(QIcon(":/images/icons/81.png"), tr("Hide &TIC"), this); actionHideTIC->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_T)); actionHideTIC->setToolTip("Hide TIC (Ctrl + Shift + T)"); actionHideTIC->setCheckable(true); + actionHideTIC->setChecked(true); toolbarView->addAction(actionHideTIC); connect(actionHideTIC, SIGNAL(toggled(bool)), chromatogramwindowwidget, SLOT(hideTIC(bool))); @@ -114,6 +141,8 @@ cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, toolbarHelp->addAction(actionHTMLDocumentation); connect(actionHTMLDocumentation, SIGNAL(triggered()), this, SLOT(showHTMLDocumentation())); + addToolBarBreak(); + toolbarTime = addToolBar(tr("Time and Spectrum ID")); @@ -210,6 +239,7 @@ cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, menuView->addAction(actionMouseSelection); menuView->addAction(actionRetentionTime); menuView->addAction(actionAbsoluteIntensity); + menuView->addAction(actionRawData); menuView->addSeparator(); menuView->addAction(actionHideTIC); menuView->addAction(actionHideEIC); @@ -235,6 +265,11 @@ cChromatogramWindow::cChromatogramWindow(cGlobalPreferences* globalpreferences, cChromatogramWindow::~cChromatogramWindow() { delete chromatogramwindowwidget; + delete peakshapelabel; + delete comboboxpeakshape; + delete peakshapehboxlayout; + delete peakshapewidget; + delete labelretentiontime; delete minretentiontime; delete labelseparatorretentiontime; @@ -261,6 +296,7 @@ cChromatogramWindow::~cChromatogramWindow() { delete actionMouseSelection; delete actionRetentionTime; delete actionAbsoluteIntensity; + delete actionRawData; delete actionHideTIC; delete actionHideEIC; delete actionHideLabels; @@ -280,8 +316,18 @@ void cChromatogramWindow::closeEvent(QCloseEvent *event) { } -void cChromatogramWindow::recalculateTICChromatogram() { - chromatogramwindowwidget->recalculateTICChromatogram(); +void cChromatogramWindow::recalculateTICChromatogram(int activefileid) { + chromatogramwindowwidget->recalculateTICChromatogram(activefileid); +} + + +void cChromatogramWindow::setAbsoluteIntensityEnabled(bool enabled) { + actionAbsoluteIntensity->setChecked(enabled); +} + + +void cChromatogramWindow::setPeakShape(int peakshape) { + comboboxpeakshape->setCurrentIndex(peakshape); } diff --git a/CycloBranch/gui/cChromatogramWindow.h b/CycloBranch/gui/cChromatogramWindow.h index e58e78c..7ce9c99 100644 --- a/CycloBranch/gui/cChromatogramWindow.h +++ b/CycloBranch/gui/cChromatogramWindow.h @@ -18,6 +18,7 @@ #include #include #include +#include #include "core/utilities.h" #include "core/cGlobalPreferences.h" #include "gui/cChromatogramWindowWidget.h" @@ -36,18 +37,18 @@ class cChromatogramWindow : public QMainWindow /** \brief The constructor. \param globalpreferences global preferences of the application - \param theoreticalspectrumlist list of spectra + \param listoftheoreticalspectra lists of theoretical spectra \param parent pointer to a parent widget - */ - cChromatogramWindow(cGlobalPreferences* globalpreferences, cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent = (QWidget *)0); + */ + cChromatogramWindow(cGlobalPreferences* globalpreferences, cTheoreticalSpectrumList& listoftheoreticalspectra, QWidget* parent = (QWidget *)0); /** \brief The destructor. - */ + */ ~cChromatogramWindow(); - + /** \brief Handle the window close event. \param event pointer to QCloseEvent @@ -57,8 +58,23 @@ class cChromatogramWindow : public QMainWindow /** \brief Recalculate TIC chromatogram. + \param activefileid id of an active file + */ + void recalculateTICChromatogram(int activefileid); + + + /** + \brief Enable/disable absolute intensity mode. + \param enabled if true the absolute intensity is used, if false the relative intensity is used */ - void recalculateTICChromatogram(); + void setAbsoluteIntensityEnabled(bool enabled); + + + /** + \brief Set chromatographic peak shape value. + \param peakshape 0 = Gaussian, 1 = ex-Gaussian (tailing), 2 = ex-Gaussian (fronting) + */ + void setPeakShape(int peakshape); /** @@ -71,7 +87,7 @@ class cChromatogramWindow : public QMainWindow private: cGlobalPreferences* globalpreferences; - cTheoreticalSpectrumList* theoreticalspectrumlist; + cTheoreticalSpectrumList* listoftheoreticalspectra; QWidget* parent; QMenuBar* menuBar; @@ -90,10 +106,16 @@ class cChromatogramWindow : public QMainWindow QAction* actionMouseSelection; QAction* actionRetentionTime; QAction* actionAbsoluteIntensity; + QAction* actionRawData; QAction* actionHideTIC; QAction* actionHideEIC; QAction* actionHideLabels; + QWidget* peakshapewidget; + QHBoxLayout* peakshapehboxlayout; + QLabel* peakshapelabel; + QComboBox* comboboxpeakshape; + QToolBar* toolbarTime; QWidget* widgetretentiontime; @@ -128,7 +150,7 @@ class cChromatogramWindow : public QMainWindow /** \brief Handle a key press event. \param event pointer to QKeyEvent - */ + */ void keyPressEvent(QKeyEvent *event); @@ -162,7 +184,7 @@ private slots: void exportImage(); - + void closeWindow(); diff --git a/CycloBranch/gui/cChromatogramWindowWidget.cpp b/CycloBranch/gui/cChromatogramWindowWidget.cpp index 5bebec0..31c333c 100644 --- a/CycloBranch/gui/cChromatogramWindowWidget.cpp +++ b/CycloBranch/gui/cChromatogramWindowWidget.cpp @@ -1,8 +1,973 @@ #include "gui/cChromatogramWindowWidget.h" -cChromatogramWindowWidget::cChromatogramWindowWidget(cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent) { - this->theoreticalspectrumlist = &theoreticalspectrumlist; +double getGaussianArea(double sigma, double height) { + return height * sigma * sqrt(2.0 * pi); +} + + +double getGaussianAreas(vector& sigmas, vector& heights) { + if (sigmas.size() != heights.size()) { + return 0; + } + + double area = 0; + size_t size = sigmas.size(); + for (size_t i = 0; i < size; i++) { + area += getGaussianArea(sigmas[i], heights[i]); + } + + return area; +} + + +double getExponentiallyModifiedGaussianArea(double x, double h, double ny, double sigma, double tau, bool fronting) { + if (sigma == 0) { + return 0; + } + + if (tau == 0) { + // to do - return Gaussian ? + return 0; + } + + //double y = computeExponentiallyModifiedGaussFunction(x, h, ny, sigma, tau, fronting); + + double t0, h0; + t0 = ny + erfcxinv(tau / sigma * sqrt(2.0 / pi)) * sigma * sqrt(2.0) - sigma * sigma / tau; + + h0 = ny - t0; + h0 *= h0; + h0 = h * pow(econst, -h0 / (2.0 * sigma * sigma)); + + h = h * h / h0; + + return getGaussianArea(sigma, h); + + //if (fronting) { + // ny = 2 * ny - t0; + //} + //else { + // ny = t0; + //} + + //double area = y * 2 * tau; + + //double z; + //if (fronting) { + // z = (-(ny - x) / sigma + sigma / tau) / sqrt(2.0); + //} + //else { + // z = ((ny - x) / sigma + sigma / tau) / sqrt(2.0); + //} + + //if (z < 0) { + // if (fronting) { + // area /= pow(econst, -(ny - x) / tau + sigma * sigma / (2.0 * tau * tau)); + // } + // else { + // area /= pow(econst, (ny - x) / tau + sigma * sigma / (2.0 * tau * tau)); + // } + // area /= erfc(z); + //} + //else { + // area /= pow(econst, -(ny - x)*(ny - x) / (2.0 * sigma * sigma)); + // area /= erfcx(z); + //} + // + //return area; +} + + +double getExponentiallyModifiedGaussianAreas(vector& xvalues, vector& heights, vector& nys, vector& sigmas, vector& taus, bool fronting) { + if ((sigmas.size() != xvalues.size()) || (sigmas.size() != heights.size()) || (sigmas.size() != nys.size()) || (sigmas.size() != taus.size())) { + return 0; + } + + double area = 0; + size_t size = sigmas.size(); + for (size_t i = 0; i < size; i++) { + area += getExponentiallyModifiedGaussianArea(xvalues[i], heights[i], nys[i], sigmas[i], taus[i], fronting); + } + + return area; +} + + +//double erfcx(double z) { +// if (z > 26) { +// return 1.0 / (z * sqrt(pi)); +// } +// return pow(econst, z*z) * erfc(z); +//} + + +/* + Based on: M. M. Shepherd and J. G. Laframboise, "Chebyshev Approximation of + (1+2x)exp(x^2)erfc x in 0 <= x < INF", Mathematics of Computation, Vol. 36, + No. 153, January 1981, pp. 249-253. + https://stackoverflow.com/questions/39777360/accurate-computation-of-scaled-complementary-error-function-erfcx +*/ +double erfcx(double x) { + double a, d, e, m, p, q, r, s, t; + + a = fmax(x, 0.0 - x); // NaN preserving absolute value computation + + /* Compute q = (a-4)/(a+4) accurately. [0,INF) -> [-1,1] */ + m = a - 4.0; + p = a + 4.0; + r = 1.0 / p; + q = m * r; + t = fma(q + 1.0, -4.0, a); + e = fma(q, -a, t); + q = fma(r, e, q); + + /* Approximate (1+2*a)*exp(a*a)*erfc(a) as p(q)+1 for q in [-1,1] */ + p = 0x1.edcad78fc8044p-31; // 8.9820305531190140e-10 + p = fma(p, q, 0x1.b1548f14735d1p-30); // 1.5764464777959401e-09 + p = fma(p, q, -0x1.a1ad2e6c4a7a8p-27); // -1.2155985739342269e-08 + p = fma(p, q, -0x1.1985b48f08574p-26); // -1.6386753783877791e-08 + p = fma(p, q, 0x1.c6a8093ac4f83p-24); // 1.0585794011876720e-07 + p = fma(p, q, 0x1.31c2b2b44b731p-24); // 7.1190423171700940e-08 + p = fma(p, q, -0x1.b87373facb29fp-21); // -8.2040389712752056e-07 + p = fma(p, q, 0x1.3fef1358803b7p-22); // 2.9796165315625938e-07 + p = fma(p, q, 0x1.7eec072bb0be3p-18); // 5.7059822144459833e-06 + p = fma(p, q, -0x1.78a680a741c4ap-17); // -1.1225056665965572e-05 + p = fma(p, q, -0x1.9951f39295cf4p-16); // -2.4397380523258482e-05 + p = fma(p, q, 0x1.3be1255ce180bp-13); // 1.5062307184282616e-04 + p = fma(p, q, -0x1.a1df71176b791p-13); // -1.9925728768782324e-04 + p = fma(p, q, -0x1.8d4aaa0099bc8p-11); // -7.5777369791018515e-04 + p = fma(p, q, 0x1.49c673066c831p-8); // 5.0319701025945277e-03 + p = fma(p, q, -0x1.0962386ea02b7p-6); // -1.6197733983519948e-02 + p = fma(p, q, 0x1.3079edf465cc3p-5); // 3.7167515521269866e-02 + p = fma(p, q, -0x1.0fb06dfedc4ccp-4); // -6.6330365820039094e-02 + p = fma(p, q, 0x1.7fee004e266dfp-4); // 9.3732834999538536e-02 + p = fma(p, q, -0x1.9ddb23c3e14d2p-4); // -1.0103906603588378e-01 + p = fma(p, q, 0x1.16ecefcfa4865p-4); // 6.8097054254651804e-02 + p = fma(p, q, 0x1.f7f5df66fc349p-7); // 1.5379652102610957e-02 + p = fma(p, q, -0x1.1df1ad154a27fp-3); // -1.3962111684056208e-01 + p = fma(p, q, 0x1.dd2c8b74febf6p-3); // 2.3299511862555250e-01 + + /* Divide (1+p) by (1+2*a) ==> exp(a*a)*erfc(a) */ + d = a + 0.5; + r = 1.0 / d; + r = r * 0.5; + q = fma(p, r, r); // q = (p+1)/(1+2*a) + t = q + q; + e = (p - q) + fma(t, -a, 1.0); // residual: (p+1)-q*(1+2*a) + r = fma(e, r, q); + + /* Handle argument of infinity */ + if (a > 0x1.fffffffffffffp1023) r = 0.0; + + /* Handle negative arguments: erfcx(x) = 2*exp(x*x) - erfcx(|x|) */ + if (x < 0.0) { + s = x * x; + d = fma(x, x, -s); + e = exp(s); + r = e - r; + r = fma(e, d + d, r); + r = r + e; + if (e > 0x1.fffffffffffffp1023) r = e; // avoid creating NaN + } + return r; +} + + +double erfcxinv(double z) { + double value; + + if (z <= 1) { + value = 1.0 / (z * sqrt(pi)); + } + else { + value = -sqrt(log(z)); + } + + for (int i = 0; i < 7; i++) { + value = value - (erfcx(value) - z) / (2.0 * value * erfcx(value) - 2.0 / sqrt(pi)); + } + + return value; +} + + +double computeExponentiallyModifiedGaussFunction(double x, double h, double ny, double sigma, double tau, bool fronting) { + if (sigma == 0) { + return 0; + } + + if (tau == 0) { + // to do - return Gaussian ? + return 0; + } + + double t0, h0; + t0 = ny + erfcxinv(tau / sigma * sqrt(2.0 / pi)) * sigma * sqrt(2.0) - sigma * sigma / tau; + + h0 = ny - t0; + h0 *= h0; + h0 = h * pow(econst, -h0 / (2.0 * sigma * sigma)); + + if (fronting) { + //x = x - ny + t0; + ny = 2 * ny - t0; + } + else { + //x = x + ny - t0; + ny = t0; + } + + h = h * h / h0; + + double z; + if (fronting) { + z = (-(ny - x) / sigma + sigma / tau) / sqrt(2.0); + } + else { + z = ((ny - x) / sigma + sigma / tau) / sqrt(2.0); + } + + double value; + if (z < 0) { + // Kalambet et al. equation (2) + if (fronting) { + value = -(ny - x) / tau + (sigma * sigma) / (2.0 * tau * tau); + } + else { + value = (ny - x) / tau + (sigma * sigma) / (2.0 * tau * tau); + } + value = pow(econst, value); + value = value * h * sigma * sqrt(pi / 2.0) / tau; + value = value * erfc(z); + } + else { + // Kalambet et al. equation (6) + value = ny - x; + value *= value; + value = pow(econst, -value / (2.0 * sigma * sigma)); + value = value * h * sigma * sqrt(pi / 2.0) / tau; + value = value * erfcx(z); + } + + return value; +} + + +double computeExponentialFunction(double x, double base, double tau, bool fronting) { + if (fronting) { + return 1.0 / tau * pow(base, x / tau); + } + return 1.0 / tau * pow(base, -x / tau); +} + + +void calculateCaruana(vector& x, vector& y, double& ny, double& sigma, double& height) { + long double a, b, c; + long double n = (long double)x.size(); + + long double sumx = 0; + long double sumx2 = 0; + long double sumx3 = 0; + long double sumx4 = 0; + + long double sumlny = 0; + long double sumxlny = 0; + long double sumx2lny = 0; + + long double tmp; + + int size = (int)x.size(); + for (int i = 0; i < size; i++) { + sumx += x[i]; + sumx2 += x[i] * x[i]; + sumx3 += x[i] * x[i] * x[i]; + sumx4 += x[i] * x[i] * x[i] * x[i]; + + sumlny += log(y[i]); + sumxlny += x[i] * log(y[i]); + sumx2lny += x[i] * x[i] * log(y[i]); + } + + ny = 0; + sigma = 0; + height = DBL_MAX; + + a = (sumlny * sumx4 - sumx2lny * sumx2) * (sumx2 * sumx4 - sumx3 * sumx3) - (sumxlny * sumx4 - sumx2lny * sumx3) * (sumx * sumx4 - sumx3 * sumx2); + tmp = (n * sumx4 - sumx2 * sumx2) * (sumx2 * sumx4 - sumx3 * sumx3) - (sumx * sumx4 - sumx2 * sumx3) * (sumx * sumx4 - sumx3 * sumx2); + if (tmp == 0) { + return; + } + a /= tmp; + + b = sumxlny * sumx4 - sumx2lny * sumx3 - a * (sumx * sumx4 - sumx2 * sumx3); + tmp = sumx2 * sumx4 - sumx3 * sumx3; + if (tmp == 0) { + return; + } + b /= tmp; + + c = sumx2lny - a * sumx2 - b * sumx3; + tmp = sumx4; + if (tmp == 0) { + return; + } + c /= tmp; + + //cout << "a = " << a << "; b = " << b << "; c = " << c << endl; + + //cout << n * a + sumx * b + sumx2 * c << " = " << sumlny << endl; + //cout << sumx * a + sumx2 * b + sumx3 * c << " = " << sumxlny << endl; + //cout << sumx2 * a + sumx3 * b + sumx4 * c << " = " << sumx2lny << endl; + //cout << endl; + + if (c >= 0) { + return; + } + + ny = -b / (2.0 * c); + + sigma = -1.0 / (2.0 * c); + sigma = sqrt(sigma); + + height = a - b * b / (4.0 * c); + height = pow(econst, height); +} + + +void calculateGuo(vector& x, vector& y, int iterations, double& ny, double& sigma, double& height) { + long double a, b, c; + + long double sumy2; + + long double sumxy2; + long double sumx2y2; + long double sumx3y2; + long double sumx4y2; + + long double sumy2lny; + long double sumxy2lny; + long double sumx2y2lny; + + long double y2; + long double tmp; + + long double expr1; + long double expr2; + long double expr3; + + int xsize; + + ny = 0; + sigma = 0; + height = DBL_MAX; + + double S; + double oldS = DBL_MAX; + double oldny, oldsigma, oldheight; + + for (int i = 0; i < iterations; i++) { + + sumy2 = 0; + + sumxy2 = 0; + sumx2y2 = 0; + sumx3y2 = 0; + sumx4y2 = 0; + + sumy2lny = 0; + sumxy2lny = 0; + sumx2y2lny = 0; + + y2 = 0; + + xsize = (int)x.size(); + for (int j = 0; j < xsize; j++) { + if (y[j] <= 1) { + return; + } + + if (i == 0) { + y2 = y[j] * y[j]; + } + else { + y2 = a + b * x[j] + c * x[j] * x[j]; + y2 = pow(econst, y2); + y2 *= y2; + } + + sumy2 += y2; + + sumxy2 += x[j] * y2; + sumx2y2 += x[j] * x[j] * y2; + sumx3y2 += x[j] * x[j] * x[j] * y2; + sumx4y2 += x[j] * x[j] * x[j] * x[j] * y2; + + sumy2lny += y2 * log(y[j]); + sumxy2lny += x[j] * y2 * log(y[j]); + sumx2y2lny += x[j] * x[j] * y2 * log(y[j]); + } + + expr1 = sumx2y2 * sumx4y2 - sumx3y2 * sumx3y2; + expr2 = sumxy2lny * sumx4y2 - sumx2y2lny * sumx3y2; + expr3 = sumxy2 * sumx4y2 - sumx3y2 * sumx2y2; + + a = (sumy2lny * sumx4y2 - sumx2y2lny * sumx2y2) * expr1 - expr2 * expr3; + tmp = (sumy2 * sumx4y2 - sumx2y2 * sumx2y2) * expr1 - expr3 * expr3; + if (tmp == 0) { + return; + } + a /= tmp; + + b = expr2 - a * expr3; + tmp = expr1; + if (tmp == 0) { + return; + } + b /= tmp; + + c = sumx2y2lny - a * sumx2y2 - b * sumx3y2; + tmp = sumx4y2; + if (tmp == 0) { + return; + } + c /= tmp; + + //cout << "iteration: " << i + 1 << endl; + //cout << "a = " << a << "; b = " << b << "; c = " << c << endl; + //cout << sumy2 * a + sumx * b + sumx2 * c << " = " << sumlny << endl; + //cout << sumx * a + sumx2 * b + sumx3 * c << " = " << sumxlny << endl; + //cout << sumx2 * a + sumx3 * b + sumx4 * c << " = " << sumx2lny << endl; + + if (c >= 0) { + return; + } + + ny = -b / (2.0 * c); + + sigma = -1.0 / (2.0 * c); + sigma = sqrt(sigma); + + height = a - b * b / (4.0 * c); + height = pow(econst, height); + + //cout << "iteration: " << i + 1 << ", "; + //cout << "ny: " << ny << ", "; + //cout << "sigma: " << sigma << ", "; + //cout << "height: " << height << ", "; + //cout << endl; + + if (xsize > 0) { + if ((ny < x[0]) || (ny > x[xsize - 1])) { + ny = 0; + sigma = 0; + height = DBL_MAX; + return; + } + } + + S = 0; + for (int j = 0; j < xsize; j++) { + tmp = y[j] - computeGaussFunction(x[j], height, ny, sigma); + S += tmp * tmp; + } + + //cout << "iteration: " << i + 1 << ", "; + //cout << "S: " << S << ", oldS: " << oldS << endl; + + if (i > 0) { + if (oldS <= S) { + ny = oldny; + sigma = oldsigma; + height = oldheight; + return; + } + } + + oldny = ny; + oldsigma = sigma; + oldheight = height; + oldS = S; + + } + + //cout << endl; +} + + +void calculateBaseTau(vector& x, vector& y, int iterations, bool fronting, double ynorm, double& base, double& tau) { + base = 0; + tau = 0; + + if (x.size() != y.size()) { + return; + } + + long double sumx; + long double sumx2; + + long double sumlny; + long double sumxlny; + + long double y2; + long double sumy2; + + long double A, B; + long double tmp; + + double S; + double oldS = DBL_MAX; + double oldbase, oldtau; + double x0; + + size_t xsize; + + if (fronting) { + + size_t k = 0; + while (k + 1 < x.size()) { + if (y[k + 1] < y[k]) { + x.erase(x.begin() + k + 1, x.end()); + y.erase(y.begin() + k + 1, y.end()); + break; + } + k++; + } + + xsize = (int)x.size(); + + if (xsize == 0) { + return; + } + + double maxy = 0; + for (int i = 0; i < xsize; i++) { + if (y[i] > maxy) { + maxy = y[i]; + } + } + + if (maxy == 0) { + return; + } + + x0 = x[0]; + for (int i = 0; i < xsize; i++) { + x[i] -= x0; + y[i] = y[i] / maxy; + } + + for (int i = 0; i < iterations; i++) { + y2 = 0; + sumy2 = 0; + + sumx = 0; + sumx2 = 0; + + sumlny = 0; + sumxlny = 0; + + for (int j = 0; j < xsize; j++) { + if (i == 0) { + y2 = y[j] * y[j]; + } + else { + y2 = A + B * x[j]; + y2 = pow(econst, y2); + y2 *= y2; + } + + sumy2 += y2; + + sumx += x[j] * y2; + sumx2 += x[j] * x[j] * y2; + + sumlny += log(y[j]) * y2; + sumxlny += x[j] * log(y[j]) * y2; + } + + tmp = sumx2 * sumy2 - sumx * sumx; + if (tmp == 0) { + return; + } + B = (sumxlny * sumy2 - sumlny * sumx) / tmp; + + if (sumy2 == 0) { + return; + } + A = (sumlny - B * sumx) / sumy2; + + tau = ynorm / pow(econst, A); + base = pow(econst, B * tau); + + if (tau <= 0) { + tau = 0; + base = 0; + return; + } + + S = 0; + for (int j = 0; j < xsize; j++) { + tmp = y[j] - computeExponentialFunction(x[j], base, tau, fronting); + S += tmp * tmp; + } + + cout << "fronting, iteration: " << i + 1 << ", base: " << base << ", tau: " << tau << ", S: " << S << endl; + + if (i > 0) { + if (oldS <= S) { + base = oldbase; + tau = oldtau; + return; + } + } + + oldbase = base; + oldtau = tau; + oldS = S; + + } + + } + else { + + while ((y.size() > 1) && (y[0] < y[1])) { + x.erase(x.begin()); + y.erase(y.begin()); + } + + xsize = (int)x.size(); + + double maxy = 0; + for (int i = 0; i < xsize; i++) { + if (y[i] > maxy) { + maxy = y[i]; + } + } + + if (maxy == 0) { + return; + } + + x0 = x[0]; + for (int i = 0; i < xsize; i++) { + x[i] -= x0; + y[i] = y[i] / maxy; + } + + for (int i = 0; i < iterations; i++) { + y2 = 0; + sumy2 = 0; + + sumx = 0; + sumx2 = 0; + + sumlny = 0; + sumxlny = 0; + + for (int j = 0; j < xsize; j++) { + if (i == 0) { + y2 = y[j] * y[j]; + } + else { + y2 = A + B * x[j]; + y2 = pow(econst, y2); + y2 *= y2; + } + + sumy2 += y2; + + sumx += x[j] * y2; + sumx2 += x[j] * x[j] * y2; + + sumlny += log(y[j]) * y2; + sumxlny += x[j] * log(y[j]) * y2; + } + + tmp = sumx2 * sumy2 - sumx * sumx; + if (tmp == 0) { + return; + } + B = (sumxlny * sumy2 - sumlny * sumx) / tmp; + + if (sumy2 == 0) { + return; + } + A = (sumlny - B * sumx) / sumy2; + + tau = ynorm / pow(econst, A); + base = pow(econst, -B * tau); + + if (tau <= 0) { + tau = 0; + base = 0; + return; + } + + S = 0; + for (int j = 0; j < xsize; j++) { + tmp = y[j] - computeExponentialFunction(x[j], base, tau, fronting); + S += tmp * tmp; + } + + cout << "tailing, iteration: " << i + 1 << ", base: " << base << ", tau: " << tau << ", S: " << S << endl; + + if (i > 0) { + if (oldS <= S) { + base = oldbase; + tau = oldtau; + return; + } + } + + oldbase = base; + oldtau = tau; + oldS = S; + + } + + } + +} + + +void calculateTauUsingWeightedAverage(vector& x, vector& y, bool fronting, double& tau) { + tau = 1; + + if (x.size() != y.size()) { + return; + } + + double x0; + size_t xsize; + + double maxy = 0; + double avg = 0; + double div = 0; + + if (fronting) { + size_t k = 0; + while (k + 1 < x.size()) { + if (y[k + 1] < y[k]) { + x.erase(x.begin() + k + 1, x.end()); + y.erase(y.begin() + k + 1, y.end()); + break; + } + k++; + } + } + else { + while ((y.size() > 1) && (y[0] < y[1])) { + x.erase(x.begin()); + y.erase(y.begin()); + } + } + + xsize = (int)x.size(); + + for (int i = 0; i < xsize; i++) { + if (y[i] > maxy) { + maxy = y[i]; + } + } + + if (maxy == 0) { + return; + } + + x0 = x[0]; + for (int i = 0; i < xsize; i++) { + x[i] -= x0; + y[i] = y[i] / maxy; + + avg += x[i] * y[i]; + div += y[i]; + } + + avg /= div; + tau = avg; +} + + +void calculateGaussianParameters(cPeaksList& eicchromatogram, vector& rtimes, int timeunit, bool absoluteintensity, bool usert, vector& nys, vector& sigmas, vector& as) { + if (eicchromatogram.size() != rtimes.size()) { + return; + } + + if ((rtimes.size() > 0) && (rtimes[rtimes.size() - 1] == 0)) { + usert = false; + } + + double ny, sigma, height; + + vector x; + vector y; + + nys.clear(); + sigmas.clear(); + as.clear(); + + int eicsize = eicchromatogram.size(); + for (int i = 0; i < eicsize; i++) { + if (absoluteintensity) { + if (eicchromatogram[i].absoluteintensity > 0) { + if (usert) { + if (timeunit == 1) { + x.push_back(rtimes[i] * 60.0); + } + else { + x.push_back(rtimes[i]); + } + y.push_back(eicchromatogram[i].absoluteintensity); + } + else { + x.push_back(eicchromatogram[i].mzratio); + y.push_back(eicchromatogram[i].absoluteintensity); + } + } + + if ((eicchromatogram[i].absoluteintensity == 0) && (x.size() > 0)) { + if ((i + 4 < eicsize) && (eicchromatogram[i + 1].absoluteintensity == 0) && (eicchromatogram[i + 2].absoluteintensity == 0) && (eicchromatogram[i + 3].absoluteintensity == 0) && (eicchromatogram[i + 4].absoluteintensity == 0)) { + //calculateCaruana(x, y, ny, sigma, height); + calculateGuo(x, y, 10, ny, sigma, height); + nys.push_back(ny); + sigmas.push_back(sigma); + as.push_back(height); + x.clear(); + y.clear(); + } + } + } + else { + if (eicchromatogram[i].relativeintensity > 0) { + if (usert) { + if (timeunit == 1) { + x.push_back(rtimes[i] * 60.0); + } + else { + x.push_back(rtimes[i]); + } + y.push_back(eicchromatogram[i].relativeintensity); + } + else { + x.push_back(eicchromatogram[i].mzratio); + y.push_back(eicchromatogram[i].relativeintensity); + } + } + + if ((eicchromatogram[i].relativeintensity == 0) && (x.size() > 0)) { + if ((i + 4 < eicsize) && (eicchromatogram[i + 1].relativeintensity == 0) && (eicchromatogram[i + 2].relativeintensity == 0) && (eicchromatogram[i + 3].relativeintensity == 0) && (eicchromatogram[i + 4].relativeintensity == 0)) { + //calculateCaruana(x, y, ny, sigma, height); + calculateGuo(x, y, 10, ny, sigma, height); + nys.push_back(ny); + sigmas.push_back(sigma); + as.push_back(height); + x.clear(); + y.clear(); + } + } + } + } + + if (x.size() > 0) { + //calculateCaruana(x, y, ny, sigma, height); + calculateGuo(x, y, 10, ny, sigma, height); + nys.push_back(ny); + sigmas.push_back(sigma); + as.push_back(height); + } +} + + +void calculateExponentialParameters(cPeaksList& eicchromatogram, vector& rtimes, int timeunit, bool absoluteintensity, bool usert, bool fronting, double ynorm, vector& bases, vector& taus) { + if (eicchromatogram.size() != rtimes.size()) { + return; + } + + if ((rtimes.size() > 0) && (rtimes[rtimes.size() - 1] == 0)) { + usert = false; + } + + double base = 0; + double tau = 0; + + vector x; + vector y; + + bases.clear(); + taus.clear(); + + int eicsize = eicchromatogram.size(); + for (int i = 0; i < eicsize; i++) { + if (absoluteintensity) { + if (eicchromatogram[i].absoluteintensity > 0) { + if (usert) { + if (timeunit == 1) { + x.push_back(rtimes[i] * 60.0); + } + else { + x.push_back(rtimes[i]); + } + y.push_back(eicchromatogram[i].absoluteintensity); + } + else { + x.push_back(eicchromatogram[i].mzratio); + y.push_back(eicchromatogram[i].absoluteintensity); + } + } + + if ((eicchromatogram[i].absoluteintensity == 0) && (x.size() > 0)) { + if ((i + 4 < eicsize) && (eicchromatogram[i + 1].absoluteintensity == 0) && (eicchromatogram[i + 2].absoluteintensity == 0) && (eicchromatogram[i + 3].absoluteintensity == 0) && (eicchromatogram[i + 4].absoluteintensity == 0)) { + calculateTauUsingWeightedAverage(x, y, fronting, tau); + //calculateBaseTau(x, y, 10, fronting, ynorm, base, tau); + bases.push_back(base); + taus.push_back(tau); + x.clear(); + y.clear(); + } + } + } + else { + if (eicchromatogram[i].relativeintensity > 0) { + if (usert) { + if (timeunit == 1) { + x.push_back(rtimes[i] * 60.0); + } + else { + x.push_back(rtimes[i]); + } + y.push_back(eicchromatogram[i].relativeintensity); + } + else { + x.push_back(eicchromatogram[i].mzratio); + y.push_back(eicchromatogram[i].relativeintensity); + } + } + + if ((eicchromatogram[i].relativeintensity == 0) && (x.size() > 0)) { + if ((i + 4 < eicsize) && (eicchromatogram[i + 1].relativeintensity == 0) && (eicchromatogram[i + 2].relativeintensity == 0) && (eicchromatogram[i + 3].relativeintensity == 0) && (eicchromatogram[i + 4].relativeintensity == 0)) { + calculateTauUsingWeightedAverage(x, y, fronting, tau); + //calculateBaseTau(x, y, 10, fronting, ynorm, base, tau); + bases.push_back(base); + taus.push_back(tau); + x.clear(); + y.clear(); + } + } + } + } + + if (x.size() > 0) { + calculateTauUsingWeightedAverage(x, y, fronting, tau); + //calculateBaseTau(x, y, 10, fronting, ynorm, base, tau); + bases.push_back(base); + taus.push_back(tau); + } +} + + +cChromatogramWindowWidget::cChromatogramWindowWidget(cTheoreticalSpectrumList& listoftheoreticalspectra, QWidget* parent) { + this->listoftheoreticalspectra = &listoftheoreticalspectra; this->parent = parent; ticchromatogram.clear(); @@ -31,7 +996,9 @@ cChromatogramWindowWidget::cChromatogramWindowWidget(cTheoreticalSpectrumList& t retentiontime = true; absoluteintensity = true; - hidetic = false; + peakshape = 0; + rawdatastate = false; + hidetic = true; hideeic = false; hidelabels = false; @@ -133,13 +1100,13 @@ void cChromatogramWindowWidget::exportToPNG(QString filename) { } -void cChromatogramWindowWidget::recalculateTICChromatogram() { +void cChromatogramWindowWidget::recalculateTICChromatogram(int activefileid) { int spectrumcount, peakscount; unsigned long long intensity; cPeak chromatogrampeak; ticchromatogram.clear(); - spectrumcount = theoreticalspectrumlist->size(); + spectrumcount = listoftheoreticalspectra->size(activefileid); rtimes.clear(); @@ -149,21 +1116,22 @@ void cChromatogramWindowWidget::recalculateTICChromatogram() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); rtimes.resize(spectrumcount); for (int i = 0; i < spectrumcount; i++) { intensity = 0; - peakscount = (*theoreticalspectrumlist)[i].getExperimentalSpectrum().size(); + peakscount = listoftheoreticalspectra->get(activefileid, i).getExperimentalSpectrum().size(); for (int j = 0; j < peakscount; j++) { - intensity += (*theoreticalspectrumlist)[i].getExperimentalSpectrum()[j].absoluteintensity; + intensity += listoftheoreticalspectra->get(activefileid, i).getExperimentalSpectrum()[j].absoluteintensity; } chromatogrampeak.clear(); chromatogrampeak.mzratio = (double)(ticchromatogram.size() + 1); chromatogrampeak.absoluteintensity = intensity; ticchromatogram.add(chromatogrampeak); - rtimes[i] = (*theoreticalspectrumlist)[i].getExperimentalSpectrum().getRetentionTime(); + rtimes[i] = listoftheoreticalspectra->get(activefileid, i).getExperimentalSpectrum().getRetentionTime(); progress.setValue(i); } @@ -184,7 +1152,31 @@ void cChromatogramWindowWidget::recalculateTICChromatogram() { void cChromatogramWindowWidget::setEICChromatogram(cPeaksList eic) { eicchromatogram = eic; - redrawScene(); + + bool autoupdate = true; + if (autoupdate) { + int minscan = 0; + int maxscan = eicchromatogram.size(); + + for (int i = 0; i < eicchromatogram.size(); i++) { + if (eicchromatogram[i].absoluteintensity > 0) { + minscan = i + 1; + break; + } + } + + for (int i = eicchromatogram.size() - 1; i >= 0; i--) { + if (eicchromatogram[i].absoluteintensity > 0) { + maxscan = i + 1; + break; + } + } + + setScanIDInterval(minscan - 10, maxscan + 10); + } + else { + redrawScene(); + } } @@ -413,6 +1405,18 @@ void cChromatogramWindowWidget::redrawScene() { int printscan; bool printintensity; + vector nys; + vector sigmas; + vector as; + vector bases; + vector taus; + cPeaksList localeic = eicchromatogram; + + bool fronting = false; + if (peakshape == 2) { + fronting = true; + } + if (!hidetic) { if (absoluteintensity) { maxintensitytic = ticchromatogram.getMaximumAbsoluteIntensityFromMZInterval((double)minscan, (double)maxscan, false, false, other, false); @@ -424,19 +1428,59 @@ void cChromatogramWindowWidget::redrawScene() { if (!hideeic) { if (absoluteintensity) { - maxintensityeic = eicchromatogram.getMaximumAbsoluteIntensityFromMZInterval((double)minscan, (double)maxscan, false, false, other, false); + maxintensityeic = localeic.getMaximumAbsoluteIntensityFromMZInterval((double)minscan, (double)maxscan, false, false, other, false); } else { - maxintensityeic = eicchromatogram.getMaximumRelativeIntensityFromMZInterval((double)minscan, (double)maxscan, false, false, other, false); + maxintensityeic = localeic.getMaximumRelativeIntensityFromMZInterval((double)minscan, (double)maxscan, false, false, other, false); } } double maxintensity = max(maxintensitytic, maxintensityeic); + if (rawdatastate && !hideeic && (maxscan > minscan - 1)) { + size_t eicsize = localeic.size(); + for (int i = 0; i < eicsize; i++) { + if ((localeic[i].mzratio < (double)minscan) || (localeic[i].mzratio > (double)maxscan)) { + localeic[i].absoluteintensity = 0; + localeic[i].relativeintensity = 0; + } + } + + calculateGaussianParameters(localeic, rtimes, 1, absoluteintensity, false, nys, sigmas, as); + + double newmaxintensity = maxintensity; + for (int i = 0; i < (int)nys.size(); i++) { + if (as[i] / maxintensity > 2 * maxintensity) { + nys[i] = 0; + sigmas[i] = 0; + as[i] = 0; + } + + if (as[i] > newmaxintensity) { + newmaxintensity = as[i]; + } + } + + if (absoluteintensity) { + maxintensity = max(maxintensity, newmaxintensity); + } + else { + if ((newmaxintensity > maxintensity) && (newmaxintensity > 0)) { + for (int i = 0; i < localeic.size(); i++) { + localeic[i].relativeintensity = localeic[i].relativeintensity * maxintensity / newmaxintensity; + } + + for (int i = 0; i < (int)as.size(); i++) { + as[i] = as[i] * maxintensity / newmaxintensity; + } + } + } + } + scene->removeItem(zoomgroup); scene->clear(); - if ((ticchromatogram.size() < 2) || (hidetic && (eicchromatogram.size() < 2))) { + if ((ticchromatogram.size() < 2) || (hidetic && (localeic.size() < 2))) { simpletext = scene->addSimpleText("The chromatogram is not available.", myFont); simpletext->setPos(0, 0); scene->setSceneRect(scene->itemsBoundingRect()); @@ -477,7 +1521,7 @@ void cChromatogramWindowWidget::redrawScene() { if (maxscan - minscan > rulergranularity) { xstep = (w - leftmargin - rightmargin) / rulergranularity; for (int i = 1; i < rulergranularity; i++) { - printscan = minscan + (maxscan - minscan) / rulergranularity * i; + printscan = (double)minscan + (double)(maxscan - minscan) / (double)rulergranularity * (double)i; if (retentiontime) { if (printscan - 1 >= 0) { simpletext = scene->addSimpleText(QString::number(rtimes[printscan - 1]), myFont); @@ -556,7 +1600,7 @@ void cChromatogramWindowWidget::redrawScene() { for (int i = 0; i < ticchromatogram.size(); i++) { - if ((ticchromatogram[i].mzratio < (double)minscan) || (ticchromatogram[i].mzratio >(double)maxscan)) { + if ((ticchromatogram[i].mzratio < (double)minscan) || (ticchromatogram[i].mzratio > (double)maxscan)) { continue; } @@ -588,24 +1632,24 @@ void cChromatogramWindowWidget::redrawScene() { // EIC peaks if (!hideeic) { - for (int i = 0; i < eicchromatogram.size(); i++) { + for (int i = 0; i < localeic.size(); i++) { - if ((eicchromatogram[i].mzratio < (double)minscan) || (eicchromatogram[i].mzratio >(double)maxscan)) { + if ((localeic[i].mzratio < (double)minscan) || (localeic[i].mzratio > (double)maxscan)) { continue; } - x = getXPositionFromScanID((int)eicchromatogram[i].mzratio, w); + x = getXPositionFromScanID((int)localeic[i].mzratio, w); printintensity = true; if (absoluteintensity) { - y = eicchromatogram[i].absoluteintensity / maxintensity * (h - topmargin - bottommargin); - if (eicchromatogram[i].absoluteintensity == 0) { + y = localeic[i].absoluteintensity / maxintensity * (h - topmargin - bottommargin); + if (localeic[i].absoluteintensity == 0) { printintensity = false; } } else { - y = eicchromatogram[i].relativeintensity / maxintensity * (h - topmargin - bottommargin); - if (eicchromatogram[i].relativeintensity == 0) { + y = localeic[i].relativeintensity / maxintensity * (h - topmargin - bottommargin); + if (localeic[i].relativeintensity == 0) { printintensity = false; } } @@ -671,24 +1715,24 @@ void cChromatogramWindowWidget::redrawScene() { // EIC descriptions if (!hideeic && (peakscount < 500)) { - for (int i = 0; i < eicchromatogram.size(); i++) { + for (int i = 0; i < localeic.size(); i++) { - if ((eicchromatogram[i].mzratio < (double)minscan) || (eicchromatogram[i].mzratio >(double)maxscan)) { + if ((localeic[i].mzratio < (double)minscan) || (localeic[i].mzratio >(double)maxscan)) { continue; } - x = getXPositionFromScanID((int)eicchromatogram[i].mzratio, w); + x = getXPositionFromScanID((int)localeic[i].mzratio, w); printintensity = true; if (absoluteintensity) { - y = eicchromatogram[i].absoluteintensity / maxintensity * (h - topmargin - bottommargin); - if (eicchromatogram[i].absoluteintensity == 0) { + y = localeic[i].absoluteintensity / maxintensity * (h - topmargin - bottommargin); + if (localeic[i].absoluteintensity == 0) { printintensity = false; } } else { - y = eicchromatogram[i].relativeintensity / maxintensity * (h - topmargin - bottommargin); - if (eicchromatogram[i].relativeintensity == 0) { + y = localeic[i].relativeintensity / maxintensity * (h - topmargin - bottommargin); + if (localeic[i].relativeintensity == 0) { printintensity = false; } } @@ -706,10 +1750,10 @@ void cChromatogramWindowWidget::redrawScene() { hits.clear(); if (!hidelabels) { - tmplong = eicchromatogram[i].description.c_str(); + tmplong = localeic[i].description.c_str(); pos = tmplong.find("
"); while (pos != string::npos) { - tmpshort = tmplong.substr(0, pos - 1); + tmpshort = tmplong.substr(0, pos); hits.push_back(tmpshort); tmplong = tmplong.substr(pos + 5); pos = tmplong.find("
"); @@ -724,7 +1768,7 @@ void cChromatogramWindowWidget::redrawScene() { tmpshort = QString::number(rtimes[i]).toStdString(); } else { - tmpshort = QString::number((int)eicchromatogram[i].mzratio).toStdString(); + tmpshort = QString::number((int)localeic[i].mzratio).toStdString(); } hits.push_back(tmpshort); @@ -764,6 +1808,118 @@ void cChromatogramWindowWidget::redrawScene() { } + // estimate chromatographic profile peaks + if (rawdatastate && !hideeic && (maxscan > minscan - 1)) { + + double ynorm = (double)(h - topmargin - bottommargin); + + if (peakshape > 0) { + calculateExponentialParameters(localeic, rtimes, 1, absoluteintensity, false, fronting, ynorm, bases, taus); + } + + for (int i = 0; i < (int)nys.size(); i++) { + nys[i] = nys[i] - ((double)minscan - 1.0); + nys[i] /= (double)maxscan - ((double)minscan - 1.0); + nys[i] *= (double)(w - leftmargin - rightmargin); + nys[i] += leftmargin; + + sigmas[i] /= (double)maxscan - ((double)minscan - 1.0); + sigmas[i] *= (double)(w - leftmargin - rightmargin); + + as[i] /= maxintensity; + as[i] *= (double)(h - topmargin - bottommargin); + + if (peakshape > 0) { + taus[i] /= (double)maxscan - ((double)minscan - 1.0); + taus[i] *= (double)(w - leftmargin - rightmargin); + } + } + + const int step = 1; + + int xmin = getXPositionFromScanID(minscan - 1.0, w); + int xmax = getXPositionFromScanID(maxscan, w); + + double relint; + int yval; + + QPainterPath rpath; + + if (peakshape == 0) { + for (int i = xmin; i < xmax; i += step) { + relint = 0; + + for (int j = 0; j < (int)as.size(); j++) { + relint += computeGaussFunction((double)i, as[j], nys[j], sigmas[j]); + } + + yval = h - topmargin - bottommargin - (int)relint; + + if (i == xmin) { + rpath.moveTo(i, yval); + } + else { + rpath.lineTo(i, yval); + } + } + + scene->addPath(rpath, QPen(Qt::gray, 1, Qt::SolidLine)); + } + + if (as.size() == taus.size()) { + + QPainterPath rpath2; + + if (peakshape > 0) { + for (int i = xmin; i < xmax; i += step) { + relint = 0; + + for (int j = 0; j < (int)as.size(); j++) { + relint += computeExponentiallyModifiedGaussFunction((double)i, as[j], nys[j], sigmas[j], taus[j], fronting); + } + + yval = h - topmargin - bottommargin - (int)relint; + + if (i == xmin) { + rpath2.moveTo(i, yval); + } + else { + rpath2.lineTo(i, yval); + } + } + + scene->addPath(rpath2, QPen(Qt::gray, 1, Qt::SolidLine)); + } + + //if (taus.size() == bases.size()) { + + // QPainterPath rpath3; + + // for (int i = xmin; i < xmax; i += step) { + // relint = 0; + + // for (int j = 0; j < (int)taus.size(); j++) { + // relint += ynorm * taus[j] * computeExponentialFunction((double)i /** log(bases[j])*/, econst, taus[j], fronting); + // } + + // yval = h - topmargin - bottommargin - (int)relint; + + // if (i == xmin) { + // rpath3.moveTo(i, yval); + // } + // else { + // rpath3.lineTo(i, yval); + // } + // } + + // scene->addPath(rpath3, QPen(Qt::blue, 1, Qt::SolidLine)); + + //} + + } + + } + scene->removeItem(zoomgroup); QRectF brect = scene->itemsBoundingRect(); @@ -921,6 +2077,12 @@ void cChromatogramWindowWidget::absoluteIntensityStateChanged(bool state) { } +void cChromatogramWindowWidget::rawDataStateChanged(bool state) { + rawdatastate = state; + redrawScene(); +} + + void cChromatogramWindowWidget::setRetentionTimeInterval(double mintime, double maxtime) { if (rtimes.size() == 0) { return; @@ -1010,3 +2172,9 @@ void cChromatogramWindowWidget::hideLabels(bool state) { redrawScene(); } + +void cChromatogramWindowWidget::peakShapeChanged(int shape) { + peakshape = shape; + redrawScene(); +} + diff --git a/CycloBranch/gui/cChromatogramWindowWidget.h b/CycloBranch/gui/cChromatogramWindowWidget.h index f735129..e5df769 100644 --- a/CycloBranch/gui/cChromatogramWindowWidget.h +++ b/CycloBranch/gui/cChromatogramWindowWidget.h @@ -20,11 +20,171 @@ #include "core/utilities.h" #include "core/cTheoreticalSpectrumList.h" #include "gui/cEventFilter.h" +#include "gui/cPatternSimulatorSceneWidget.h" using namespace std; +/** + \brief Get area under Gaussian function. + \param sigma sigma + \param height height + \retval double area +*/ +double getGaussianArea(double sigma, double height); + + +/** + \brief Get area of EIC peaks (Gaussian function). + \param sigmas input vector of sigmas + \param heights input vector of heights + \retval double area +*/ +double getGaussianAreas(vector& sigmas, vector& heights); + + +/** + \brief Get area under Exponentially Modified Gaussian function. + \param x some value of x + \param h height of Gaussian + \param ny ny of Gaussian + \param sigma sigma of Gaussian + \param tau tau of Exponential + \param fronting true = fronting enabled, false = tailing enabled + \retval double area +*/ +double getExponentiallyModifiedGaussianArea(double x, double h, double ny, double sigma, double tau, bool fronting); + + +/** + \brief Get area of EIC peaks (Exponentially Modified Gaussian function). + \param xvalues vector of x values + \param heights vector of heights of Gaussians + \param nys vector of nys of Gaussians + \param sigmas vector of sigmas of Gaussians + \param taus vector of taus of Exponentials + \param fronting true = fronting enabled, false = tailing enabled + \retval double area +*/ +double getExponentiallyModifiedGaussianAreas(vector& xvalues, vector& heights, vector& nys, vector& sigmas, vector& taus, bool fronting); + + +/** + \brief Calculate erfcx(z). + \param z input value + \retval erfcx(z) +*/ +double erfcx(double z); + + +/** + \brief Calculate erfcxinv(z). + \param z input value + \retval erfcxinv(z) +*/ +double erfcxinv(double z); + + +/** + \brief Compute value of exponentially modified Gaussian function. + \param x x + \param h h + \param ny ny + \param sigma sigma + \param tau tau + \param fronting true = fronting enabled, false = tailing enabled + \retval double f(x) +*/ +double computeExponentiallyModifiedGaussFunction(double x, double h, double ny, double sigma, double tau, bool fronting); + + +/** + \brief Compute value of exponential function. + \param x x + \param base base + \param tau tau + \param fronting true = fronting enabled, false = tailing enabled + \retval double f(x) +*/ +double computeExponentialFunction(double x, double base, double tau, bool fronting); + + +/** + \brief Calculate ny, sigma, and height using Caruana's algorithm. + \param x input vector of x-coordinates + \param y input vector of y-coordinates + \param ny output value of ny + \param sigma output value of sigma + \param height output value of height +*/ +void calculateCaruana(vector& x, vector& y, double& ny, double& sigma, double& height); + + +/** + \brief Calculate ny, sigma, and height using Guo's algorithm. + \param x input vector of x-coordinates + \param y input vector of y-coordinates + \param iterations number of iterations + \param ny output value of ny + \param sigma output value of sigma + \param height output value of height +*/ +void calculateGuo(vector& x, vector& y, int iterations, double& ny, double& sigma, double& height); + + +/** + \brief Calculate base and tau for exponential distribution. + \param x input vector of x-coordinates + \param y input vector of y-coordinates + \param iterations number of iterations + \param fronting true = fronting enabled, false = tailing enabled + \param ynorm y axis normalization value + \param base output value of base + \param tau output value of tau +*/ +void calculateBaseTau(vector& x, vector& y, int iterations, bool fronting, double ynorm, double& base, double& tau); + + +/** + \brief Calculate tau for exponential distribution using weighted average. + \param x input vector of x-coordinates + \param y input vector of y-coordinates + \param fronting true = fronting enabled, false = tailing enabled + \param tau output value of tau +*/ +void calculateTauUsingWeightedAverage(vector& x, vector& y, bool fronting, double& tau); + + +/** + \brief Get parameters of Gaussians functions (nys, sigmas, and heights). + \param eicchromatogram input EIC chromatogram + \param rtimes input retention time vector + \param timeunit RT time unit + \param absoluteintensity use absolute intensities + \param usert use RT instead of scan ids + \param nys output vector of nys + \param sigmas output vector of sigmas + \param as output vector of heights +*/ +void calculateGaussianParameters(cPeaksList& eicchromatogram, vector& rtimes, int timeunit, bool absoluteintensity, bool usert, vector& nys, vector& sigmas, vector& as); + + +/** + \brief Get parameters of Exponential functions (bases and taus). + \param eicchromatogram input EIC chromatogram + \param rtimes input retention time vector + \param timeunit RT time unit + \param absoluteintensity use absolute intensities + \param usert use RT instead of scan ids + \param fronting true = fronting enabled, false = tailing enabled + \param ynorm y axis normalization value + \param bases output vector of bases + \param taus output vector of taus +*/ +void calculateExponentialParameters(cPeaksList& eicchromatogram, vector& rtimes, int timeunit, bool absoluteintensity, bool usert, bool fronting, double ynorm, vector& bases, vector& taus); + + /** \brief Chromatogram window widget. */ @@ -37,10 +197,10 @@ class cChromatogramWindowWidget : public QGraphicsView /** \brief The constructor. - \param theoreticalspectrumlist list of spectra + \param listoftheoreticalspectra lists of theoretical spectra \param parent pointer to a parent widget */ - cChromatogramWindowWidget(cTheoreticalSpectrumList& theoreticalspectrumlist, QWidget* parent = 0); + cChromatogramWindowWidget(cTheoreticalSpectrumList& listoftheoreticalspectra, QWidget* parent = 0); /** @@ -73,8 +233,9 @@ class cChromatogramWindowWidget : public QGraphicsView /** \brief Recalculate TIC chromatogram. + \param activefileid id of an active file */ - void recalculateTICChromatogram(); + void recalculateTICChromatogram(int activefileid); /** @@ -137,7 +298,7 @@ class cChromatogramWindowWidget : public QGraphicsView private: - cTheoreticalSpectrumList* theoreticalspectrumlist; + cTheoreticalSpectrumList* listoftheoreticalspectra; cPeaksList ticchromatogram; cPeaksList eicchromatogram; vector rtimes; @@ -178,6 +339,8 @@ class cChromatogramWindowWidget : public QGraphicsView bool retentiontime; bool absoluteintensity; + bool rawdatastate; + int peakshape; bool hidetic; bool hideeic; bool hidelabels; @@ -241,6 +404,9 @@ private slots: void absoluteIntensityStateChanged(bool state); + void rawDataStateChanged(bool state); + + void setRetentionTimeInterval(double mintime, double maxtime); @@ -263,6 +429,9 @@ private slots: void hideLabels(bool state); + + + void peakShapeChanged(int shape); }; diff --git a/CycloBranch/gui/cDefineCalibrationWidget.cpp b/CycloBranch/gui/cDefineCalibrationWidget.cpp new file mode 100644 index 0000000..5a7c715 --- /dev/null +++ b/CycloBranch/gui/cDefineCalibrationWidget.cpp @@ -0,0 +1,631 @@ +#include "gui/cDefineCalibrationWidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +cDefineCalibrationWidget::cDefineCalibrationWidget() { + setWindowTitle("Define Samples and Calibration Curve..."); + setWindowIcon(QIcon(":/images/icons/features.png")); + + vlayout = new QVBoxLayout(); + filelistwidget = new QWidget(); + + gridlayout = new QGridLayout(); + + uselabel = new QLabel("Use: "); + filelabel = new QLabel("Filename: "); + datatypelabel = new QLabel("Data Type: "); + grouplabel = new QLabel("Group: "); + concentrationlabel = new QLabel("Concentration: "); + + filelistwidget->setLayout(gridlayout); + + compoundslabel = new QLabel("Ion Types: "); + compoundslist = new QListWidget(); + compoundslist->setSelectionMode(QAbstractItemView::MultiSelection); + compoundslayout = new QVBoxLayout(); + compoundswidget = new QWidget(); + + compoundslayout->addWidget(compoundslabel); + compoundslayout->addWidget(compoundslist); + compoundswidget->setLayout(compoundslayout); + + equationcombobox = new QComboBox(); + equationcombobox->setToolTip("Select the type of equation to estimate its parameters."); + equationcombobox->setSizeAdjustPolicy(QComboBox::AdjustToContents); + equationcombobox->addItem("Automatic mode (y = a*x)"); + equationcombobox->addItem("Automatic mode (y = a*x + b)"); + equationcombobox->addItem("Enter parameters manually"); + + connect(equationcombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(equationChanged(int))); + + doublespinboxa = new QDoubleSpinBox(); + doublespinboxa->setRange(-DBL_MAX, DBL_MAX); + doublespinboxa->setDecimals(6); + doublespinboxa->setValue(1); + doublespinboxa->setDisabled(true); + doublespinboxa->setToolTip("Enter the value of 'a' in the calibration curve 'y = a*x + b'."); + + doublespinboxb = new QDoubleSpinBox(); + doublespinboxb->setRange(-DBL_MAX, DBL_MAX); + doublespinboxb->setDecimals(6); + doublespinboxb->setValue(1); + doublespinboxb->setDisabled(true); + doublespinboxb->setToolTip("Enter the value of 'b' in the calibration curve 'y = a*x + b'."); + + eiccombobox = new QComboBox(); + eiccombobox->setToolTip("Select a method for construction of extracted ion chromatogram.\nHighest Peak = Intensity of the highest peak of a given ion in every spectrum is used.\nAll isotopes = Sums of intensities of all isotopes of a given ion in every spectrum are used."); + eiccombobox->setSizeAdjustPolicy(QComboBox::AdjustToContents); + eiccombobox->addItem("Highest Peak (e.g., 12C)"); + eiccombobox->addItem("All Isotopes (e.g., sum of 12C + 13C + 13C2 + ...)"); + + peakshapecombobox = new QComboBox(); + peakshapecombobox->setToolTip("Select chromatographic peak shape to be used for area and concentration calculations:\nGaussian = basic Gaussian function,\nex-Gaussian (tailing) = Exponentially Modified Gaussian for chromatographic peaks with tailing,\nex-Gaussian (fronting) = Exponentially Modified Gaussian for chromatographic peaks with fronting."); + peakshapecombobox->setSizeAdjustPolicy(QComboBox::AdjustToContents); + peakshapecombobox->addItem("Gaussian"); + peakshapecombobox->addItem("ex-Gaussian (tailing)"); + peakshapecombobox->addItem("ex-Gaussian (fronting)"); + + standardcombobox = new QComboBox(); + standardcombobox->setToolTip("Select compound standard."); + standardcombobox->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + formlayout = new QFormLayout(); + formwidget = new QWidget(); + + formlayout->addRow(tr("Equation: "), equationcombobox); + formlayout->addRow(tr("a: "), doublespinboxa); + formlayout->addRow(tr("b: "), doublespinboxb); + formlayout->addRow(tr("Extracted Ion Chromatogram: "), eiccombobox); + formlayout->addRow(tr("Peak Shape: "), peakshapecombobox); + formlayout->addRow(tr("Standard: "), standardcombobox); + formwidget->setLayout(formlayout); + + okbutton = new QPushButton("Ok"); + cancelbutton = new QPushButton("Cancel"); + buttonslayout = new QHBoxLayout(); + buttonswidget = new QWidget(); + + buttonslayout->addStretch(1); + buttonslayout->addWidget(okbutton); + buttonslayout->addWidget(cancelbutton); + + buttonswidget->setLayout(buttonslayout); + + connect(okbutton, SIGNAL(released()), this, SLOT(okButtonReleased())); + connect(cancelbutton, SIGNAL(released()), this, SLOT(cancelButtonReleased())); + + vlayout->addWidget(filelistwidget); + vlayout->addWidget(compoundswidget); + vlayout->addWidget(formwidget); + vlayout->addWidget(buttonswidget); + vlayout->addStretch(1); + + scrollwidget = new QWidget(); + scrollwidget->setLayout(vlayout); + + scrollarea = new QScrollArea(); + scrollarea->setWidgetResizable(true); + scrollarea->setFrameShape(QFrame::NoFrame); + scrollarea->setWidget(scrollwidget); + + scrolllayout = new QVBoxLayout(); + scrolllayout->addWidget(scrollarea); + + setLayout(scrolllayout); + + resize(750, defaultwinsizey); + + internalusedvector.clear(); + internalfilenames.clear(); + internaldatatypesvector.clear(); + internalgroupsvector.clear(); + internalconcentrationsvector.clear(); + + internalcompounds.clear(); + internalselectedionsvector.clear(); + + internalequationtype = 0; + internala = 1; + internalb = 0; + internaleictype = 0; + internalpeakshape = 0; + internalstandard = 0; +} + + +cDefineCalibrationWidget::~cDefineCalibrationWidget() { + delete uselabel; + delete filelabel; + delete datatypelabel; + delete grouplabel; + delete concentrationlabel; + + for (auto& it : checkboxes) { + delete it; + } + + for (auto& it : lineedits) { + delete it; + } + + for (auto& it : comboboxes) { + delete it; + } + + for (auto& it : spinboxes) { + delete it; + } + + for (auto& it : doublespinboxes) { + delete it; + } + + delete gridlayout; + delete filelistwidget; + + delete compoundslabel; + delete compoundslist; + delete compoundslayout; + delete compoundswidget; + + delete equationcombobox; + delete doublespinboxa; + delete doublespinboxb; + delete eiccombobox; + delete peakshapecombobox; + delete standardcombobox; + + delete formlayout; + delete formwidget; + + delete okbutton; + delete cancelbutton; + delete buttonslayout; + delete buttonswidget; + + delete vlayout; + + delete scrollwidget; + delete scrollarea; + delete scrolllayout; +} + + +void cDefineCalibrationWidget::closeEvent(QCloseEvent *event) { + hide(); + event->accept(); +} + + +void cDefineCalibrationWidget::store(ofstream& os) { + storeIntVector(internalusedvector, os); + storeStringVector(internalfilenames, os); + storeIntVector(internaldatatypesvector, os); + storeIntVector(internalgroupsvector, os); + storeDoubleVector(internalconcentrationsvector, os); + + storeStringVector(internalcompounds, os); + storeIntVector(internalselectedionsvector, os); + + os.write((char *)&internalequationtype, sizeof(int)); + os.write((char *)&internaleictype, sizeof(int)); + os.write((char *)&internalpeakshape, sizeof(int)); + os.write((char *)&internalstandard, sizeof(int)); + + os.write((char *)&internala, sizeof(double)); + os.write((char *)&internalb, sizeof(double)); +} + + +void cDefineCalibrationWidget::load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3) { + loadIntVector(internalusedvector, is); + loadStringVector(internalfilenames, is); + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 18)) { + loadIntVector(internaldatatypesvector, is); + loadIntVector(internalgroupsvector, is); + } + else { + internaldatatypesvector.clear(); + internaldatatypesvector.resize(internalusedvector.size(), 0); + + internalgroupsvector.clear(); + internalgroupsvector.resize(internalusedvector.size()); + + for (int i = 0; i < (int)internalgroupsvector.size(); i++) { + internalgroupsvector[i] = i + 1; + } + } + + loadDoubleVector(internalconcentrationsvector, is); + + loadStringVector(internalcompounds, is); + loadIntVector(internalselectedionsvector, is); + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 16)) { + is.read((char *)&internalequationtype, sizeof(int)); + is.read((char *)&internaleictype, sizeof(int)); + is.read((char *)&internalpeakshape, sizeof(int)); + is.read((char *)&internalstandard, sizeof(int)); + } + else { + internalequationtype = 0; + internaleictype = 0; + internalpeakshape = 0; + internalstandard = 0; + } + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 19)) { + is.read((char *)&internala, sizeof(double)); + is.read((char *)&internalb, sizeof(double)); + } + else { + internala = 1; + internalb = 0; + } +} + + +void cDefineCalibrationWidget::prepareWidget(vector& filenames, vector& compounds) { + delete uselabel; + delete filelabel; + delete datatypelabel; + delete grouplabel; + delete concentrationlabel; + + for (auto& it : checkboxes) { + delete it; + } + + for (auto& it : lineedits) { + delete it; + } + + for (auto& it : comboboxes) { + delete it; + } + + for (auto& it : spinboxes) { + delete it; + } + + for (auto& it : doublespinboxes) { + delete it; + } + + checkboxes.clear(); + lineedits.clear(); + comboboxes.clear(); + spinboxes.clear(); + doublespinboxes.clear(); + + delete gridlayout; + + bool load = compareStringVectors(internalfilenames, filenames) && compareStringVectors(internalcompounds, compounds) && (filenames.size() == internalusedvector.size()) && (filenames.size() == internaldatatypesvector.size()) && (filenames.size() == internalgroupsvector.size()) && (filenames.size() == internalconcentrationsvector.size()) && (compounds.size() == internalselectedionsvector.size()); + + if (!load) { + internalusedvector.clear(); + internalfilenames = filenames; + internaldatatypesvector.clear(); + internalgroupsvector.clear(); + internalconcentrationsvector.clear(); + + internalcompounds = compounds; + internalselectedionsvector.clear(); + + internalequationtype = 0; + internala = 1; + internalb = 0; + internaleictype = 0; + internalpeakshape = 0; + internalstandard = 0; + } + + gridlayout = new QGridLayout(); + filelistwidget->setLayout(gridlayout); + + uselabel = new QLabel("Use: "); + filelabel = new QLabel("Filename: "); + datatypelabel = new QLabel("Data Type: "); + grouplabel = new QLabel("Group: "); + concentrationlabel = new QLabel("Concentration: "); + + gridlayout->addWidget(uselabel, 0, 0, 1, 1); + gridlayout->addWidget(filelabel, 0, 1, 1, 10); + gridlayout->addWidget(datatypelabel, 0, 11, 1, 2); + gridlayout->addWidget(grouplabel, 0, 13, 1, 1); + gridlayout->addWidget(concentrationlabel, 0, 14, 1, 1); + + int size = (int)filenames.size(); + for (int i = 0; i < size; i++) { + QCheckBox* checkbox = new QCheckBox(); + checkbox->setChecked(true); + checkboxes.push_back(checkbox); + + QLineEdit* lineedit = new QLineEdit(); + lineedit->setText(filenames[i].c_str()); + lineedit->setDisabled(true); + lineedits.push_back(lineedit); + + QComboBox* combobox = new QComboBox(); + combobox->addItem("Sample"); + combobox->addItem("Calibration"); + comboboxes.push_back(combobox); + + connect(combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(dataTypeChanged(int))); + + QSpinBox* spinbox = new QSpinBox(); + spinbox->setToolTip("Enter a number. Items with the same number form a group of technical replicates and the results are averaged."); + spinbox->setRange(0, 1000000); + spinbox->setSingleStep(1); + spinboxes.push_back(spinbox); + spinbox->setValue((int)spinboxes.size()); + + QDoubleSpinBox* doublespinbox = new QDoubleSpinBox(); + doublespinbox->setToolTip("Enter the concentration of compound in corresponding dataset. Units are dataset dependent. Multiple datasets can have the same value (results are averaged)."); + doublespinbox->setDecimals(3); + doublespinbox->setRange(0, 1000000); + doublespinbox->setSingleStep(1); + doublespinboxes.push_back(doublespinbox); + + doublespinbox->setDisabled(true); + + gridlayout->addWidget(checkbox, i + 1, 0, 1, 1); + gridlayout->addWidget(lineedit, i + 1, 1, 1, 10); + gridlayout->addWidget(combobox, i + 1, 11, 1, 2); + gridlayout->addWidget(spinbox, i + 1, 13, 1, 1); + gridlayout->addWidget(doublespinbox, i + 1, 14, 1, 1); + + if (load) { + checkbox->setChecked(internalusedvector[i]); + combobox->setCurrentIndex(internaldatatypesvector[i]); + spinbox->setValue(internalgroupsvector[i]); + doublespinbox->setValue(internalconcentrationsvector[i]); + } + else { + internalusedvector.push_back(checkbox->isChecked()); + internaldatatypesvector.push_back(combobox->currentIndex()); + internalgroupsvector.push_back(spinbox->value()); + internalconcentrationsvector.push_back(doublespinbox->value()); + } + } + + compoundslist->clear(); + + standardcombobox->clear(); + standardcombobox->addItem("None"); + + size = (int)compounds.size(); + for (int i = 0; i < size; i++) { + compoundslist->addItem(compounds[i].c_str()); + + if (load) { + compoundslist->item(i)->setSelected(internalselectedionsvector[i]); + } + else { + internalselectedionsvector.push_back(false); + } + + standardcombobox->addItem(compounds[i].c_str()); + } + + equationcombobox->setCurrentIndex(internalequationtype); + doublespinboxa->setValue(internala); + doublespinboxb->setValue(internalb); + eiccombobox->setCurrentIndex(internaleictype); + peakshapecombobox->setCurrentIndex(internalpeakshape); + standardcombobox->setCurrentIndex(internalstandard); +} + + +void cDefineCalibrationWidget::getData(vector& usedvector, vector& datatypesvector, vector& groupsvector, vector& concentrationsvector, vector& selectedionsvector, int& equationtype, double& manuala, double& manualb, int& eictype, int& peakshape, int& standard) { + usedvector = internalusedvector; + datatypesvector = internaldatatypesvector; + groupsvector = internalgroupsvector; + concentrationsvector = internalconcentrationsvector; + selectedionsvector = internalselectedionsvector; + + equationtype = internalequationtype; + manuala = internala; + manualb = internalb; + eictype = internaleictype; + peakshape = internalpeakshape; + standard = internalstandard; +} + + +void cDefineCalibrationWidget::keyPressEvent(QKeyEvent *event) { + if (event->key() == Qt::Key_Escape) { + hide(); + } + + if (event->key() == Qt::Key_F1) { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/annotatedfeatures.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/annotatedfeatures.html").absoluteFilePath())); + #endif + } + + event->accept(); +} + + +void cDefineCalibrationWidget::okButtonReleased() { + int firstvalue = -1; + bool allzeros = true; + int size; + + if (equationcombobox->currentIndex() < 2) { + + size = (int)checkboxes.size(); + for (int i = 0; i < size; i++) { + if (checkboxes[i]->isChecked() && (comboboxes[i]->currentIndex() == 1)) { + if (firstvalue == -1) { + firstvalue = doublespinboxes[i]->value() * 1000.0; + } + else { + if (firstvalue != doublespinboxes[i]->value() * 1000.0) { + allzeros = false; + break; + } + } + } + } + + if (allzeros) { + QMessageBox msgBox; + QString errstr = "At least two different values of concentration must be defined !"; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + } + else { + + if (doublespinboxa->value() == 0) { + QMessageBox msgBox; + QString errstr = "The parameter 'a' cannot be zero !"; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + } + + allzeros = true; + + size = (int)compoundslist->count(); + for (int i = 0; i < size; i++) { + if (compoundslist->item(i)->isSelected()) { + allzeros = false; + break; + } + } + + if (allzeros) { + QMessageBox msgBox; + QString errstr = "At least one ion type must be selected !"; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + internalusedvector.clear(); + internalfilenames.clear(); + internaldatatypesvector.clear(); + internalgroupsvector.clear(); + internalconcentrationsvector.clear(); + + size = (int)lineedits.size(); + for (int i = 0; i < size; i++) { + internalusedvector.push_back(checkboxes[i]->isChecked()); + internalfilenames.push_back(lineedits[i]->text().toStdString()); + internaldatatypesvector.push_back(comboboxes[i]->currentIndex()); + internalgroupsvector.push_back(spinboxes[i]->value()); + internalconcentrationsvector.push_back(doublespinboxes[i]->value()); + } + + internalcompounds.clear(); + internalselectedionsvector.clear(); + + size = (int)compoundslist->count(); + for (int i = 0; i < size; i++) { + internalcompounds.push_back(compoundslist->item(i)->text().toStdString()); + internalselectedionsvector.push_back(compoundslist->item(i)->isSelected()); + } + + internalequationtype = equationcombobox->currentIndex(); + internala = doublespinboxa->value(); + internalb = doublespinboxb->value(); + internaleictype = eiccombobox->currentIndex(); + internalpeakshape = peakshapecombobox->currentIndex(); + internalstandard = standardcombobox->currentIndex(); + + hide(); + + emit calibrationRedefined(); +} + + +void cDefineCalibrationWidget::cancelButtonReleased() { + int size = (int)internalfilenames.size(); + for (int i = 0; i < size; i++) { + checkboxes[i]->setChecked(internalusedvector[i]); + lineedits[i]->setText(internalfilenames[i].c_str()); + comboboxes[i]->setCurrentIndex(internaldatatypesvector[i]); + spinboxes[i]->setValue(internalgroupsvector[i]); + doublespinboxes[i]->setValue(internalconcentrationsvector[i]); + } + + compoundslist->clear(); + + size = (int)internalcompounds.size(); + for (int i = 0; i < size; i++) { + compoundslist->addItem(internalcompounds[i].c_str()); + compoundslist->item(i)->setSelected(internalselectedionsvector[i]); + } + + equationcombobox->setCurrentIndex(internalequationtype); + doublespinboxa->setValue(internala); + doublespinboxb->setValue(internalb); + eiccombobox->setCurrentIndex(internaleictype); + peakshapecombobox->setCurrentIndex(internalpeakshape); + standardcombobox->setCurrentIndex(internalstandard); + + hide(); +} + + +void cDefineCalibrationWidget::dataTypeChanged(int index) { + QComboBox* combobox = qobject_cast(sender()); + int position = gridlayout->indexOf(combobox); + + int row, column, rowspan, colspan; + gridlayout->getItemPosition(position, &row, &column, &rowspan, &colspan); + + row--; + + if (row < 0) { + return; + } + + if (index == 0) { + spinboxes[row]->setDisabled(false); + doublespinboxes[row]->setDisabled(true); + } + + if (index == 1) { + spinboxes[row]->setDisabled(true); + doublespinboxes[row]->setDisabled(false); + } +} + + +void cDefineCalibrationWidget::equationChanged(int index) { + if (index == 2) { + doublespinboxa->setEnabled(true); + doublespinboxb->setEnabled(true); + } + else { + doublespinboxa->setEnabled(false); + doublespinboxb->setEnabled(false); + } +} + diff --git a/CycloBranch/gui/cDefineCalibrationWidget.h b/CycloBranch/gui/cDefineCalibrationWidget.h new file mode 100644 index 0000000..4323286 --- /dev/null +++ b/CycloBranch/gui/cDefineCalibrationWidget.h @@ -0,0 +1,199 @@ +/** + \file cDefineCalibrationWidget.h + \brief The widget for definition of calibration curve. +*/ + + +#ifndef _CDEFINECALIBRATIONWIDGET_H +#define _CDEFINECALIBRATIONWIDGET_H + +#include +#include +#include +#include + +#include "core/utilities.h" + + +// forward declaration +class QScrollArea; +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QLabel; +class QListWidget; +class QCheckBox; +class QLineEdit; +class QSpinBox; +class QDoubleSpinBox; +class QPushButton; +class QComboBox; +class QFormLayout; + + +/** + \brief The widget for definition of calibration curve. +*/ +class cDefineCalibrationWidget : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + */ + cDefineCalibrationWidget(); + + + /** + \brief The destructor. + */ + ~cDefineCalibrationWidget(); + + + /** + \brief Handle the window close event. + \param event pointer to QCloseEvent + */ + void closeEvent(QCloseEvent *event); + + + /** + \brief Store the content into an output stream. + \param os an output stream + */ + void store(ofstream& os); + + + /** + \brief Load the content from an input stream. + \param is an input stream + \param fileversionpart1 first number of .res the file version + \param fileversionpart2 second number of .res the file version + \param fileversionpart3 third number of .res the file version + */ + void load(ifstream& is, int fileversionpart1, int fileversionpart2, int fileversionpart3); + + + /** + \brief Prepare widget for visualization. + \param filenames list of files + \param compounds list of compounds + */ + void prepareWidget(vector& filenames, vector& compounds); + + + /** + \brief Get data from dialog. + \param usedvector vector of used items + \param datatypesvector vector of sample types + \param groupsvector vector of groups of technical replicates + \param concentrationsvector vector of concentrations + \param selectedionsvector vector of selected ions + \param equationtype type of linear equation (y = a*x, y = a*x + b or manual mode) + \param manuala the parameter 'a' in manual mode + \param manualb the parameter 'b' in manual mode + \param eictype type of EIC chromatogram (highest peaks = 0, all isotopes = 1) + \param peakshape shape of chromatographic peak + \param standard compound standard + */ + void getData(vector& usedvector, vector& datatypesvector, vector& groupsvector, vector& concentrationsvector, vector& selectedionsvector, int& equationtype, double& manuala, double& manualb, int& eictype, int& peakshape, int& standard); + + +private: + + QScrollArea* scrollarea; + QWidget* scrollwidget; + QVBoxLayout* scrolllayout; + + QVBoxLayout* vlayout; + QWidget* filelistwidget; + + QGridLayout* gridlayout; + + QLabel* uselabel; + QLabel* filelabel; + QLabel* grouplabel; + QLabel* datatypelabel; + QLabel* concentrationlabel; + + vector checkboxes; + vector lineedits; + vector comboboxes; + vector spinboxes; + vector doublespinboxes; + + QLabel* compoundslabel; + QListWidget* compoundslist; + QVBoxLayout* compoundslayout; + QWidget* compoundswidget; + + QFormLayout* formlayout; + QWidget* formwidget; + + QComboBox* equationcombobox; + QDoubleSpinBox* doublespinboxa; + QDoubleSpinBox* doublespinboxb; + QComboBox* eiccombobox; + QComboBox* peakshapecombobox; + QComboBox* standardcombobox; + + QPushButton* okbutton; + QPushButton* cancelbutton; + QHBoxLayout* buttonslayout; + QWidget* buttonswidget; + + vector internalusedvector; + vector internalfilenames; + vector internaldatatypesvector; + vector internalgroupsvector; + vector internalconcentrationsvector; + + vector internalcompounds; + vector internalselectedionsvector; + + int internalequationtype; + double internala; + double internalb; + int internaleictype; + int internalpeakshape; + int internalstandard; + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + void keyPressEvent(QKeyEvent *event); + + +private slots: + + void okButtonReleased(); + + + void cancelButtonReleased(); + + + void dataTypeChanged(int index); + + + void equationChanged(int index); + + +signals: + + + /** + \brief Parameters of calibration curve were redefined. + */ + void calibrationRedefined(); + +}; + +#endif + diff --git a/CycloBranch/gui/cFormulaPredictor.cpp b/CycloBranch/gui/cFormulaPredictor.cpp new file mode 100644 index 0000000..ccd04dd --- /dev/null +++ b/CycloBranch/gui/cFormulaPredictor.cpp @@ -0,0 +1,720 @@ +#include "gui/cFormulaPredictor.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "core/cParameters.h" + + +cFormulaPredictor::cFormulaPredictor(cGlobalPreferences* globalpreferences, QWidget *parent) { + this->parent = parent; + this->globalpreferences = globalpreferences; + + formulapredictorthread = 0; + chargevalue = 0; + maximumcombinedelements = 0; + basicformulacheck = false; + advancedformulacheck = false; + noratiocheck = false; + mzvalue = 0; + mzerror = 0; + + selectedions.clear(); + selectedelements.clear(); + ionitems.clear(); + + success = false; + terminatecomputation = false; + errmsg = ""; + + pchemdata.clear(); + + setWindowTitle("Calculate Molecular Formula"); + setWindowIcon(QIcon(":/images/icons/formula.png")); + + menuBar = new QMenuBar(this); + menuBar->setNativeMenuBar(false); + menuFile = new QMenu(tr("&File"), this); + menuSearch = new QMenu(tr("&Search"), this); + menuHelp = new QMenu(tr("&Help"), this); + + toolbarFile = addToolBar(tr("File")); + + 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); + connect(actionExportTable, SIGNAL(triggered()), this, SLOT(exportTableToCSV())); + + actionCloseWindow = new QAction(QIcon(":/images/icons/33.png"), tr("&Close"), this); + actionCloseWindow->setShortcut(QKeySequence(Qt::Key_Escape)); + actionCloseWindow->setToolTip("Close (Esc)"); + toolbarFile->addAction(actionCloseWindow); + connect(actionCloseWindow, SIGNAL(triggered()), this, SLOT(closeWindow())); + + toolbarSearch = addToolBar(tr("Search")); + + actionSearchPubChem = new QAction(QIcon(":/images/icons/search.png"), tr("Search &PubChem..."), this); + actionSearchPubChem->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); + actionSearchPubChem->setToolTip("Search PubChem... (Ctrl + P)"); + toolbarSearch->addAction(actionSearchPubChem); + connect(actionSearchPubChem, SIGNAL(triggered()), this, SLOT(searchPubChem())); + + toolbarHelp = addToolBar(tr("Help")); + + actionHTMLDocumentation = new QAction(QIcon(":/images/icons/3.png"), tr("&HTML Documentation"), this); + actionHTMLDocumentation->setShortcut(QKeySequence(Qt::Key_F1)); + actionHTMLDocumentation->setToolTip("Show HTML Documentation (F1)"); + toolbarHelp->addAction(actionHTMLDocumentation); + connect(actionHTMLDocumentation, SIGNAL(triggered()), this, SLOT(showHTMLDocumentation())); + + const int formwidth = 350; + + formlayout = new QFormLayout(); + + doublespinboxmz = new QDoubleSpinBox(); + doublespinboxmz->setToolTip("Enter the value of m/z."); + doublespinboxmz->setFixedWidth(formwidth); + doublespinboxmz->setDecimals(6); + doublespinboxmz->setRange(0, 1000000); + doublespinboxmz->setSingleStep(1); + doublespinboxmz->setValue(500.0); + formlayout->addRow(tr("m/z: "), doublespinboxmz); + + spinboxcharge = new QSpinBox(); + spinboxcharge->setToolTip("Enter the value of charge. Use negative values in negative ion mode (e.g., -1)."); + spinboxcharge->setFixedWidth(formwidth); + spinboxcharge->setRange(-100, 100); + spinboxcharge->setSingleStep(1); + spinboxcharge->setValue(1); + formlayout->addRow(tr("Charge: "), spinboxcharge); + + doublespinboxmzerror = new QDoubleSpinBox(); + doublespinboxmzerror->setToolTip("Enter the m/z error tolerance in ppm."); + doublespinboxmzerror->setFixedWidth(formwidth); + doublespinboxmzerror->setDecimals(6); + doublespinboxmzerror->setRange(0, 10000); + doublespinboxmzerror->setSingleStep(1); + doublespinboxmzerror->setValue(5.0); + doublespinboxmzerror->setSuffix(" ppm"); + formlayout->addRow(tr("m/z Error Tolerance: "), doublespinboxmzerror); + + widgetiontypes = new cFragmentIonsListWidget(this); + widgetiontypes->setToolTip("Select the types of ions to be generated."); + widgetiontypes->setFixedWidth(formwidth); + formlayout->addRow(tr("Ion Types: "), widgetiontypes); + + widgetelements = new cNeutralLossesListWidget(false, true, this); + widgetelements->setToolTip("Define and select the chemical elements. Use the colon to limit the maximum number of occurrences of an element (e.g., S:2)."); + widgetelements->setFixedWidth(formwidth); + formlayout->addRow(tr("Chemical Elements: "), widgetelements); + + spinboxmaximumcombinedelements = new QSpinBox(); + spinboxmaximumcombinedelements->setToolTip("Enter the maximum number of chemical elements in a neutral molecule (i.e., M)."); + spinboxmaximumcombinedelements->setRange(1, 10000); + spinboxmaximumcombinedelements->setSingleStep(1); + spinboxmaximumcombinedelements->setFixedWidth(formwidth); + spinboxmaximumcombinedelements->setValue(200); + formlayout->addRow(tr("Maximum Number of Combined Elements "), spinboxmaximumcombinedelements); + + checkboxbasicformula = new QCheckBox(); + checkboxbasicformula->setToolTip("Apply Senior's filtering rules."); + checkboxbasicformula->setFixedWidth(formwidth); + checkboxbasicformula->setChecked(true); + formlayout->addRow(tr("Basic Formula Check: "), checkboxbasicformula); + + checkboxadvancedformula = new QCheckBox(); + checkboxadvancedformula->setToolTip("Apply advanced filtering rules."); + checkboxadvancedformula->setFixedWidth(formwidth); + checkboxadvancedformula->setChecked(true); + formlayout->addRow(tr("Advanced Formula Check: "), checkboxadvancedformula); + + checkboxnoratio = new QCheckBox(); + checkboxnoratio->setToolTip("Check if the number of nitrogen atoms is less or equal to the number of oxygen atoms."); + checkboxnoratio->setFixedWidth(formwidth); + checkboxnoratio->setChecked(true); + formlayout->addRow(tr("N/O Ratio Check: "), checkboxnoratio); + + predictbutton = new QPushButton("Calculate"); + predictbutton->setFixedWidth(100); + //formlayout->addRow("", predictbutton); + formlayout->addRow(predictbutton); + connect(predictbutton, SIGNAL(released()), this, SLOT(predictButtonReleased())); + + cancelbutton = new QPushButton("Cancel"); + cancelbutton->setFixedWidth(100); + //formlayout->addRow("", cancelbutton); + formlayout->addRow(cancelbutton); + connect(cancelbutton, SIGNAL(released()), this, SLOT(cancelButtonReleased())); + + formwidget = new QWidget(); + formwidget->setLayout(formlayout); + + peakstable = new QTableView(this); + peakstablemodel = new QStandardItemModel(0, 0, this); + proxymodel = new cSpectrumDetailProxyModel(this); + proxymodel->setSourceModel(peakstablemodel); + proxymodel->setDynamicSortFilter(false); + peakstable->setModel(proxymodel); + peakstable->setSortingEnabled(true); + + hsplitter = new QSplitter(); + hsplitter->setOrientation(Qt::Horizontal); + + vsplitter1 = new QSplitter(); + vsplitter1->setOrientation(Qt::Vertical); + + vsplitter2 = new QSplitter(); + vsplitter2->setOrientation(Qt::Vertical); + + vsplitter1->addWidget(peakstable); + vsplitter2->addWidget(formwidget); + + QList sizes; + sizes.push_back(1900); + sizes.push_back(100); + + hsplitter->addWidget(vsplitter1); + hsplitter->addWidget(vsplitter2); + + hsplitter->setSizes(sizes); + + setCentralWidget(hsplitter); + centralWidget()->setContentsMargins(5, 5, 5, 5); + + menuFile->addAction(actionExportTable); + menuFile->addSeparator(); + menuFile->addAction(actionCloseWindow); + + menuSearch->addAction(actionSearchPubChem); + + menuHelp->addAction(actionHTMLDocumentation); + + menuBar->addMenu(menuFile); + menuBar->addMenu(menuSearch); + menuBar->addMenu(menuHelp); + + setMenuBar(menuBar); + + connect(widgetiontypes, SIGNAL(resetReleased()), this, SLOT(resetIonTypes())); + + resize(defaultwinsizex, defaultwinsizey); + + applyGlobalPreferences(); +} + + +cFormulaPredictor::~cFormulaPredictor() { + delete doublespinboxmz; + delete spinboxcharge; + delete doublespinboxmzerror; + delete widgetiontypes; + delete widgetelements; + delete spinboxmaximumcombinedelements; + delete checkboxbasicformula; + delete checkboxadvancedformula; + delete checkboxnoratio; + delete predictbutton; + delete cancelbutton; + + delete formlayout; + delete formwidget; + + deleteTable(); + + delete peakstablemodel; + delete proxymodel; + delete peakstable; + + delete vsplitter1; + delete vsplitter2; + + delete hsplitter; + + delete actionExportTable; + delete actionCloseWindow; + delete actionSearchPubChem; + delete actionHTMLDocumentation; + + delete menuFile; + delete menuSearch; + delete menuHelp; + + delete menuBar; +} + + +void cFormulaPredictor::closeEvent(QCloseEvent *event) { + hide(); + event->accept(); +} + + +void cFormulaPredictor::applyGlobalPreferences() { + if (globalpreferences) { + resetIonTypes(); + } +} + + +void cFormulaPredictor::keyPressEvent(QKeyEvent *event) { + if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { + predictButtonReleased(); + } + + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C)) { + QModelIndexList selectedindexes = peakstable->selectionModel()->selectedIndexes(); + QStandardItem* item; + + QString selectedtext; + string itemtext; + + int selectedcount = selectedindexes.count(); + for (int i = 0; i < selectedcount; i++) { + if (i > 0) { + if (proxymodel->mapToSource(selectedindexes[i - 1]).row() != proxymodel->mapToSource(selectedindexes[i]).row()) { + selectedtext += "\n"; + } + else { + selectedtext += "\t"; + } + } + + item = peakstablemodel->itemFromIndex(proxymodel->mapToSource(selectedindexes[i])); + if (item) { + itemtext = item->text().toStdString(); + selectedtext += stripHTML(itemtext).c_str(); + } + } + selectedtext += "\n"; + QApplication::clipboard()->setText(selectedtext); + } + + event->accept(); +} + + +void cFormulaPredictor::preparePeaksTable() { + deleteTable(); + + pchemdata.clear(); + + peakstable->setEditTriggers(QAbstractItemView::NoEditTriggers); + peakstable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); + peakstable->horizontalHeader()->setSectionsMovable(true); + //peakstable->verticalHeader()->setDefaultSectionSize(30); + + peakstablemodel->setColumnCount(7); + + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + peakstablemodel->setHorizontalHeaderItem(i, new QStandardItem()); + } + + int currentcolumn = 0; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Compound"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical m/z"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Error [ppm]"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Selected Ion"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Charge"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("PubChem Results"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Reference"); + peakstable->setItemDelegateForColumn(currentcolumn, new cViewButtonDelegate()); + + int formulascount = (int)ionitems.size(); + peakstablemodel->setRowCount(formulascount); + + peakstable->setModel(0); + proxymodel->setSourceModel(0); + peakstable->setSortingEnabled(false); + + string link; + for (int i = 0; i < formulascount; i++) { + currentcolumn = 0; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setText(ionitems[i].ionformula.c_str()); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(ionitems[i].theoreticalmz)), Qt::DisplayRole); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(ppmError(mzvalue, ionitems[i].theoreticalmz))), Qt::DisplayRole); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setText(ionitems[i].iontype.c_str()); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(ionitems[i].charge), Qt::DisplayRole); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + currentcolumn++; + + link = "https://pubchem.ncbi.nlm.nih.gov/#query=" + ionitems[i].ionformula; + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setText(link.c_str()); + } + + proxymodel->setSourceModel(peakstablemodel); + peakstable->setModel(proxymodel); + peakstable->setSortingEnabled(true); + + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + peakstable->resizeColumnToContents(i); + } + + //peakstable->setColumnWidth(4, min(1200, peakstable->columnWidth(4))); +} + + +void cFormulaPredictor::deleteTable() { + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + if (peakstable->itemDelegateForColumn(i)) { + delete peakstable->itemDelegateForColumn(i); + } + } + peakstablemodel->clear(); +} + + +void cFormulaPredictor::predictButtonReleased() { + if (!globalpreferences) { + return; + } + + chargevalue = spinboxcharge->value(); + maximumcombinedelements = spinboxmaximumcombinedelements->value(); + + basicformulacheck = checkboxbasicformula->isChecked(); + advancedformulacheck = checkboxadvancedformula->isChecked(); + noratiocheck = checkboxnoratio->isChecked(); + + mzvalue = doublespinboxmz->value(); + mzerror = doublespinboxmzerror->value(); + + selectedions.clear(); + selectedelements.clear(); + ionitems.clear(); + + QMessageBox msgbox; + errmsg = ""; + + if (chargevalue == 0) { + errmsg = "The charge cannot be zero !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + for (int i = 0; i < widgetiontypes->getList()->count(); i++) { + if (widgetiontypes->getList()->item(i)->isSelected()) { + if ((globalpreferences->customions[i].positive && (chargevalue > 0)) || (!globalpreferences->customions[i].positive && (chargevalue < 0))) { + selectedions.push_back(globalpreferences->customions[i]); + } + } + } + + if (selectedions.empty()) { + errmsg = "Please, select at least one valid ion type.\n\nIf charge > 0, select positive ions only.\nIf charge < 0, select negative ions only."; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + for (int i = 0; i < widgetelements->getList()->count(); i++) { + if (widgetelements->getList()->item(i)->isSelected()) { + selectedelements.push_back(widgetelements->getList()->item(i)->text().toStdString()); + } + } + + if (selectedelements.empty()) { + errmsg = "Please, select some chemical elements first."; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + predictbutton->setDisabled(true); + predictbutton->setText("Calculating..."); + + success = false; + terminatecomputation = false; + + //cout << "Starting thread..." << endl; + + formulapredictorthread = new cFormulaPredictorThread(); + formulapredictorthread->initialize(chargevalue, maximumcombinedelements, basicformulacheck, advancedformulacheck, noratiocheck, mzvalue, mzerror, selectedions, selectedelements, ionitems, success, terminatecomputation, errmsg); + connect(formulapredictorthread, SIGNAL(finished()), this, SLOT(formulaPredictorThreadFinished())); + formulapredictorthread->start(); +} + + +void cFormulaPredictor::cancelButtonReleased() { + terminatecomputation = true; +} + + +void cFormulaPredictor::exportTableToCSV() { + QString currentdir = "./"; + if (globalpreferences) { + currentdir = globalpreferences->exportcsvdefaultdir; + } + + QString filename = QFileDialog::getSaveFileName(this, tr("Export Table to CSV..."), currentdir, "Files (*.csv)"); + + if (!filename.isEmpty()) { + + QProgressDialog progress("Exporting the CSV file...", "Cancel", 0, proxymodel->rowCount(), this); + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + + bool removefile = false; + QFile file(filename); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + return; + } + + QTextStream out(&file); + + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + out << "\"" << peakstablemodel->horizontalHeaderItem(i)->text() << "\""; + if (i < peakstablemodel->columnCount() - 1) { + out << ","; + } + } + out << endl; + + QStandardItem* item; + string str; + for (int i = 0; i < proxymodel->rowCount(); i++) { + + for (int j = 0; j < peakstablemodel->columnCount(); j++) { + item = peakstablemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, j))); + if (item) { + str = item->data(Qt::DisplayRole).toString().toStdString(); + out << "\"" << stripHTML(str).c_str() << "\""; + if (j < peakstablemodel->columnCount() - 1) { + out << ","; + } + } + else { + if (j < peakstablemodel->columnCount() - 1) { + out << ","; + } + } + } + out << endl; + + progress.setValue(i); + if (progress.wasCanceled()) { + removefile = true; + break; + } + } + + file.close(); + + if (removefile) { + file.remove(); + } + + progress.setValue(proxymodel->rowCount()); + + } +} + + +void cFormulaPredictor::showHTMLDocumentation() { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/calculatemolecularformula.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/calculatemolecularformula.html").absoluteFilePath())); + #endif +} + + +void cFormulaPredictor::closeWindow() { + hide(); +} + + +void cFormulaPredictor::resetIonTypes() { + if (globalpreferences) { + widgetiontypes->getList()->clear(); + for (int i = 0; i < (int)globalpreferences->customions.size(); i++) { + widgetiontypes->getList()->addItem(globalpreferences->customions[i].name.c_str()); + if (globalpreferences->customions[i].name.compare("[M+H]+") == 0) { + widgetiontypes->getList()->item(i)->setSelected(true); + } + } + } +} + + +void cFormulaPredictor::formulaPredictorThreadFinished() { + QMessageBox msgbox; + + if (success) { + preparePeaksTable(); + } + else { + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + } + + predictbutton->setText("Calculate"); + predictbutton->setDisabled(false); +} + + +void cFormulaPredictor::searchPubChem() { + bool repeatsearch = false; + if (pchemdata.size() > 0) { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, "Search PubChem...", "Search again ?", QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::Yes) { + repeatsearch = true; + } + } + + if (repeatsearch || (pchemdata.size() == 0)) { + + int formulacol = 0; + int pchemcol = 5; + + set formulas; + QStandardItem* itemname; + QStandardItem* pchemres; + + pchemdata.clear(); + + for (int i = 0; i < proxymodel->rowCount(); i++) { + itemname = peakstablemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, formulacol))); + if (itemname) { + formulas.insert(itemname->text().toStdString()); + } + } + + if (formulas.size() == 0) { + return; + } + + const int limit = 500; + + if (formulas.size() > limit) { + QMessageBox msgBox; + QString errstr = "The maximum number of formulas to be searched is " + QVariant(limit).toString() + ". You generated " + QVariant((int)formulas.size()).toString() + " formulas. "; + errstr += "Please, optimize the search settings."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + int maxthreadsbackup = QThreadPool::globalInstance()->maxThreadCount(); + int maxparallelqueries = 2; + + QThreadPool::globalInstance()->setMaxThreadCount(maxparallelqueries); + + vector vformulas; + for (auto& it : formulas) { + vformulas.push_back(it); + } + + QProgressDialog firstdialog("Searching compounds...", "Cancel", 0, (int)formulas.size(), this); + firstdialog.setMinimumWidth(250); + cEventFilter firstfilter; + firstdialog.installEventFilter(&firstfilter); + firstdialog.setMinimumDuration(0); + firstdialog.setWindowModality(Qt::ApplicationModal); + firstdialog.setValue(0); + + QFutureWatcher firstfuturewatcher; + QObject::connect(&firstfuturewatcher, SIGNAL(finished()), &firstdialog, SLOT(reset())); + QObject::connect(&firstdialog, SIGNAL(canceled()), &firstfuturewatcher, SLOT(cancel())); + QObject::connect(&firstfuturewatcher, SIGNAL(progressRangeChanged(int, int)), &firstdialog, SLOT(setRange(int, int))); + QObject::connect(&firstfuturewatcher, SIGNAL(progressValueChanged(int)), &firstdialog, SLOT(setValue(int))); + + QFuture firstfuture = QtConcurrent::mapped(vformulas.begin(), vformulas.end(), cPubchemCIDReader()); + + firstfuturewatcher.setFuture(firstfuture); + + firstdialog.exec(); + + if (firstfuturewatcher.isCanceled()) { + QThreadPool::globalInstance()->clear(); + } + + firstfuturewatcher.waitForFinished(); + + if (!firstfuturewatcher.isCanceled()) { + + cPubchemCIDReader pubchemformulareader; + string firstfutureresult; + for (int i = 0; i < (int)vformulas.size(); i++) { + firstfutureresult = firstfuture.resultAt(i); + + if (firstfutureresult.substr(0, 6).compare("@ERROR") == 0) { + firstfutureresult.clear(); + } + + pchemdata[vformulas[i]] = pubchemformulareader.getNumberOfCIDs(firstfutureresult); + } + + } + + QThreadPool::globalInstance()->setMaxThreadCount(maxthreadsbackup); + + for (int i = 0; i < proxymodel->rowCount(); i++) { + itemname = peakstablemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, formulacol))); + pchemres = peakstablemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, pchemcol))); + + if (itemname && pchemres) { + pchemres->setData(QVariant::fromValue(pchemdata[itemname->text().toStdString()]), Qt::DisplayRole); + } + } + + } + +} + diff --git a/CycloBranch/gui/cFormulaPredictor.h b/CycloBranch/gui/cFormulaPredictor.h new file mode 100644 index 0000000..7b4ec34 --- /dev/null +++ b/CycloBranch/gui/cFormulaPredictor.h @@ -0,0 +1,192 @@ +/** + \file cFormulaPredictor.h + \brief Predicts the molecular formula from the exact mass. +*/ + + +#ifndef _CFORMULAPREDICTOR_H +#define _CFORMULAPREDICTOR_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core/cGlobalPreferences.h" +#include "core/cPeaksList.h" +#include "gui/cViewButtonDelegate.h" +#include "gui/cFragmentIonsListWidget.h" +#include "gui/cNeutralLossesListWidget.h" +#include "gui/cSpectrumDetailProxyModel.h" +#include "gui/cEventFilter.h" +#include "gui/cPubChemSearchWidget.h" +#include "parallel/cFormulaPredictorThread.h" + + +// forward declaration +class QTextBrowser; +class QHBoxLayout; +class QVBoxLayout; +class QFormLayout; +class QCheckBox; +class QPushButton; +class QSplitter; +class QComboBox; +class QDoubleSpinBox; +class QSpinBox; +class QAction; +class QLabel; +class QLineEdit; + + +/** + \brief Predicts the molecular formula from the exact mass. +*/ +class cFormulaPredictor : public QMainWindow +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + cFormulaPredictor(cGlobalPreferences* globalpreferences, QWidget *parent); + + + /** + \brief The destructor. + */ + ~cFormulaPredictor(); + + + /** + \brief Handle the window close event. + \param event pointer to QCloseEvent + */ + void closeEvent(QCloseEvent *event); + + + /** + \brief Apply new global preferences. + */ + void applyGlobalPreferences(); + + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + void keyPressEvent(QKeyEvent *event); + + +private: + + cGlobalPreferences* globalpreferences; + QWidget* parent; + + cFormulaPredictorThread* formulapredictorthread; + int chargevalue; + int maximumcombinedelements; + bool basicformulacheck; + bool advancedformulacheck; + bool noratiocheck; + double mzvalue; + double mzerror; + vector selectedions; + vector selectedelements; + vector ionitems; + bool success; + bool terminatecomputation; + string errmsg; + + map pchemdata; + + QMenuBar* menuBar; + QMenu* menuFile; + QMenu* menuSearch; + QMenu* menuHelp; + + QToolBar* toolbarFile; + QToolBar* toolbarSearch; + QToolBar* toolbarHelp; + + QAction* actionExportTable; + QAction* actionCloseWindow; + QAction* actionSearchPubChem; + QAction* actionHTMLDocumentation; + + QDoubleSpinBox* doublespinboxmz; + QSpinBox* spinboxcharge; + QDoubleSpinBox* doublespinboxmzerror; + cFragmentIonsListWidget* widgetiontypes; + cNeutralLossesListWidget* widgetelements; + QSpinBox* spinboxmaximumcombinedelements; + QCheckBox* checkboxbasicformula; + QCheckBox* checkboxadvancedformula; + QCheckBox* checkboxnoratio; + QPushButton* predictbutton; + QPushButton* cancelbutton; + + QFormLayout* formlayout; + QWidget* formwidget; + + QTableView* peakstable; + QStandardItemModel* peakstablemodel; + cSpectrumDetailProxyModel* proxymodel; + + QSplitter* vsplitter1; + QSplitter* vsplitter2; + QSplitter* hsplitter; + + void preparePeaksTable(); + + void deleteTable(); + + +private slots: + + + void predictButtonReleased(); + + + void cancelButtonReleased(); + + + void exportTableToCSV(); + + + void showHTMLDocumentation(); + + + void closeWindow(); + + + void resetIonTypes(); + + + void formulaPredictorThreadFinished(); + + + void searchPubChem(); + +}; + +#endif + diff --git a/CycloBranch/gui/cImageWindow.cpp b/CycloBranch/gui/cImageWindow.cpp index 1c8281f..461b1dc 100644 --- a/CycloBranch/gui/cImageWindow.cpp +++ b/CycloBranch/gui/cImageWindow.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -13,11 +14,15 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* parent) { + editorname = "Image Fusion"; + this->globalpreferences = globalpreferences; this->parent = parent; - setWindowTitle("CrossVis"); - setWindowIcon(QIcon(":/images/icons/image.png")); + redrawenabled = false; + + setWindowTitle(editorname); + setWindowIcon(QIcon(":/images/icons/image_edit.png")); menuBar = new QMenuBar(this); menuBar->setNativeMenuBar(false); @@ -218,7 +223,7 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren microscopyx = new QDoubleSpinBox(); microscopyx->setRange(0, 1000000); - microscopyx->setDecimals(6); + microscopyx->setDecimals(3); microscopyx->setSingleStep(1); microscopyx->setValue(0); microscopyx->setSuffix(" um"); @@ -228,7 +233,7 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren microscopyy = new QDoubleSpinBox(); microscopyy->setRange(0, 1000000); - microscopyy->setDecimals(6); + microscopyy->setDecimals(3); microscopyy->setSingleStep(1); microscopyy->setValue(0); microscopyy->setSuffix(" um"); @@ -238,7 +243,7 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren microscopywidth = new QDoubleSpinBox(); microscopywidth->setRange(0, 1000000); - microscopywidth->setDecimals(6); + microscopywidth->setDecimals(3); microscopywidth->setSingleStep(1); microscopywidth->setValue(0); microscopywidth->setSuffix(" um"); @@ -248,7 +253,7 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren microscopyheight = new QDoubleSpinBox(); microscopyheight->setRange(0, 1000000); - microscopyheight->setDecimals(6); + microscopyheight->setDecimals(3); microscopyheight->setSingleStep(1); microscopyheight->setValue(0); microscopyheight->setSuffix(" um"); @@ -263,12 +268,23 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren microscopyangle->setValue(0); microscopyangle->setToolTip("Rotation angle of microscopy image [degrees]."); + microscopynavigationlabel = new QLabel("Navigation: "); + microscopynavigationcombobox = new QComboBox(); + microscopynavigationcombobox->setToolTip("The navigation layer used for currently selected image."); + updateMicroscopyNavigationCombobox(numberoflayers); + microscopydefaultbutton = new QPushButton(" Default "); microscopydefaultbutton->setToolTip("Set default position of microscopy image."); microscopygobutton = new QPushButton(" Go "); microscopygobutton->setToolTip("Go to position."); + microscopyprevbutton = new QPushButton("Previous"); + microscopyprevbutton->setToolTip("Go to previous position."); + + microscopynextbutton = new QPushButton("Next"); + microscopynextbutton->setToolTip("Go to next position."); + microscopyhbox = new QHBoxLayout(); microscopyhbox->addWidget(microscopyxlabel); microscopyhbox->addWidget(microscopyx); @@ -280,8 +296,12 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren microscopyhbox->addWidget(microscopyheight); microscopyhbox->addWidget(microscopyanglelabel); microscopyhbox->addWidget(microscopyangle); + microscopyhbox->addWidget(microscopynavigationlabel); + microscopyhbox->addWidget(microscopynavigationcombobox); microscopyhbox->addWidget(microscopydefaultbutton); microscopyhbox->addWidget(microscopygobutton); + microscopyhbox->addWidget(microscopyprevbutton); + microscopyhbox->addWidget(microscopynextbutton); microscopywidget = new QWidget(); microscopywidget->setLayout(microscopyhbox); @@ -290,14 +310,14 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren image = new QImage(); histologyimage = new QImage(); - microscopylayers.resize(layer_end); + microscopylayers.resize(numberoflayers); imagewindowwidget = new cImageWindowWidget(); layerslayout = new QGridLayout(); layerslayout->setAlignment(Qt::AlignTop); - connect(this, SIGNAL(layerChanged(int, bool, int, int)), imagewindowwidget, SLOT(changeLayer(int, bool, int, int))); + connect(this, SIGNAL(layerChanged(int, bool, int, int, bool)), imagewindowwidget, SLOT(changeLayer(int, bool, int, int, bool))); connect(this, SIGNAL(activeLayerChanged(int)), imagewindowwidget, SLOT(changeActiveLayer(int))); connect(imagewindowwidget, SIGNAL(imageWidgetDoubleClicked(int)), this, SLOT(imageDoubleClickedSlot(int))); @@ -307,30 +327,30 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren addLayer("Compounds"); addLayer("Optical Image"); addLayer("Histology Image"); -#ifdef MICROSCOPY_IMAGES addLayer("Microscopy Image (nav.)"); - addLayer("Microscopy Image 1"); - addLayer("Microscopy Image 2"); - addLayer("Microscopy Image 3"); - addLayer("Microscopy Image 4"); - addLayer("Microscopy Image 5"); - addLayer("Microscopy Image 6"); - addLayer("Microscopy Image 7"); - addLayer("Microscopy Image 8"); - addLayer("Microscopy Image 9"); - addLayer("Microscopy Image 10"); -#endif + + QString microscopylayername = "Microscopy Image "; + QString tmpname; + for (int i = 0; i < numberoflayers - 4; i++) { + tmpname = microscopylayername + QVariant(i + 1).toString(); + addLayer(tmpname); + } + colorSpinBoxes(0); layerswidget = new QWidget(); layerswidget->setLayout(layerslayout); + layersscrollarea = new QScrollArea(); + layersscrollarea->setWidgetResizable(true); + layersscrollarea->setWidget(layerswidget); + mainwidget = new QSplitter(); mainwidget->setOrientation(Qt::Horizontal); mainwidget->addWidget(imagewindowwidget); - mainwidget->addWidget(layerswidget); - mainwidget->setStretchFactor(0, 9); - mainwidget->setStretchFactor(1, 1); + mainwidget->addWidget(layersscrollarea); + mainwidget->setStretchFactor(0, 7); + mainwidget->setStretchFactor(1, 3); connect(setregionbutton, SIGNAL(released()), this, SLOT(setRegionButtonReleased())); connect(resetregionbutton, SIGNAL(released()), this, SLOT(resetSelection())); @@ -349,22 +369,61 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren connect(microscopywidth, SIGNAL(valueChanged(double)), this, SLOT(microscopyPositionChanged(double))); connect(microscopyheight, SIGNAL(valueChanged(double)), this, SLOT(microscopyPositionChanged(double))); connect(microscopyangle, SIGNAL(valueChanged(double)), this, SLOT(microscopyAngleChanged(double))); + connect(microscopynavigationcombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(microscopyNavigationChanged(int))); connect(microscopydefaultbutton, SIGNAL(released()), this, SLOT(microscopyDefaultButtonReleased())); connect(microscopygobutton, SIGNAL(released()), this, SLOT(microscopyGoButtonReleased())); + connect(microscopyprevbutton, SIGNAL(released()), this, SLOT(microscopyPrevButtonReleased())); + connect(microscopynextbutton, SIGNAL(released()), this, SLOT(microscopyNextButtonReleased())); toolbarFile = addToolBar(tr("File")); - actionOpenImage = new QAction(QIcon(":/images/icons/52.png"), tr("&Open Image"), this); + actionLoadLayers = new QAction(QIcon(":/images/icons/52.png"), tr("&Load Layers"), this); + actionLoadLayers->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L)); + actionLoadLayers->setToolTip("Load Layers (Ctrl + L)"); + toolbarFile->addAction(actionLoadLayers); + connect(actionLoadLayers, SIGNAL(triggered()), this, SLOT(loadLayers())); + + actionSaveLayers = new QAction(QIcon(":/images/icons/22.png"), tr("&Save Layers"), this); + actionSaveLayers->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); + actionSaveLayers->setToolTip("Save Layers (Ctrl + S)"); + toolbarFile->addAction(actionSaveLayers); + connect(actionSaveLayers, SIGNAL(triggered()), this, SLOT(saveLayers())); + + actionSaveLayersAs = new QAction(QIcon(":/images/icons/86.png"), tr("Save La&yers As..."), this); + actionSaveLayersAs->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D)); + actionSaveLayersAs->setToolTip("Save Layers As... (Ctrl + D)"); + toolbarFile->addAction(actionSaveLayersAs); + connect(actionSaveLayersAs, SIGNAL(triggered()), this, SLOT(saveLayersAs())); + + toolbarFile->addSeparator(); + + actionOpenImage = new QAction(QIcon(":/images/icons/image_open.png"), tr("&Open Image"), this); actionOpenImage->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O)); actionOpenImage->setToolTip("Open Image (Ctrl + O)"); toolbarFile->addAction(actionOpenImage); connect(actionOpenImage, SIGNAL(triggered()), this, SLOT(selectImageType())); - actionSaveImage = new QAction(QIcon(":/images/icons/22.png"), tr("&Save Image"), this); - actionSaveImage->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S)); - actionSaveImage->setToolTip("Save Image (Ctrl + S)"); - toolbarFile->addAction(actionSaveImage); - connect(actionSaveImage, SIGNAL(triggered()), this, SLOT(saveImage())); + actionImportDialog = new QAction(QIcon(":/images/icons/import.png"), tr("I&mport Images..."), this); + actionImportDialog->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M)); + actionImportDialog->setToolTip("Import Images... (Ctrl + M)"); + toolbarFile->addAction(actionImportDialog); + connect(actionImportDialog, SIGNAL(triggered()), this, SLOT(openImportDialog())); + + actionExportImage = new QAction(QIcon(":/images/icons/66.png"), tr("Export Ima&ge"), this); + actionExportImage->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_G)); + actionExportImage->setToolTip("Export Image (Ctrl + G)"); + toolbarFile->addAction(actionExportImage); + connect(actionExportImage, SIGNAL(triggered()), this, SLOT(exportImage())); + + toolbarFile->addSeparator(); + + actionClearAll = new QAction(QIcon(":/images/icons/clear.png"), tr("Clear &All Layers"), this); + actionClearAll->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W)); + actionClearAll->setToolTip("Clear All Layers (Ctrl + W)"); + toolbarFile->addAction(actionClearAll); + connect(actionClearAll, SIGNAL(triggered()), this, SLOT(clearAllLayersSlot())); + + toolbarFile->addSeparator(); actionCloseWindow = new QAction(QIcon(":/images/icons/33.png"), tr("&Close"), this); actionCloseWindow->setShortcut(QKeySequence(Qt::Key_Escape)); @@ -421,7 +480,7 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren rulerValue = new QDoubleSpinBox(); rulerValue->setRange(0.000001, 1000000); - rulerValue->setDecimals(6); + rulerValue->setDecimals(3); rulerValue->setSingleStep(1); rulerValue->setValue(1000); rulerValue->setSuffix(" um"); @@ -469,15 +528,36 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren toolbarHistology->addSeparator(); toolbarHistology->addWidget(histologywidget); -#ifdef MICROSCOPY_IMAGES addToolBarBreak(); toolbarMicroscopy = addToolBar(tr("Microscopy Image")); + + actionFlipMicroscopyHorizontal = new QAction(QIcon(":/images/icons/flip_horizontal.png"), tr("Flip &Microscopy Horizontally"), this); + actionFlipMicroscopyHorizontal->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H)); + actionFlipMicroscopyHorizontal->setToolTip("Flip Microscopy Horizontally (Ctrl + Shift + H)"); + actionFlipMicroscopyHorizontal->setCheckable(true); + toolbarMicroscopy->addAction(actionFlipMicroscopyHorizontal); + connect(actionFlipMicroscopyHorizontal, SIGNAL(toggled(bool)), this, SLOT(microscopyFlipStateChanged(bool))); + + actionFlipMicroscopyVertical = new QAction(QIcon(":/images/icons/flip_vertical.png"), tr("Flip Microscopy Ver&tically"), this); + actionFlipMicroscopyVertical->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_V)); + actionFlipMicroscopyVertical->setToolTip("Flip Microscopy Vertically (Ctrl + Shift + V)"); + actionFlipMicroscopyVertical->setCheckable(true); + toolbarMicroscopy->addAction(actionFlipMicroscopyVertical); + connect(actionFlipMicroscopyVertical, SIGNAL(toggled(bool)), this, SLOT(microscopyFlipStateChanged(bool))); + + toolbarMicroscopy->addSeparator(); toolbarMicroscopy->addWidget(microscopywidget); -#endif + menuFile->addAction(actionLoadLayers); + menuFile->addAction(actionSaveLayers); + menuFile->addAction(actionSaveLayersAs); + menuFile->addSeparator(); menuFile->addAction(actionOpenImage); - menuFile->addAction(actionSaveImage); + menuFile->addAction(actionImportDialog); + menuFile->addAction(actionExportImage); + menuFile->addSeparator(); + menuFile->addAction(actionClearAll); menuFile->addSeparator(); menuFile->addAction(actionCloseWindow); @@ -491,6 +571,9 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren menuView->addSeparator(); menuView->addAction(actionFlipHistologyHorizontal); menuView->addAction(actionFlipHistologyVertical); + menuView->addSeparator(); + menuView->addAction(actionFlipMicroscopyHorizontal); + menuView->addAction(actionFlipMicroscopyVertical); menuHelp->addAction(actionHTMLDocumentation); @@ -508,17 +591,23 @@ cImageWindow::cImageWindow(cGlobalPreferences* globalpreferences, QWidget* paren connect(this, SIGNAL(updateSummaryPeaksTableFilter(int, int, int, int)), this->parent, SLOT(updateSummaryPeaksTableFilterSlot(int, int, int, int))); connect(imagewindowwidget, SIGNAL(updateCorrelation(int, int, int, int)), this, SLOT(updatePointsArea(int, int, int, int))); connect(imagewindowwidget, SIGNAL(updateHistologyPosition(int, int, int, int, double)), this, SLOT(updateHistologySlot(int, int, int, int, double))); - connect(imagewindowwidget, SIGNAL(updateMicroscopyPosition(double, double, double, double, double)), this, SLOT(updateMicroscopySlot(double, double, double, double, double))); + connect(imagewindowwidget, SIGNAL(updateMicroscopyPosition(bool, bool, double, double, double, double, double)), this, SLOT(updateMicroscopySlot(bool, bool, double, double, double, double, double))); resize(defaultwinsizex, defaultwinsizey); applyGlobalPreferences(globalpreferences); + + layersfileloaded = false; + saveascalled = false; + imzmlfilename.clear(); defaultmaxx = 1; defaultmaxy = 1; defaultpixelsizex = 1; defaultpixelsizey = 1; vendor = unknownvendor; + + redrawenabled = true; } @@ -577,7 +666,11 @@ cImageWindow::~cImageWindow() { delete microscopyanglelabel; delete microscopyangle; delete microscopydefaultbutton; + delete microscopynavigationlabel; + delete microscopynavigationcombobox; delete microscopygobutton; + delete microscopyprevbutton; + delete microscopynextbutton; delete microscopyhbox; delete microscopywidget; @@ -586,16 +679,20 @@ cImageWindow::~cImageWindow() { delete imagewindowwidget; delete layerslayout; - delete layerswidget; - + delete layersscrollarea; delete mainwidget; delete rulerLabel; delete rulerValue; + delete actionLoadLayers; + delete actionSaveLayers; + delete actionSaveLayersAs; delete actionOpenImage; - delete actionSaveImage; + delete actionImportDialog; + delete actionExportImage; + delete actionClearAll; delete actionCloseWindow; delete actionShowSelection; delete actionColorScale; @@ -621,13 +718,29 @@ void cImageWindow::closeEvent(QCloseEvent *event) { } -void cImageWindow::setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor) { +void cImageWindow::setDefaultValues(string imzmlfilename, int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor) { + this->imzmlfilename = imzmlfilename; this->defaultmaxx = defaultmaxx; this->defaultmaxy = defaultmaxy; this->defaultpixelsizex = defaultpixelsizex; this->defaultpixelsizey = defaultpixelsizey; this->vendor = vendor; imagewindowwidget->setDefaultMaxXY(defaultmaxx, defaultmaxy, defaultpixelsizex, defaultpixelsizey, vendor); + + string settingsfile = imzmlfilename; + if (settingsfile.rfind('.') == string::npos) { + return; + } + settingsfile = settingsfile.substr(0, settingsfile.rfind('.')); + settingsfile += ".layers"; + + lastdirlayersfile = settingsfile.c_str(); + layersfileloaded = false; + + QString shortname = getShortFileName(imzmlfilename).c_str(); + ((QLabel *)layerslayout->itemAtPosition(0, 7)->widget())->setText(shortname); + + setWindowTitle(editorname); } @@ -647,6 +760,7 @@ void cImageWindow::addLayer(QString name) { layerlabel->setText(name); QSlider* layerslider = new QSlider(Qt::Horizontal); + layerslider->setMinimumWidth(100); layerslider->setTickPosition(QSlider::TicksBelow); layerslider->setRange(0, 100); layerslider->setSingleStep(1); @@ -664,16 +778,23 @@ void cImageWindow::addLayer(QString name) { layerzvalue->setSingleStep(1); if (layerscount == 0) { - layerzvalue->setValue(2); - } - else if (layerscount == 1) { - layerzvalue->setValue(1); + layerzvalue->setValue(500); } else { - layerzvalue->setValue(layerscount + 1); + layerzvalue->setValue(layerscount); } layerzvalue->setToolTip("Order of Layer"); + QLabel* layerdescription = new QLabel(); + + QPushButton* layerclearbutton = new QPushButton("x"); + layerclearbutton->setToolTip("Clear Layer"); + layerclearbutton->setFixedWidth(25); + + if (layerscount == 0) { + layerclearbutton->setDisabled(true); + } + // the ownership is taken by QGridLayout layerslayout->addWidget(layerradiobutton, layerscount, 0); layerslayout->addWidget(layercheckbox, layerscount, 1); @@ -681,6 +802,8 @@ void cImageWindow::addLayer(QString name) { layerslayout->addWidget(layerslider, layerscount, 3); layerslayout->addWidget(layerspinbox, layerscount, 4); layerslayout->addWidget(layerzvalue, layerscount, 5); + layerslayout->addWidget(layerclearbutton, layerscount, 6); + layerslayout->addWidget(layerdescription, layerscount, 7); connect(layerspinbox, SIGNAL(valueChanged(int)), layerslider, SLOT(setValue(int))); connect(layerslider, SIGNAL(valueChanged(int)), layerspinbox, SLOT(setValue(int))); @@ -692,7 +815,9 @@ void cImageWindow::addLayer(QString name) { connect(layerzvalue, SIGNAL(valueChanged(int)), this, SLOT(layerZValueChangedSlot(int))); - emit layerChanged(layerscount, layercheckbox->isChecked(), layerspinbox->value(), layerzvalue->value()); + connect(layerclearbutton, SIGNAL(released()), this, SLOT(clearLayer())); + + emit layerChanged(layerscount, layercheckbox->isChecked(), layerspinbox->value(), layerzvalue->value(), redrawenabled); layerscount++; } @@ -736,7 +861,7 @@ void cImageWindow::applyGlobalPreferences(cGlobalPreferences* globalpreferences) void cImageWindow::colorSpinBoxes(int layerid) { - if ((eLayerType)layerid == layer_compounds) { + if (layerid == 0) { xfrom->setStyleSheet("QSpinBox { background-color: lime; }"); xto->setStyleSheet("QSpinBox { background-color: lime; }"); yfrom->setStyleSheet("QSpinBox { background-color: lime; }"); @@ -749,7 +874,7 @@ void cImageWindow::colorSpinBoxes(int layerid) { yto->setStyleSheet("QSpinBox { background-color: white; }"); } - if ((eLayerType)layerid == layer_optical_image) { + if (layerid == 1) { leftshift->setStyleSheet("QSpinBox { background-color: lime; }"); topshift->setStyleSheet("QSpinBox { background-color: lime; }"); maxx->setStyleSheet("QSpinBox { background-color: lime; }"); @@ -766,7 +891,7 @@ void cImageWindow::colorSpinBoxes(int layerid) { pixelsizeyspinbox->setStyleSheet("QSpinBox { background-color: white; }"); } - if ((eLayerType)layerid == layer_histology_image) { + if (layerid == 2) { histologyx->setStyleSheet("QSpinBox { background-color: lime; }"); histologyy->setStyleSheet("QSpinBox { background-color: lime; }"); histologywidth->setStyleSheet("QSpinBox { background-color: lime; }"); @@ -781,7 +906,7 @@ void cImageWindow::colorSpinBoxes(int layerid) { histologyangle->setStyleSheet("QDoubleSpinBox { background-color: white; }"); } - if (((eLayerType)layerid >= layer_microscopy_navigation_image) && (((eLayerType)layerid < layer_end))) { + if (layerid >= 3) { microscopyx->setStyleSheet("QDoubleSpinBox { background-color: lime; }"); microscopyy->setStyleSheet("QDoubleSpinBox { background-color: lime; }"); microscopywidth->setStyleSheet("QDoubleSpinBox { background-color: lime; }"); @@ -799,7 +924,17 @@ void cImageWindow::colorSpinBoxes(int layerid) { } +void cImageWindow::setNavigationLayer(int layer, int navigation) { + microscopylayers[layer].navigationlayer = navigation; + imagewindowwidget->setNavigationLayer(layer, navigation); +} + + void cImageWindow::keyPressEvent(QKeyEvent *event) { + if (event->key() == Qt::Key_Control) { + imagewindowwidget->setKeepAspectRatio(true); + } + if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { if (xfrom->hasFocus() || xto->hasFocus() || yfrom->hasFocus() || yto->hasFocus()) { @@ -811,11 +946,29 @@ void cImageWindow::keyPressEvent(QKeyEvent *event) { } } + + event->accept(); +} + + +void cImageWindow::keyReleaseEvent(QKeyEvent *event) { + if (event->key() == Qt::Key_Control) { + imagewindowwidget->setKeepAspectRatio(false); + } + event->accept(); } void cImageWindow::closeWindow() { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, editorname, "Save changes ?", QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::Yes) { + saveascalled = true; + saveLayers(); + } + hide(); } @@ -824,19 +977,15 @@ void cImageWindow::selectImageType() { QStringList imagetypes; imagetypes << "Optical Image"; imagetypes << "Histology Image"; -#ifdef MICROSCOPY_IMAGES imagetypes << "Microscopy Image (navigation)"; - imagetypes << "Microscopy Image 1"; - imagetypes << "Microscopy Image 2"; - imagetypes << "Microscopy Image 3"; - imagetypes << "Microscopy Image 4"; - imagetypes << "Microscopy Image 5"; - imagetypes << "Microscopy Image 6"; - imagetypes << "Microscopy Image 7"; - imagetypes << "Microscopy Image 8"; - imagetypes << "Microscopy Image 9"; - imagetypes << "Microscopy Image 10"; -#endif + + QString microscopylayername = "Microscopy Image "; + QString tmpname; + int size = (int)microscopylayers.size(); + for (int i = 0; i < size - 4; i++) { + tmpname = microscopylayername + QVariant(i + 1).toString(); + imagetypes << tmpname; + } QInputDialog input; input.setInputMode(QInputDialog::TextInput); @@ -844,6 +993,8 @@ void cImageWindow::selectImageType() { input.setComboBoxItems(imagetypes); input.setWindowTitle("Open Image..."); input.setLabelText("Select Image Type:"); + input.setWindowIcon(QIcon(":/images/icons/image_open.png")); + input.resize(300, 400); connect(&input, SIGNAL(textValueSelected(const QString &)), this, SLOT(imageTypeSelected(const QString &))); @@ -855,52 +1006,44 @@ void cImageWindow::imageTypeSelected(const QString &s) { if (s.compare("Optical Image") == 0) { openOpticalImage(); } + if (s.compare("Histology Image") == 0) { openHistologyImage(); } + if (s.compare("Microscopy Image (navigation)") == 0) { - openMicroscopyImage(layer_microscopy_navigation_image, s); - } - if (s.compare("Microscopy Image 1") == 0) { - openMicroscopyImage(layer_microscopy_image_1, s); - } - if (s.compare("Microscopy Image 2") == 0) { - openMicroscopyImage(layer_microscopy_image_2, s); - } - if (s.compare("Microscopy Image 3") == 0) { - openMicroscopyImage(layer_microscopy_image_3, s); - } - if (s.compare("Microscopy Image 4") == 0) { - openMicroscopyImage(layer_microscopy_image_4, s); + openMicroscopyImage(3, s); } - if (s.compare("Microscopy Image 5") == 0) { - openMicroscopyImage(layer_microscopy_image_5, s); - } - if (s.compare("Microscopy Image 6") == 0) { - openMicroscopyImage(layer_microscopy_image_6, s); - } - if (s.compare("Microscopy Image 7") == 0) { - openMicroscopyImage(layer_microscopy_image_7, s); - } - if (s.compare("Microscopy Image 8") == 0) { - openMicroscopyImage(layer_microscopy_image_8, s); - } - if (s.compare("Microscopy Image 9") == 0) { - openMicroscopyImage(layer_microscopy_image_9, s); - } - if (s.compare("Microscopy Image 10") == 0) { - openMicroscopyImage(layer_microscopy_image_10, s); + + QString microscopylayername = "Microscopy Image "; + QString tmpname; + int size = (int)microscopylayers.size(); + for (int i = 0; i < size - 4; i++) { + tmpname = microscopylayername + QVariant(i + 1).toString(); + if (s.compare(tmpname) == 0) { + openMicroscopyImage(i + 4, s); + } } } void cImageWindow::openOpticalImage() { - QString filename = QFileDialog::getOpenFileName(this, tr("Open Optical Image ..."), lastdiropticalimage, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); + QString filename = QFileDialog::getOpenFileName(this, tr("Open Optical Image ..."), lastdiropticalimage, tr("Image Files (*.tif *.tiff *.jpg *.jpeg *.bmp *.png *.gif)")); + reopenOpticalImage(filename); +} + +void cImageWindow::reopenOpticalImage(QString filename) { if (!filename.isEmpty()) { lastdiropticalimage = filename; - image->load(filename); + if (!image->load(filename)) { + QMessageBox msgBox; + QString errstr = "The image cannot be opened."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } leftshift->setValue(0); topshift->setValue(0); @@ -908,27 +1051,46 @@ void cImageWindow::openOpticalImage() { maxy->setValue(defaultmaxy); pixelsizexspinbox->setValue(defaultpixelsizex); pixelsizeyspinbox->setValue(defaultpixelsizey); - + setMaxButtonReleased(); imagewindowwidget->setOpticalImage(image); - ((QCheckBox *)layerslayout->itemAtPosition((int)layer_optical_image, 1)->widget())->setChecked(true); + ((QCheckBox *)layerslayout->itemAtPosition(1, 1)->widget())->setChecked(true); + + QString shortname = getShortFileName(filename.toStdString()).c_str(); + ((QLabel *)layerslayout->itemAtPosition(1, 7)->widget())->setText(shortname); } } void cImageWindow::openHistologyImage() { - QString filename = QFileDialog::getOpenFileName(this, tr("Open Histology Image ..."), lastdirhistologyimage, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); + QString filename = QFileDialog::getOpenFileName(this, tr("Open Histology Image ..."), lastdirhistologyimage, tr("Image Files (*.tif *.tiff *.jpg *.jpeg *.bmp *.png *.gif)")); + reopenHistologyImage(filename); +} + +void cImageWindow::reopenHistologyImage(QString filename) { if (!filename.isEmpty()) { lastdirhistologyimage = filename; - histologyimage->load(filename); + if (!histologyimage->load(filename)) { + QMessageBox msgBox; + QString errstr = "The image cannot be opened."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + checkLoadedImage(histologyimage); + imagewindowwidget->setHistologyImage(histologyimage); - ((QRadioButton *)layerslayout->itemAtPosition((int)layer_histology_image, 0)->widget())->setChecked(true); - ((QCheckBox *)layerslayout->itemAtPosition((int)layer_histology_image, 1)->widget())->setChecked(true); + ((QRadioButton *)layerslayout->itemAtPosition(2, 0)->widget())->setChecked(true); + ((QCheckBox *)layerslayout->itemAtPosition(2, 1)->widget())->setChecked(true); + + QString shortname = getShortFileName(filename.toStdString()).c_str(); + ((QLabel *)layerslayout->itemAtPosition(2, 7)->widget())->setText(shortname); histologyx->blockSignals(true); histologyy->blockSignals(true); @@ -953,7 +1115,7 @@ void cImageWindow::openHistologyImage() { } -bool cImageWindow::parseMicroscopyImage(QString& filename, double& pixelwidth, double& pixelheight, int& resolutionx, int& resolutiony, double& stagex, double& stagey) { +bool cImageWindow::parseMicroscopyImage(QString& filename, double& pixelwidth, double& pixelheight, int& resolutionx, int& resolutiony, double& realwidth, double& stagex, double& stagey) { ifstream is; char buffer; bool tags = false; @@ -1024,6 +1186,14 @@ bool cImageWindow::parseMicroscopyImage(QString& filename, double& pixelwidth, d } } + pos = desc.find("[Image]"); + if (pos != string::npos) { + pos = desc.find("MagCanvasRealWidth=", pos); + if (pos != string::npos) { + sscanf_s(desc.substr(pos + 19).c_str(), "%lf", &realwidth); + } + } + pos = desc.find("[Stage]"); if (pos != string::npos) { pos = desc.find("StageX=", pos); @@ -1046,276 +1216,1260 @@ bool cImageWindow::parseMicroscopyImage(QString& filename, double& pixelwidth, d } -void cImageWindow::openMicroscopyImage(eLayerType layer, const QString &layername) { +void cImageWindow::openMicroscopyImage(int layer, const QString &layername) { QString title = "Open " + layername + " ..."; - QString filename; - filename = QFileDialog::getOpenFileName(this, tr(title.toStdString().c_str()), lastdirmicroscopyimage, tr("Image Files (*.jpg *.jpeg *.png *.tif *.tiff *.bmp *.gif)")); + string imagetypes = "Image Files (*.tif *.tiff *.jpg *.jpeg *.bmp *.png *.gif *.lif)"; - if (!filename.isEmpty()) { - lastdirmicroscopyimage = filename; + QString filename = QFileDialog::getOpenFileName(this, tr(title.toStdString().c_str()), lastdirmicroscopyimage, tr(imagetypes.c_str())); - int microscopycountx, microscopycounty; - double microscopypixelwidth, microscopypixelheight, stagex, stagey; + if ((filename.toStdString().size() > 4) && (filename.toStdString().substr(filename.toStdString().size() - 4).compare(".lif") == 0)) { + lastdirmicroscopyimage = filename; - if (parseMicroscopyImage(filename, microscopypixelwidth, microscopypixelheight, microscopycountx, microscopycounty, stagex, stagey)) { - QImage image; - image.load(filename); + vector parsedmetadata; + readLifMetadata(filename.toStdString(), parsedmetadata); - *microscopylayers[layer].image = image.copy(0, 0, microscopycountx, microscopycounty); - imagewindowwidget->setMicroscopyImage(layer, microscopylayers[layer].image); + if (parsedmetadata.size() == 0) { + QMessageBox msgBox; + QString errstr = "The selected LIF file does not contain any image !"; + msgBox.setText(errstr); + msgBox.exec(); + return; + } - ((QRadioButton *)layerslayout->itemAtPosition((int)layer, 0)->widget())->setChecked(true); - ((QCheckBox *)layerslayout->itemAtPosition((int)layer, 1)->widget())->setChecked(true); + int imagepos = -1; - microscopylayers[layer].defaultwidth = (double)microscopycountx * microscopypixelwidth * 1000000.0; - microscopylayers[layer].defaultheight = (double)microscopycounty * microscopypixelheight * 1000000.0; + if (parsedmetadata.size() == 1) { + imagepos = 0; + } - microscopylayers[layer].stagex = stagex; - microscopylayers[layer].stagey = stagey; + if (parsedmetadata.size() > 1) { + QStringList items; + QString tmpname; + + for (int i = 0; i < (int)parsedmetadata.size(); i++) { + tmpname = QVariant(parsedmetadata[i].magnification).toString(); + tmpname += "x, "; + tmpname += parsedmetadata[i].imagename.c_str(); + //if (parsedmetadata[i].microscopytype == 1) { + // if (parsedmetadata[i].luts.size() == 1) { + // tmpname += ", "; + // tmpname += parsedmetadata[i].luts[0].c_str(); + // } + // if (parsedmetadata[i].luts.size() > 1) { + // tmpname += ", number of luts: "; + // tmpname += QVariant((int)parsedmetadata[i].luts.size()).toString(); + // } + //} + items << tmpname; + } - microscopyDefaultButtonReleased(); + QInputDialog input; + input.setInputMode(QInputDialog::TextInput); + input.setOptions(QInputDialog::UseListViewForComboBoxItems); + input.setComboBoxItems(items); + input.setWindowTitle("Open Image..."); + input.setLabelText("Select Image:"); + input.setWindowIcon(QIcon(":/images/icons/image_open.png")); + input.resize(300, 400); + + if (input.exec()) { + for (int i = 0; i < items.size(); i++) { + if (input.textValue().compare(items[i]) == 0) { + imagepos = i; + break; + } + } + } } - else { - microscopylayers[layer].image->load(filename); - imagewindowwidget->setMicroscopyImage(layer, microscopylayers[layer].image); - - ((QRadioButton *)layerslayout->itemAtPosition((int)layer, 0)->widget())->setChecked(true); - ((QCheckBox *)layerslayout->itemAtPosition((int)layer, 1)->widget())->setChecked(true); - microscopylayers[layer].defaultwidth = microscopylayers[layer].image->width(); - microscopylayers[layer].defaultheight = microscopylayers[layer].image->height(); + if (imagepos == -1) { + return; + } - microscopylayers[layer].stagex = 0; - microscopylayers[layer].stagex = 0; + QInputDialog minthreshold; + minthreshold.setInputMode(QInputDialog::IntInput); + minthreshold.setIntMinimum(0); + minthreshold.setIntMaximum(255); + minthreshold.setIntValue(0); + minthreshold.setWindowTitle("Open Image..."); + minthreshold.setLabelText("Noise Threshold:"); + minthreshold.setWindowIcon(QIcon(":/images/icons/image_open.png")); + + if (!minthreshold.exec()) { + return; + } - microscopyDefaultButtonReleased(); - - QMessageBox msgBox; - QString errstr = "The microscopy image does not include any metadata.\nThe width and height of the image must be set up manually !"; - msgBox.setText(errstr); - msgBox.exec(); + QInputDialog maxthreshold; + maxthreshold.setInputMode(QInputDialog::IntInput); + maxthreshold.setIntMinimum(0); + maxthreshold.setIntMaximum(255); + maxthreshold.setIntValue(255); + maxthreshold.setWindowTitle("Open Image..."); + maxthreshold.setLabelText("Signal Threshold:"); + maxthreshold.setWindowIcon(QIcon(":/images/icons/image_open.png")); + + if (!maxthreshold.exec()) { + return; } - - } -} + microscopylayers[layer].thresholdmin = minthreshold.intValue(); + microscopylayers[layer].thresholdmax = maxthreshold.intValue(); -void cImageWindow::saveImage() { - QString filename = QFileDialog::getSaveFileName(this, tr("Save Image ..."), lastdirexportimage, "PNG Files (*.png)"); + openLifImage(filename.toStdString(), layer, parsedmetadata[imagepos], true); - if (!filename.isEmpty()) { - lastdirexportimage = filename; - imagewindowwidget->getImage().save(filename, "PNG"); - } -} + //parsedmetadata[imagepos].print(); + setNavigationLayer(layer, layer/*3*/); -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); + microscopyDefaultButtonReleased(); + } + else { + reopenMicroscopyImage(layer, filename, false); + } } -void cImageWindow::setMaxButtonReleased() { - imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value(), pixelsizexspinbox->value(), pixelsizeyspinbox->value()); - resetregionbutton->click(); -} +void cImageWindow::reopenMicroscopyImage(int layer, QString filename, bool reopen) { + if (!filename.isEmpty()) { + if (!reopen) { + lastdirmicroscopyimage = filename; + } + int microscopycountx, microscopycounty; + double microscopypixelwidth, microscopypixelheight, realwidth, stagex, stagey; -void cImageWindow::setDefaultButtonReleased() { - leftshift->setValue(0); - topshift->setValue(0); - maxx->setValue(defaultmaxx); - maxy->setValue(defaultmaxy); - pixelsizexspinbox->setValue(defaultpixelsizex); - pixelsizeyspinbox->setValue(defaultpixelsizey); - imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value(), pixelsizexspinbox->value(), pixelsizeyspinbox->value()); - resetregionbutton->click(); -} + microscopylayers[layer].sourcename = filename; + microscopylayers[layer].imagename = filename; + QString description = getShortFileName(filename.toStdString()).c_str(); -void cImageWindow::setRegionButtonReleased() { - imagewindowwidget->setSelectedRegion(xfrom->value(), xto->value(), yfrom->value(), yto->value()); - emit updateSummaryPeaksTableFilter(xfrom->value(), xto->value(), yfrom->value(), yto->value()); -} + if (parseMicroscopyImage(filename, microscopypixelwidth, microscopypixelheight, microscopycountx, microscopycounty, realwidth, stagex, stagey)) { + QImage image; + if (!image.load(filename)) { + QMessageBox msgBox; + QString errstr = "The image cannot be opened."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } -void cImageWindow::histologyChanged() { - imagewindowwidget->setHistologyPosition(histologyx->value(), histologyy->value(), histologywidth->value(), histologyheight->value(), histologyangle->value()); - imagewindowwidget->redraw(); -} + *microscopylayers[layer].image = image.copy(0, 0, microscopycountx, microscopycounty); + checkLoadedImage(microscopylayers[layer].image); -void cImageWindow::histologyPositionChanged(int value) { - histologyChanged(); -} + imagewindowwidget->setMicroscopyImage(layer, microscopylayers[layer].image); + ((QRadioButton *)layerslayout->itemAtPosition(layer, 0)->widget())->setChecked(true); + ((QCheckBox *)layerslayout->itemAtPosition(layer, 1)->widget())->setChecked(true); -void cImageWindow::histologyAngleChanged(double value) { - histologyChanged(); -} + int magnification = 0; + if ((double)microscopycountx * microscopypixelwidth > 0) { + magnification = round(realwidth / ((double)microscopycountx * microscopypixelwidth)); + } + if (magnification > 0) { + description = QVariant(magnification).toString() + "x, " + description; + } + ((QLabel *)layerslayout->itemAtPosition(layer, 7)->widget())->setText(description); -void cImageWindow::microscopyChanged() { - if ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end)) { - microscopylayers[activelayer].x = microscopyx->value(); - microscopylayers[activelayer].y = microscopyy->value(); - microscopylayers[activelayer].width = microscopywidth->value(); - microscopylayers[activelayer].height = microscopyheight->value(); - microscopylayers[activelayer].angle = microscopyangle->value(); - imagewindowwidget->setMicroscopyPosition((eLayerType)activelayer, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); - - if (activelayer == layer_microscopy_navigation_image) { - double widthratio, heightratio; - for (int i = layer_microscopy_navigation_image + 1; i < layer_end; i++) { - if (!microscopylayers[i].image->size().isEmpty()) { - widthratio = microscopylayers[layer_microscopy_navigation_image].width / microscopylayers[layer_microscopy_navigation_image].defaultwidth; - heightratio = microscopylayers[layer_microscopy_navigation_image].height / microscopylayers[layer_microscopy_navigation_image].defaultheight; - - microscopylayers[i].x = microscopylayers[layer_microscopy_navigation_image].x + (microscopylayers[layer_microscopy_navigation_image].width - microscopylayers[i].defaultwidth * widthratio) / 2.0 + (microscopylayers[i].stagex - microscopylayers[layer_microscopy_navigation_image].stagex) * widthratio * 1000000.0; - microscopylayers[i].y = microscopylayers[layer_microscopy_navigation_image].y + (microscopylayers[layer_microscopy_navigation_image].height - microscopylayers[i].defaultheight * heightratio) / 2.0 + (microscopylayers[i].stagey - microscopylayers[layer_microscopy_navigation_image].stagey) * heightratio * 1000000.0; - microscopylayers[i].width = microscopylayers[i].defaultwidth * widthratio; - microscopylayers[i].height = microscopylayers[i].defaultheight * heightratio; - imagewindowwidget->setMicroscopyPosition((eLayerType)i, microscopylayers[i].x, microscopylayers[i].y, microscopylayers[i].width, microscopylayers[i].height, microscopylayers[i].angle); - } - } - } + if (!reopen) { + microscopylayers[layer].defaultwidth = (double)microscopycountx * microscopypixelwidth * 1000000.0; + microscopylayers[layer].defaultheight = (double)microscopycounty * microscopypixelheight * 1000000.0; - imagewindowwidget->redraw(); - } -} + microscopylayers[layer].stagex = stagex; + microscopylayers[layer].stagey = stagey; + microscopylayers[layer].type = 0; -void cImageWindow::microscopyDefaultButtonReleased() { - if ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end)) { - if (activelayer == layer_microscopy_navigation_image) { - microscopylayers[activelayer].x = 0; - microscopylayers[activelayer].y = 0; - microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; - microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; - microscopylayers[activelayer].angle = 0; - imagewindowwidget->setMicroscopyPosition((eLayerType)activelayer, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); - - for (int i = layer_microscopy_navigation_image + 1; i < layer_end; i++) { - if (!microscopylayers[i].image->size().isEmpty()) { - microscopylayers[i].x = microscopylayers[layer_microscopy_navigation_image].x + (microscopylayers[layer_microscopy_navigation_image].width - microscopylayers[i].defaultwidth) / 2.0 + (microscopylayers[i].stagex - microscopylayers[layer_microscopy_navigation_image].stagex) * 1000000.0; - microscopylayers[i].y = microscopylayers[layer_microscopy_navigation_image].y + (microscopylayers[layer_microscopy_navigation_image].height - microscopylayers[i].defaultheight) / 2.0 + (microscopylayers[i].stagey - microscopylayers[layer_microscopy_navigation_image].stagey) * 1000000.0; - microscopylayers[i].width = microscopylayers[i].defaultwidth; - microscopylayers[i].height = microscopylayers[i].defaultheight; - microscopylayers[i].angle = 0; - imagewindowwidget->setMicroscopyPosition((eLayerType)i, microscopylayers[i].x, microscopylayers[i].y, microscopylayers[i].width, microscopylayers[i].height, microscopylayers[i].angle); - } + microscopyDefaultButtonReleased(); } } + else { + + if (!microscopylayers[layer].image->load(filename)) { + QMessageBox msgBox; + QString errstr = "The image cannot be opened."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } - if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { - microscopylayers[activelayer].x = microscopylayers[layer_microscopy_navigation_image].x + (microscopylayers[layer_microscopy_navigation_image].width - microscopylayers[activelayer].defaultwidth) / 2.0 + (microscopylayers[activelayer].stagex - microscopylayers[layer_microscopy_navigation_image].stagex) * 1000000.0; - microscopylayers[activelayer].y = microscopylayers[layer_microscopy_navigation_image].y + (microscopylayers[layer_microscopy_navigation_image].height - microscopylayers[activelayer].defaultheight) / 2.0 + (microscopylayers[activelayer].stagey - microscopylayers[layer_microscopy_navigation_image].stagey) * 1000000.0; - microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; - microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; - microscopylayers[activelayer].angle = microscopylayers[layer_microscopy_navigation_image].angle; - imagewindowwidget->setMicroscopyPosition((eLayerType)activelayer, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); - } + microscopylayers[layer].reduced = checkLoadedImage(microscopylayers[layer].image); - microscopyx->blockSignals(true); - microscopyy->blockSignals(true); - microscopywidth->blockSignals(true); - microscopyheight->blockSignals(true); - microscopyangle->blockSignals(true); + imagewindowwidget->setMicroscopyImage(layer, microscopylayers[layer].image); - microscopyx->setValue(microscopylayers[activelayer].x); - microscopyy->setValue(microscopylayers[activelayer].y); - microscopywidth->setValue(microscopylayers[activelayer].width); - microscopyheight->setValue(microscopylayers[activelayer].height); - microscopyangle->setValue(microscopylayers[activelayer].angle); + ((QRadioButton *)layerslayout->itemAtPosition(layer, 0)->widget())->setChecked(true); + ((QCheckBox *)layerslayout->itemAtPosition(layer, 1)->widget())->setChecked(true); - microscopyx->blockSignals(false); - microscopyy->blockSignals(false); - microscopywidth->blockSignals(false); - microscopyheight->blockSignals(false); - microscopyangle->blockSignals(false); + if (!reopen) { - imagewindowwidget->redraw(); - } -} + QMessageBox::StandardButton reply; + QString s = "The microscopy image does not include any metadata.\nDo you want to load the metadata from a LIF file ?\n\nYes = Select the LIF file.\nNo = Set up the image width and height manually."; + reply = QMessageBox::question(this, "Load metadata ?", s, QMessageBox::Yes | QMessageBox::No); -void cImageWindow::microscopyGoButtonReleased() { - if ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end)) { - imagewindowwidget->goToMicroscopyPosition((eLayerType)activelayer); - } -} + QString liffile; + vector parsedmetadata; + microscopylayers[layer].defaultwidth = microscopylayers[layer].image->width(); + microscopylayers[layer].defaultheight = microscopylayers[layer].image->height(); -void cImageWindow::microscopyPositionChanged(double value) { - microscopyChanged(); -} + microscopylayers[layer].stagex = 0; + microscopylayers[layer].stagey = 0; + microscopylayers[layer].type = 1; -void cImageWindow::microscopyAngleChanged(double value) { - microscopyChanged(); -} + if (reply == QMessageBox::Yes) { + liffile = QFileDialog::getOpenFileName(this, tr("Select LIF file ..."), lastdirmicroscopyimage, tr("LIF Files (*.lif)")); + if (!liffile.isEmpty()) { -void cImageWindow::showHTMLDocumentation() { - #if OS_TYPE == WIN - QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/crossvis.html").absoluteFilePath())); - #else - QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/crossvis.html").absoluteFilePath())); - #endif -} + readLifMetadata(liffile.toStdString(), parsedmetadata); + string tmpimagename; + for (auto& it : parsedmetadata) { + tmpimagename = it.imagename; -void cImageWindow::updateSelection(int xmin, int xmax, int ymin, int ymax) { - xfrom->setValue(xmin); - xto->setValue(xmax); - yfrom->setValue(ymin); - yto->setValue(ymax); -} + if ((it.microscopytype == 1) && (it.luts.size() == 1) && (it.luts[0].size() > 0)) { + size_t lutcomma = it.imagename.rfind(','); + if (lutcomma != string::npos) { + tmpimagename = tmpimagename.substr(0, lutcomma); + } + } + if (microscopylayers[layer].sourcename.toStdString().find(tmpimagename) != string::npos) { + if (microscopylayers[layer].reduced || (!microscopylayers[layer].reduced && (microscopylayers[layer].image->width() == it.dimx) && (microscopylayers[layer].image->height() == it.dimy))) { + if (it.dim10 == 0) { + microscopylayers[layer].defaultwidth = it.width * 1000000.0; + microscopylayers[layer].defaultheight = it.height * 1000000.0; + + // move stagex/stagey from image center to top-left corner + if (it.tiles.size() == 1) { + microscopylayers[layer].stagex = max(0.0, it.tiles[0].posx - it.width / 2.0); + microscopylayers[layer].stagey = max(0.0, it.tiles[0].posy - it.height / 2.0); + } + else { + microscopylayers[layer].stagex = max(0.0, it.stageposx - it.width / 2.0); + microscopylayers[layer].stagey = max(0.0, it.stageposy - it.height / 2.0); + } + + if (it.magnification > 0) { + description = QVariant(it.magnification).toString() + "x, " + description; + } + + //if ((it.microscopytype == 1) && (it.luts.size() == 1) && (it.luts[0].size() > 0)) { + // description += ", "; + // description += it.luts[0].c_str(); + //} + + break; + } + } + } + } -void cImageWindow::clearSelection() { - xfrom->setValue(0); - yfrom->setValue(0); - xto->setValue(maxx->value()); - yto->setValue(maxy->value()); -} + } + } -void cImageWindow::resetSelection() { - clearSelection(); - imagewindowwidget->setSelectedRegion(xfrom->value(), xto->value(), yfrom->value(), yto->value()); - emit updateSummaryPeaksTableFilter(xfrom->value(), xto->value(), yfrom->value(), yto->value()); -} + setNavigationLayer(layer, 3); + microscopyDefaultButtonReleased(); -void cImageWindow::updatePointsArea(int xmin, int xmax, int ymin, int ymax) { - leftshift->setValue(xmin); - maxx->setValue(xmax); - topshift->setValue(ymin); - maxy->setValue(ymax); - setMaxButtonReleased(); -} + if ((reply == QMessageBox::Yes) && (liffile.isEmpty() || parsedmetadata.empty())) { + QMessageBox msgBox; + QString errstr = "The file does not include any metadata.\nThe image width and height must be set up manually !"; + msgBox.setText(errstr); + msgBox.exec(); + } + } -void cImageWindow::layerSpinBoxChangedSlot(int alpha) { - int row, column, rowSpan, columnSpan; - QSpinBox* spinbox = qobject_cast(sender()); + ((QLabel *)layerslayout->itemAtPosition(layer, 7)->widget())->setText(description); - layerslayout->getItemPosition(layerslayout->indexOf(spinbox), &row, &column, &rowSpan, &columnSpan); + } - emit layerChanged(row, ((QCheckBox *)layerslayout->itemAtPosition(row, 1)->widget())->isChecked(), alpha, ((QSpinBox *)layerslayout->itemAtPosition(row, 5)->widget())->value()); + } } -void cImageWindow::layerZValueChangedSlot(int zvalue) { - int row, column, rowSpan, columnSpan; - QSpinBox* spinbox = qobject_cast(sender()); - - layerslayout->getItemPosition(layerslayout->indexOf(spinbox), &row, &column, &rowSpan, &columnSpan); +void cImageWindow::clearLayers() { + redrawenabled = false; - emit layerChanged(row, ((QCheckBox *)layerslayout->itemAtPosition(row, 1)->widget())->isChecked(), ((QSpinBox *)layerslayout->itemAtPosition(row, 4)->widget())->value(), zvalue); -} + activelayer = 0; + imagewindowwidget->clearLayers(); + + int size = (int)microscopylayers.size(); + for (int i = 0; i < size; i++) { + ((QRadioButton *)layerslayout->itemAtPosition(i, 0)->widget())->setChecked(false); + ((QCheckBox *)layerslayout->itemAtPosition(i, 1)->widget())->setChecked(false); + ((QSlider *)layerslayout->itemAtPosition(i, 3)->widget())->setValue(100); + ((QSpinBox *)layerslayout->itemAtPosition(i, 4)->widget())->setValue(100); + + if (i == 0) { + ((QSpinBox *)layerslayout->itemAtPosition(i, 5)->widget())->setValue(500); + } + else { + ((QSpinBox *)layerslayout->itemAtPosition(i, 5)->widget())->setValue(i); + } + + ((QLabel *)layerslayout->itemAtPosition(i, 7)->widget())->setText(""); + + microscopylayers[i].clear(); + } + + leftshift->setValue(0); + topshift->setValue(0); + maxx->setValue(500); + maxy->setValue(500); + pixelsizexspinbox->setValue(100); + pixelsizeyspinbox->setValue(100); + + setMaxButtonReleased(); + + //actionFlipHistologyHorizontal->blockSignals(true); + //actionFlipHistologyVertical->blockSignals(true); + histologyx->blockSignals(true); + histologyy->blockSignals(true); + histologywidth->blockSignals(true); + histologyheight->blockSignals(true); + histologyangle->blockSignals(true); + + actionFlipHistologyHorizontal->setChecked(false); + actionFlipHistologyVertical->setChecked(false); + + histologyx->setValue(0); + histologyy->setValue(0); + histologywidth->setValue(0); + histologyheight->setValue(0); + histologyangle->setValue(0); + + //actionFlipHistologyHorizontal->blockSignals(false); + //actionFlipHistologyVertical->blockSignals(false); + histologyx->blockSignals(false); + histologyy->blockSignals(false); + histologywidth->blockSignals(false); + histologyheight->blockSignals(false); + histologyangle->blockSignals(false); + + histologyChanged(); + + actionFlipMicroscopyHorizontal->blockSignals(true); + actionFlipMicroscopyVertical->blockSignals(true); + microscopyx->blockSignals(true); + microscopyy->blockSignals(true); + microscopywidth->blockSignals(true); + microscopyheight->blockSignals(true); + microscopyangle->blockSignals(true); + microscopynavigationcombobox->blockSignals(true); + + actionFlipMicroscopyHorizontal->setChecked(false); + actionFlipMicroscopyVertical->setChecked(false); + + microscopyx->setValue(0); + microscopyy->setValue(0); + microscopywidth->setValue(0); + microscopyheight->setValue(0); + microscopyangle->setValue(0); + microscopynavigationcombobox->setCurrentIndex(0); + + actionFlipMicroscopyHorizontal->blockSignals(false); + actionFlipMicroscopyVertical->blockSignals(false); + microscopyx->blockSignals(false); + microscopyy->blockSignals(false); + microscopywidth->blockSignals(false); + microscopyheight->blockSignals(false); + microscopyangle->blockSignals(false); + microscopynavigationcombobox->blockSignals(false); + + redrawenabled = true; +} + + +void cImageWindow::updateMicroscopyNavigationCombobox(int numberofitems) { + QString layername = "Microscopy Image "; + QString tmpname = layername + "(nav.)"; + + microscopynavigationcombobox->blockSignals(true); + microscopynavigationcombobox->clear(); + microscopynavigationcombobox->insertItem(0, tmpname); + for (int i = 0; i < numberofitems - 4; i++) { + tmpname = layername + QVariant(i + 1).toString(); + microscopynavigationcombobox->insertItem(i + 1, tmpname); + } + microscopynavigationcombobox->blockSignals(false); +} + + +bool cImageWindow::checkLoadedImage(QImage* image) { + double checkw = image->width(); + double checkh = image->height(); + double maxrotationsize = sqrt(checkw * checkw + checkh * checkh); + + if (maxrotationsize == 0) { + return false; + } + + // can be increased up to max uint + double maximumsize = 18000.0; + double ratio = maximumsize / maxrotationsize; + + if (maxrotationsize > maximumsize) { + checkw = checkw * ratio; + checkh = checkh * ratio; + *image = image->scaled((int)checkw, (int)checkh, Qt::KeepAspectRatio); + return true; + } + + return false; +} + + +void cImageWindow::readLifImageOptical(string filename, cLifMetadata& metadata, QImage& image, bool enableprogress) { + if ((metadata.memoryblockoffsets.size() == 0) || (metadata.memoryblockoffsets[0] == 0) || (metadata.dimx == 0) || (metadata.dimy == 0) || (metadata.dimx > 32767) || (metadata.dimy > 32767)) { + return; + } + + int flipx = (metadata.tilescaninfoflipx == -1) ? metadata.flipx : metadata.tilescaninfoflipx; + int flipy = (metadata.tilescaninfoflipy == -1) ? metadata.flipy : metadata.tilescaninfoflipy; + + if (flipx != flipy) { + return; + } + + int x, y; + int r, g, b, value; + QRgb pixelcolor; + + ifstream is; + is.open(filename, ifstream::binary); + + if (!is.good()) { + return; + } + + is.seekg(metadata.memoryblockoffsets[0]); + + image = QImage(metadata.dimx, metadata.dimy, QImage::Format_RGB32); + + if (metadata.channels.size() != 3) { + // empty image + return; + } + + int lastdimy = 0; + + QProgressDialog progress("Loading image...", /*"Cancel"*/0, 0, metadata.dimy, this); + if (enableprogress) { + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + } + + for (unsigned i = 0; i < (unsigned)metadata.memoryblocksize; i++) { + if (!is.good()) { + break; + } + + value = is.get(); + + if (metadata.channels[i % 3] == red) { + r = value; + } + if (metadata.channels[i % 3] == green) { + g = value; + } + if (metadata.channels[i % 3] == blue) { + b = value; + } + + if (i % 3 == 2) { + x = (i / 3) % metadata.dimx; + y = (i / 3) / metadata.dimx; + + pixelcolor = qRgb(r, g, b); + + if (!flipx && !flipy) { + image.setPixel(x, y, pixelcolor); + } + + if (flipx && flipy) { + image.setPixel(metadata.dimx - 1 - x, metadata.dimy - 1 - y, pixelcolor); + } + + if (enableprogress) { + if (y != lastdimy) { + progress.setValue(y); + lastdimy = y; + } + } + } + } + + if (enableprogress) { + progress.setValue(metadata.dimy); + } +} + + +void cImageWindow::readLifImageFluorescence(string filename, cLifMetadata& metadata, QImage& image, int minthreshold, int maxthreshold, bool enableprogress) { + if ((metadata.memoryblockoffsets.size() == 0) || (metadata.memoryblockoffsets[0] == 0) || (metadata.dimx == 0) || (metadata.dimy == 0) || (metadata.dimx > 32767) || (metadata.dimy > 32767)) { + return; + } + + int flipx = (metadata.tilescaninfoflipx == -1) ? metadata.flipx : metadata.tilescaninfoflipx; + int flipy = (metadata.tilescaninfoflipy == -1) ? metadata.flipy : metadata.tilescaninfoflipy; + + if (flipx != flipy) { + return; + } + + int x, y; + int value; + QRgb pixelrgb; + QColor pixelclr; + + ifstream is; + is.open(filename, ifstream::binary); + + if (!is.good()) { + return; + } + + image = QImage(metadata.dimx, metadata.dimy, QImage::Format_RGB32); + + if ((metadata.channels.size() != metadata.luts.size()) || (metadata.channels.size() != 1)) { + // empty image + return; + } + + int offsetssize = (int)metadata.memoryblockoffsets.size(); + + QProgressDialog progress("Loading image...", /*"Cancel"*/0, 0, metadata.dimy * offsetssize, this); + if (enableprogress) { + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + } + + eChannelType currentchannel = gray; + if (metadata.luts[0].compare("Red") == 0) { + currentchannel = red; + } + if (metadata.luts[0].compare("Green") == 0) { + currentchannel = green; + } + if (metadata.luts[0].compare("Blue") == 0) { + currentchannel = blue; + } + + if (currentchannel == gray) { + // empty image + return; + } + + int lastdimy = 0; + + for (int i = 0; i < offsetssize; i++) { + + is.seekg(metadata.memoryblockoffsets[i]); + + for (unsigned j = 0; j < metadata.memoryblocksize; j++) { + if (!is.good()) { + break; + } + + value = is.get(); + + if (value < minthreshold) { + value = 0; + } + + if (value >= maxthreshold) { + value = 255; + } + + x = j % metadata.dimx; + y = j / metadata.dimx; + + if (i > 0) { + if (!flipx && !flipy) { + pixelclr = image.pixel(x, y); + } + + if (flipx && flipy) { + pixelclr = image.pixel(metadata.dimx - 1 - x, metadata.dimy - 1 - y); + } + } + + switch (currentchannel) { + case red: + if (i > 0) { + pixelrgb = qRgb(max(value, pixelclr.red()), 0, 0); + } + else { + pixelrgb = qRgb(value, 0, 0); + } + break; + case green: + if (i > 0) { + pixelrgb = qRgb(0, max(value, pixelclr.green()), 0); + } + else { + pixelrgb = qRgb(0, value, 0); + } + break; + case blue: + if (i > 0) { + pixelrgb = qRgb(0, 0, max(value, pixelclr.blue())); + } + else { + pixelrgb = qRgb(0, 0, value); + } + break; + default: + pixelrgb = qRgb(0, 0, 0); + break; + } + + if (!flipx && !flipy) { + image.setPixel(x, y, pixelrgb); + } + + if (flipx && flipy) { + image.setPixel(metadata.dimx - 1 - x, metadata.dimy - 1 - y, pixelrgb); + } + + if (enableprogress) { + if (y != lastdimy) { + progress.setValue(y + i * metadata.dimy); + lastdimy = y; + } + } + } + + } + + if (enableprogress) { + progress.setValue(metadata.dimy * offsetssize); + } +} + + +void cImageWindow::openLifImage(string liffilename, int layer, cLifMetadata& metadata, bool enableprogress) { + microscopylayers[layer].sourcename = liffilename.c_str(); + microscopylayers[layer].imagename = metadata.imagename.c_str(); + + QString description = metadata.imagename.c_str(); + + if (metadata.microscopytype == 1) { + readLifImageFluorescence(liffilename, metadata, *microscopylayers[layer].image, microscopylayers[layer].thresholdmin, microscopylayers[layer].thresholdmax, enableprogress); + } + else { + readLifImageOptical(liffilename, metadata, *microscopylayers[layer].image, enableprogress); + } + + microscopylayers[layer].reduced = checkLoadedImage(microscopylayers[layer].image); + + imagewindowwidget->setMicroscopyImage(layer, microscopylayers[layer].image); + + ((QRadioButton *)layerslayout->itemAtPosition(layer, 0)->widget())->setChecked(true); + ((QCheckBox *)layerslayout->itemAtPosition(layer, 1)->widget())->setChecked(true); + + microscopylayers[layer].defaultwidth = microscopylayers[layer].image->width(); + microscopylayers[layer].defaultheight = microscopylayers[layer].image->height(); + + microscopylayers[layer].stagex = 0; + microscopylayers[layer].stagey = 0; + + microscopylayers[layer].type = 1; + + if (metadata.dim10 == 0) { + microscopylayers[layer].defaultwidth = metadata.width * 1000000.0; + microscopylayers[layer].defaultheight = metadata.height * 1000000.0; + + // move stagex/stagey from image center to top-left corner + if (metadata.tiles.size() == 1) { + microscopylayers[layer].stagex = max(0.0, metadata.tiles[0].posx - metadata.width / 2.0); + microscopylayers[layer].stagey = max(0.0, metadata.tiles[0].posy - metadata.height / 2.0); + } + else { + microscopylayers[layer].stagex = max(0.0, metadata.stageposx - metadata.width / 2.0); + microscopylayers[layer].stagey = max(0.0, metadata.stageposy - metadata.height / 2.0); + } + + if (metadata.magnification > 0) { + description = QVariant(metadata.magnification).toString() + "x, " + description; + } + + //if ((metadata.microscopytype == 1) && (metadata.luts.size() == 1) && (metadata.luts[0].size() > 0)) { + // description += ", "; + // description += metadata.luts[0].c_str(); + //} + } + + ((QLabel *)layerslayout->itemAtPosition(layer, 7)->widget())->setText(description); +} + + +void cImageWindow::openImportDialog() { + importdialog.setFormValues(lastdirmicroscopyimage, (int)microscopylayers.size()); + + if (importdialog.exec() != QDialog::Accepted) { + importdialog.setFormValues(lastdirmicroscopyimage, (int)microscopylayers.size()); + return; + } + + int startfromindex; + int navigationindex; + QStringList tiffilenames; + QString liffilename; + + int layer; + + vector parsedmetadata; + + int tabindex = importdialog.getFormValues(startfromindex, tiffilenames, navigationindex, liffilename); + + int numberofimages = tiffilenames.size(); + bool lifopen = false; + + switch (tabindex) { + case 0: + if (tiffilenames.size() == 0) { + return; + } + break; + case 1: + readLifMetadata(liffilename.toStdString(), parsedmetadata); + + if (tiffilenames.size() == 0) { + if (parsedmetadata.size() == 0) { + return; + } + numberofimages = (int)parsedmetadata.size(); + lifopen = true; + } + break; + default: + break; + } + + + QProgressDialog progress("Importing images...", /*"Cancel"*/0, 0, numberofimages, this); + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + + switch (tabindex) { + case 0: + for (int i = 0; i < tiffilenames.size(); i++) { + reopenMicroscopyImage(startfromindex + 4 + i, tiffilenames[i], false); + progress.setValue(i + 1); + } + break; + case 1: + if (parsedmetadata.size() > 0) { + startfromindex += 4; + navigationindex += 3; + + for (int i = 0; i < numberofimages; i++) { + layer = startfromindex + i; + + if (layer >= microscopylayers.size()) { + QMessageBox msgBox; + QString errstr = "Not enough free layers ! Number of imported images: " + QVariant(i).toString() + "."; + msgBox.setText(errstr); + msgBox.exec(); + break; + } + + if (lifopen) { + microscopylayers[layer].thresholdmin = 0; + microscopylayers[layer].thresholdmax = 255; + + openLifImage(liffilename.toStdString(), layer, parsedmetadata[i], false); + } + else { + reopenMicroscopyImage(layer, tiffilenames[i], true); + + microscopylayers[layer].defaultwidth = microscopylayers[layer].image->width(); + microscopylayers[layer].defaultheight = microscopylayers[layer].image->height(); + + microscopylayers[layer].stagex = 0; + microscopylayers[layer].stagey = 0; + + microscopylayers[layer].type = 1; + + string tmpimagename; + for (auto& it : parsedmetadata) { + tmpimagename = it.imagename; + + if ((it.microscopytype == 1) && (it.luts.size() == 1) && (it.luts[0].size() > 0)) { + size_t lutcomma = it.imagename.rfind(','); + if (lutcomma != string::npos) { + tmpimagename = tmpimagename.substr(0, lutcomma); + } + } + + if (tiffilenames[i].toStdString().find(tmpimagename) != string::npos) { + if (microscopylayers[layer].reduced || (!microscopylayers[layer].reduced && (microscopylayers[layer].image->width() == it.dimx) && (microscopylayers[layer].image->height() == it.dimy))) { + if (it.dim10 == 0) { + microscopylayers[layer].defaultwidth = it.width * 1000000.0; + microscopylayers[layer].defaultheight = it.height * 1000000.0; + + // move stagex/stagey from image center to top-left corner + if (it.tiles.size() == 1) { + microscopylayers[layer].stagex = max(0.0, it.tiles[0].posx - it.width / 2.0); + microscopylayers[layer].stagey = max(0.0, it.tiles[0].posy - it.height / 2.0); + } + else { + microscopylayers[layer].stagex = max(0.0, it.stageposx - it.width / 2.0); + microscopylayers[layer].stagey = max(0.0, it.stageposy - it.height / 2.0); + } + + if (it.magnification > 0) { + QString description = ((QLabel *)layerslayout->itemAtPosition(layer, 7)->widget())->text(); + description = QVariant(it.magnification).toString() + "x, " + description; + ((QLabel *)layerslayout->itemAtPosition(layer, 7)->widget())->setText(description); + } + + break; + } + } + } + } + } + + setNavigationLayer(layer, navigationindex); + + microscopyDefaultButtonReleased(); + + progress.setValue(i + 1); + } + } + break; + default: + break; + } + + progress.setValue(numberofimages); +} + + +void cImageWindow::exportImage() { + QString filename = QFileDialog::getSaveFileName(this, tr("Export Image ..."), lastdirexportimage, "PNG Files (*.png)"); + + if (!filename.isEmpty()) { + lastdirexportimage = filename; + imagewindowwidget->getImage().save(filename, "PNG"); + } +} + + +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); +} + + +void cImageWindow::setMaxButtonReleased() { + imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value(), pixelsizexspinbox->value(), pixelsizeyspinbox->value()); + resetregionbutton->click(); +} + + +void cImageWindow::setDefaultButtonReleased() { + leftshift->setValue(0); + topshift->setValue(0); + maxx->setValue(defaultmaxx); + maxy->setValue(defaultmaxy); + pixelsizexspinbox->setValue(defaultpixelsizex); + pixelsizeyspinbox->setValue(defaultpixelsizey); + imagewindowwidget->setCorrelationValues(leftshift->value(), topshift->value(), maxx->value(), maxy->value(), pixelsizexspinbox->value(), pixelsizeyspinbox->value()); + resetregionbutton->click(); +} + + +void cImageWindow::setRegionButtonReleased() { + imagewindowwidget->setSelectedRegion(xfrom->value(), xto->value(), yfrom->value(), yto->value()); + emit updateSummaryPeaksTableFilter(xfrom->value(), xto->value(), yfrom->value(), yto->value()); +} + + +void cImageWindow::histologyChanged() { + imagewindowwidget->setHistologyPosition(histologyx->value(), histologyy->value(), histologywidth->value(), histologyheight->value(), histologyangle->value()); + imagewindowwidget->redraw(); +} + + +void cImageWindow::histologyPositionChanged(int value) { + histologyChanged(); +} + + +void cImageWindow::histologyAngleChanged(double value) { + histologyChanged(); +} + + +void cImageWindow::microscopyChanged() { + double lastnavigationangle = 0; + double widthratio, heightratio; + int size = (int)microscopylayers.size(); + + if (activelayer >= 3) { + if (activelayer == 3) { + lastnavigationangle = microscopylayers[activelayer].angle; + } + + microscopylayers[activelayer].flipx = actionFlipMicroscopyHorizontal->isChecked(); + microscopylayers[activelayer].flipy = actionFlipMicroscopyVertical->isChecked(); + microscopylayers[activelayer].x = microscopyx->value(); + microscopylayers[activelayer].y = microscopyy->value(); + microscopylayers[activelayer].width = microscopywidth->value(); + microscopylayers[activelayer].height = microscopyheight->value(); + microscopylayers[activelayer].angle = microscopyangle->value(); + + //if (microscopylayers[activelayer].flipx) { + // microscopylayers[activelayer].y = microscopylayers[microscopylayers[activelayer].navigationlayer].y + microscopylayers[microscopylayers[activelayer].navigationlayer].height - (microscopylayers[activelayer].y + microscopylayers[activelayer].height - microscopylayers[microscopylayers[activelayer].navigationlayer].y); + //} + + //if (microscopylayers[activelayer].flipy) { + // microscopylayers[activelayer].x = microscopylayers[microscopylayers[activelayer].navigationlayer].x + microscopylayers[microscopylayers[activelayer].navigationlayer].width - (microscopylayers[activelayer].x + microscopylayers[activelayer].width - microscopylayers[microscopylayers[activelayer].navigationlayer].x); + //} + + imagewindowwidget->setMicroscopyPosition(activelayer, microscopylayers[activelayer].flipx, microscopylayers[activelayer].flipy, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); + + if (activelayer == 3) { + if (microscopylayers[activelayer].type == 0) { + for (int i = 4; i < size; i++) { + if ((microscopylayers[i].navigationlayer == 3) && (!microscopylayers[i].image->size().isEmpty())) { + widthratio = microscopylayers[3].width / microscopylayers[3].defaultwidth; + heightratio = microscopylayers[3].height / microscopylayers[3].defaultheight; + + microscopylayers[i].flipx = microscopylayers[3].flipx; + microscopylayers[i].flipy = microscopylayers[3].flipy; + microscopylayers[i].x = microscopylayers[3].x + (microscopylayers[3].width - microscopylayers[i].defaultwidth * widthratio) / 2.0 + (microscopylayers[i].stagex - microscopylayers[3].stagex) * widthratio * 1000000.0; + microscopylayers[i].y = microscopylayers[3].y + (microscopylayers[3].height - microscopylayers[i].defaultheight * heightratio) / 2.0 + (microscopylayers[i].stagey - microscopylayers[3].stagey) * heightratio * 1000000.0; + microscopylayers[i].width = microscopylayers[i].defaultwidth * widthratio; + microscopylayers[i].height = microscopylayers[i].defaultheight * heightratio; + microscopylayers[i].angle = microscopylayers[3].angle - lastnavigationangle + microscopylayers[i].angle; + + //if (microscopylayers[i].flipx) { + // microscopylayers[i].y = microscopylayers[3].y + microscopylayers[3].height - (microscopylayers[activelayer].y + microscopylayers[activelayer].height - microscopylayers[3].y); + //} + + //if (microscopylayers[i].flipy) { + // microscopylayers[i].x = microscopylayers[3].x + microscopylayers[3].width - (microscopylayers[activelayer].x + microscopylayers[activelayer].width - microscopylayers[3].x); + //} + + imagewindowwidget->setMicroscopyPosition(i, microscopylayers[i].flipx, microscopylayers[i].flipy, microscopylayers[i].x, microscopylayers[i].y, microscopylayers[i].width, microscopylayers[i].height, microscopylayers[i].angle); + } + } + } + + if (microscopylayers[activelayer].type == 1) { + for (int i = 4; i < size; i++) { + if ((microscopylayers[i].navigationlayer == 3) && (!microscopylayers[i].image->size().isEmpty())) { + widthratio = microscopylayers[3].width / microscopylayers[3].defaultwidth; + heightratio = microscopylayers[3].height / microscopylayers[3].defaultheight; + + microscopylayers[i].flipx = microscopylayers[3].flipx; + microscopylayers[i].flipy = microscopylayers[3].flipy; + microscopylayers[i].x = microscopylayers[3].x + (microscopylayers[i].stagex - microscopylayers[3].stagex) * widthratio * 1000000.0; + microscopylayers[i].y = microscopylayers[3].y + (microscopylayers[i].stagey - microscopylayers[3].stagey) * heightratio * 1000000.0; + microscopylayers[i].width = microscopylayers[i].defaultwidth * widthratio; + microscopylayers[i].height = microscopylayers[i].defaultheight * heightratio; + microscopylayers[i].angle = microscopylayers[3].angle - lastnavigationangle + microscopylayers[i].angle; + + //if (microscopylayers[i].flipx) { + // microscopylayers[i].y = microscopylayers[3].y + microscopylayers[3].height - (microscopylayers[activelayer].y + microscopylayers[activelayer].height - microscopylayers[3].y); + //} + + //if (microscopylayers[i].flipy) { + // microscopylayers[i].x = microscopylayers[3].x + microscopylayers[3].width - (microscopylayers[activelayer].x + microscopylayers[activelayer].width - microscopylayers[3].x); + //} + + imagewindowwidget->setMicroscopyPosition(i, microscopylayers[i].flipx, microscopylayers[i].flipy, microscopylayers[i].x, microscopylayers[i].y, microscopylayers[i].width, microscopylayers[i].height, microscopylayers[i].angle); + } + } + } + } + + imagewindowwidget->redraw(); + } +} + + +void cImageWindow::microscopyDefaultButtonReleased() { + if (activelayer >= 3) { + if (activelayer == 3) { + int size = (int)microscopylayers.size(); + + if (microscopylayers[activelayer].type == 0) { + microscopylayers[activelayer].flipx = false; + microscopylayers[activelayer].flipy = false; + microscopylayers[activelayer].x = 0; + microscopylayers[activelayer].y = 0; + microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; + microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; + microscopylayers[activelayer].angle = 0; + imagewindowwidget->setMicroscopyPosition(activelayer, microscopylayers[activelayer].flipx, microscopylayers[activelayer].flipy, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); + + for (int i = 4; i < size; i++) { + if ((microscopylayers[i].navigationlayer == 3) && (!microscopylayers[i].image->size().isEmpty())) { + microscopylayers[i].flipx = false; + microscopylayers[i].flipy = false; + microscopylayers[i].x = microscopylayers[3].x + (microscopylayers[3].width - microscopylayers[i].defaultwidth) / 2.0 + (microscopylayers[i].stagex - microscopylayers[3].stagex) * 1000000.0; + microscopylayers[i].y = microscopylayers[3].y + (microscopylayers[3].height - microscopylayers[i].defaultheight) / 2.0 + (microscopylayers[i].stagey - microscopylayers[3].stagey) * 1000000.0; + microscopylayers[i].width = microscopylayers[i].defaultwidth; + microscopylayers[i].height = microscopylayers[i].defaultheight; + microscopylayers[i].angle = 0; + imagewindowwidget->setMicroscopyPosition(i, microscopylayers[i].flipx, microscopylayers[i].flipy, microscopylayers[i].x, microscopylayers[i].y, microscopylayers[i].width, microscopylayers[i].height, microscopylayers[i].angle); + } + } + } + + if (microscopylayers[activelayer].type == 1) { + microscopylayers[activelayer].flipx = false; + microscopylayers[activelayer].flipy = false; + microscopylayers[activelayer].x = microscopylayers[activelayer].stagex * 1000000.0; + microscopylayers[activelayer].y = microscopylayers[activelayer].stagey * 1000000.0; + microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; + microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; + microscopylayers[activelayer].angle = 0; + + // fix the coordinates if they are outside of range + if (vendor == bruker) { + if ((microscopylayers[activelayer].x + microscopylayers[activelayer].width > (maxx->value() + 1) * pixelsizexspinbox->value()) || (microscopylayers[activelayer].y + microscopylayers[activelayer].height > (maxy->value() + 1) * pixelsizeyspinbox->value())) { + microscopylayers[activelayer].x = 0; + microscopylayers[activelayer].y = 0; + } + } + else { + if ((microscopylayers[activelayer].x + microscopylayers[activelayer].width > maxx->value() * pixelsizexspinbox->value()) || (microscopylayers[activelayer].y + microscopylayers[activelayer].height > maxy->value() * pixelsizeyspinbox->value())) { + microscopylayers[activelayer].x = 0; + microscopylayers[activelayer].y = 0; + } + } + + imagewindowwidget->setMicroscopyPosition(activelayer, microscopylayers[activelayer].flipx, microscopylayers[activelayer].flipy, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); + + for (int i = 4; i < size; i++) { + if ((microscopylayers[i].navigationlayer == 3) && (!microscopylayers[i].image->size().isEmpty())) { + microscopylayers[i].flipx = false; + microscopylayers[i].flipy = false; + microscopylayers[i].x = microscopylayers[3].x + (microscopylayers[i].stagex - microscopylayers[3].stagex) * 1000000.0; + microscopylayers[i].y = microscopylayers[3].y + (microscopylayers[i].stagey - microscopylayers[3].stagey) * 1000000.0; + microscopylayers[i].width = microscopylayers[i].defaultwidth; + microscopylayers[i].height = microscopylayers[i].defaultheight; + microscopylayers[i].angle = 0; + + if ((microscopylayers[i].x < 0) || (microscopylayers[i].y < 0)) { + microscopylayers[i].x = 0; + microscopylayers[i].y = 0; + } + + imagewindowwidget->setMicroscopyPosition(i, microscopylayers[i].flipx, microscopylayers[i].flipy, microscopylayers[i].x, microscopylayers[i].y, microscopylayers[i].width, microscopylayers[i].height, microscopylayers[i].angle); + } + } + } + } + + if (activelayer > 3) { + if ((microscopylayers[activelayer].type == 0) && (microscopylayers[activelayer].navigationlayer >= 3)) { + if (activelayer != microscopylayers[activelayer].navigationlayer) { + microscopylayers[activelayer].flipx = microscopylayers[microscopylayers[activelayer].navigationlayer].flipx; + microscopylayers[activelayer].flipy = microscopylayers[microscopylayers[activelayer].navigationlayer].flipy; + microscopylayers[activelayer].x = microscopylayers[microscopylayers[activelayer].navigationlayer].x + (microscopylayers[microscopylayers[activelayer].navigationlayer].width - microscopylayers[activelayer].defaultwidth) / 2.0 + (microscopylayers[activelayer].stagex - microscopylayers[microscopylayers[activelayer].navigationlayer].stagex) * 1000000.0; + microscopylayers[activelayer].y = microscopylayers[microscopylayers[activelayer].navigationlayer].y + (microscopylayers[microscopylayers[activelayer].navigationlayer].height - microscopylayers[activelayer].defaultheight) / 2.0 + (microscopylayers[activelayer].stagey - microscopylayers[microscopylayers[activelayer].navigationlayer].stagey) * 1000000.0; + microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; + microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; + microscopylayers[activelayer].angle = microscopylayers[microscopylayers[activelayer].navigationlayer].angle; + imagewindowwidget->setMicroscopyPosition(activelayer, microscopylayers[activelayer].flipx, microscopylayers[activelayer].flipy, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); + } + else { + microscopylayers[activelayer].flipx = false; + microscopylayers[activelayer].flipy = false; + microscopylayers[activelayer].x = 0; + microscopylayers[activelayer].y = 0; + microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; + microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; + microscopylayers[activelayer].angle = 0; + imagewindowwidget->setMicroscopyPosition(activelayer, microscopylayers[activelayer].flipx, microscopylayers[activelayer].flipy, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); + } + } + + if ((microscopylayers[activelayer].type == 1) && (microscopylayers[activelayer].navigationlayer >= 3)) { + if (activelayer != microscopylayers[activelayer].navigationlayer) { + microscopylayers[activelayer].flipx = microscopylayers[microscopylayers[activelayer].navigationlayer].flipx; + microscopylayers[activelayer].flipy = microscopylayers[microscopylayers[activelayer].navigationlayer].flipy; + microscopylayers[activelayer].x = microscopylayers[microscopylayers[activelayer].navigationlayer].x + (microscopylayers[activelayer].stagex - microscopylayers[microscopylayers[activelayer].navigationlayer].stagex) * 1000000.0; + microscopylayers[activelayer].y = microscopylayers[microscopylayers[activelayer].navigationlayer].y + (microscopylayers[activelayer].stagey - microscopylayers[microscopylayers[activelayer].navigationlayer].stagey) * 1000000.0; + microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; + microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; + microscopylayers[activelayer].angle = microscopylayers[microscopylayers[activelayer].navigationlayer].angle; + + if ((microscopylayers[activelayer].x < 0) || (microscopylayers[activelayer].y < 0)) { + microscopylayers[activelayer].x = 0; + microscopylayers[activelayer].y = 0; + } + + imagewindowwidget->setMicroscopyPosition(activelayer, microscopylayers[activelayer].flipx, microscopylayers[activelayer].flipy, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); + } + else { + microscopylayers[activelayer].flipx = false; + microscopylayers[activelayer].flipy = false; + microscopylayers[activelayer].x = 0; + microscopylayers[activelayer].y = 0; + microscopylayers[activelayer].width = microscopylayers[activelayer].defaultwidth; + microscopylayers[activelayer].height = microscopylayers[activelayer].defaultheight; + microscopylayers[activelayer].angle = 0; + imagewindowwidget->setMicroscopyPosition(activelayer, microscopylayers[activelayer].flipx, microscopylayers[activelayer].flipy, microscopylayers[activelayer].x, microscopylayers[activelayer].y, microscopylayers[activelayer].width, microscopylayers[activelayer].height, microscopylayers[activelayer].angle); + } + } + } + + actionFlipMicroscopyHorizontal->blockSignals(true); + actionFlipMicroscopyVertical->blockSignals(true); + microscopyx->blockSignals(true); + microscopyy->blockSignals(true); + microscopywidth->blockSignals(true); + microscopyheight->blockSignals(true); + microscopyangle->blockSignals(true); + microscopynavigationcombobox->blockSignals(true); + + actionFlipMicroscopyHorizontal->setChecked(microscopylayers[activelayer].flipx); + actionFlipMicroscopyVertical->setChecked(microscopylayers[activelayer].flipy); + microscopyx->setValue(microscopylayers[activelayer].x); + microscopyy->setValue(microscopylayers[activelayer].y); + microscopywidth->setValue(microscopylayers[activelayer].width); + microscopyheight->setValue(microscopylayers[activelayer].height); + microscopyangle->setValue(microscopylayers[activelayer].angle); + microscopynavigationcombobox->setCurrentIndex(max(0, microscopylayers[activelayer].navigationlayer - 3)); + + actionFlipMicroscopyHorizontal->blockSignals(false); + actionFlipMicroscopyVertical->blockSignals(false); + microscopyx->blockSignals(false); + microscopyy->blockSignals(false); + microscopywidth->blockSignals(false); + microscopyheight->blockSignals(false); + microscopyangle->blockSignals(false); + microscopynavigationcombobox->blockSignals(false); + + imagewindowwidget->redraw(); + } +} + + +void cImageWindow::microscopyGoButtonReleased() { + if (activelayer >= 3) { + imagewindowwidget->goToMicroscopyPosition(activelayer); + } +} + + +void cImageWindow::microscopyPrevButtonReleased() { + if ((activelayer > 3) && (activelayer < microscopylayers.size())) { + ((QRadioButton *)layerslayout->itemAtPosition(activelayer - 1, 0)->widget())->setChecked(true); + imagewindowwidget->goToMicroscopyPosition(activelayer); + } +} + + +void cImageWindow::microscopyNextButtonReleased() { + if ((activelayer >= 3) && (activelayer < microscopylayers.size() - 1)) { + ((QRadioButton *)layerslayout->itemAtPosition(activelayer + 1, 0)->widget())->setChecked(true); + imagewindowwidget->goToMicroscopyPosition(activelayer); + } +} + + +void cImageWindow::microscopyPositionChanged(double value) { + microscopyChanged(); +} + + +void cImageWindow::microscopyAngleChanged(double value) { + microscopyChanged(); +} + + +void cImageWindow::microscopyFlipStateChanged(bool state) { + microscopyChanged(); +} + + +void cImageWindow::showHTMLDocumentation() { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/imagefusion.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/imagefusion.html").absoluteFilePath())); + #endif +} + + +void cImageWindow::updateSelection(int xmin, int xmax, int ymin, int ymax) { + xfrom->setValue(xmin); + xto->setValue(xmax); + yfrom->setValue(ymin); + yto->setValue(ymax); +} + + +void cImageWindow::clearSelection() { + xfrom->setValue(0); + yfrom->setValue(0); + xto->setValue(maxx->value()); + yto->setValue(maxy->value()); +} + + +void cImageWindow::resetSelection() { + clearSelection(); + imagewindowwidget->setSelectedRegion(xfrom->value(), xto->value(), yfrom->value(), yto->value()); + emit updateSummaryPeaksTableFilter(xfrom->value(), xto->value(), yfrom->value(), yto->value()); +} + + +void cImageWindow::updatePointsArea(int xmin, int xmax, int ymin, int ymax) { + leftshift->setValue(xmin); + maxx->setValue(xmax); + topshift->setValue(ymin); + maxy->setValue(ymax); + setMaxButtonReleased(); +} + + +void cImageWindow::layerSpinBoxChangedSlot(int alpha) { + int row, column, rowSpan, columnSpan; + QSpinBox* spinbox = qobject_cast(sender()); + + layerslayout->getItemPosition(layerslayout->indexOf(spinbox), &row, &column, &rowSpan, &columnSpan); + + emit layerChanged(row, ((QCheckBox *)layerslayout->itemAtPosition(row, 1)->widget())->isChecked(), alpha, ((QSpinBox *)layerslayout->itemAtPosition(row, 5)->widget())->value(), redrawenabled); +} + + +void cImageWindow::layerZValueChangedSlot(int zvalue) { + int row, column, rowSpan, columnSpan; + QSpinBox* spinbox = qobject_cast(sender()); + + layerslayout->getItemPosition(layerslayout->indexOf(spinbox), &row, &column, &rowSpan, &columnSpan); + + emit layerChanged(row, ((QCheckBox *)layerslayout->itemAtPosition(row, 1)->widget())->isChecked(), ((QSpinBox *)layerslayout->itemAtPosition(row, 4)->widget())->value(), zvalue, redrawenabled); +} void cImageWindow::layerCheckBoxChangedSlot(int state) { @@ -1324,7 +2478,7 @@ void cImageWindow::layerCheckBoxChangedSlot(int state) { layerslayout->getItemPosition(layerslayout->indexOf(checkbox), &row, &column, &rowSpan, &columnSpan); - emit layerChanged(row, ((QCheckBox *)layerslayout->itemAtPosition(row, 1)->widget())->isChecked(), ((QSpinBox *)layerslayout->itemAtPosition(row, 4)->widget())->value(), ((QSpinBox *)layerslayout->itemAtPosition(row, 5)->widget())->value()); + emit layerChanged(row, ((QCheckBox *)layerslayout->itemAtPosition(row, 1)->widget())->isChecked(), ((QSpinBox *)layerslayout->itemAtPosition(row, 4)->widget())->value(), ((QSpinBox *)layerslayout->itemAtPosition(row, 5)->widget())->value(), redrawenabled); } @@ -1340,32 +2494,56 @@ void cImageWindow::activeLayerChangedSlot(bool checked) { activelayer = row; emit activeLayerChanged(row); + actionFlipMicroscopyHorizontal->blockSignals(true); + actionFlipMicroscopyVertical->blockSignals(true); microscopyx->blockSignals(true); microscopyy->blockSignals(true); microscopywidth->blockSignals(true); microscopyheight->blockSignals(true); microscopyangle->blockSignals(true); + microscopynavigationcombobox->blockSignals(true); - if ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end) && (!microscopylayers[activelayer].image->size().isEmpty())) { + if ((activelayer >= 3) && (!microscopylayers[activelayer].image->size().isEmpty())) { + actionFlipMicroscopyHorizontal->setChecked(microscopylayers[activelayer].flipx); + actionFlipMicroscopyVertical->setChecked(microscopylayers[activelayer].flipy); microscopyx->setValue(microscopylayers[activelayer].x); microscopyy->setValue(microscopylayers[activelayer].y); microscopywidth->setValue(microscopylayers[activelayer].width); microscopyheight->setValue(microscopylayers[activelayer].height); microscopyangle->setValue(microscopylayers[activelayer].angle); + microscopynavigationcombobox->setCurrentIndex(max(0, microscopylayers[activelayer].navigationlayer - 3)); } else { + actionFlipMicroscopyHorizontal->setChecked(false); + actionFlipMicroscopyVertical->setChecked(false); microscopyx->setValue(0); microscopyy->setValue(0); microscopywidth->setValue(0); microscopyheight->setValue(0); microscopyangle->setValue(0); + microscopynavigationcombobox->setCurrentIndex(0); } + actionFlipMicroscopyHorizontal->blockSignals(false); + actionFlipMicroscopyVertical->blockSignals(false); microscopyx->blockSignals(false); microscopyy->blockSignals(false); microscopywidth->blockSignals(false); microscopyheight->blockSignals(false); microscopyangle->blockSignals(false); + microscopynavigationcombobox->blockSignals(false); + + if ((activelayer == 0) || (activelayer == 1)) { + if (actionShowSelection->isChecked()) { + actionShowSelection->setChecked(false); + } + } + + if (activelayer >= 2) { + if (!actionShowSelection->isChecked()) { + actionShowSelection->setChecked(true); + } + } } } @@ -1393,19 +2571,25 @@ void cImageWindow::updateHistologySlot(int x, int y, int width, int height, doub } -void cImageWindow::updateMicroscopySlot(double x, double y, double width, double height, double angle) { +void cImageWindow::updateMicroscopySlot(bool flipx, bool flipy, double x, double y, double width, double height, double angle) { + actionFlipMicroscopyHorizontal->blockSignals(true); + actionFlipMicroscopyVertical->blockSignals(true); microscopyx->blockSignals(true); microscopyy->blockSignals(true); microscopywidth->blockSignals(true); microscopyheight->blockSignals(true); microscopyangle->blockSignals(true); + actionFlipMicroscopyHorizontal->setChecked(flipx); + actionFlipMicroscopyVertical->setChecked(flipy); microscopyx->setValue(x); microscopyy->setValue(y); microscopywidth->setValue(width); microscopyheight->setValue(height); microscopyangle->setValue(angle); + actionFlipMicroscopyHorizontal->blockSignals(false); + actionFlipMicroscopyVertical->blockSignals(false); microscopyx->blockSignals(false); microscopyy->blockSignals(false); microscopywidth->blockSignals(false); @@ -1425,3 +2609,573 @@ void cImageWindow::imageDoubleClickedSlot(int spectrumid) { emit doubleClickedSpectrumIDSignal(spectrumid); } + +void cImageWindow::loadLayers() { + QString filename = QFileDialog::getOpenFileName(this, tr("Load Layers..."), lastdirlayersfile, tr("Layers File (*.layers)")); + + if (filename.isEmpty()) { + return; + } + + lastdirlayersfile = filename; + layersfileloaded = true; + + QString shortname; + if (lastdirlayersfile.toStdString().rfind('/') != string::npos) { + shortname = lastdirlayersfile.toStdString().substr(lastdirlayersfile.toStdString().rfind('/') + 1).c_str(); + } + if (!shortname.isEmpty()) { + setWindowTitle(editorname + QString(" - ") + shortname); + } + else { + setWindowTitle(editorname); + } + + clearLayers(); + + QString qloadstring, qlayername; + QSettings settings(lastdirlayersfile, QSettings::IniFormat); + + QString opticalfilename = settings.value("opticalimage_file", "").toString(); + QFileInfo opticalfilecheck(opticalfilename); + if (!(opticalfilecheck.exists() && opticalfilecheck.isFile())) { + QMessageBox msgBox; + QString errstr = "The optical image does not exist. Cannot open the file '" + opticalfilename + "'."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + QProgressDialog progress("Loading layers...", /*"Cancel"*/0, 0, max(5, (int)microscopylayers.size()), this); + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + + reopenOpticalImage(opticalfilename); + + leftshift->setValue(settings.value("opticalimage_horizontal_shift", 0).toInt()); + topshift->setValue(settings.value("opticalimage_vertical_shift", 0).toInt()); + maxx->setValue(settings.value("opticalimage_max_x", defaultmaxx).toInt()); + maxy->setValue(settings.value("opticalimage_max_y", defaultmaxy).toInt()); + pixelsizexspinbox->setValue(settings.value("opticalimage_pixel_width", defaultpixelsizex).toInt()); + pixelsizeyspinbox->setValue(settings.value("opticalimage_pixel_height", defaultpixelsizey).toInt()); + + setMaxButtonReleased(); + + progress.setValue(1); + + QString histologyfilename = settings.value("histologyimage_file", "").toString(); + if (!histologyfilename.isEmpty()) { + QFileInfo histologyfilecheck(histologyfilename); + if (histologyfilecheck.exists() && histologyfilecheck.isFile()) { + reopenHistologyImage(histologyfilename); + + histologyx->blockSignals(true); + histologyy->blockSignals(true); + histologywidth->blockSignals(true); + histologyheight->blockSignals(true); + histologyangle->blockSignals(true); + + qloadstring = "histologyimage_flip_horizontal"; + settings.value(qloadstring, 0).toInt() == 0 ? actionFlipHistologyHorizontal->setChecked(false) : actionFlipHistologyHorizontal->setChecked(true); + + qloadstring = "histologyimage_flip_vertical"; + settings.value(qloadstring, 0).toInt() == 0 ? actionFlipHistologyVertical->setChecked(false) : actionFlipHistologyVertical->setChecked(true); + + histologyx->setValue(settings.value("histologyimage_x", 0).toInt()); + histologyy->setValue(settings.value("histologyimage_y", 0).toInt()); + histologywidth->setValue(settings.value("histologyimage_width", 400).toInt()); + histologyheight->setValue(settings.value("histologyimage_height", (int)((double)histologyimage->height() / (double)histologyimage->width() * (double)histologywidth->value())).toInt()); + histologyangle->setValue(settings.value("histologyimage_angle", 0).toDouble()); + + histologyx->blockSignals(false); + histologyy->blockSignals(false); + histologywidth->blockSignals(false); + histologyheight->blockSignals(false); + histologyangle->blockSignals(false); + + histologyChanged(); + } + else { + QMessageBox msgBox; + QString errstr = "The histology image does not exist. Cannot open the file '" + histologyfilename + "'."; + msgBox.setText(errstr); + msgBox.exec(); + progress.setValue(max(5, (int)microscopylayers.size())); + return; + } + } + + progress.setValue(2); + + int size = settings.value("microscopy_layers_count", 0).toInt(); + microscopylayers.resize(max(3, size)); + + for (int i = 3; i < size; i++) { + qlayername = "microscopy_layer_" + QVariant(i).toString() + "_"; + + qloadstring = qlayername + "sourcename"; + microscopylayers[i].sourcename = settings.value(qloadstring, "").toString(); + + qloadstring = qlayername + "imagename"; + microscopylayers[i].imagename = settings.value(qloadstring, "").toString(); + + qloadstring = qlayername + "thresholdmin"; + microscopylayers[i].thresholdmin = settings.value(qloadstring, 0).toInt(); + + qloadstring = qlayername + "thresholdmax"; + microscopylayers[i].thresholdmax = settings.value(qloadstring, 255).toInt(); + + if (!microscopylayers[i].sourcename.isEmpty()) { + QFileInfo microscopyfilecheck(microscopylayers[i].sourcename); + if (microscopyfilecheck.exists() && microscopyfilecheck.isFile()) { + + if ((microscopylayers[i].sourcename.toStdString().size() > 4) && (microscopylayers[i].sourcename.toStdString().substr(microscopylayers[i].sourcename.toStdString().size() - 4).compare(".lif") == 0)) { + vector parsedmetadata; + readLifMetadata(microscopylayers[i].sourcename.toStdString(), parsedmetadata); + + for (auto& it : parsedmetadata) { + if (it.imagename.compare(microscopylayers[i].imagename.toStdString()) == 0) { + if (i == 3) { + openLifImage(microscopylayers[i].sourcename.toStdString(), i, it, true); + } + else { + openLifImage(microscopylayers[i].sourcename.toStdString(), i, it, false); + } + break; + } + } + } + else { + reopenMicroscopyImage(i, microscopylayers[i].sourcename, true); + } + + qloadstring = qlayername + "type"; + microscopylayers[i].type = settings.value(qloadstring, -1).toInt(); + + qloadstring = qlayername + "navigationlayer"; + setNavigationLayer(i, settings.value(qloadstring, 3).toInt()); + + qloadstring = qlayername + "flipx"; + microscopylayers[i].flipx = settings.value(qloadstring, 0).toBool(); + + qloadstring = qlayername + "flipy"; + microscopylayers[i].flipy = settings.value(qloadstring, 0).toBool(); + + qloadstring = qlayername + "x"; + microscopylayers[i].x = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "y"; + microscopylayers[i].y = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "width"; + microscopylayers[i].width = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "height"; + microscopylayers[i].height = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "angle"; + microscopylayers[i].angle = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "defaultwidth"; + microscopylayers[i].defaultwidth = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "defaultheight"; + microscopylayers[i].defaultheight = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "stagex"; + microscopylayers[i].stagex = settings.value(qloadstring, 0).toDouble(); + + qloadstring = qlayername + "stagey"; + microscopylayers[i].stagey = settings.value(qloadstring, 0).toDouble(); + + imagewindowwidget->setMicroscopyPosition(i, microscopylayers[i].flipx, microscopylayers[i].flipy, microscopylayers[i].x, microscopylayers[i].y, microscopylayers[i].width, microscopylayers[i].height, microscopylayers[i].angle); + } + else { + QMessageBox msgBox; + QString errstr = "The microscopy image does not exist. Cannot open the file '" + microscopylayers[i].sourcename + "'."; + msgBox.setText(errstr); + msgBox.exec(); + progress.setValue(max(5, (int)microscopylayers.size())); + return; + } + } + + progress.setValue(i); + } + + redrawenabled = false; + + for (int i = 0; i < size; i++) { + qlayername = "layer_info_" + QVariant(i).toString() + "_"; + + qloadstring = qlayername + "selected"; + settings.value(qloadstring, 0).toInt() == 0 ? ((QRadioButton *)layerslayout->itemAtPosition(i, 0)->widget())->setChecked(false) : ((QRadioButton *)layerslayout->itemAtPosition(i, 0)->widget())->setChecked(true); + + if (i >= 3) { + if (settings.value(qloadstring, 0).toInt() == 1) { + actionFlipMicroscopyHorizontal->blockSignals(true); + actionFlipMicroscopyVertical->blockSignals(true); + microscopyx->blockSignals(true); + microscopyy->blockSignals(true); + microscopywidth->blockSignals(true); + microscopyheight->blockSignals(true); + microscopyangle->blockSignals(true); + microscopynavigationcombobox->blockSignals(true); + + actionFlipMicroscopyHorizontal->setChecked(microscopylayers[i].flipx); + actionFlipMicroscopyVertical->setChecked(microscopylayers[i].flipy); + microscopyx->setValue(microscopylayers[i].x); + microscopyy->setValue(microscopylayers[i].y); + microscopywidth->setValue(microscopylayers[i].width); + microscopyheight->setValue(microscopylayers[i].height); + microscopyangle->setValue(microscopylayers[i].angle); + microscopynavigationcombobox->setCurrentIndex(max(0, microscopylayers[i].navigationlayer - 3)); + + actionFlipMicroscopyHorizontal->blockSignals(false); + actionFlipMicroscopyVertical->blockSignals(false); + microscopyx->blockSignals(false); + microscopyy->blockSignals(false); + microscopywidth->blockSignals(false); + microscopyheight->blockSignals(false); + microscopyangle->blockSignals(false); + microscopynavigationcombobox->blockSignals(false); + } + } + + qloadstring = qlayername + "checked"; + settings.value(qloadstring, 0).toInt() == 0 ? ((QCheckBox *)layerslayout->itemAtPosition(i, 1)->widget())->setChecked(false) : ((QCheckBox *)layerslayout->itemAtPosition(i, 1)->widget())->setChecked(true); + + qloadstring = qlayername + "label"; + ((QLabel *)layerslayout->itemAtPosition(i, 2)->widget())->setText(settings.value(qloadstring, "Unknown Layer").toString()); + + qloadstring = qlayername + "slider_alpha"; + ((QSlider *)layerslayout->itemAtPosition(i, 3)->widget())->setValue(settings.value(qloadstring, 100).toInt()); + + qloadstring = qlayername + "spinbox_alpha"; + ((QSpinBox *)layerslayout->itemAtPosition(i, 4)->widget())->setValue(settings.value(qloadstring, 100).toInt()); + + qloadstring = qlayername + "spinbox_zvalue"; + ((QSpinBox *)layerslayout->itemAtPosition(i, 5)->widget())->setValue(settings.value(qloadstring, 1).toInt()); + + qloadstring = qlayername + "description"; + ((QLabel *)layerslayout->itemAtPosition(i, 7)->widget())->setText(settings.value(qloadstring, "").toString()); + } + + redrawenabled = true; + + imagewindowwidget->redraw(); + + progress.setValue(max(5, (int)microscopylayers.size())); +} + + +void cImageWindow::saveLayers() { + if (!layersfileloaded || saveascalled) { + QString filename = QFileDialog::getSaveFileName(this, tr("Save Layers As..."), lastdirlayersfile, tr("Layers File (*.layers)")); + if (filename.isEmpty()) { + saveascalled = false; + return; + } + lastdirlayersfile = filename; + } + + if (layersfileloaded && !saveascalled) { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, editorname, "Save changes ?", QMessageBox::Yes | QMessageBox::No); + if (reply == QMessageBox::No) { + return; + } + } + + layersfileloaded = true; + saveascalled = false; + + QString shortname; + if (lastdirlayersfile.toStdString().rfind('/') != string::npos) { + shortname = lastdirlayersfile.toStdString().substr(lastdirlayersfile.toStdString().rfind('/') + 1).c_str(); + } + if (!shortname.isEmpty()) { + setWindowTitle(editorname + QString(" - ") + shortname); + } + else { + setWindowTitle(editorname); + } + + QString qsavestring, qlayername; + QSettings settings(lastdirlayersfile, QSettings::IniFormat); + settings.clear(); + + //QProgressDialog progress("Saving layers...", /*"Cancel"*/0, 0, max(5, (int)microscopylayers.size()), this); + //progress.setMinimumWidth(250); + //cEventFilter filter; + //progress.installEventFilter(&filter); + //progress.setMinimumDuration(0); + //progress.setWindowModality(Qt::ApplicationModal); + //progress.setValue(0); + + settings.setValue("opticalimage_file", lastdiropticalimage); + settings.setValue("opticalimage_horizontal_shift", leftshift->value()); + settings.setValue("opticalimage_vertical_shift", topshift->value()); + settings.setValue("opticalimage_max_x", maxx->value()); + settings.setValue("opticalimage_max_y", maxy->value()); + settings.setValue("opticalimage_pixel_width", pixelsizexspinbox->value()); + settings.setValue("opticalimage_pixel_height", pixelsizeyspinbox->value()); + + //progress.setValue(1); + + qsavestring = "histologyimage_flip_horizontal"; + actionFlipHistologyHorizontal->isChecked() ? settings.setValue(qsavestring, 1) : settings.setValue(qsavestring, 0); + + qsavestring = "histologyimage_flip_vertical"; + actionFlipHistologyVertical->isChecked() ? settings.setValue(qsavestring, 1) : settings.setValue(qsavestring, 0); + + QFileInfo histologyfilecheck(lastdirhistologyimage); + if (histologyfilecheck.exists() && histologyfilecheck.isFile()) { + settings.setValue("histologyimage_file", lastdirhistologyimage); + } + else { + settings.setValue("histologyimage_file", ""); + } + + settings.setValue("histologyimage_x", histologyx->value()); + settings.setValue("histologyimage_y", histologyy->value()); + settings.setValue("histologyimage_width", histologywidth->value()); + settings.setValue("histologyimage_height", histologyheight->value()); + settings.setValue("histologyimage_angle", histologyangle->value()); + + //progress.setValue(2); + + int size = (int)microscopylayers.size(); + settings.setValue("microscopy_layers_count", size); + + for (int i = 3; i < size; i++) { + qlayername = "microscopy_layer_" + QVariant(i).toString() + "_"; + + qsavestring = qlayername + "type"; + settings.setValue(qsavestring, microscopylayers[i].type); + + qsavestring = qlayername + "navigationlayer"; + settings.setValue(qsavestring, microscopylayers[i].navigationlayer); + + qsavestring = qlayername + "sourcename"; + settings.setValue(qsavestring, microscopylayers[i].sourcename); + + qsavestring = qlayername + "imagename"; + settings.setValue(qsavestring, microscopylayers[i].imagename); + + qsavestring = qlayername + "flipx"; + settings.setValue(qsavestring, microscopylayers[i].flipx); + + qsavestring = qlayername + "flipy"; + settings.setValue(qsavestring, microscopylayers[i].flipy); + + qsavestring = qlayername + "x"; + settings.setValue(qsavestring, microscopylayers[i].x); + + qsavestring = qlayername + "y"; + settings.setValue(qsavestring, microscopylayers[i].y); + + qsavestring = qlayername + "width"; + settings.setValue(qsavestring, microscopylayers[i].width); + + qsavestring = qlayername + "height"; + settings.setValue(qsavestring, microscopylayers[i].height); + + qsavestring = qlayername + "angle"; + settings.setValue(qsavestring, microscopylayers[i].angle); + + qsavestring = qlayername + "defaultwidth"; + settings.setValue(qsavestring, microscopylayers[i].defaultwidth); + + qsavestring = qlayername + "defaultheight"; + settings.setValue(qsavestring, microscopylayers[i].defaultheight); + + qsavestring = qlayername + "stagex"; + settings.setValue(qsavestring, microscopylayers[i].stagex); + + qsavestring = qlayername + "stagey"; + settings.setValue(qsavestring, microscopylayers[i].stagey); + + qsavestring = qlayername + "thresholdmin"; + settings.setValue(qsavestring, microscopylayers[i].thresholdmin); + + qsavestring = qlayername + "thresholdmax"; + settings.setValue(qsavestring, microscopylayers[i].thresholdmax); + + //progress.setValue(i); + } + + for (int i = 0; i < size; i++) { + qlayername = "layer_info_" + QVariant(i).toString() + "_"; + + qsavestring = qlayername + "selected"; + ((QRadioButton *)layerslayout->itemAtPosition(i, 0)->widget())->isChecked() ? settings.setValue(qsavestring, 1) : settings.setValue(qsavestring, 0); + + qsavestring = qlayername + "checked"; + ((QCheckBox *)layerslayout->itemAtPosition(i, 1)->widget())->isChecked() ? settings.setValue(qsavestring, 1) : settings.setValue(qsavestring, 0); + + qsavestring = qlayername + "label"; + settings.setValue(qsavestring, ((QLabel *)layerslayout->itemAtPosition(i, 2)->widget())->text()); + + qsavestring = qlayername + "slider_alpha"; + settings.setValue(qsavestring, ((QSlider *)layerslayout->itemAtPosition(i, 3)->widget())->value()); + + qsavestring = qlayername + "spinbox_alpha"; + settings.setValue(qsavestring, ((QSpinBox *)layerslayout->itemAtPosition(i, 4)->widget())->value()); + + qsavestring = qlayername + "spinbox_zvalue"; + settings.setValue(qsavestring, ((QSpinBox *)layerslayout->itemAtPosition(i, 5)->widget())->value()); + + qsavestring = qlayername + "description"; + settings.setValue(qsavestring, ((QLabel *)layerslayout->itemAtPosition(i, 7)->widget())->text()); + } + + //progress.setValue(max(5, (int)microscopylayers.size())); +} + + +void cImageWindow::saveLayersAs() { + saveascalled = true; + saveLayers(); +} + + +void cImageWindow::clearAllLayersSlot() { + QMessageBox::StandardButton reply; + QString s = "Clear all layers ?"; + + reply = QMessageBox::question(this, "Are you sure ?", s, QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::No) { + return; + } + + clearLayers(); + + ((QCheckBox *)layerslayout->itemAtPosition(0, 1)->widget())->setChecked(true); + + QString shortname = getShortFileName(imzmlfilename).c_str(); + ((QLabel *)layerslayout->itemAtPosition(0, 7)->widget())->setText(shortname); +} + + +void cImageWindow::microscopyNavigationChanged(int index) { + if (activelayer < 3) { + return; + } + + setNavigationLayer(activelayer, index + 3); + microscopyDefaultButtonReleased(); +} + + +void cImageWindow::clearLayer() { + QPushButton* button = qobject_cast(sender()); + int index = layerslayout->indexOf(button); + + int row, column, rowspan, colspan; + layerslayout->getItemPosition(index, &row, &column, &rowspan, &colspan); + + if (row == 0) { + return; + } + + ((QLabel *)layerslayout->itemAtPosition(row, 7)->widget())->setText(""); + microscopylayers[row].clear(); + + imagewindowwidget->clearLayer(row); + + // optical image + if (row == 1) { + redrawenabled = false; + + leftshift->setValue(0); + topshift->setValue(0); + maxx->setValue(500); + maxy->setValue(500); + pixelsizexspinbox->setValue(100); + pixelsizeyspinbox->setValue(100); + + setMaxButtonReleased(); + + redrawenabled = true; + } + + // histology image + if (row == 2) { + redrawenabled = false; + + //actionFlipHistologyHorizontal->blockSignals(true); + //actionFlipHistologyVertical->blockSignals(true); + histologyx->blockSignals(true); + histologyy->blockSignals(true); + histologywidth->blockSignals(true); + histologyheight->blockSignals(true); + histologyangle->blockSignals(true); + + actionFlipHistologyHorizontal->setChecked(false); + actionFlipHistologyVertical->setChecked(false); + + histologyx->setValue(0); + histologyy->setValue(0); + histologywidth->setValue(0); + histologyheight->setValue(0); + histologyangle->setValue(0); + + //actionFlipHistologyHorizontal->blockSignals(false); + //actionFlipHistologyVertical->blockSignals(false); + histologyx->blockSignals(false); + histologyy->blockSignals(false); + histologywidth->blockSignals(false); + histologyheight->blockSignals(false); + histologyangle->blockSignals(false); + + histologyChanged(); + + redrawenabled = true; + } + + // microscopy images + if (row >= 3) { + if (row == activelayer) { + redrawenabled = false; + + actionFlipMicroscopyHorizontal->blockSignals(true); + actionFlipMicroscopyVertical->blockSignals(true); + microscopyx->blockSignals(true); + microscopyy->blockSignals(true); + microscopywidth->blockSignals(true); + microscopyheight->blockSignals(true); + microscopyangle->blockSignals(true); + microscopynavigationcombobox->blockSignals(true); + + actionFlipMicroscopyHorizontal->setChecked(false); + actionFlipMicroscopyVertical->setChecked(false); + + microscopyx->setValue(0); + microscopyy->setValue(0); + microscopywidth->setValue(0); + microscopyheight->setValue(0); + microscopyangle->setValue(0); + microscopynavigationcombobox->setCurrentIndex(0); + + actionFlipMicroscopyHorizontal->blockSignals(false); + actionFlipMicroscopyVertical->blockSignals(false); + microscopyx->blockSignals(false); + microscopyy->blockSignals(false); + microscopywidth->blockSignals(false); + microscopyheight->blockSignals(false); + microscopyangle->blockSignals(false); + microscopynavigationcombobox->blockSignals(false); + + redrawenabled = true; + } + } + + imagewindowwidget->redraw(); +} + diff --git a/CycloBranch/gui/cImageWindow.h b/CycloBranch/gui/cImageWindow.h index f27cc15..01ea066 100644 --- a/CycloBranch/gui/cImageWindow.h +++ b/CycloBranch/gui/cImageWindow.h @@ -20,9 +20,13 @@ #include #include #include +#include +#include #include "core/utilities.h" #include "core/cGlobalPreferences.h" #include "gui/cImageWindowWidget.h" +#include "gui/cImageWindowImportDialog.h" +#include "gui/cImageWindowTabOptical.h" // forward declaration @@ -41,6 +45,42 @@ class QMenu; \brief Paramaters of a microscopy layer. */ struct microscopyLayerInfo { + /** + \brief Type (0 = FEI SEM, 1 = LEICA LIF). + */ + int type; + + + /** + \brief Index of navigation layer. + */ + int navigationlayer; + + + /** + \brief Source file name. + */ + QString sourcename; + + + /** + \brief Image name. + */ + QString imagename; + + + /** + \brief Flip horizontally. + */ + bool flipx; + + + /** + \brief Flip vertically. + */ + bool flipy; + + /** \brief X position. */ @@ -101,20 +141,30 @@ struct microscopyLayerInfo { QImage* image; + /** + \brief True if the image size has been reduced. + */ + bool reduced; + + + /** + \brief Noise threshold. + */ + int thresholdmin; + + + /** + \brief Signal threshold. + */ + int thresholdmax; + + /** \brief The constructor. */ microscopyLayerInfo() { - x = 0; - y = 0; - width = 0; - height = 0; - angle = 0; - defaultwidth = 0; - defaultheight = 0; - stagex = 0; - stagey = 0; image = new QImage(); + clear(); } @@ -122,6 +172,12 @@ struct microscopyLayerInfo { \brief The copy constructor. */ microscopyLayerInfo(const microscopyLayerInfo& layer) { + type = layer.type; + navigationlayer = layer.navigationlayer; + sourcename = layer.sourcename; + imagename = layer.imagename; + flipx = layer.flipx; + flipy = layer.flipy; x = layer.x; y = layer.y; width = layer.width; @@ -133,6 +189,9 @@ struct microscopyLayerInfo { stagey = layer.stagey; image = new QImage(); *image = *layer.image; + reduced = layer.reduced; + thresholdmin = layer.thresholdmin; + thresholdmax = layer.thresholdmax; } @@ -142,6 +201,35 @@ struct microscopyLayerInfo { ~microscopyLayerInfo() { delete image; } + + + /** + \brief Clear the structure. + */ + void clear() { + type = -1; + navigationlayer = 3; + sourcename.clear(); + imagename.clear(); + flipx = false; + flipy = false; + x = 0; + y = 0; + width = 0; + height = 0; + angle = 0; + defaultwidth = 0; + defaultheight = 0; + stagex = 0; + stagey = 0; + + delete image; + image = new QImage(); + + reduced = false; + thresholdmin = 0; + thresholdmax = 255; + } }; @@ -177,14 +265,15 @@ class cImageWindow : public QMainWindow /** - \brief Set the default max count of pixel x/y values parsed from an imzML file. + \brief Set the filename and some default values parsed from the imzML file. + \param imzmlfilename name of imzML file \param defaultmaxx max count of pixel x - parsed from imzML file \param defaultmaxy max count of pixel y - parsed from imzML file \param defaultpixelsizex pixel size x - parsed from imzML file \param defaultpixelsizey pixel size y - parsed from imzML file \param vendor vendor type */ - void setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor); + void setDefaultValues(string imzmlfilename, int defaultmaxx, int defaultmaxy, int defaultpixelsizex, int defaultpixelsizey, eVendorType vendor); /** @@ -202,7 +291,11 @@ class cImageWindow : public QMainWindow private: + + QString editorname; + cImageWindowImportDialog importdialog; + cGlobalPreferences* globalpreferences; QWidget* parent; @@ -212,8 +305,13 @@ class cImageWindow : public QMainWindow QMenu* menuHelp; QToolBar* toolbarFile; + QAction* actionLoadLayers; + QAction* actionSaveLayers; + QAction* actionSaveLayersAs; QAction* actionOpenImage; - QAction* actionSaveImage; + QAction* actionImportDialog; + QAction* actionExportImage; + QAction* actionClearAll; QAction* actionCloseWindow; QToolBar* toolbarView; @@ -225,6 +323,8 @@ class cImageWindow : public QMainWindow QAction* actionZoomReset; QAction* actionFlipHistologyHorizontal; QAction* actionFlipHistologyVertical; + QAction* actionFlipMicroscopyHorizontal; + QAction* actionFlipMicroscopyVertical; QLabel* rulerLabel; QDoubleSpinBox* rulerValue; @@ -288,8 +388,12 @@ class cImageWindow : public QMainWindow QDoubleSpinBox* microscopyheight; QLabel* microscopyanglelabel; QDoubleSpinBox* microscopyangle; + QLabel* microscopynavigationlabel; + QComboBox* microscopynavigationcombobox; QPushButton* microscopydefaultbutton; QPushButton* microscopygobutton; + QPushButton* microscopyprevbutton; + QPushButton* microscopynextbutton; QToolBar* toolbarHelp; QAction* actionHTMLDocumentation; @@ -297,11 +401,17 @@ class cImageWindow : public QMainWindow QImage* image; QImage* histologyimage; + // layer == 0 - compounds + // layer == 1 - optical image + // layer == 2 - histology image + // layer == 3 - microscopy navigation image + // layer >= 4 - microscopy images vector microscopylayers; cImageWindowWidget* imagewindowwidget; QGridLayout* layerslayout; QWidget* layerswidget; + QScrollArea* layersscrollarea; QSplitter* mainwidget; int layerscount; @@ -311,6 +421,12 @@ class cImageWindow : public QMainWindow QString lastdirhistologyimage; QString lastdirmicroscopyimage; QString lastdirexportimage; + QString lastdirlayersfile; + + bool layersfileloaded; + bool saveascalled; + + string imzmlfilename; int defaultmaxx; int defaultmaxy; @@ -320,15 +436,38 @@ class cImageWindow : public QMainWindow eVendorType vendor; + bool redrawenabled; + void colorSpinBoxes(int layerid); void openOpticalImage(); + void reopenOpticalImage(QString filename); + void openHistologyImage(); - bool parseMicroscopyImage(QString& filename, double& pixelwidth, double& pixelheight, int& resolutionx, int& resolutiony, double& stagex, double& stagey); + void reopenHistologyImage(QString filename); + + bool parseMicroscopyImage(QString& filename, double& pixelwidth, double& pixelheight, int& resolutionx, int& resolutiony, double& realwidth, double& stagex, double& stagey); + + void openMicroscopyImage(int layer, const QString &layername); + + void reopenMicroscopyImage(int layer, QString filename, bool reopen); + + void clearLayers(); + + void updateMicroscopyNavigationCombobox(int numberofitems); + + bool checkLoadedImage(QImage* image); + + void readLifImageOptical(string filename, cLifMetadata& metadata, QImage& image, bool enableprogress); + + void readLifImageFluorescence(string filename, cLifMetadata& metadata, QImage& image, int minthreshold, int maxthreshold, bool enableprogress); + + void openLifImage(string liffilename, int layer, cLifMetadata& metadata, bool enableprogress); + + void setNavigationLayer(int layer, int navigation); - void openMicroscopyImage(eLayerType layer, const QString &layername); protected: @@ -340,6 +479,13 @@ class cImageWindow : public QMainWindow void keyPressEvent(QKeyEvent *event); + /** + \brief Handle a key release event. + \param event pointer to QKeyEvent + */ + void keyReleaseEvent(QKeyEvent *event); + + private slots: @@ -352,7 +498,10 @@ private slots: void imageTypeSelected(const QString &s); - void saveImage(); + void openImportDialog(); + + + void exportImage(); void setFilterOptionsSlot(vector coordinates, bool operatortype, string columnname1, string comparatorname1, string filterstring1, string columnname2, string comparatorname2, string filterstring2, bool casesensitive, bool wholeword); @@ -385,12 +534,21 @@ private slots: void microscopyGoButtonReleased(); + void microscopyPrevButtonReleased(); + + + void microscopyNextButtonReleased(); + + void microscopyPositionChanged(double value); void microscopyAngleChanged(double value); + void microscopyFlipStateChanged(bool state); + + void showHTMLDocumentation(); @@ -421,7 +579,7 @@ private slots: void updateHistologySlot(int x, int y, int width, int height, double angle); - void updateMicroscopySlot(double x, double y, double width, double height, double angle); + void updateMicroscopySlot(bool flipx, bool flipy, double x, double y, double width, double height, double angle); void updateRulerSlot(double value); @@ -430,6 +588,24 @@ private slots: void imageDoubleClickedSlot(int spectrumid); + void loadLayers(); + + + void saveLayers(); + + + void saveLayersAs(); + + + void clearAllLayersSlot(); + + + void microscopyNavigationChanged(int index); + + + void clearLayer(); + + signals: @@ -449,8 +625,9 @@ private slots: \param checked true if the layer was checked, false if the layer was unchecked \param alpha transparency of the layer \param zvalue z-value of the layer + \param redraw redraw scene */ - void layerChanged(int layerid, bool checked, int alpha, int zvalue); + void layerChanged(int layerid, bool checked, int alpha, int zvalue, bool redraw); /** diff --git a/CycloBranch/gui/cImageWindowImportDialog.cpp b/CycloBranch/gui/cImageWindowImportDialog.cpp new file mode 100644 index 0000000..3db4ba3 --- /dev/null +++ b/CycloBranch/gui/cImageWindowImportDialog.cpp @@ -0,0 +1,122 @@ +#include "gui/cImageWindowImportDialog.h" +#include "gui/cImageWindowTabElectron.h" +#include "gui/cImageWindowTabOptical.h" + +#include + + +cImageWindowImportDialog::cImageWindowImportDialog(QWidget *parent) : QDialog(parent) { + tabelectron = new cImageWindowTabElectron(); + taboptical = new cImageWindowTabOptical(); + + tabwidget = new QTabWidget(); + tabwidget->addTab(tabelectron, tr("Scanning Electron Microscope (FEI)")); + tabwidget->addTab(taboptical, tr("Light Microscope (Leica)")); + + buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + buttonbox->button(QDialogButtonBox::Ok)->setText("Import"); + + 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("Import Images...")); + setWindowIcon(QIcon(":/images/icons/import.png")); +} + + +void cImageWindowImportDialog::setFormValues(QString& lastdirmicroscopyimage, int numberoflayers) { + tabelectron->setFormValues(lastdirmicroscopyimage, numberoflayers); + taboptical->setFormValues(lastdirmicroscopyimage, numberoflayers); +} + + +int cImageWindowImportDialog::getFormValues(int& startfromindex, QStringList& tiffilenames, int& navigationindex, QString& liffilename) { + int tabindex = tabwidget->currentIndex(); + + switch (tabindex) { + case 0: + tabelectron->getFormValues(startfromindex, tiffilenames); + break; + case 1: + taboptical->getFormValues(startfromindex, tiffilenames, navigationindex, liffilename); + break; + default: + startfromindex = 0; + tiffilenames.clear(); + navigationindex = 0; + liffilename.clear(); + break; + } + + return tabindex; +} + + +cImageWindowImportDialog::~cImageWindowImportDialog() { + delete tabelectron; + delete taboptical; + + delete tabwidget; + delete buttonbox; + + delete mainlayout; +} + + +//void cImageWindowImportDialog::keyPressEvent(QKeyEvent *event) { +// if (event->key() == Qt::Key_F1) { +// #if OS_TYPE == WIN +// QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/importimagesdialog.html").absoluteFilePath())); +// #else +// QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/importimagesdialog.html").absoluteFilePath())); +// #endif +// } +// +// event->accept(); +//} + + +void cImageWindowImportDialog::accept() { + int startfromindex; + QStringList tiffilenames; + int navigationindex; + QString liffilename; + + QMessageBox msgBox; + QString errstr; + + int tabindex = tabwidget->currentIndex(); + + switch (tabindex) { + case 0: + tabelectron->getFormValues(startfromindex, tiffilenames); + if (tiffilenames.isEmpty()) { + errstr = "At least one TIF file must be selected !"; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + break; + case 1: + taboptical->getFormValues(startfromindex, tiffilenames, navigationindex, liffilename); + if (liffilename.isEmpty()) { + errstr = "A LIF file must be selected !"; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + break; + default: + break; + } + + QDialog::accept(); +} + diff --git a/CycloBranch/gui/cImageWindowImportDialog.h b/CycloBranch/gui/cImageWindowImportDialog.h new file mode 100644 index 0000000..3f65e65 --- /dev/null +++ b/CycloBranch/gui/cImageWindowImportDialog.h @@ -0,0 +1,98 @@ +/** + \file cImageWindowImportDialog.h + \brief The implementation of import dialog in image window. +*/ + + +#ifndef _CIMAGEWINDOWIMPORTDIALOG_H +#define _CIMAGEWINDOWIMPORTDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include + + +class cImageWindowTabElectron; +class cImageWindowTabOptical; + + +/** + \brief Import dialog in image window. +*/ +class cImageWindowImportDialog : public QDialog +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + explicit cImageWindowImportDialog(QWidget *parent = 0); + + + /** + \brief Initialize values in the form. + \param lastdirmicroscopyimage a default directory with microscopy images + \param numberoflayers number of layers + */ + void setFormValues(QString& lastdirmicroscopyimage, int numberoflayers); + + + /** + \brief Get the values from the form. + \param startfromindex starting index to open microscopy images + \param tiffilenames a list of tif images to be opened + \param navigationindex index of navigation image + \param liffilename a lif file from which the metadata are read + \retval int tab index + */ + int getFormValues(int& startfromindex, QStringList& tiffilenames, int& navigationindex, QString& liffilename); + + + /** + \brief The destructor. + */ + ~cImageWindowImportDialog(); + + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + //void keyPressEvent(QKeyEvent *event); + + +private: + + cImageWindowTabElectron* tabelectron; + cImageWindowTabOptical* taboptical; + + QTabWidget *tabwidget; + QDialogButtonBox *buttonbox; + + QVBoxLayout *mainlayout; + + +public slots: + + /** + \brief Override the accept slot. + */ + void accept(); + +}; + + +#endif + diff --git a/CycloBranch/gui/cImageWindowTabElectron.cpp b/CycloBranch/gui/cImageWindowTabElectron.cpp new file mode 100644 index 0000000..6b6ccc9 --- /dev/null +++ b/CycloBranch/gui/cImageWindowTabElectron.cpp @@ -0,0 +1,75 @@ +#include "gui/cImageWindowTabElectron.h" + + +cImageWindowTabElectron::cImageWindowTabElectron(QWidget *parent) : QWidget(parent) { + gridlayout = new QGridLayout(); + + labelstartfrom = new QLabel("Begin import at : "); + + comboboxstartfrom = new QComboBox(); + + gridlayout->addWidget(labelstartfrom, 0, 0, 1, 1); + gridlayout->addWidget(comboboxstartfrom, 0, 1, 1, 9); + + labelfilenames = new QLabel("TIF Images : "); + + listwidgetfilenames = new QListWidget(); + listwidgetfilenames->setSelectionMode(QAbstractItemView::NoSelection); + + buttonfilenames = new QPushButton("Browse"); + + gridlayout->addWidget(labelfilenames, 1, 0, 1, 1); + gridlayout->addWidget(listwidgetfilenames, 1, 1, 1, 9); + gridlayout->addWidget(buttonfilenames, 2, 9, 1, 1); + + setLayout(gridlayout); + + connect(buttonfilenames, SIGNAL(released()), this, SLOT(browseButtonReleased())); +} + + +void cImageWindowTabElectron::setFormValues(QString& lastdirmicroscopyimage, int numberoflayers) { + this->lastdirmicroscopyimage = &lastdirmicroscopyimage; + + QString layername = "Microscopy Image "; + QString tmpname; + comboboxstartfrom->clear(); + for (int i = 0; i < numberoflayers - 4; i++) { + tmpname = layername + QVariant(i + 1).toString(); + comboboxstartfrom->insertItem(i, tmpname); + } + + listwidgetfilenames->clear(); + imagenames.clear(); +} + + +void cImageWindowTabElectron::getFormValues(int& index, QStringList& filenames) { + index = comboboxstartfrom->currentIndex(); + filenames = imagenames; +} + + +cImageWindowTabElectron::~cImageWindowTabElectron() { + delete labelstartfrom; + delete comboboxstartfrom; + + delete labelfilenames; + delete listwidgetfilenames; + delete buttonfilenames; + + delete gridlayout; +} + + +void cImageWindowTabElectron::browseButtonReleased() { + QStringList filenames = QFileDialog::getOpenFileNames(this, tr("Select Images..."), *lastdirmicroscopyimage, tr("Images (*.tif *.tiff)")); + if (!filenames.isEmpty()) { + listwidgetfilenames->clear(); + for (auto& it : filenames) { + listwidgetfilenames->addItem(it); + } + imagenames = filenames; + } +} + diff --git a/CycloBranch/gui/cImageWindowTabElectron.h b/CycloBranch/gui/cImageWindowTabElectron.h new file mode 100644 index 0000000..a252ff4 --- /dev/null +++ b/CycloBranch/gui/cImageWindowTabElectron.h @@ -0,0 +1,84 @@ +/** + \file cImageWindowTabElectron.h + \brief The implementation of a tab used to import images from electron microscopy. +*/ + + +#ifndef _CIMAGEWINDOWTABELECTRON_H +#define _CIMAGEWINDOWTABELECTRON_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/** + \brief The class representing a tab used to import images from electron microscopy. +*/ +class cImageWindowTabElectron : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + explicit cImageWindowTabElectron(QWidget *parent = 0); + + + /** + \brief Initialize values in the form. + \param lastdirmicroscopyimage a default directory with microscopy images + \param numberoflayers number of layers + */ + void setFormValues(QString& lastdirmicroscopyimage, int numberoflayers); + + + /** + \brief Get the values from the form. + \param index starting index to open microscopy images + \param filenames list of images to open + */ + void getFormValues(int& index, QStringList& filenames); + + + /** + \brief The destructor. + */ + ~cImageWindowTabElectron(); + + +private: + + QString* lastdirmicroscopyimage; + + QGridLayout* gridlayout; + + QLabel* labelstartfrom; + QComboBox* comboboxstartfrom; + + QLabel* labelfilenames; + QListWidget* listwidgetfilenames; + QPushButton* buttonfilenames; + QStringList imagenames; + + +private slots: + + void browseButtonReleased(); + +}; + + +#endif + diff --git a/CycloBranch/gui/cImageWindowTabOptical.cpp b/CycloBranch/gui/cImageWindowTabOptical.cpp new file mode 100644 index 0000000..142683b --- /dev/null +++ b/CycloBranch/gui/cImageWindowTabOptical.cpp @@ -0,0 +1,856 @@ +#include "gui/cImageWindowTabOptical.h" +#include "core/cMzML.h" + + +void readLifMetadata(string filename, vector& parsedmetadata) { + parsedmetadata.clear(); + + ifstream is; + is.open(filename, ifstream::binary); + + if (!is.good()) { + return; + } + + char c; + + is.get(c); + + // LIF magic byte + if (c != 0x70) { + return; + } + + is.seekg(7, ios::cur); + + if (!is.good()) { + return; + } + + is.get(c); + + // LIF memory byte + if (c != 0x2a) { + return; + } + + if (!is.good()) { + return; + } + + // length of xml metadata + unsigned unicodelenght; + is.read((char *)&unicodelenght, sizeof(unsigned)); + + // xml metadata + string xmlmetadata; + xmlmetadata.resize(unicodelenght); + for (unsigned i = 0; i < 2 * unicodelenght; i++) { + if (!is.good()) { + return; + } + + is.get(c); + + if (i % 2 == 0) { + if ((c >= 0x20) && (c <= 0x7e)) { + xmlmetadata[i / 2] = c; + } + else { + xmlmetadata[i / 2] = ' '; + } + } + } + + // print xml metadata + bool printxml = false; + if (printxml) { + for (auto& it : xmlmetadata) { + cout << it; + if (it == '>') { + cout << endl; + } + } + cout << endl; + } + + parseLifMetadata(xmlmetadata, parsedmetadata); + + unsigned long long datasize; + unsigned unicodeheadersize; + string headername; + + while (is.good()) { + datasize = 0; + unicodeheadersize = 0; + headername.clear(); + + is.get(c); + + if (c != 0x70) { + break; + } + + if (!is.good()) { + break; + } + + is.seekg(7, ios::cur); + + if (!is.good()) { + break; + } + + is.get(c); + + if (c != 0x2a) { + break; + } + + if (!is.good()) { + break; + } + + is.read((char*)&datasize, sizeof(unsigned long long)); + + is.get(c); + + if (c != 0x2a) { + break; + } + + if (!is.good()) { + break; + } + + is.read((char*)&unicodeheadersize, sizeof(unsigned)); + + if (!is.good()) { + break; + } + + headername.resize(unicodeheadersize); + for (unsigned i = 0; i < 2 * unicodeheadersize; i++) { + if (!is.good()) { + return; + } + + is.get(c); + + if (i % 2 == 0) { + if ((c >= 0x20) && (c <= 0x7e)) { + headername[i / 2] = c; + } + else { + headername[i / 2] = ' '; + } + } + } + + for (auto& it : parsedmetadata) { + if ((it.memoryblockid.compare(headername) == 0) && (it.memoryblocksize == datasize)) { + it.memoryblockoffsets.push_back((unsigned long long)is.tellg()); + break; + } + } + + is.seekg((streampos)datasize, ios::cur); + } + + // delete 3D images + bool delete3dimages = false; + if (delete3dimages) { + size_t pos = 0; + while (pos < parsedmetadata.size()) { + if ((parsedmetadata[pos].microscopytype == 1) && (parsedmetadata[pos].dimz > 1)) { + parsedmetadata.erase(parsedmetadata.begin() + pos); + } + else { + pos++; + } + } + } + + // delete empty images + bool deleteemptyimages = true; + if (deleteemptyimages) { + size_t pos = 0; + while (pos < parsedmetadata.size()) { + if (parsedmetadata[pos].memoryblocksize == 0) { + parsedmetadata.erase(parsedmetadata.begin() + pos); + } + else { + pos++; + } + } + } + + // delete tiles + bool deletetiles = true; + if (deletetiles) { + size_t pos = 0; + while (pos < parsedmetadata.size()) { + if (parsedmetadata[pos].tiles.size() > 1) { + cout << "deleting: " << endl; + parsedmetadata[pos].print(); + parsedmetadata.erase(parsedmetadata.begin() + pos); + } + else { + pos++; + } + } + } + + // expand z-layers (fluorescence) + bool expandzlayers = false; + if (expandzlayers) { + if (parsedmetadata.size() > 0) { + if (parsedmetadata[0].microscopytype == 1) { + + vector tmpmetadata; + + for (int i = 0; i < (int)parsedmetadata.size(); i++) { + + if (parsedmetadata[i].dimz > 1) { + + for (int j = 0; j < parsedmetadata[i].dimz; j++) { + tmpmetadata.push_back(parsedmetadata[i]); + + tmpmetadata.back().memoryblocksize = parsedmetadata[i].memoryblocksize / (unsigned long long)parsedmetadata[i].dimz; + + if (tmpmetadata.back().memoryblockoffsets.size() == 0) { + tmpmetadata.back().memoryblockoffsets.push_back(0); + } + + tmpmetadata.back().memoryblockoffsets.back() += (unsigned long long)j * tmpmetadata.back().memoryblocksize; + } + + } + else { + + tmpmetadata.push_back(parsedmetadata[i]); + + } + + } + + parsedmetadata = tmpmetadata; + } + } + } + + // expand color channels (fluorescence) + bool expandcolorchannels = false; + if (expandcolorchannels) { + if (parsedmetadata.size() > 0) { + if (parsedmetadata[0].microscopytype == 1) { + + vector tmpmetadata; + + for (int i = 0; i < (int)parsedmetadata.size(); i++) { + if (parsedmetadata[i].channels.size() == parsedmetadata[i].luts.size()) { + + for (int j = 0; j < (int)parsedmetadata[i].channels.size(); j++) { + + if (parsedmetadata[i].channels[j] == gray) { + tmpmetadata.push_back(parsedmetadata[i]); + + tmpmetadata.back().channels.clear(); + tmpmetadata.back().luts.clear(); + + tmpmetadata.back().channels.push_back(parsedmetadata[i].channels[j]); + tmpmetadata.back().luts.push_back(parsedmetadata[i].luts[j]); + + tmpmetadata.back().memoryblocksize = parsedmetadata[i].memoryblocksize / (unsigned long long)parsedmetadata[i].channels.size(); + + if (tmpmetadata.back().memoryblockoffsets.size() == 0) { + tmpmetadata.back().memoryblockoffsets.push_back(0); + } + + tmpmetadata.back().memoryblockoffsets.back() += (unsigned long long)j * tmpmetadata.back().memoryblocksize; + } + + } + + } + } + + parsedmetadata = tmpmetadata; + } + } + } + + // expand z-layers, color channels and group images with the same color channel (fluorescence) + bool expandfluorescence = true; + if (expandfluorescence) { + if (parsedmetadata.size() > 0) { + if (parsedmetadata[0].microscopytype == 1) { + + vector tmpmetadata; + unsigned long long memoryoffset; + int dimz; + + for (int i = 0; i < (int)parsedmetadata.size(); i++) { + + if (parsedmetadata[i].channels.size() == parsedmetadata[i].luts.size()) { + + for (int j = 0; j < (int)parsedmetadata[i].channels.size(); j++) { + + if (parsedmetadata[i].channels[j] == gray) { + + dimz = max(parsedmetadata[i].dimz, 1); + + tmpmetadata.push_back(parsedmetadata[i]); + + tmpmetadata.back().channels.clear(); + tmpmetadata.back().luts.clear(); + + tmpmetadata.back().channels.push_back(parsedmetadata[i].channels[j]); + tmpmetadata.back().luts.push_back(parsedmetadata[i].luts[j]); + + // fix image name for fluorescence images + if ((tmpmetadata.back().microscopytype == 1) && (tmpmetadata.back().luts.size() == 1) && (tmpmetadata.back().luts[0].size() > 0)) { + tmpmetadata.back().imagename += ", "; + tmpmetadata.back().imagename += tmpmetadata.back().luts[0].c_str(); + } + + //tmpmetadata.back().dimz = 1; + + tmpmetadata.back().memoryblocksize = parsedmetadata[i].memoryblocksize / ((unsigned long long)parsedmetadata[i].channels.size() * (unsigned long long)dimz); + + if (tmpmetadata.back().memoryblockoffsets.size() == 0) { + tmpmetadata.back().memoryblockoffsets.push_back(0); + } + + memoryoffset = tmpmetadata.back().memoryblockoffsets[0]; + tmpmetadata.back().memoryblockoffsets.clear(); + + for (int k = 0; k < dimz; k++) { + tmpmetadata.back().memoryblockoffsets.push_back(memoryoffset + (unsigned long long)k * parsedmetadata[i].memoryblocksize / (unsigned long long)dimz + (unsigned long long)j * tmpmetadata.back().memoryblocksize); + } + + } + + } + + } + + } + + parsedmetadata = tmpmetadata; + } + } + } + + // print parsed metadata + bool printparsedmetadata = false; + if (printparsedmetadata) { + for (auto& it : parsedmetadata) { + it.print(); + } + } +} + + +void parseLifMetadataSubTree(DOMElement* subtree, vector& parsedmetadata) { + DOMNode* currentNode3 = subtree->getFirstChild(); + while (currentNode3) { + + if (currentNode3->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement3 = dynamic_cast(currentNode3); + if (compareElementTagName(currentElement3, "Element")) { + + + cLifMetadata metadata; + metadata.imagename = getAttribute(currentElement3, "Name"); + parsedmetadata.push_back(metadata); + + vector subtreemetadata; + + + // childrens of Element + DOMNode* currentNode4 = currentElement3->getFirstChild(); + while (currentNode4) { + + if (currentNode4->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement4 = dynamic_cast(currentNode4); + if (compareElementTagName(currentElement4, "Memory")) { + + parsedmetadata.back().memoryblocksize = stoull(getAttribute(currentElement4, "Size")); + parsedmetadata.back().memoryblockid = getAttribute(currentElement4, "MemoryBlockID"); + + } + + if (compareElementTagName(currentElement4, "Data")) { + + + // childrens of Data + DOMNode* currentNode5 = currentElement4->getFirstChild(); + while (currentNode5) { + + if (currentNode5->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement5 = dynamic_cast(currentNode5); + if (compareElementTagName(currentElement5, "Image")) { + + + // childrens of Image + DOMNode* currentNode6 = currentElement5->getFirstChild(); + while (currentNode6) { + + if (currentNode6->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement6 = dynamic_cast(currentNode6); + if (compareElementTagName(currentElement6, "ImageDescription")) { + + + // childrens of ImageDescription + DOMNode* currentNode7 = currentElement6->getFirstChild(); + while (currentNode7) { + + if (currentNode7->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement7 = dynamic_cast(currentNode7); + if (compareElementTagName(currentElement7, "Dimensions")) { + + + // childrens of Dimensions + DOMNode* currentNode8 = currentElement7->getFirstChild(); + while (currentNode8) { + + if (currentNode8->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement8 = dynamic_cast(currentNode8); + if (compareElementTagName(currentElement8, "DimensionDescription")) { + + string dimid = getAttribute(currentElement8, "DimID"); + + if (dimid.compare("1") == 0) { + parsedmetadata.back().dimx = QVariant(getAttribute(currentElement8, "NumberOfElements").c_str()).toInt(); + parsedmetadata.back().width = QVariant(getAttribute(currentElement8, "Length").c_str()).toDouble(); + } + + if (dimid.compare("2") == 0) { + parsedmetadata.back().dimy = QVariant(getAttribute(currentElement8, "NumberOfElements").c_str()).toInt(); + parsedmetadata.back().height = QVariant(getAttribute(currentElement8, "Length").c_str()).toDouble(); + } + + if (dimid.compare("3") == 0) { + parsedmetadata.back().dimz = QVariant(getAttribute(currentElement8, "NumberOfElements").c_str()).toInt(); + } + + if (dimid.compare("10") == 0) { + parsedmetadata.back().dim10 = QVariant(getAttribute(currentElement8, "NumberOfElements").c_str()).toInt(); + } + + } + + } + + currentNode8 = currentNode8->getNextSibling(); + + } + + + } + + if (compareElementTagName(currentElement7, "Channels")) { + + + // childrens of Channels + DOMNode* currentNode8 = currentElement7->getFirstChild(); + while (currentNode8) { + + if (currentNode8->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement8 = dynamic_cast(currentNode8); + if (compareElementTagName(currentElement8, "ChannelDescription")) { + + eChannelType channeltype = (eChannelType)QVariant(getAttribute(currentElement8, "ChannelTag").c_str()).toInt(); + parsedmetadata.back().channels.push_back(channeltype); + + string lut = getAttribute(currentElement8, "LUTName"); + parsedmetadata.back().luts.push_back(lut); + + } + + } + + currentNode8 = currentNode8->getNextSibling(); + + } + + + } + + } + + currentNode7 = currentNode7->getNextSibling(); + + } + + + } + + + if (compareElementTagName(currentElement6, "Attachment")) { + + + if (getAttribute(currentElement6, "Name").compare("TileScanInfo") == 0) { + parsedmetadata.back().tilescaninfoflipx = QVariant(getAttribute(currentElement6, "FlipX").c_str()).toInt(); + parsedmetadata.back().tilescaninfoflipy = QVariant(getAttribute(currentElement6, "FlipY").c_str()).toInt(); + } + + // childrens of Attachment + DOMNode* currentNode7 = currentElement6->getFirstChild(); + while (currentNode7) { + + if (currentNode7->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement7 = dynamic_cast(currentNode7); + if (compareElementTagName(currentElement7, "ATLCameraSettingDefinition")) { + + parsedmetadata.back().flipx = QVariant(getAttribute(currentElement7, "FlipX").c_str()).toInt(); + parsedmetadata.back().flipy = QVariant(getAttribute(currentElement7, "FlipY").c_str()).toInt(); + parsedmetadata.back().magnification = QVariant(getAttribute(currentElement7, "Magnification").c_str()).toInt(); + parsedmetadata.back().stageposx = QVariant(getAttribute(currentElement7, "StagePosX").c_str()).toDouble(); + parsedmetadata.back().stageposy = QVariant(getAttribute(currentElement7, "StagePosY").c_str()).toDouble(); + parsedmetadata.back().microscopemodel = getAttribute(currentElement7, "MicroscopeModel"); + parsedmetadata.back().inversemicroscopemodel = QVariant(getAttribute(currentElement7, "IsInverseMicroscopeModel").c_str()).toInt(); + parsedmetadata.back().microscopytype = 0; + + } + + if (compareElementTagName(currentElement7, "ATLConfocalSettingDefinition")) { + + parsedmetadata.back().flipx = QVariant(getAttribute(currentElement7, "FlipX").c_str()).toInt(); + parsedmetadata.back().flipy = QVariant(getAttribute(currentElement7, "FlipY").c_str()).toInt(); + parsedmetadata.back().magnification = QVariant(getAttribute(currentElement7, "Magnification").c_str()).toInt(); + parsedmetadata.back().stageposx = QVariant(getAttribute(currentElement7, "StagePosX").c_str()).toDouble(); + parsedmetadata.back().stageposy = QVariant(getAttribute(currentElement7, "StagePosY").c_str()).toDouble(); + parsedmetadata.back().microscopemodel = getAttribute(currentElement7, "MicroscopeModel"); + parsedmetadata.back().inversemicroscopemodel = QVariant(getAttribute(currentElement7, "IsInverseMicroscopeModel").c_str()).toInt(); + parsedmetadata.back().microscopytype = 1; + + } + + if (compareElementTagName(currentElement7, "Tile")) { + + cTileInfo tileinfo; + tileinfo.fieldx = QVariant(getAttribute(currentElement7, "FieldX").c_str()).toInt(); + tileinfo.fieldy = QVariant(getAttribute(currentElement7, "FieldY").c_str()).toInt(); + tileinfo.posx = QVariant(getAttribute(currentElement7, "PosX").c_str()).toDouble(); + tileinfo.posy = QVariant(getAttribute(currentElement7, "PosY").c_str()).toDouble(); + parsedmetadata.back().tiles.push_back(tileinfo); + + } + + if (compareElementTagName(currentElement7, "HardwareSetting")) { + + + // childrens of HardwareSetting + DOMNode* currentNode8 = currentElement7->getFirstChild(); + while (currentNode8) { + + if (currentNode8->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement8 = dynamic_cast(currentNode8); + if (compareElementTagName(currentElement8, "LDM_Block_Sequential")) { + + + // childrens of LDM_Block_Sequential + DOMNode* currentNode9 = currentElement8->getFirstChild(); + while (currentNode9) { + + if (currentNode9->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement9 = dynamic_cast(currentNode9); + if (compareElementTagName(currentElement9, "LDM_Block_Sequential_Master")) { + + + // childrens of LDM_Block_Sequential_Master + DOMNode* currentNode10 = currentElement9->getFirstChild(); + while (currentNode10) { + + if (currentNode10->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement10 = dynamic_cast(currentNode10); + if (compareElementTagName(currentElement10, "ATLConfocalSettingDefinition")) { + + if (parsedmetadata.back().microscopytype == -1) { + parsedmetadata.back().magnification = QVariant(getAttribute(currentElement10, "Magnification").c_str()).toInt(); + parsedmetadata.back().stageposx = QVariant(getAttribute(currentElement10, "StagePosX").c_str()).toDouble(); + parsedmetadata.back().stageposy = QVariant(getAttribute(currentElement10, "StagePosY").c_str()).toDouble(); + parsedmetadata.back().microscopemodel = getAttribute(currentElement10, "MicroscopeModel"); + parsedmetadata.back().inversemicroscopemodel = QVariant(getAttribute(currentElement10, "IsInverseMicroscopeModel").c_str()).toInt(); + parsedmetadata.back().microscopytype = 1; + } + + } + + } + + currentNode10 = currentNode10->getNextSibling(); + + } + + + } + + } + + currentNode9 = currentNode9->getNextSibling(); + + } + + + } + + } + + currentNode8 = currentNode8->getNextSibling(); + + } + + + } + + } + + currentNode7 = currentNode7->getNextSibling(); + + } + + + } + + } + + currentNode6 = currentNode6->getNextSibling(); + + } + + + } + + } + + currentNode5 = currentNode5->getNextSibling(); + + } + + + } + + if (compareElementTagName(currentElement4, "Children")) { + + + parseLifMetadataSubTree(currentElement4, subtreemetadata); + + } + + } + + currentNode4 = currentNode4->getNextSibling(); + + } + + + for (auto& it : subtreemetadata) { + parsedmetadata.push_back(it); + } + + + } + + } + + currentNode3 = currentNode3->getNextSibling(); + + } + +} + + +void parseLifMetadata(string& metadata, vector& parsedmetadata) { + MemBufInputSource lifxml((const XMLByte*)metadata.c_str(), metadata.size(), "lif metadata"); + + XercesDOMParser* parser = new XercesDOMParser(); + parser->parse(lifxml); + + DOMDocument* document = parser->getDocument(); + DOMElement* root = document->getDocumentElement(); + + if (!root) { + delete parser; + return; + } + + if (compareElementTagName(root, "LMSDataContainerHeader")) { + + // childrens of LMSDataContainerHeader + DOMNode* currentNode1 = root->getFirstChild(); + while (currentNode1) { + + if (currentNode1->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement1 = dynamic_cast(currentNode1); + if (compareElementTagName(currentElement1, "Element")) { + + + // childrens of Element + DOMNode* currentNode2 = currentElement1->getFirstChild(); + while (currentNode2) { + + if (currentNode2->getNodeType() == DOMNode::ELEMENT_NODE) { + + DOMElement* currentElement2 = dynamic_cast(currentNode2); + if (compareElementTagName(currentElement2, "Children")) { + + + // childrens of Children + parseLifMetadataSubTree(currentElement2, parsedmetadata); + + + } + + } + + currentNode2 = currentNode2->getNextSibling(); + + } + + + } + + } + + currentNode1 = currentNode1->getNextSibling(); + + } + + } + + delete parser; +} + + +cImageWindowTabOptical::cImageWindowTabOptical(QWidget *parent) : QWidget(parent) { + gridlayout = new QGridLayout(); + + + labelstartfrom = new QLabel("Begin import at : "); + + comboboxstartfrom = new QComboBox(); + + gridlayout->addWidget(labelstartfrom, 0, 0, 1, 1); + gridlayout->addWidget(comboboxstartfrom, 0, 1, 1, 9); + + + labelusevaluesfrom = new QLabel("Navigation : "); + + comboboxusevaluesfrom = new QComboBox(); + + gridlayout->addWidget(labelusevaluesfrom, 1, 0, 1, 1); + gridlayout->addWidget(comboboxusevaluesfrom, 1, 1, 1, 9); + + + labellif = new QLabel("LIF File : "); + lineeditlif = new QLineEdit(); + buttonlif = new QPushButton("Browse"); + + gridlayout->addWidget(labellif, 2, 0, 1, 1); + gridlayout->addWidget(lineeditlif, 2, 1, 1, 8); + gridlayout->addWidget(buttonlif, 2, 9, 1, 1); + + + labelfilenames = new QLabel("TIF Images (optional) : "); + + listwidgetfilenames = new QListWidget(); + listwidgetfilenames->setSelectionMode(QAbstractItemView::NoSelection); + + buttonfilenames = new QPushButton("Browse"); + + gridlayout->addWidget(labelfilenames, 3, 0, 1, 1); + gridlayout->addWidget(listwidgetfilenames, 3, 1, 1, 9); + gridlayout->addWidget(buttonfilenames, 4, 9, 1, 1); + + + setLayout(gridlayout); + + connect(buttonfilenames, SIGNAL(released()), this, SLOT(browseButtonReleased())); + connect(buttonlif, SIGNAL(released()), this, SLOT(lifButtonReleased())); +} + + +void cImageWindowTabOptical::setFormValues(QString& lastdirmicroscopyimage, int numberoflayers) { + this->lastdirmicroscopyimage = &lastdirmicroscopyimage; + + QString layername = "Microscopy Image "; + QString tmpname; + comboboxstartfrom->clear(); + comboboxusevaluesfrom->clear(); + + tmpname = layername + "(nav.)"; + comboboxusevaluesfrom->insertItem(0, tmpname); + + for (int i = 0; i < numberoflayers - 4; i++) { + tmpname = layername + QVariant(i + 1).toString(); + comboboxstartfrom->insertItem(i, tmpname); + comboboxusevaluesfrom->insertItem(i + 1, tmpname); + } + + lineeditlif->clear(); + listwidgetfilenames->clear(); + imagenames.clear(); +} + + +void cImageWindowTabOptical::getFormValues(int& startfromindex, QStringList& tiffilenames, int& navigationindex, QString& liffilename) { + startfromindex = comboboxstartfrom->currentIndex(); + tiffilenames = imagenames; + navigationindex = comboboxusevaluesfrom->currentIndex(); + liffilename = lineeditlif->text(); +} + + +cImageWindowTabOptical::~cImageWindowTabOptical() { + delete labelstartfrom; + delete comboboxstartfrom; + + delete labelusevaluesfrom; + delete comboboxusevaluesfrom; + + delete labellif; + delete lineeditlif; + delete buttonlif; + + delete labelfilenames; + delete listwidgetfilenames; + delete buttonfilenames; + + delete gridlayout; +} + + +void cImageWindowTabOptical::browseButtonReleased() { + QStringList filenames = QFileDialog::getOpenFileNames(this, tr("Select Images..."), *lastdirmicroscopyimage, tr("Images (*.tif *.tiff)")); + if (!filenames.isEmpty()) { + listwidgetfilenames->clear(); + for (auto& it : filenames) { + listwidgetfilenames->addItem(it); + } + imagenames = filenames; + } +} + + +void cImageWindowTabOptical::lifButtonReleased() { + QString filename = QFileDialog::getOpenFileName(this, tr("Select LIF file ..."), *lastdirmicroscopyimage, tr("LIF Files (*.lif)")); + if (!filename.isEmpty()) { + lineeditlif->setText(filename); + } +} + diff --git a/CycloBranch/gui/cImageWindowTabOptical.h b/CycloBranch/gui/cImageWindowTabOptical.h new file mode 100644 index 0000000..09dd740 --- /dev/null +++ b/CycloBranch/gui/cImageWindowTabOptical.h @@ -0,0 +1,425 @@ +/** + \file cImageWindowTabOptical.h + \brief The implementation of a tab used to import images from light microscopy. +*/ + + +#ifndef _CIMAGEWINDOWTABOPTICAL_H +#define _CIMAGEWINDOWTABOPTICAL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "core/utilities.h" + + +using namespace xercesc; + + +/** + \brief Color channels. +*/ +enum eChannelType { + gray = 0, + red = 1, + green = 2, + blue = 3 +}; + + +/** + \brief Description of an image tile. +*/ +struct cTileInfo { + + /** + \brief Tile logical x coordinate. + */ + int fieldx; + + + /** + \brief Tile logical y coordinate. + */ + int fieldy; + + + /** + \brief Tile position x [m]. + */ + double posx; + + + /** + \brief Tile position y [m]. + */ + double posy; + + + /** + \brief The constructor. + */ + cTileInfo() { + fieldx = 0; + fieldy = 0; + posx = 0; + posy = 0; + } + + + /** + \brief Print the metadata. + */ + void print() { + cout << "fieldx: " << fieldx << endl; + cout << "fieldy: " << fieldy << endl; + cout << "posx: " << posx << endl; + cout << "posy: " << posy << endl; + } + +}; + + +/** + \brief A structure to keep parsed lif metadata. +*/ +struct cLifMetadata { + + /** + \brief Image name. + */ + string imagename; + + + /** + \brief Type of microscopy technique (-1 = unknown, 0 = optical, 1 = fluorescence). + */ + int microscopytype; + + + /** + \brief Microscope model. + */ + string microscopemodel; + + + /** + \brief Inverse microscope model. + */ + int inversemicroscopemodel; + + + /** + \brief Magnification. + */ + int magnification; + + + /** + \brief Flip X. + */ + int flipx; + + + /** + \brief Flip Y. + */ + int flipy; + + + /** + \brief Width [pixels]. + */ + int dimx; + + + /** + \brief Height [pixels]. + */ + int dimy; + + + /** + \brief Depth [layers]. + */ + int dimz; + + + /** + \brief Number of tiles. + */ + int dim10; + + + /** + \brief Width [m]. + */ + double width; + + + /** + \brief Height [m]. + */ + double height; + + + /** + \brief Stage position x [m]. + */ + double stageposx; + + + /** + \brief Stage position y [m]. + */ + double stageposy; + + + /** + \brief Memory block size. + */ + long long unsigned memoryblocksize; + + + /** + \brief Memory block ID. + */ + string memoryblockid; + + + /** + \brief Offsets of memory blocks. + */ + vector memoryblockoffsets; + + + /** + \brief Color channels. + */ + vector channels; + + + /** + \brief LUTs. + */ + vector luts; + + + /** + \brief Flip X from TileScanInfo. + */ + int tilescaninfoflipx; + + + /** + \brief Flip Y from TileScanInfo. + */ + int tilescaninfoflipy; + + + /** + \brief Vector of tiles. + */ + vector tiles; + + + /** + \brief The constructor. + */ + cLifMetadata() { + imagename.clear(); + microscopytype = -1; + microscopemodel.clear(); + inversemicroscopemodel = 0; + magnification = 0; + flipx = 0; + flipy = 0; + dimx = 0; + dimy = 0; + dimz = 0; + dim10 = 0; + width = 0; + height = 0; + stageposx = 0; + stageposy = 0; + memoryblocksize = 0; + memoryblockid = ""; + memoryblockoffsets.clear(); + channels.clear(); + luts.clear(); + tilescaninfoflipx = -1; + tilescaninfoflipy = -1; + tiles.clear(); + } + + + /** + \brief Print metadata. + */ + void print() { + cout << "imagename: " << imagename << endl; + cout << "microscopytype: " << microscopytype << endl; + cout << "microscopemodel: " << microscopemodel << endl; + cout << "inversemicroscopemodel: " << inversemicroscopemodel << endl; + cout << "magnification: " << magnification << endl; + cout << "flipx: " << flipx << endl; + cout << "flipy: " << flipy << endl; + cout << "dimx: " << dimx << endl; + cout << "dimy: " << dimy << endl; + cout << "dimz: " << dimz << endl; + cout << "dim10: " << dim10 << endl; + cout << "width: " << width << endl; + cout << "height: " << height << endl; + cout << "stageposx: " << stageposx << endl; + cout << "stageposy: " << stageposy << endl; + cout << "memoryblocksize: " << memoryblocksize << endl; + cout << "memoryblockid: " << memoryblockid << endl; + + for (int i = 0; i < (int)memoryblockoffsets.size(); i++) { + cout << "memoryblockoffset " << i + 1 << ": " << memoryblockoffsets[i] << endl; + } + + for (int i = 0; i < (int)channels.size(); i++) { + cout << "channel " << i + 1 << ": " << channels[i] << endl; + } + + for (int i = 0; i < (int)luts.size(); i++) { + cout << "lut " << i + 1 << ": " << luts[i] << endl; + } + + cout << "tilescaninfoflipx: " << tilescaninfoflipx << endl; + cout << "tilescaninfoflipy: " << tilescaninfoflipy << endl; + + double avgposx = 0; + double avgposy = 0; + + for (auto& it : tiles) { + it.print(); + + avgposx += it.posx; + avgposy += it.posy; + } + + if (tiles.size() > 0) { + avgposx /= (double)tiles.size(); + avgposy /= (double)tiles.size(); + + cout << "avgposx: " << avgposx << endl; + cout << "avgpoxy: " << avgposy << endl; + } + + cout << endl; + } + +}; + + +/** + \brief Get metadata from a lif file. + \param filename input lif file + \param parsedmetadata output vector of parsed metadata +*/ +void readLifMetadata(string filename, vector& parsedmetadata); + + +/** + \brief Parse metadata from a subtree of a lif file. + \param subtree root of a subtree + \param parsedmetadata output vector of parsed metadata +*/ +void parseLifMetadataSubTree(DOMElement* subtree, vector& parsedmetadata); + + +/** + \brief Parse metadata from a lif file. + \param metadata input metadata + \param parsedmetadata output vector of parsed metadata +*/ +void parseLifMetadata(string& metadata, vector& parsedmetadata); + + +/** + \brief The class representing a tab used to import images from light microscopy. +*/ +class cImageWindowTabOptical : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + explicit cImageWindowTabOptical(QWidget *parent = 0); + + + /** + \brief Initialize values in the form. + \param lastdirmicroscopyimage a default directory with microscopy images + \param numberoflayers number of layers + */ + void setFormValues(QString& lastdirmicroscopyimage, int numberoflayers); + + + /** + \brief Get the values from the form. + \param startfromindex starting index to open microscopy images + \param tiffilenames a list of tif images to be opened + \param navigationindex index of navigation image + \param liffilename a lif file from which the metadata are read + */ + void getFormValues(int& startfromindex, QStringList& tiffilenames, int& navigationindex, QString& liffilename); + + + /** + \brief The destructor. + */ + ~cImageWindowTabOptical(); + + +private: + + QString* lastdirmicroscopyimage; + + QGridLayout* gridlayout; + + QLabel* labelstartfrom; + QComboBox* comboboxstartfrom; + + QLabel* labelusevaluesfrom; + QComboBox* comboboxusevaluesfrom; + + QLabel* labellif; + QLineEdit* lineeditlif; + QPushButton* buttonlif; + + QLabel* labelfilenames; + QListWidget* listwidgetfilenames; + QPushButton* buttonfilenames; + QStringList imagenames; + + +private slots: + + void browseButtonReleased(); + + void lifButtonReleased(); + + +}; + + +#endif + diff --git a/CycloBranch/gui/cImageWindowWidget.cpp b/CycloBranch/gui/cImageWindowWidget.cpp index 2a6fc9a..7d82651 100644 --- a/CycloBranch/gui/cImageWindowWidget.cpp +++ b/CycloBranch/gui/cImageWindowWidget.cpp @@ -27,7 +27,7 @@ cImageWindowWidget::cImageWindowWidget() { absoluteintensity = false; layersvector.clear(); - activelayer = layer_compounds; + activelayer = 0; xfrom = 0; xto = 0; @@ -61,6 +61,7 @@ cImageWindowWidget::cImageWindowWidget() { currentheight = 1; showselection = false; + keepaspectratio = false; microscopynavigationcenterx = 0; microscopynavigationcentery = 0; @@ -92,26 +93,26 @@ cImageWindowWidget::~cImageWindowWidget() { void cImageWindowWidget::setOpticalImage(QImage* image) { - *layersvector[layer_optical_image].pixmap = QPixmap::fromImage(image->convertToFormat(QImage::Format_ARGB32_Premultiplied)); + *layersvector[1].pixmap = QPixmap::fromImage(image->convertToFormat(QImage::Format_ARGB32_Premultiplied)); currentscale = 1; rulervalue = recalculateRulerValue(currentscale); emit updateRuler(rulervalue); - layersvector[layer_optical_image].ispixmapdefined = true; + layersvector[1].ispixmapdefined = true; redrawScene(); } void cImageWindowWidget::setHistologyImage(QImage* histologyimage) { - *layersvector[layer_histology_image].pixmap = QPixmap::fromImage(histologyimage->convertToFormat(QImage::Format_ARGB32_Premultiplied)); - layersvector[layer_histology_image].ispixmapdefined = true; + *layersvector[2].pixmap = QPixmap::fromImage(histologyimage->convertToFormat(QImage::Format_ARGB32_Premultiplied)); + layersvector[2].ispixmapdefined = true; redrawScene(); } -void cImageWindowWidget::setMicroscopyImage(eLayerType layer, QImage* microscopyimage) { +void cImageWindowWidget::setMicroscopyImage(int layer, QImage* microscopyimage) { *layersvector[layer].pixmap = QPixmap::fromImage(microscopyimage->convertToFormat(QImage::Format_ARGB32_Premultiplied)); layersvector[layer].ispixmapdefined = true; redrawScene(); @@ -178,15 +179,17 @@ void cImageWindowWidget::setDefaultMaxXY(int defaultmaxx, int defaultmaxy, int d void cImageWindowWidget::setHistologyPosition(int x, int y, int width, int height, double angle) { - layersvector[layer_histology_image].x = x; - layersvector[layer_histology_image].y = y; - layersvector[layer_histology_image].width = width; - layersvector[layer_histology_image].height = height; - layersvector[layer_histology_image].angle = angle; + layersvector[2].x = x; + layersvector[2].y = y; + layersvector[2].width = width; + layersvector[2].height = height; + layersvector[2].angle = angle; } -void cImageWindowWidget::setMicroscopyPosition(eLayerType layer, double x, double y, double width, double height, double angle) { +void cImageWindowWidget::setMicroscopyPosition(int layer, bool flipx, bool flipy, double x, double y, double width, double height, double angle) { + layersvector[layer].fliphorizontally = flipx; + layersvector[layer].flipvertically = flipy; layersvector[layer].x = x; layersvector[layer].y = y; layersvector[layer].width = width; @@ -195,13 +198,13 @@ void cImageWindowWidget::setMicroscopyPosition(eLayerType layer, double x, doubl } -void cImageWindowWidget::goToMicroscopyPosition(eLayerType layer) { - if (!layersvector[layer_optical_image].ispixmapdefined || !layersvector[layer].ispixmapdefined) { +void cImageWindowWidget::goToMicroscopyPosition(int layer) { + if (!layersvector[1].ispixmapdefined || !layersvector[layer].ispixmapdefined) { return; } - horizontalScrollBar()->setValue(layersvector[layer].lastx); - verticalScrollBar()->setValue(layersvector[layer].lasty); + horizontalScrollBar()->setValue(max(0.0, layersvector[layer].lastx - 250.0)); + verticalScrollBar()->setValue(max(0.0, layersvector[layer].lasty - 100.0)); } @@ -218,6 +221,39 @@ void cImageWindowWidget::redraw() { } +void cImageWindowWidget::clearLayers() { + activelayer = 0; + + size_t size = layersvector.size(); + layersvector.clear(); + layersvector.resize(size); +} + + +void cImageWindowWidget::clearLayer(int layer) { + if ((layer >= 0) && (layer < layersvector.size())) { + layersvector[layer].clear(); + } +} + + +void cImageWindowWidget::setKeepAspectRatio(bool state) { + keepaspectratio = state; + + // simulate mouseMoveEvent + if ((pressedx != -1) && (pressedy != -1)) { + if (layersvector[1].ispixmapdefined) { + updateSelectionGroup(); + } + } +} + + +void cImageWindowWidget::setNavigationLayer(int layer, int navigation) { + layersvector[layer].navigationlayer = navigation; +} + + void cImageWindowWidget::wheelEvent(QWheelEvent *event) { if (event->delta() > 0) { zoomIn(); @@ -233,7 +269,7 @@ void cImageWindowWidget::wheelEvent(QWheelEvent *event) { void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { QGraphicsView::mousePressEvent(event); - if (layersvector[layer_optical_image].ispixmapdefined) { + if (layersvector[1].ispixmapdefined) { if (event->button() == Qt::LeftButton) { QPointF p = mapToScene(event->x(), event->y()); @@ -247,7 +283,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { int transformedy = currenty; double tmpangle; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { QTransform transform; tmpangle = prepareTransformation(selectionrect->rect(), transform, layersvector[activelayer].fliphorizontally, layersvector[activelayer].flipvertically, layersvector[activelayer].angle, true); transform.map(currentx, currenty, &transformedx, &transformedy); @@ -259,7 +295,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { if ((abs(transformedx - selectionrect->rect().x()) < 5) && (abs(transformedy - selectionrect->rect().y()) < 5)) { setCursor(Qt::SizeFDiagCursor); cursoractivity = cursoractivity_resize_top_left; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeBDiagCursor); } @@ -268,7 +304,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { else if ((abs(transformedx - selectionrect->rect().x() - selectionrect->rect().width()) < 5) && (abs(transformedy - selectionrect->rect().y()) < 5)) { setCursor(Qt::SizeBDiagCursor); cursoractivity = cursoractivity_resize_top_right; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeFDiagCursor); } @@ -277,7 +313,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { else if ((abs(transformedx - selectionrect->rect().x()) < 5) && (abs(transformedy - selectionrect->rect().y() - selectionrect->rect().height()) < 5)) { setCursor(Qt::SizeBDiagCursor); cursoractivity = cursoractivity_resize_bottom_left; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeFDiagCursor); } @@ -286,7 +322,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { else if ((abs(transformedx - selectionrect->rect().x() - selectionrect->rect().width()) < 5) && (abs(transformedy - selectionrect->rect().y() - selectionrect->rect().height()) < 5)) { setCursor(Qt::SizeFDiagCursor); cursoractivity = cursoractivity_resize_bottom_right; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeBDiagCursor); } @@ -295,7 +331,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { else if ((abs(transformedx - selectionrect->rect().x()) < 5) && (transformedy >= selectionrect->rect().y()) && (transformedy <= selectionrect->rect().y() + selectionrect->rect().height())) { setCursor(Qt::SizeHorCursor); cursoractivity = cursoractivity_resize_left; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeVerCursor); } @@ -304,7 +340,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { else if ((abs(transformedx - selectionrect->rect().x() - selectionrect->rect().width()) < 5) && (transformedy >= selectionrect->rect().y()) && (transformedy <= selectionrect->rect().y() + selectionrect->rect().height())) { setCursor(Qt::SizeHorCursor); cursoractivity = cursoractivity_resize_right; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeVerCursor); } @@ -313,7 +349,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { else if ((abs(transformedy - selectionrect->rect().y()) < 5) && (transformedx >= selectionrect->rect().x()) && (transformedx <= selectionrect->rect().x() + selectionrect->rect().width())) { setCursor(Qt::SizeVerCursor); cursoractivity = cursoractivity_resize_top; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeHorCursor); } @@ -322,7 +358,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { else if ((abs(transformedy - selectionrect->rect().y() - selectionrect->rect().height()) < 5) && (transformedx >= selectionrect->rect().x()) && (transformedx <= selectionrect->rect().x() + selectionrect->rect().width())) { setCursor(Qt::SizeVerCursor); cursoractivity = cursoractivity_resize_bottom; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeHorCursor); } @@ -377,7 +413,7 @@ void cImageWindowWidget::mousePressEvent(QMouseEvent *event) { void cImageWindowWidget::mouseMoveEvent(QMouseEvent *event) { QGraphicsView::mouseMoveEvent(event); - if (layersvector[layer_optical_image].ispixmapdefined) { + if (layersvector[1].ispixmapdefined) { QPointF p = mapToScene(event->x(), event->y()); currentx = (int)p.x(); @@ -394,13 +430,13 @@ void cImageWindowWidget::mouseMoveEvent(QMouseEvent *event) { void cImageWindowWidget::mouseReleaseEvent(QMouseEvent *event) { QGraphicsView::mouseReleaseEvent(event); - if (layersvector[layer_optical_image].ispixmapdefined) { + if (layersvector[1].ispixmapdefined) { int xmin, xmax, ymin, ymax; qreal rx1, ry1, rx2, ry2; // select region tool - if (activelayer == layer_compounds) { + if (activelayer == 0) { if (pressedx == currentx) { pressedx = -1; @@ -440,7 +476,7 @@ void cImageWindowWidget::mouseReleaseEvent(QMouseEvent *event) { } // correlate image - if (activelayer == layer_optical_image) { + if (activelayer == 1) { if (pressedx == currentx) { pressedx = -1; @@ -484,7 +520,7 @@ void cImageWindowWidget::mouseReleaseEvent(QMouseEvent *event) { } // set histology - if (activelayer == layer_histology_image) { + if (activelayer == 2) { if (pressedx == currentx) { pressedx = -1; @@ -510,12 +546,12 @@ void cImageWindowWidget::mouseReleaseEvent(QMouseEvent *event) { redrawScene(); - emit updateHistologyPosition(x, y, width, height, layersvector[layer_histology_image].angle); + emit updateHistologyPosition(x, y, width, height, layersvector[2].angle); } } // set microscopy - if ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (activelayer >= 3) { if (pressedx == currentx) { pressedx = -1; @@ -559,7 +595,7 @@ void cImageWindowWidget::mouseReleaseEvent(QMouseEvent *event) { redrawScene(); - emit updateMicroscopyPosition(layersvector[activelayer].x, layersvector[activelayer].y, layersvector[activelayer].width, layersvector[activelayer].height, layersvector[activelayer].angle); + emit updateMicroscopyPosition(layersvector[activelayer].fliphorizontally, layersvector[activelayer].flipvertically, layersvector[activelayer].x, layersvector[activelayer].y, layersvector[activelayer].width, layersvector[activelayer].height, layersvector[activelayer].angle); } } @@ -647,15 +683,15 @@ void cImageWindowWidget::redrawScene() { scene->addItem(selectionrect); scene->addItem(selectionsimpletextitem); - if (!((int)layersvector.size() >= layer_optical_image + 1) || !layersvector[layer_optical_image].ispixmapdefined) { - scene->addText("Please, open an optical image."); + if (!((int)layersvector.size() >= 2) || !layersvector[1].ispixmapdefined) { + scene->addText("Please, open an optical image ('File->Open Image', CTRL + O) or load a previously saved configuration ('File->Load Layers', CTRL + L)."); return; } QRect rect_viewport(0, 0, viewport()->width(), viewport()->height()); QRectF rect_scene = mapToScene(rect_viewport).boundingRect(); - QPixmap scaledpixmap = layersvector[layer_optical_image].pixmap->copy(rect_scene.x() / currentscale, rect_scene.y() / currentscale, rect_scene.width() / currentscale + 1, rect_scene.height() / currentscale + 1); + QPixmap scaledpixmap = layersvector[1].pixmap->copy(rect_scene.x() / currentscale, rect_scene.y() / currentscale, rect_scene.width() / currentscale + 1, rect_scene.height() / currentscale + 1); if (scaledpixmap.isNull()) { return; @@ -672,36 +708,36 @@ void cImageWindowWidget::redrawScene() { return; } - currentwidth = layersvector[layer_optical_image].pixmap->width()*currentscale; - currentheight = layersvector[layer_optical_image].pixmap->height()*currentscale; + currentwidth = layersvector[1].pixmap->width()*currentscale; + currentheight = layersvector[1].pixmap->height()*currentscale; - if (((int)layersvector.size() >= layer_optical_image + 1) && layersvector[layer_optical_image].checked) { + if (((int)layersvector.size() >= 2) && layersvector[1].checked) { QPixmap alphapixmap(scaledpixmap.size()); alphapixmap.fill(Qt::transparent); QPainter painter(&alphapixmap); - painter.setOpacity((double)layersvector[layer_optical_image].alpha / 100.0); + painter.setOpacity((double)layersvector[1].alpha / 100.0); painter.drawPixmap(0, 0, scaledpixmap); painter.end(); QGraphicsPixmapItem* pixmapitem = scene->addPixmap(alphapixmap); pixmapitem->setPos(rect_scene.x(), rect_scene.y()); - pixmapitem->setZValue(layersvector[layer_optical_image].zvalue); + pixmapitem->setZValue(layersvector[1].zvalue); } - if (((int)layersvector.size() >= layer_histology_image + 1) && layersvector[layer_histology_image].ispixmapdefined) { - if (layersvector[layer_histology_image].checked) { - if ((layersvector[layer_histology_image].width * currentscale > 1) && (layersvector[layer_histology_image].height * currentscale > 1)) { + if (((int)layersvector.size() >= 3) && layersvector[2].ispixmapdefined) { + if (layersvector[2].checked) { + if ((layersvector[2].width * currentscale > 1) && (layersvector[2].height * currentscale > 1)) { - QPixmap scaledhistologypixmap = layersvector[layer_histology_image].pixmap->scaled((int)layersvector[layer_histology_image].width, (int)layersvector[layer_histology_image].height); + QPixmap scaledhistologypixmap = layersvector[2].pixmap->scaled((int)layersvector[2].width, (int)layersvector[2].height); int historigcenterx = scaledhistologypixmap.rect().center().x(); int historigcentery = scaledhistologypixmap.rect().center().y(); QTransform transform; transform.translate((qreal)historigcenterx, (qreal)historigcentery); - transform.scale(layersvector[layer_histology_image].flipvertically ? -1 : 1, layersvector[layer_histology_image].fliphorizontally ? -1 : 1); - transform.rotate(layersvector[layer_histology_image].angle); + transform.scale(layersvector[2].flipvertically ? -1 : 1, layersvector[2].fliphorizontally ? -1 : 1); + transform.rotate(layersvector[2].angle); transform.translate(-(qreal)historigcenterx, -(qreal)historigcentery); scaledhistologypixmap = scaledhistologypixmap.transformed(transform); @@ -710,21 +746,21 @@ void cImageWindowWidget::redrawScene() { int histnewwidth = scaledhistologypixmap.width(); int histnewheight = scaledhistologypixmap.height(); - if (((qreal)(layersvector[layer_histology_image].x + histnewwidth + historigcenterx - histnewcenterx) * currentscale > rect_scene.x()) && ((qreal)(layersvector[layer_histology_image].y + histnewheight + historigcentery - histnewcentery) * currentscale > rect_scene.y())) { - scaledhistologypixmap = scaledhistologypixmap.copy(max(rect_scene.x() / currentscale - (qreal)(layersvector[layer_histology_image].x + historigcenterx - histnewcenterx), 0.0), max(rect_scene.y() / currentscale - (qreal)(layersvector[layer_histology_image].y + historigcentery - histnewcentery), 0.0), rect_scene.width() / currentscale + 1, rect_scene.height() / currentscale + 1); + if (((qreal)(layersvector[2].x + histnewwidth + historigcenterx - histnewcenterx) * currentscale > rect_scene.x()) && ((qreal)(layersvector[2].y + histnewheight + historigcentery - histnewcentery) * currentscale > rect_scene.y())) { + scaledhistologypixmap = scaledhistologypixmap.copy(max(rect_scene.x() / currentscale - (qreal)(layersvector[2].x + historigcenterx - histnewcenterx), 0.0), max(rect_scene.y() / currentscale - (qreal)(layersvector[2].y + historigcentery - histnewcentery), 0.0), rect_scene.width() / currentscale + 1, rect_scene.height() / currentscale + 1); scaledhistologypixmap = scaledhistologypixmap.scaled(scaledhistologypixmap.width()*currentscale, scaledhistologypixmap.height()*currentscale); QPixmap alphapixmap(scaledhistologypixmap.size()); alphapixmap.fill(Qt::transparent); QPainter painter(&alphapixmap); - painter.setOpacity((double)layersvector[layer_histology_image].alpha / 100.0); + painter.setOpacity((double)layersvector[2].alpha / 100.0); painter.drawPixmap(0, 0, scaledhistologypixmap); painter.end(); QGraphicsPixmapItem* pixmapitem = scene->addPixmap(alphapixmap); - pixmapitem->setPos(max(rect_scene.x(), (qreal)(layersvector[layer_histology_image].x + historigcenterx - histnewcenterx) * currentscale), max(rect_scene.y(), (qreal)(layersvector[layer_histology_image].y + historigcentery - histnewcentery) * currentscale)); - pixmapitem->setZValue(layersvector[layer_histology_image].zvalue); + pixmapitem->setPos(max(rect_scene.x(), (qreal)(layersvector[2].x + historigcenterx - histnewcenterx) * currentscale), max(rect_scene.y(), (qreal)(layersvector[2].y + historigcentery - histnewcentery) * currentscale)); + pixmapitem->setZValue(layersvector[2].zvalue); } } @@ -734,10 +770,11 @@ void cImageWindowWidget::redrawScene() { microscopynavigationcenterx = 0; microscopynavigationcentery = 0; - for (int i = layer_microscopy_navigation_image; i < layer_end; i++) { + int size = (int)layersvector.size(); + for (int i = 3; i < size; i++) { if (((int)layersvector.size() >= i + 1) && layersvector[i].ispixmapdefined) { - if ((i == layer_microscopy_navigation_image) || (layersvector[i].checked)) { - drawMicroscopyImage((eLayerType)i, rect_scene, currentwidth, currentheight); + if ((i == 3) || (layersvector[i].checked)) { + drawMicroscopyImage(i, rect_scene, currentwidth, currentheight); } } } @@ -777,7 +814,7 @@ void cImageWindowWidget::redrawScene() { stringstream scalemin; stringstream scalemax; - if (((int)layersvector.size() >= layer_compounds + 1) && layersvector[layer_compounds].checked) { + if (((int)layersvector.size() >= 1) && layersvector[0].checked) { if (maximumintensity > 0) { @@ -833,7 +870,7 @@ void cImageWindowWidget::redrawScene() { rectitem->setPen(Qt::NoPen); QColor color; - double alpha = (double)layersvector[layer_compounds].alpha / 100.0; + double alpha = (double)layersvector[0].alpha / 100.0; if (!absoluteintensity) { color.setHslF(min(max((double)1 - (it->relativeintensity*(hue_max - hue_min) / maximumintensity + hue_min), 0.0), 1.0), 0.5, 0.5, alpha); @@ -846,7 +883,7 @@ void cImageWindowWidget::redrawScene() { 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); + rectitem->setZValue(layersvector[0].zvalue); scene->addItem(rectitem); } @@ -1007,8 +1044,11 @@ void cImageWindowWidget::redrawScene() { rulerend->setZValue(1001); scene->addItem(rulerend); + stringstream rulerstream; + rulerstream << std::fixed << std::setprecision(3) << rulervalue; + QString rulerhtml = ""; - rulerhtml += to_string(rulervalue).c_str(); + rulerhtml += rulerstream.str().c_str(); rulerhtml += " um"; QGraphicsTextItem *rulertext = scene->addText(""); @@ -1024,7 +1064,7 @@ void cImageWindowWidget::redrawScene() { } -void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scene, int currentwidth, int currentheight) { +void cImageWindowWidget::drawMicroscopyImage(int layer, QRectF& rect_scene, int currentwidth, int currentheight) { int micrometerswidth, micrometersheight; switch (vendor) { @@ -1051,7 +1091,7 @@ void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scen QTransform transform; transform.translate((qreal)microscopyorigcenterx, (qreal)microscopyorigcentery); - transform.scale(layersvector[layer].fliphorizontally ? -1 : 1, layersvector[layer].flipvertically ? -1 : 1); + transform.scale(layersvector[layer].flipvertically ? -1 : 1, layersvector[layer].fliphorizontally ? -1 : 1); transform.rotate(layersvector[layer].angle); transform.translate(-(qreal)microscopyorigcenterx, -(qreal)microscopyorigcentery); @@ -1079,7 +1119,7 @@ void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scen qreal scaledmicroscopycenterx = ((qreal)scaledmicroscopyx / microscopywidthratio + (qreal)microscopynewwidth / 2.0 + centershiftx) * microscopywidthratio; qreal scaledmicroscopycentery = ((qreal)scaledmicroscopyy / microscopyheightratio + (qreal)microscopynewheight / 2.0 + centershifty) * microscopyheightratio; - if (layer == layer_microscopy_navigation_image) { + if (layer == 3) { microscopynavigationcenterx = scaledmicroscopycenterx; microscopynavigationcentery = scaledmicroscopycentery; @@ -1095,6 +1135,9 @@ void cImageWindowWidget::drawMicroscopyImage(eLayerType layer, QRectF& rect_scen QPointF oldcenterpoint(scaledmicroscopycenterx, scaledmicroscopycentery); QPointF newcenterpoint = transformcenter.map(oldcenterpoint); + if (layersvector[layer].navigationlayer != 3) { + newcenterpoint = oldcenterpoint; + } centershiftx += (newcenterpoint.x() - scaledmicroscopycenterx) / microscopywidthratio; centershifty += (newcenterpoint.y() - scaledmicroscopycentery) / microscopyheightratio; @@ -1156,7 +1199,7 @@ void cImageWindowWidget::updateSelectionGroup() { getRectanglePoints(rx1, ry1, rx2, ry2); - if (activelayer == layer_compounds) { + if (activelayer == 0) { selectionrect->resetTransform(); selectionrect->setPen(QPen(Qt::green, 1, Qt::DashLine)); @@ -1179,7 +1222,7 @@ void cImageWindowWidget::updateSelectionGroup() { } - if (activelayer == layer_optical_image) { + if (activelayer == 1) { selectionrect->resetTransform(); selectionrect->setPen(QPen(Qt::green, 1, Qt::DashLine)); @@ -1204,7 +1247,7 @@ void cImageWindowWidget::updateSelectionGroup() { } - if (activelayer == layer_histology_image) { + if (activelayer == 2) { selectionrect->resetTransform(); selectionrect->setPen(QPen(Qt::green, 1, Qt::DashLine)); @@ -1226,20 +1269,24 @@ void cImageWindowWidget::updateSelectionGroup() { } - if ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (activelayer >= 3) { selectionrect->resetTransform(); selectionrect->setPen(QPen(Qt::green, 1, Qt::DashLine)); selectionrect->setRect(QRectF(QPointF(rx1, ry1), QPointF(rx2, ry2))); QTransform transform; - if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (activelayer > 3) { QTransform transformcenter; transformcenter.translate((qreal)microscopynavigationcenterx, (qreal)microscopynavigationcentery); transformcenter.rotate(layersvector[activelayer].angle); transformcenter.translate(-(qreal)microscopynavigationcenterx, -(qreal)microscopynavigationcentery); QPointF newcenterpoint = transformcenter.map(selectionrect->rect().center()); + if (layersvector[activelayer].navigationlayer != 3) { + newcenterpoint = selectionrect->rect().center(); + } + transform.translate(newcenterpoint.x() - selectionrect->rect().center().x(), newcenterpoint.y() - selectionrect->rect().center().y()); } transform.translate(selectionrect->rect().center().x(), selectionrect->rect().center().y()); @@ -1274,7 +1321,7 @@ void cImageWindowWidget::updateSelectionGroup() { int transformedy = currenty; double tmpangle; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { QTransform transform; tmpangle = prepareTransformation(selectionrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle, true); transform.map(currentx, currenty, &transformedx, &transformedy); @@ -1285,7 +1332,7 @@ void cImageWindowWidget::updateSelectionGroup() { if ((abs(transformedx - selectionrect->rect().x()) < 5) && (abs(transformedy - selectionrect->rect().y()) < 5)) { setCursor(Qt::SizeFDiagCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeBDiagCursor); } @@ -1293,7 +1340,7 @@ void cImageWindowWidget::updateSelectionGroup() { } else if ((abs(transformedx - selectionrect->rect().x() - selectionrect->rect().width()) < 5) && (abs(transformedy - selectionrect->rect().y()) < 5)) { setCursor(Qt::SizeBDiagCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeFDiagCursor); } @@ -1301,7 +1348,7 @@ void cImageWindowWidget::updateSelectionGroup() { } else if ((abs(transformedx - selectionrect->rect().x()) < 5) && (abs(transformedy - selectionrect->rect().y() - selectionrect->rect().height()) < 5)) { setCursor(Qt::SizeBDiagCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeFDiagCursor); } @@ -1309,7 +1356,7 @@ void cImageWindowWidget::updateSelectionGroup() { } else if ((abs(transformedx - selectionrect->rect().x() - selectionrect->rect().width()) < 5) && (abs(transformedy - selectionrect->rect().y() - selectionrect->rect().height()) < 5)) { setCursor(Qt::SizeFDiagCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeBDiagCursor); } @@ -1317,7 +1364,7 @@ void cImageWindowWidget::updateSelectionGroup() { } else if ((abs(transformedx - selectionrect->rect().x()) < 5) && (transformedy >= selectionrect->rect().y()) && (transformedy <= selectionrect->rect().y() + selectionrect->rect().height())) { setCursor(Qt::SizeHorCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeVerCursor); } @@ -1325,7 +1372,7 @@ void cImageWindowWidget::updateSelectionGroup() { } else if ((abs(transformedx - selectionrect->rect().x() - selectionrect->rect().width()) < 5) && (transformedy >= selectionrect->rect().y()) && (transformedy <= selectionrect->rect().y() + selectionrect->rect().height())) { setCursor(Qt::SizeHorCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeVerCursor); } @@ -1333,7 +1380,7 @@ void cImageWindowWidget::updateSelectionGroup() { } else if ((abs(transformedy - selectionrect->rect().y()) < 5) && (transformedx >= selectionrect->rect().x()) && (transformedx <= selectionrect->rect().x() + selectionrect->rect().width())) { setCursor(Qt::SizeVerCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeHorCursor); } @@ -1341,7 +1388,7 @@ void cImageWindowWidget::updateSelectionGroup() { } else if ((abs(transformedy - selectionrect->rect().y() - selectionrect->rect().height()) < 5) && (transformedx >= selectionrect->rect().x()) && (transformedx <= selectionrect->rect().x() + selectionrect->rect().width())) { setCursor(Qt::SizeVerCursor); - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { if (rotatedimage) { setCursor(Qt::SizeHorCursor); } @@ -1359,7 +1406,7 @@ void cImageWindowWidget::updateSelectionGroup() { setCursor(Qt::ArrowCursor); } - if (activelayer == layer_compounds) { + if (activelayer == 0) { if (vendor == bruker) { xmin = currentx*(maxx + 1) / max(1, currentwidth) - leftshift; @@ -1416,7 +1463,7 @@ void cImageWindowWidget::updateSelectionGroup() { } - if (activelayer == layer_optical_image) { + if (activelayer == 1) { if (vendor == bruker) { rx1 = (double)leftshift * (double)currentwidth / (double)(maxx + 1); @@ -1473,15 +1520,15 @@ void cImageWindowWidget::updateSelectionGroup() { } - if (activelayer == layer_histology_image) { + if (activelayer == 2) { int x = (double)currentx / currentscale; int y = (double)currenty / currentscale; - rx1 = layersvector[layer_histology_image].x * currentscale; - ry1 = layersvector[layer_histology_image].y * currentscale; - rx2 = (layersvector[layer_histology_image].x + layersvector[layer_histology_image].width) * currentscale; - ry2 = (layersvector[layer_histology_image].y + layersvector[layer_histology_image].height) * currentscale; + rx1 = layersvector[2].x * currentscale; + ry1 = layersvector[2].y * currentscale; + rx2 = (layersvector[2].x + layersvector[2].width) * currentscale; + ry2 = (layersvector[2].y + layersvector[2].height) * currentscale; //rx2 = min(rx2, (qreal)currentwidth); //ry2 = min(ry2, (qreal)currentheight); @@ -1518,7 +1565,7 @@ void cImageWindowWidget::updateSelectionGroup() { } - if ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (activelayer >= 3) { double x = (double)currentx * (double)micrometerswidth / (double)currentwidth; double y = (double)currenty * (double)micrometersheight / (double)currentheight; @@ -1534,13 +1581,17 @@ void cImageWindowWidget::updateSelectionGroup() { selectionrect->setRect(QRectF(QPointF(rx1, ry1), QPointF(rx2, ry2))); QTransform transform; - if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (activelayer > 3) { QTransform transformcenter; transformcenter.translate((qreal)microscopynavigationcenterx, (qreal)microscopynavigationcentery); transformcenter.rotate(layersvector[activelayer].angle); transformcenter.translate(-(qreal)microscopynavigationcenterx, -(qreal)microscopynavigationcentery); QPointF newcenterpoint = transformcenter.map(selectionrect->rect().center()); + if (layersvector[activelayer].navigationlayer != 3) { + newcenterpoint = selectionrect->rect().center(); + } + transform.translate(newcenterpoint.x() - selectionrect->rect().center().x(), newcenterpoint.y() - selectionrect->rect().center().y()); } transform.translate(selectionrect->rect().center().x(), selectionrect->rect().center().y()); @@ -1622,7 +1673,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, bool testedfliphorizontally = layersvector[activelayer].fliphorizontally; bool testedflipvertically = layersvector[activelayer].flipvertically; - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { QTransform transform; prepareTransformation(currentrect->rect(), transform, testedfliphorizontally, testedflipvertically, testedangle, true); transform.map((qreal)currentx, (qreal)currenty, &untransformedcurrentx, &untransformedcurrenty); @@ -1648,12 +1699,12 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, ry2 = untransformedcurrenty; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; case cursoractivity_move: - if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (activelayer > 3) { if (((testedangle >= 90.0) && (testedangle <= 270.0)) || ((testedangle <= -90.0) && (testedangle >= -270.0))) { rx1 = tmprx1 - untransformedcurrentx + untransformedpressedx; ry1 = tmpry1 - untransformedcurrenty + untransformedpressedy; @@ -1695,6 +1746,16 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, ry1 = tmpry1; rx2 = tmprx2; ry2 = tmpry2; + + if (keepaspectratio && (activelayer >= 2) && (tmprx1 != tmprx2)) { + ry2 = tmpry2 - (untransformedcurrentx - tmprx1) * (tmpry2 - tmpry1) / (tmprx2 - tmprx1); + + if (ry2 < ry1) { + tmp = ry1; + ry1 = ry2; + ry2 = tmp; + } + } if (rx2 < rx1) { tmp = rx1; @@ -1702,7 +1763,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1712,13 +1773,23 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = untransformedcurrentx; ry2 = tmpry2; + if (keepaspectratio && (activelayer >= 2) && (tmprx1 != tmprx2)) { + ry2 = tmpry2 + (untransformedcurrentx - tmprx2) * (tmpry2 - tmpry1) / (tmprx2 - tmprx1); + + if (ry2 < ry1) { + tmp = ry1; + ry1 = ry2; + ry2 = tmp; + } + } + if (rx2 < rx1) { tmp = rx1; rx1 = rx2; rx2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1728,13 +1799,23 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = tmprx2; ry2 = tmpry2; + if (keepaspectratio && (activelayer >= 2) && (tmpry1 != tmpry2)) { + rx2 = tmprx2 - (untransformedcurrenty - tmpry1) * (tmprx2 - tmprx1) / (tmpry2 - tmpry1); + + if (rx2 < rx1) { + tmp = rx1; + rx1 = rx2; + rx2 = tmp; + } + } + if (ry2 < ry1) { tmp = ry1; ry1 = ry2; ry2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1744,13 +1825,23 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = tmprx2; ry2 = untransformedcurrenty; + if (keepaspectratio && (activelayer >= 2) && (tmpry1 != tmpry2)) { + rx2 = tmprx2 + (untransformedcurrenty - tmpry2) * (tmprx2 - tmprx1) / (tmpry2 - tmpry1); + + if (rx2 < rx1) { + tmp = rx1; + rx1 = rx2; + rx2 = tmp; + } + } + if (ry2 < ry1) { tmp = ry1; ry1 = ry2; ry2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1760,6 +1851,10 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = tmprx2; ry2 = tmpry2; + if (keepaspectratio && (activelayer >= 2) && (tmprx1 != tmprx2)) { + ry1 = tmpry1 + (untransformedcurrentx - tmprx1) * (tmpry2 - tmpry1) / (tmprx2 - tmprx1); + } + if (rx2 < rx1) { tmp = rx1; rx1 = rx2; @@ -1772,7 +1867,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, ry2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1782,6 +1877,10 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = untransformedcurrentx; ry2 = tmpry2; + if (keepaspectratio && (activelayer >= 2) && (tmprx1 != tmprx2)) { + ry1 = tmpry1 - (untransformedcurrentx - tmprx2) * (tmpry2 - tmpry1) / (tmprx2 - tmprx1); + } + if (rx2 < rx1) { tmp = rx1; rx1 = rx2; @@ -1794,7 +1893,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, ry2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1804,6 +1903,10 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = tmprx2; ry2 = untransformedcurrenty; + if (keepaspectratio && (activelayer >= 2) && (tmprx1 != tmprx2)) { + ry2 = tmpry2 - (untransformedcurrentx - tmprx1) * (tmpry2 - tmpry1) / (tmprx2 - tmprx1); + } + if (rx2 < rx1) { tmp = rx1; rx1 = rx2; @@ -1816,7 +1919,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, ry2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1826,6 +1929,10 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, rx2 = untransformedcurrentx; ry2 = untransformedcurrenty; + if (keepaspectratio && (activelayer >= 2) && (tmprx1 != tmprx2)) { + ry2 = tmpry2 + (untransformedcurrentx - tmprx2) * (tmpry2 - tmpry1) / (tmprx2 - tmprx1); + } + if (rx2 < rx1) { tmp = rx1; rx1 = rx2; @@ -1838,7 +1945,7 @@ void cImageWindowWidget::getRectanglePoints(qreal& rx1, qreal& ry1, qreal& rx2, ry2 = tmp; } - if ((activelayer == layer_histology_image) || ((activelayer >= layer_microscopy_navigation_image) && (activelayer < layer_end))) { + if (activelayer >= 2) { fixRectCenter(rx1, ry1, rx2, ry2, testedfliphorizontally, testedflipvertically, testedangle); } break; @@ -1872,13 +1979,17 @@ double cImageWindowWidget::prepareTransformation(QRectF rect, QTransform& transf transform.reset(); - if ((activelayer > layer_microscopy_navigation_image) && (activelayer < layer_end)) { + if (activelayer > 3) { QTransform transformcenter; transformcenter.translate((qreal)microscopynavigationcenterx, (qreal)microscopynavigationcentery); transformcenter.rotate(-testedangle); transformcenter.translate(-(qreal)microscopynavigationcenterx, -(qreal)microscopynavigationcentery); QPointF newcenterpoint = transformcenter.map(rect.center()); + if (layersvector[activelayer].navigationlayer != 3) { + newcenterpoint = rect.center(); + } + if (flipaxes && (((testedangle >= 90.0) && (testedangle <= 270.0)) || ((testedangle <= -90.0) && (testedangle >= -270.0)))) { transform.translate(rect.center().x() - newcenterpoint.x(), rect.center().y() - newcenterpoint.y()); } @@ -1918,13 +2029,13 @@ double cImageWindowWidget::recalculateRulerValue(qreal currentscale) { switch (vendor) { case unknownvendor: - value = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); + value = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[1].pixmap->width()*currentscale); break; case bruker: - value = ((double)(maxx + 1)*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); + value = ((double)(maxx + 1)*(double)pixelsizex) * (double)rulersize / ((double)layersvector[1].pixmap->width()*currentscale); break; case waters: - value = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*currentscale); + value = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[1].pixmap->width()*currentscale); break; default: break; @@ -1955,13 +2066,13 @@ void cImageWindowWidget::setRulerValue(double value) { rulervalue = value; switch (vendor) { case unknownvendor: - currentscale = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); + currentscale = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[1].pixmap->width()*rulervalue); break; case bruker: - currentscale = ((double)(maxx + 1)*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); + currentscale = ((double)(maxx + 1)*(double)pixelsizex) * (double)rulersize / ((double)layersvector[1].pixmap->width()*rulervalue); break; case waters: - currentscale = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[layer_optical_image].pixmap->width()*rulervalue); + currentscale = ((double)maxx*(double)pixelsizex) * (double)rulersize / ((double)layersvector[1].pixmap->width()*rulervalue); break; default: break; @@ -2005,7 +2116,7 @@ void cImageWindowWidget::colorScaleStateChanged(bool state) { } -void cImageWindowWidget::changeLayer(int layerid, bool checked, int alpha, int zvalue) { +void cImageWindowWidget::changeLayer(int layerid, bool checked, int alpha, int zvalue, bool redraw) { if (layerid == (int)layersvector.size()) { layerInfo layer; layer.checked = checked; @@ -2020,7 +2131,9 @@ void cImageWindowWidget::changeLayer(int layerid, bool checked, int alpha, int z layersvector[layerid].zvalue = zvalue; } - redrawScene(); + if (redraw) { + redrawScene(); + } } @@ -2031,13 +2144,13 @@ void cImageWindowWidget::changeActiveLayer(int layerid) { void cImageWindowWidget::flipHistologyHorizontallyStateChanged(bool state) { - layersvector[layer_histology_image].fliphorizontally = state; + layersvector[2].fliphorizontally = state; redrawScene(); } void cImageWindowWidget::flipHistologyVerticallyStateChanged(bool state) { - layersvector[layer_histology_image].flipvertically = state; + layersvector[2].flipvertically = state; redrawScene(); } diff --git a/CycloBranch/gui/cImageWindowWidget.h b/CycloBranch/gui/cImageWindowWidget.h index 3c0c9bb..814505d 100644 --- a/CycloBranch/gui/cImageWindowWidget.h +++ b/CycloBranch/gui/cImageWindowWidget.h @@ -16,25 +16,9 @@ /** - \brief Layer types. + \brief The number of layers. */ -enum eLayerType { - layer_compounds = 0, - layer_optical_image, - layer_histology_image, - layer_microscopy_navigation_image, - layer_microscopy_image_1, - layer_microscopy_image_2, - layer_microscopy_image_3, - layer_microscopy_image_4, - layer_microscopy_image_5, - layer_microscopy_image_6, - layer_microscopy_image_7, - layer_microscopy_image_8, - layer_microscopy_image_9, - layer_microscopy_image_10, - layer_end -}; +const int numberoflayers = 204; /** @@ -136,6 +120,12 @@ struct layerInfo { qreal lasty; + /** + \brief Navigation layer. + */ + int navigationlayer; + + /** \brief Pixmap. */ @@ -146,20 +136,8 @@ struct layerInfo { \brief The constructor. */ layerInfo() { - checked = true; - alpha = 100; - zvalue = 0; - ispixmapdefined = false; - fliphorizontally = false; - flipvertically = false; - x = 0; - y = 0; - width = 0; - height = 0; - angle = 0; - lastx = 0; - lasty = 0; pixmap = new QPixmap(); + clear(); } @@ -180,11 +158,36 @@ struct layerInfo { angle = layer.angle; lastx = layer.lastx; lasty = layer.lasty; + navigationlayer = layer.navigationlayer; pixmap = new QPixmap(); *pixmap = *layer.pixmap; } + /** + \brief Clear the structure. + */ + void clear() { + checked = true; + alpha = 100; + zvalue = 0; + ispixmapdefined = false; + fliphorizontally = false; + flipvertically = false; + x = 0; + y = 0; + width = 0; + height = 0; + angle = 0; + lastx = 0; + lasty = 0; + navigationlayer = 3; + + delete pixmap; + pixmap = new QPixmap(); + } + + /** \brief The destructor. */ @@ -236,7 +239,7 @@ class cImageWindowWidget : public QGraphicsView \param layer a microscopy layer \param microscopyimage a microscopy image */ - void setMicroscopyImage(eLayerType layer, QImage* microscopyimage); + void setMicroscopyImage(int layer, QImage* microscopyimage); /** @@ -299,20 +302,22 @@ class cImageWindowWidget : public QGraphicsView /** \brief Set the position of a microscopy image. \param layer a microscopy layer + \param flipx flip horizontally + \param flipy flip vertically \param x x offset [um] \param y y offset [um] \param width width [um] \param height height [um] \param angle angle */ - void setMicroscopyPosition(eLayerType layer, double x, double y, double width, double height, double angle); + void setMicroscopyPosition(int layer, bool flipx, bool flipy, double x, double y, double width, double height, double angle); /** \brief Go to the position of a microscopy image. \param layer a microscopy layer */ - void goToMicroscopyPosition(eLayerType layer); + void goToMicroscopyPosition(int layer); /** @@ -331,6 +336,33 @@ class cImageWindowWidget : public QGraphicsView void redraw(); + /** + \brief Clear the vector of layers. + */ + void clearLayers(); + + + /** + \brief Clear a layer. + */ + void clearLayer(int layer); + + + /** + \brief Set the flag to keep aspect ratio. + \param state if true, the aspect ratio is kept + */ + void setKeepAspectRatio(bool state); + + + /** + \brief Set navigation layer. + \param layer current layer + \param navigation navigation layer + */ + void setNavigationLayer(int layer, int navigation); + + protected: @@ -412,13 +444,15 @@ class cImageWindowWidget : public QGraphicsView /** \brief The signal is emitted when the microscopy position was changed. + \param flipx flip horizontally + \param flipy flip vertically \param x x coordinate [um] \param y y coordinate [um] \param width width [um] \param height height [um] \param angle angle */ - void updateMicroscopyPosition(double x, double y, double width, double height, double angle); + void updateMicroscopyPosition(bool flipx, bool flipy, double x, double y, double width, double height, double angle); /** @@ -489,6 +523,7 @@ class cImageWindowWidget : public QGraphicsView int currentheight; bool showselection; + bool keepaspectratio; qreal microscopynavigationcenterx; qreal microscopynavigationcentery; @@ -501,7 +536,7 @@ class cImageWindowWidget : public QGraphicsView void redrawScene(); - void drawMicroscopyImage(eLayerType layer, QRectF& rect_scene, int currentwidth, int currentheight); + void drawMicroscopyImage(int layer, QRectF& rect_scene, int currentwidth, int currentheight); void updateSelectionGroup(); @@ -538,7 +573,7 @@ private slots: void colorScaleStateChanged(bool state); - void changeLayer(int layerid, bool checked, int alpha, int zvalue); + void changeLayer(int layerid, bool checked, int alpha, int zvalue, bool redraw); void changeActiveLayer(int layerid); diff --git a/CycloBranch/gui/cMainThread.cpp b/CycloBranch/gui/cMainThread.cpp index 93db270..215df3a 100644 --- a/CycloBranch/gui/cMainThread.cpp +++ b/CycloBranch/gui/cMainThread.cpp @@ -4,9 +4,916 @@ cIsotopePatternCache isotopepatterncache; -cMainThread::cMainThread(cParameters& parameters, cTheoreticalSpectrumList& theoreticalspectrumlist, bool enablelogwindow, bool enablestdout) { +string cMainThread::getCurrentTime(QTime& time) { + int secs = time.elapsed() / 1000; + int mins = (secs / 60) % 60; + int hrs = (secs / 3600); + secs = secs % 60; + + return to_string(hrs) + " hrs, " + to_string(mins) + " min, " + to_string(secs) + " sec"; +} + + +void cMainThread::singleThreadMS1(cMainThread* os, QTime& time, cTheoreticalSpectrum* testspectrum, vector< vector< vector > >* testhintsindexvector, cTheoreticalSpectrumList* testlistoftheoreticalspectra, vector< vector >* testunmatchedpeaksvector) { + if (testspectrum) { + *os << "===== running test - singleThreadMS1 =====" << endl; + } + + *os << "Time elapsed: " << getCurrentTime(time) << "." << endl << endl; + + *os << "Generating theoretical peaks... "; + + listoftheoreticalspectra->clear(); + listoftheoreticalspectra->resize((int)parameters.peaklistseriesvector.size()); + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + listoftheoreticalspectra->clear(h); + } + + if (testspectrum && testunmatchedpeaksvector && testlistoftheoreticalspectra) { + testlistoftheoreticalspectra->clear(); + testlistoftheoreticalspectra->resize((int)parameters.peaklistseriesvector.size()); + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + testlistoftheoreticalspectra->clear(h); + } + + testunmatchedpeaksvector->resize((int)parameters.peaklistseriesvector.size()); + } + + cTheoreticalSpectrum ts; + ts.setParameters(¶meters); + + if (parameters.generateisotopepattern) { + if (parameters.calculatefdrs) { + parameters.sequencedatabase.attachDecoys(terminatecomputation); + } + + if (terminatecomputation) { + emitEndSignals(); + return; + } + + ts.generateFineMSSpectrum(0, (int)parameters.sequencedatabase.size(), terminatecomputation); + } + else { + ts.generateMSSpectrum(0, (int)parameters.sequencedatabase.size(), terminatecomputation, true); + } + + if (terminatecomputation) { + emitEndSignals(); + return; + } + + unordered_map tempmap; + parameters.peakidtodesc.clear(); + parameters.isotopeformulaidtodesc.clear(); + + tempmap.clear(); + ts.getTheoreticalPeaks()->reducePeakDescriptions(tempmap); + convertStringIntUnorderedMapToStringVector(tempmap, parameters.peakidtodesc); + + //tempmap.clear(); + //ts.getTheoreticalPeaks()->reduceIsotopeFormulaDescriptions(tempmap); + //convertStringIntUnorderedMapToStringVector(tempmap, parameters.isotopeformulaidtodesc); + + *os << "ok" << endl; + *os << "Comparing theoretical peaks with the experimental peaklist(s)... " << endl; + *os << "Number of input files: " << parameters.peaklistseriesvector.size() << endl; + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + *os << "Number of experimental peaklists in the file no. " << h + 1 << " : " << parameters.peaklistseriesvector[h].size() << endl; + for (int i = 0; i < parameters.peaklistseriesvector[h].size(); i++) { + if (terminatecomputation) { + emitEndSignals(); + return; + } + parameters.peaklistseriesvector[h][i].sortbyMass(); + } + } + + *os << endl << "Time elapsed: " << getCurrentTime(time) << "." << endl << endl; + + bool lcms; + bool rtavailable; + bool skipcomparison; + + vector< vector< vector > > hintsindexvector; + hintsindexvector.resize(parameters.peaklistseriesvector.size()); + + vector< vector > unmatchedpeaksvector; + unmatchedpeaksvector.resize(parameters.peaklistseriesvector.size()); + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + + unmatchedpeaksvector[h].resize(parameters.peaklistseriesvector[h].size()); + + lcms = (parameters.peaklistseriesvector[h].size() > 1) && !((parameters.peaklistfileformats[h] == mis) || (parameters.peaklistfileformats[h] == imzML)); + rtavailable = (parameters.peaklistseriesvector[h].size() > 1) && (parameters.peaklistseriesvector[h][parameters.peaklistseriesvector[h].size() - 1].getRetentionTime() > 0); + + if (lcms || (parameters.peaklistfileformats[h] == mis) || (parameters.peaklistfileformats[h] == imzML)) { + *os << "Analyzing spectra in the file no. " << h + 1 << " : " << endl; + + hintsindexvector[h].resize(ts.getNumberOfPeaks()); + + for (int i = 0; i < parameters.peaklistseriesvector[h].size(); i++) { + if ((i + 1) % 100 == 0) { + *os << i + 1 << " "; + } + if ((i + 1) % 2500 == 0) { + *os << endl; + } + + if (terminatecomputation) { + emitEndSignals(); + return; + } + + skipcomparison = false; + if (lcms && rtavailable) { + if (parameters.minimumrt != 0) { + if (parameters.peaklistseriesvector[h][i].getRetentionTime() < parameters.minimumrt) { + skipcomparison = true; + } + } + if (parameters.maximumrt != 0) { + if (parameters.peaklistseriesvector[h][i].getRetentionTime() > parameters.maximumrt) { + skipcomparison = true; + } + } + } + + cTheoreticalSpectrum tstmp; + tstmp.setParameters(¶meters); + tstmp.getHintsIndex(i, h, ts, unmatchedpeaksvector[h][i], hintsindexvector[h], lcms && rtavailable, skipcomparison); + } + + for (auto& it : hintsindexvector[h]) { + sort(it.begin(), it.end()); + } + + *os << " ok" << endl; + } + + *os << endl << "Time elapsed: " << getCurrentTime(time) << "." << endl << endl; + + *os << "Processing the file no. " << h + 1 << " peaklist no. : " << endl; + + for (int i = 0; i < parameters.peaklistseriesvector[h].size(); i++) { + if ((i + 1) % 100 == 0) { + *os << i + 1 << " "; + } + if ((i + 1) % 2500 == 0) { + *os << endl; + } + + if (terminatecomputation) { + emitEndSignals(); + return; + } + + cTheoreticalSpectrum tstmp; + tstmp.setParameters(¶meters); + + skipcomparison = false; + if (lcms && rtavailable) { + if (parameters.minimumrt != 0) { + if (parameters.peaklistseriesvector[h][i].getRetentionTime() < parameters.minimumrt) { + skipcomparison = true; + } + } + if (parameters.maximumrt != 0) { + if (parameters.peaklistseriesvector[h][i].getRetentionTime() > parameters.maximumrt) { + skipcomparison = true; + } + } + } + + tstmp.compareMSSpectrum(i, h, ts, unmatchedpeaksvector[h][i], hintsindexvector[h], lcms && rtavailable, skipcomparison); + if ((parameters.peaklistfileformats[h] == mis) || (parameters.peaklistfileformats[h] == imzML)) { + if (!testspectrum) { + parameters.peaklistseriesvector[h][i].clear(); + } + } + + listoftheoreticalspectra->add(h, tstmp); + } + + if (testspectrum && testunmatchedpeaksvector && testlistoftheoreticalspectra) { + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + testlistoftheoreticalspectra->add(h, listoftheoreticalspectra->get(h, i)); + } + (*testunmatchedpeaksvector)[h] = unmatchedpeaksvector[h]; + } + + if (!((parameters.peaklistfileformats[h] == mis) || (parameters.peaklistfileformats[h] == imzML))) { + for (int i = 0; i < parameters.peaklistseriesvector[h].size(); i++) { + if (terminatecomputation) { + emitEndSignals(); + return; + } + + if (!testspectrum) { + parameters.peaklistseriesvector[h][i].clear(); + } + } + } + + *os << " ok" << endl << "Total number of spectra in the file no. " << h + 1 << " : " << parameters.peaklistseriesvector[h].size() << endl; + + if (parameters.calculatefdrs && parameters.generateisotopepattern) { + + *os << endl << "Calculating FDRs... "; + + vector targetscoresvector; + vector decoyscoresvector; + vector allscoresvector; + vector fdrs; + map *targetscores; + map *decoyscores; + map numbersofmatchedenvelopes; + double minfdr; + int targetscoresvectorsize; + + // calculate numbers of matched envelopes in single-pixel spectra + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + targetscores = &(listoftheoreticalspectra->get(h, i).getTargetScores()); + decoyscores = &(listoftheoreticalspectra->get(h, i).getDecoyScores()); + + for (auto& it : *targetscores) { + if (numbersofmatchedenvelopes.count(it.first) == 0) { + numbersofmatchedenvelopes.insert(make_pair(it.first, 1)); + } + else { + numbersofmatchedenvelopes[it.first]++; + } + } + + for (auto& it : *decoyscores) { + if (numbersofmatchedenvelopes.count(it.first) == 0) { + numbersofmatchedenvelopes.insert(make_pair(it.first, 1)); + } + else { + numbersofmatchedenvelopes[it.first]++; + } + } + } + + // divide scores by numbers of matched envelopes in all single-pixel spectra + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + targetscores = &(listoftheoreticalspectra->get(h, i).getTargetScores()); + decoyscores = &(listoftheoreticalspectra->get(h, i).getDecoyScores()); + + for (auto& it : *targetscores) { + //it.second /= sqrt((double)numbersofmatchedenvelopes[it.first]); + targetscoresvector.push_back(it.second); + } + + for (auto& it : *decoyscores) { + //it.second /= sqrt((double)numbersofmatchedenvelopes[it.first]); + decoyscoresvector.push_back(it.second); + } + } + + // calculate FDRs + sort(targetscoresvector.begin(), targetscoresvector.end()); + sort(decoyscoresvector.begin(), decoyscoresvector.end()); + + allscoresvector = targetscoresvector; + allscoresvector.insert(allscoresvector.end(), decoyscoresvector.begin(), decoyscoresvector.end()); + sort(allscoresvector.begin(), allscoresvector.end()); + + targetscoresvectorsize = (int)targetscoresvector.size(); + fdrs.resize(targetscoresvectorsize); + for (int i = 0; i < targetscoresvectorsize; i++) { + fdrs[i] = (double)getNumberOfScoreHits(decoyscoresvector, targetscoresvector[i]) / (double)max(getNumberOfScoreHits(allscoresvector, targetscoresvector[i]), 1); + } + + // calculate q-values + /*for (int i = targetscoresvectorsize - 1; i >= 0; i--) { + if ((i == targetscoresvectorsize - 1) || (fdrs[i] < minfdr)) { + minfdr = fdrs[i]; + } + if (fdrs[i] > minfdr) { + fdrs[i] = minfdr; + } + }*/ + + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + listoftheoreticalspectra->get(h, i).setFDRs(targetscoresvector, fdrs, unmatchedpeaksvector[h][i]); + } + + *os << "ok" << endl; + + } + + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + listoftheoreticalspectra->get(h, i).finalizeMSSpectrum(unmatchedpeaksvector[h][i], true); + } + + } + + if (testspectrum && testhintsindexvector && testlistoftheoreticalspectra && testunmatchedpeaksvector) { + *testspectrum = ts; + *testhintsindexvector = hintsindexvector; + + //for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + // for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + // testlistoftheoreticalspectra->add(h, listoftheoreticalspectra->get(h, i)); + // } + //} + + //*testunmatchedpeaksvector = unmatchedpeaksvector; + + *os << "===== test ended =====" << endl << endl; + } + +} + + +void cMainThread::multiThreadMS1(cMainThread* os, QTime& time, cTheoreticalSpectrum* testspectrum, vector< vector< vector > >* testhintsindexvector, cTheoreticalSpectrumList* testlistoftheoreticalspectra, vector< vector >* testunmatchedpeaksvector) { + if (testspectrum) { + *os << "===== running test - multiThreadMS1 =====" << endl; + } + + *os << "Time elapsed: " << getCurrentTime(time) << "." << endl << endl; + + *os << "Generating theoretical peaks... "; + + listoftheoreticalspectra->clear(); + listoftheoreticalspectra->resize((int)parameters.peaklistseriesvector.size()); + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + listoftheoreticalspectra->clear(h); + } + + if (testspectrum && testunmatchedpeaksvector && testlistoftheoreticalspectra) { + testlistoftheoreticalspectra->clear(); + testlistoftheoreticalspectra->resize((int)parameters.peaklistseriesvector.size()); + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + testlistoftheoreticalspectra->clear(h); + } + + testunmatchedpeaksvector->resize((int)parameters.peaklistseriesvector.size()); + } + + if (parameters.generateisotopepattern && parameters.calculatefdrs) { + parameters.sequencedatabase.attachDecoys(terminatecomputation); + } + + vector spectrumpool; + + QThreadPool::globalInstance()->setMaxThreadCount(parameters.maximumnumberofthreads); + + int sequencestart = 0; + int sequencestop = max(100, parameters.sequencedatabase.size() / (2 * parameters.maximumnumberofthreads)); + + int poolreserve = parameters.sequencedatabase.size() / sequencestop; + if (parameters.sequencedatabase.size() % sequencestop > 0) { + poolreserve++; + } + + spectrumpool.reserve(poolreserve); + + initParallelOutputState(poolreserve); + + while (sequencestart < parameters.sequencedatabase.size()) { + if (terminatecomputation) { + break; + } + + cSpectrumGeneratorThreadMS1* generatorthread = new cSpectrumGeneratorThreadMS1(); + cTheoreticalSpectrum* poolitem = new cTheoreticalSpectrum(); + + generatorthread->initialize(this, ¶meters, sequencestart, min(sequencestart + sequencestop, (int)parameters.sequencedatabase.size()), poolitem, &terminatecomputation); + spectrumpool.push_back(poolitem); + + QThreadPool::globalInstance()->start(generatorthread); + + sequencestart += sequencestop; + } + + QThreadPool::globalInstance()->waitForDone(); + + if (terminatecomputation) { + for (auto& it : spectrumpool) { + delete it; + } + emitEndSignals(); + return; + } + + unordered_map tempmap; + parameters.peakidtodesc.clear(); + parameters.isotopeformulaidtodesc.clear(); + + tempmap.clear(); + + size_t spectrumpoolsize = spectrumpool.size(); + int numberoftheoreticalpeaks = 0; + int lastgroupid = 0; + int thpeaksize; + + for (size_t i = 0; i < spectrumpoolsize; i++) { + thpeaksize = spectrumpool[i]->getTheoreticalPeaks()->size(); + + spectrumpool[i]->getTheoreticalPeaks()->reducePeakDescriptions(tempmap); + numberoftheoreticalpeaks += thpeaksize; + + for (int j = 0; j < thpeaksize; j++) { + (*spectrumpool[i]->getTheoreticalPeaks())[j].groupid += lastgroupid; + } + + if (thpeaksize > 0) { + lastgroupid = (*spectrumpool[i]->getTheoreticalPeaks())[thpeaksize - 1].groupid + 1; + } + } + convertStringIntUnorderedMapToStringVector(tempmap, parameters.peakidtodesc); + + //tempmap.clear(); + + //for (size_t i = 0; i < spectrumpoolsize; i++) { + // spectrumpool[i]->getTheoreticalPeaks()->reduceIsotopeFormulaDescriptions(tempmap); + //} + //convertStringIntUnorderedMapToStringVector(tempmap, parameters.isotopeformulaidtodesc); + + *os << "ok" << endl; + *os << "Comparing theoretical peaks with the experimental peaklist(s)... " << endl; + *os << "Number of input files: " << parameters.peaklistseriesvector.size() << endl; + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + *os << "Number of experimental peaklists in the file no. " << h + 1 << " : " << parameters.peaklistseriesvector[h].size() << endl; + for (int i = 0; i < parameters.peaklistseriesvector[h].size(); i++) { + if (terminatecomputation) { + for (auto& it : spectrumpool) { + delete it; + } + emitEndSignals(); + return; + } + + parameters.peaklistseriesvector[h][i].sortbyMass(); + } + } + + *os << endl << "Time elapsed: " << getCurrentTime(time) << "." << endl << endl; + + bool lcms; + + vector< vector< vector< vector > > > hintsindexpoolvector; + hintsindexpoolvector.resize(parameters.peaklistseriesvector.size()); + + vector< vector< vector > > hintsindexvector; + hintsindexvector.resize(parameters.peaklistseriesvector.size()); + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + + hintsindexpoolvector[h].resize(spectrumpoolsize); + + lcms = (parameters.peaklistseriesvector[h].size() > 1) && !((parameters.peaklistfileformats[h] == mis) || (parameters.peaklistfileformats[h] == imzML)); + + if (lcms || (parameters.peaklistfileformats[h] == mis) || (parameters.peaklistfileformats[h] == imzML)) { + *os << "Analyzing spectra in the file no. " << h + 1 << " ... "; + + if (testspectrum && testhintsindexvector) { + hintsindexvector[h].resize(numberoftheoreticalpeaks); + } + + initParallelOutputState((int)spectrumpoolsize); + + for (size_t i = 0; i < spectrumpoolsize; i++) { + if (terminatecomputation) { + break; + } + + cSpectrumAnalyzerThreadMS1* analyzerthread = new cSpectrumAnalyzerThreadMS1(); + analyzerthread->initialize(this, ¶meters, h, spectrumpool[i], &hintsindexpoolvector[h][i], &terminatecomputation); + + QThreadPool::globalInstance()->start(analyzerthread); + } + + QThreadPool::globalInstance()->waitForDone(); + + if (testspectrum && testhintsindexvector) { + serializeHintsIndexPool(hintsindexpoolvector[h], hintsindexvector[h]); + } + + *os << "ok" << endl; + } + + } + + *os << endl << "Time elapsed: " << getCurrentTime(time) << "." << endl << endl; + + if (terminatecomputation) { + for (auto& it : spectrumpool) { + delete it; + } + emitEndSignals(); + return; + } + + *os << "Processing the peaklist(s)... "; + + vector< vector > unmatchedpeaksvector; + unmatchedpeaksvector.resize(parameters.peaklistseriesvector.size()); + + vector theoreticalspectrumlistpool; + vector< vector > unmatchedpeakspool; + + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + unmatchedpeaksvector[h].resize(parameters.peaklistseriesvector[h].size()); + + theoreticalspectrumlistpool.resize(spectrumpoolsize); + unmatchedpeakspool.resize(spectrumpoolsize); + + initParallelOutputState((int)spectrumpoolsize); + + for (size_t i = 0; i < spectrumpoolsize; i++) { + if (terminatecomputation) { + break; + } + + theoreticalspectrumlistpool[i] = new cTheoreticalSpectrumList(); + + theoreticalspectrumlistpool[i]->clear(); + theoreticalspectrumlistpool[i]->resize((int)parameters.peaklistseriesvector.size()); + + for (int j = 0; j < (int)parameters.peaklistseriesvector.size(); j++) { + theoreticalspectrumlistpool[i]->clear(j); + } + + cSpectrumComparatorThreadMS1* comparatorthread = new cSpectrumComparatorThreadMS1(); + comparatorthread->initialize(this, ¶meters, h, spectrumpool[i], &hintsindexpoolvector[h][i], theoreticalspectrumlistpool[i], &unmatchedpeakspool[i], &terminatecomputation); + + QThreadPool::globalInstance()->start(comparatorthread); + } + + QThreadPool::globalInstance()->waitForDone(); + + serializeTheoreticalSpectrumListPool(h, theoreticalspectrumlistpool, *listoftheoreticalspectra); + + for (auto& it : theoreticalspectrumlistpool) { + delete it; + } + + serializeUnmatchedPeaksPool(h, unmatchedpeakspool, unmatchedpeaksvector); + + unmatchedpeakspool.clear(); + + if (testspectrum && testunmatchedpeaksvector && testlistoftheoreticalspectra) { + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + testlistoftheoreticalspectra->add(h, listoftheoreticalspectra->get(h, i)); + } + (*testunmatchedpeaksvector)[h] = unmatchedpeaksvector[h]; + } + + for (int i = 0; i < parameters.peaklistseriesvector[h].size(); i++) { + if (terminatecomputation) { + for (auto& it : spectrumpool) { + delete it; + } + emitEndSignals(); + return; + } + + if (!testspectrum) { + parameters.peaklistseriesvector[h][i].clear(); + } + } + + *os << " ok" << endl << "Total number of spectra in the file no. " << h + 1 << " : " << parameters.peaklistseriesvector[h].size() << endl; + + if (parameters.calculatefdrs && parameters.generateisotopepattern) { + + *os << endl << "Calculating FDRs... "; + + vector targetscoresvector; + vector decoyscoresvector; + vector allscoresvector; + vector fdrs; + map *targetscores; + map *decoyscores; + map numbersofmatchedenvelopes; + double minfdr; + int targetscoresvectorsize; + + // calculate numbers of matched envelopes in single-pixel spectra + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + targetscores = &(listoftheoreticalspectra->get(h, i).getTargetScores()); + decoyscores = &(listoftheoreticalspectra->get(h, i).getDecoyScores()); + + for (auto& it : *targetscores) { + if (numbersofmatchedenvelopes.count(it.first) == 0) { + numbersofmatchedenvelopes.insert(make_pair(it.first, 1)); + } + else { + numbersofmatchedenvelopes[it.first]++; + } + } + + for (auto& it : *decoyscores) { + if (numbersofmatchedenvelopes.count(it.first) == 0) { + numbersofmatchedenvelopes.insert(make_pair(it.first, 1)); + } + else { + numbersofmatchedenvelopes[it.first]++; + } + } + } + + // divide scores by numbers of matched envelopes in all single-pixel spectra + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + targetscores = &(listoftheoreticalspectra->get(h, i).getTargetScores()); + decoyscores = &(listoftheoreticalspectra->get(h, i).getDecoyScores()); + + for (auto& it : *targetscores) { + //it.second /= sqrt((double)numbersofmatchedenvelopes[it.first]); + targetscoresvector.push_back(it.second); + } + + for (auto& it : *decoyscores) { + //it.second /= sqrt((double)numbersofmatchedenvelopes[it.first]); + decoyscoresvector.push_back(it.second); + } + } + + // calculate FDRs + sort(targetscoresvector.begin(), targetscoresvector.end()); + sort(decoyscoresvector.begin(), decoyscoresvector.end()); + + allscoresvector = targetscoresvector; + allscoresvector.insert(allscoresvector.end(), decoyscoresvector.begin(), decoyscoresvector.end()); + sort(allscoresvector.begin(), allscoresvector.end()); + + targetscoresvectorsize = (int)targetscoresvector.size(); + fdrs.resize(targetscoresvectorsize); + for (int i = 0; i < targetscoresvectorsize; i++) { + fdrs[i] = (double)getNumberOfScoreHits(decoyscoresvector, targetscoresvector[i]) / (double)max(getNumberOfScoreHits(allscoresvector, targetscoresvector[i]), 1); + } + + // calculate q-values + /*for (int i = targetscoresvectorsize - 1; i >= 0; i--) { + if ((i == targetscoresvectorsize - 1) || (fdrs[i] < minfdr)) { + minfdr = fdrs[i]; + } + if (fdrs[i] > minfdr) { + fdrs[i] = minfdr; + } + }*/ + + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + listoftheoreticalspectra->get(h, i).setFDRs(targetscoresvector, fdrs, unmatchedpeaksvector[h][i]); + } + + *os << "ok" << endl; + + } + + for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + listoftheoreticalspectra->get(h, i).finalizeMSSpectrum(unmatchedpeaksvector[h][i], true); + } + + } + + cTheoreticalSpectrum ts; + + if (testspectrum) { + ts.setParameters(¶meters); + serializeSpectrumPool(spectrumpool, ts); + } + + for (auto& it : spectrumpool) { + delete it; + } + + if (testspectrum && testhintsindexvector && testlistoftheoreticalspectra && testunmatchedpeaksvector) { + *testspectrum = ts; + *testhintsindexvector = hintsindexvector; + + //for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + // for (int i = 0; i < listoftheoreticalspectra->size(h); i++) { + // testlistoftheoreticalspectra->add(h, listoftheoreticalspectra->get(h, i)); + // } + //} + + //*testunmatchedpeaksvector = unmatchedpeaksvector; + + *os << "===== test ended =====" << endl << endl; + } +} + + +void cMainThread::initParallelOutputState(int size) { + paralleloutputstate = 0; + paralleloutputsize = size; +} + + +void cMainThread::serializeSpectrumPool(vector& spectrumpool, cTheoreticalSpectrum& ts) { + size_t poolsize = spectrumpool.size(); + for (size_t i = 0; i < poolsize; i++) { + ts.getTheoreticalPeaks()->attach(*spectrumpool[i]->getTheoreticalPeaks()); + } + + if (parameters.generateisotopepattern) { + int lastgroupid = 0; + int currentgroupid = 0; + + for (int i = 0; i < ts.getTheoreticalPeaks()->size(); i++) { + if (lastgroupid != (*ts.getTheoreticalPeaks())[i].groupid) { + currentgroupid++; + } + + lastgroupid = (*ts.getTheoreticalPeaks())[i].groupid; + (*ts.getTheoreticalPeaks())[i].groupid = currentgroupid; + } + } +} + + +void cMainThread::serializeHintsIndexPool(vector< vector< vector > >& hintsindexpool, vector< vector >& hintsindex) { + hintsindex.clear(); + size_t hintsindexpoolsize = hintsindexpool.size(); + for (size_t i = 0; i < hintsindexpoolsize; i++) { + hintsindex.reserve(hintsindex.size() + hintsindexpool[i].size()); + hintsindex.insert(hintsindex.end(), hintsindexpool[i].begin(), hintsindexpool[i].end()); + } +} + + +void cMainThread::serializeUnmatchedPeaksPool(int peaklistseriesvectorid, vector< vector >& unmatchedpeakspool, vector< vector >& unmatchedpeaks) { + size_t unmatchedpeakspoolsize = unmatchedpeakspool.size(); + for (size_t i = 0; i < unmatchedpeakspoolsize; i++) { + if (unmatchedpeaks[peaklistseriesvectorid].size() != unmatchedpeakspool[i].size()) { + unmatchedpeaks[peaklistseriesvectorid].clear(); + unmatchedpeaks[peaklistseriesvectorid].resize(parameters.peaklistseriesvector[peaklistseriesvectorid].size()); + return; + } + for (size_t j = 0; j < unmatchedpeakspool[i].size(); j++) { + unmatchedpeaks[peaklistseriesvectorid][j].attach(unmatchedpeakspool[i][j]); + } + } +} + + +void cMainThread::serializeTheoreticalSpectrumListPool(int peaklistseriesvectorid, vector& theoreticalspectrumlistpool, cTheoreticalSpectrumList& theoreticalspectrumlist) { + if (theoreticalspectrumlistpool.size() == 0) { + return; + } + + for (int i = 0; i < theoreticalspectrumlistpool[0]->size(peaklistseriesvectorid); i++) { + theoreticalspectrumlist.add(peaklistseriesvectorid, theoreticalspectrumlistpool[0]->get(peaklistseriesvectorid, i)); + } + + for (int i = 1; i < theoreticalspectrumlistpool.size(); i++) { + for (int j = 0; j < theoreticalspectrumlistpool[i]->size(peaklistseriesvectorid); j++) { + theoreticalspectrumlist.get(peaklistseriesvectorid, j).attach(theoreticalspectrumlistpool[i]->get(peaklistseriesvectorid, j)); + } + } +} + + +void cMainThread::printMatrix(cPeaksList& peaklist) { + unsigned roundedmz; + map blocksmap; + multimap blocksmultimap; + + double precisionvalue = 1000.0; + int size = (int)peaklist.size(); + + string htmlfilename = parameters.peaklistfilenames[0]; + if (htmlfilename.rfind('/') != string::npos) { + htmlfilename = htmlfilename.substr(0, htmlfilename.rfind('/')) + "_matrix.html"; + } + + ofstream html(htmlfilename); + html << "

"; + + html << ""; + for (int i = 0; i < size; i++) { + html << ""; + } + html << ""; + + for (int i = 0; i < size; i++) { + html << ""; + + html << ""; + + for (int j = 0; j < size; j++) { + html << ""; + } + html << ""; + } + + html << "
" << peaklist[i].mzratio << "
" << peaklist[i].mzratio << ""; + + if (i > j) { + roundedmz = round(fabs(peaklist[i].mzratio - peaklist[j].mzratio) * precisionvalue); + html << (double)roundedmz / precisionvalue; + + if (blocksmap.count(roundedmz) == 0) { + blocksmap[roundedmz] = 1; + } + else { + blocksmap[roundedmz]++; + } + } + + html << "

"; + + html << "

"; + + for (auto& it : blocksmap) { + blocksmultimap.insert(make_pair(it.second, it.first)); + } + + html << ""; + + cBricksDatabase blockdb; + ifstream blocksstream(parameters.bricksdatabasefilename); + string error; + blockdb.loadFromPlainTextStream(blocksstream, error, true, true); + + for (auto it = blocksmultimap.rbegin(); it != blocksmultimap.rend(); ++it) { + html << ""; + html << ""; + html << ""; + html << ""; + html << ""; + } + + html << "
countm/z differenceblock
" << it->first << "" << (double)it->second / precisionvalue << ""; + + for (int j = 0; j < blockdb.size(); j++) { + if (round(blockdb[j].getMass() * precisionvalue) == it->second) { + html << blockdb[j].getAcronymsAsString() << ", " << blockdb[j].getSummary() << "; "; + } + } + + html << "

"; + + html << ""; +} + + +void cMainThread::printIonEstimations(cPeaksList& peaklist) { + vector testedions; + //testedions.push_back("deamidated b-ion"); + testedions.push_back("dehydrated b-ion"); + testedions.push_back("a-ion"); + //testedions.push_back("deamidated a-ion"); + //testedions.push_back("dehydrated a-ion"); + + vector massshifts; + //massshifts.push_back(17.026549); + massshifts.push_back(18.01057); + massshifts.push_back(27.99492); + //massshifts.push_back(45.021464); + //massshifts.push_back(46.005479); + + double adduct = 0; + adduct = 21.981946; + + string htmlfilename = parameters.peaklistfilenames[0]; + if (htmlfilename.rfind('/') != string::npos) { + htmlfilename = htmlfilename.substr(0, htmlfilename.rfind('/')) + "_estimations.html"; + } + + ofstream html(htmlfilename); + html << "

"; + + html << ""; + for (int i = 0; i < (int)testedions.size(); i++) { + html << ""; + } + html << ""; + + for (int i = 0; i < peaklist.size(); i++) { + html << ""; + for (int j = 0; j < (int)massshifts.size(); j++) { + html << ""; + } + html << ""; + } + + html << "
" << testedions[i] << " (-" << massshifts[i] << ")
"; + html << peaklist[i].mzratio - adduct; + html << " "; + if (searchHint(peaklist[i].mzratio - massshifts[j], peaklist, parameters.fragmentmasserrortolerance)) { + html << peaklist[i].mzratio - massshifts[j] - adduct; + } + html << "

"; + + html << ""; +} + + +cMainThread::cMainThread(cParameters& parameters, cTheoreticalSpectrumList& listoftheoreticalspectra, bool enablelogwindow, bool enablestdout) { this->parameters = parameters; - this->theoreticalspectrumlist = &theoreticalspectrumlist; + this->listoftheoreticalspectra = &listoftheoreticalspectra; this->enablelogwindow = enablelogwindow; this->enablestdout = enablestdout; @@ -69,6 +976,19 @@ cMainThread& cMainThread::operator<<(StandardEndLine manip) { } +void cMainThread::addToParallelOutputState(int value) { + QMutexLocker ml(&mutex); + paralleloutputstate += value; + + if (paralleloutputsize > 0) { + *this << endl << int((double)paralleloutputstate / (double)paralleloutputsize * 100.0) << "%"; + if (paralleloutputsize == paralleloutputstate) { + *this << endl; + } + } +} + + void cMainThread::run() { if (parameters.mode != denovoengine) { @@ -77,18 +997,19 @@ void cMainThread::run() { cMainThread* os = this; string errormessage; + + int startscanno; + int endscanno; cCandidateSet candidates; candidates.getSet().clear(); - theoreticalspectrumlist->clear(); + listoftheoreticalspectra->clear(); isotopepatterncache.lock(); isotopepatterncache.clear(); isotopepatterncache.unlock(); - int hrs, mins, secs; - QTime time; time.start(); @@ -134,59 +1055,78 @@ void cMainThread::run() { } } - if (parameters.peaklistseries.size() == 0) { - *os << "Error: no peaklist found. The format of peaklist is likely incorrect." << endl; + if (parameters.peaklistseriesvector.size() == 0) { + *os << "Error: no peaklist found. The format of a peaklist is likely incorrect." << endl; emitEndSignals(); return; } - if (((parameters.mode == denovoengine) || (parameters.mode == databasesearch)) && (parameters.scannumber > parameters.peaklistseries.size())) { - *os << "Number of spectra in the file: " << parameters.peaklistseries.size() << endl; + if ((parameters.mode == denovoengine) || (parameters.mode == singlecomparison) || (parameters.mode == databasesearch)) { + if (parameters.peaklistseriesvector.size() > 1) { + *os << "Error: multiple files cannot be processed in MS/MS mode." << endl; + emitEndSignals(); + return; + } + } + + for (auto& it : parameters.peaklistseriesvector) { + if (it.size() == 0) { + *os << "Error: no peaklist found. The format of a peaklist is likely incorrect." << endl; + emitEndSignals(); + return; + } + } + + if (((parameters.mode == denovoengine) || (parameters.mode == databasesearch)) && (parameters.scannumber > parameters.peaklistseriesvector[0].size())) { + *os << "Number of spectra in the file: " << parameters.peaklistseriesvector[0].size() << endl; *os << "Error: no peaklist found (scan no. " << parameters.scannumber << ")." << endl; emitEndSignals(); return; } - int startscanno = ((parameters.mode == dereplication) || (parameters.mode == compoundsearch) || (parameters.mode == singlecomparison)) ? 0 : parameters.scannumber - 1; - int endscanno = ((parameters.mode == dereplication) || (parameters.mode == compoundsearch) || (parameters.mode == singlecomparison)) ? parameters.peaklistseries.size() : parameters.scannumber; - for (int i = startscanno; i < endscanno; i++) { - parameters.peaklistseries[i].sortbyMass(); + for (int h = 0; h < (int)parameters.peaklistseriesvector.size(); h++) { + startscanno = ((parameters.mode == dereplication) || (parameters.mode == compoundsearch) || (parameters.mode == singlecomparison)) ? 0 : parameters.scannumber - 1; + endscanno = ((parameters.mode == dereplication) || (parameters.mode == compoundsearch) || (parameters.mode == singlecomparison)) ? parameters.peaklistseriesvector[h].size() : parameters.scannumber; - if (parameters.peaklistseries[i].normalizeIntenzity() == -1) { - if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch) || (parameters.mode == singlecomparison)) { - *os << "Warning: the spectrum no. " << i + 1 << " is empty or the format of peaklist is incorrect." << endl; - } - else { - *os << "Number of spectra in the file: " << parameters.peaklistseries.size() << endl; - *os << "Error: the spectrum no. " << i + 1 << " is empty or the format of peaklist is incorrect." << endl; - emitEndSignals(); - return; + for (int i = startscanno; i < endscanno; i++) { + parameters.peaklistseriesvector[h][i].sortbyMass(); + + if (parameters.peaklistseriesvector[h][i].normalizeIntenzity() == -1) { + if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch) || (parameters.mode == singlecomparison)) { + *os << "Warning: the spectrum no. " << i + 1 << " in the file no. " << h + 1 << " is empty or the format of peaklist is incorrect." << endl; + } + else { + *os << "Number of spectra in the file: " << parameters.peaklistseriesvector[h].size() << endl; + *os << "Error: the spectrum no. " << i + 1 << " in the file no. " << h + 1 << " is empty or the format of peaklist is incorrect." << endl; + emitEndSignals(); + return; + } } - } - parameters.peaklistseries[i].cropMinimumMZRatio(parameters.minimummz, parameters.fragmentmasserrortolerance); + parameters.peaklistseriesvector[h][i].cropMinimumMZRatio(parameters.minimummz, parameters.fragmentmasserrortolerance); - if ((parameters.mode == denovoengine) || (parameters.mode == singlecomparison) || (parameters.mode == databasesearch)) { - parameters.peaklistseries[i].cropMaximumMZRatio(charge(uncharge(parameters.precursormass, parameters.precursorcharge), (parameters.precursorcharge > 0)?1:-1), parameters.precursormasserrortolerance); - } + if ((parameters.mode == denovoengine) || (parameters.mode == singlecomparison) || (parameters.mode == databasesearch)) { + parameters.peaklistseriesvector[h][i].cropMaximumMZRatio(charge(uncharge(parameters.precursormass, parameters.precursorcharge), (parameters.precursorcharge > 0) ? 1 : -1), parameters.precursormasserrortolerance); + } - if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { - if (parameters.maximummz > 0) { - parameters.peaklistseries[i].cropMaximumMZRatio(parameters.maximummz, parameters.fragmentmasserrortolerance); + if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { + if (parameters.maximummz > 0) { + parameters.peaklistseriesvector[h][i].cropMaximumMZRatio(parameters.maximummz, parameters.fragmentmasserrortolerance); + } } - } - parameters.peaklistseries[i].cropAbsoluteIntenzity(parameters.minimumabsoluteintensitythreshold); - parameters.peaklistseries[i].cropRelativeIntenzity(parameters.minimumrelativeintensitythreshold); + parameters.peaklistseriesvector[h][i].cropAbsoluteIntenzity(parameters.minimumabsoluteintensitythreshold); + parameters.peaklistseriesvector[h][i].cropRelativeIntenzity(parameters.minimumrelativeintensitythreshold); - if ((parameters.mode == denovoengine) || (parameters.mode == databasesearch) || ((parameters.mode == singlecomparison) && (parameters.peaklistseries.size() == 1))) { - *os << "Number of spectra in the file: " << parameters.peaklistseries.size() << endl; - *os << "Processing spectrum no.: " << i + 1; - if (parameters.peaklistseries[i].getTitle().size() > 0) { - *os << " (" << parameters.peaklistseries[i].getTitle() << "):"; + if ((parameters.mode == denovoengine) || (parameters.mode == databasesearch) || ((parameters.mode == singlecomparison) && (parameters.peaklistseriesvector[h].size() == 1))) { + *os << "Number of spectra in the file: " << parameters.peaklistseriesvector[h].size() << endl; + *os << "Processing spectrum no.: " << i + 1; + if (parameters.peaklistseriesvector[h][i].getTitle().size() > 0) { + *os << " (" << parameters.peaklistseriesvector[h][i].getTitle() << "):"; + } + *os << endl; + *os << parameters.peaklistseriesvector[h][i].print(); } - *os << endl; - *os << parameters.peaklistseries[i].print(); } } @@ -203,20 +1143,16 @@ void cMainThread::run() { if (parameters.sequencedatabase.size() > compoundslimit) { parameters.sequencedatabase.clear(); *os << "Error: The number of generated compounds exceeded the limit " + to_string(compoundslimit) + ". Please, adjust the settings to limit the number of compounds." << endl; - - secs = time.elapsed() / 1000; - mins = (secs / 60) % 60; - hrs = (secs / 3600); - secs = secs % 60; - - *os << "Execution time: " << to_string(hrs) << " hrs, " << to_string(mins) << " min, " << to_string(secs) << " sec." << endl << endl; - + *os << "Execution time: " << getCurrentTime(time) << "." << endl << endl; emitEndSignals(); return; } } if ((parameters.mode == denovoengine) || (parameters.mode == singlecomparison) || (parameters.mode == databasesearch)) { + //printMatrix(parameters.peaklistseries[parameters.scannumber - 1]); + //printIonEstimations(parameters.peaklistseries[parameters.scannumber - 1]); + int startmodifid, endmodifid, middlemodifid; cSequence sequence; @@ -482,233 +1418,169 @@ void cMainThread::run() { // database search - MS mode if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { - *os << "Generating theoretical peaks... "; - - theoreticalspectrumlist->initialize(*os, parameters, &graph); - - cTheoreticalSpectrum ts; - ts.setParameters(¶meters); + bool runtest = false; - if (parameters.generateisotopepattern) { - ts.generateFineMSSpectrum(terminatecomputation); + if (!runtest) { + if (parameters.maximumnumberofthreads > 1) { + multiThreadMS1(os, time); + } + else { + singleThreadMS1(os, time); + } } else { - ts.generateMSSpectrum(terminatecomputation, true); - } - - if (terminatecomputation) { - emitEndSignals(); - return; - } + cTheoreticalSpectrum* singletest = new cTheoreticalSpectrum(); + cTheoreticalSpectrum* multitest = new cTheoreticalSpectrum(); - unordered_map tempmap; - parameters.peakidtodesc.clear(); - parameters.isotopeformulaidtodesc.clear(); + vector > > singlehintsindex; + vector > > multihintsindex; - tempmap.clear(); - ts.getTheoreticalPeaks()->reducePeakDescriptions(tempmap); - convertStringIntUnorderedMapToStringVector(tempmap, parameters.peakidtodesc); + cTheoreticalSpectrumList* singlelistoftheoreticalspectra = new cTheoreticalSpectrumList(); + cTheoreticalSpectrumList* multilistoftheoreticalspectra = new cTheoreticalSpectrumList(); - //tempmap.clear(); - //ts.getTheoreticalPeaks()->reduceIsotopeFormulaDescriptions(tempmap); - //convertStringIntUnorderedMapToStringVector(tempmap, parameters.isotopeformulaidtodesc); + vector > singleunmatchedpeaks; + vector > multiunmatchedpeaks; - *os << "ok" << endl; - *os << "Comparing theoretical peaks with the experimental peaklist(s)... " << endl; - *os << "Number of experimental peaklists: " << parameters.peaklistseries.size() << endl; + cSequenceDatabase dbbackup = parameters.sequencedatabase; + singleThreadMS1(os, time, singletest, &singlehintsindex, singlelistoftheoreticalspectra, &singleunmatchedpeaks); - vector unmatchedpeaks; - unmatchedpeaks.resize(parameters.peaklistseries.size()); + parameters.sequencedatabase = dbbackup; + multiThreadMS1(os, time, multitest, &multihintsindex, multilistoftheoreticalspectra, &multiunmatchedpeaks); - for (int i = 0; i < parameters.peaklistseries.size(); i++) { - if (terminatecomputation) { - emitEndSignals(); - return; + if (singletest->getTheoreticalPeaks()->equals(*multitest->getTheoreticalPeaks())) { + *os << endl << "theoretical peaks test ok - singleThreadMS1 vs. multiThreadMS1" << endl; } - - parameters.peaklistseries[i].sortbyMass(); - } - - vector< vector > hintsindex; - hintsindex.resize(ts.getNumberOfPeaks()); - - bool lcms = (parameters.peaklistseries.size() > 1) && !((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)); - - if (lcms || (parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { - *os << "Analyzing spectra : " << endl; - - for (int i = 0; i < parameters.peaklistseries.size(); i++) { - if ((i + 1) % 100 == 0) { - *os << i + 1 << " "; - } - if ((i + 1) % 2500 == 0) { - *os << endl; - } - - if (terminatecomputation) { - emitEndSignals(); - return; - } - - cTheoreticalSpectrum tstmp; - tstmp.setParameters(¶meters); - tstmp.getHintsIndex(i, ts, unmatchedpeaks[i], hintsindex); - - for (auto& it : hintsindex) { - sort(it.begin(), it.end()); - } + else { + *os << endl << "theoretical peakstest failed - singleThreadMS1 vs. multiThreadMS1" << endl; } - *os << " ok" << endl; - } - - *os << "Processing the peaklist no. : " << endl; - - for (int i = 0; i < parameters.peaklistseries.size(); i++) { - if ((i + 1) % 100 == 0) { - *os << i + 1 << " "; - } - if ((i + 1) % 2500 == 0) { - *os << endl; + bool hintsindextest = true; + if (singlehintsindex.size() == multihintsindex.size()) { + for (int i = 0; i < singlehintsindex.size(); i++) { + if (singlehintsindex[i].size() == multihintsindex[i].size()) { + for (int j = 0; j < singlehintsindex[i].size(); j++) { + if (singlehintsindex[i][j].size() == multihintsindex[i][j].size()) { + for (int k = 0; k < singlehintsindex[i][j].size(); k++) { + if (singlehintsindex[i][j][k] != multihintsindex[i][j][k]) { + *os << "hintsindex " << i << " " << j << " " << k << " failed" << endl; + hintsindextest = false; + break; + } + } + if (!hintsindextest) { + break; + } + } + else { + *os << "singlehintsindex[i][j].size() == multihintsindex[i][j].size()" << " failed"; + hintsindextest = false; + break; + } + } + } + else { + *os << "singlehintsindex[i].size() == multihintsindex[i].size()" << " failed"; + hintsindextest = false; + break; + } + } } - - if (terminatecomputation) { - emitEndSignals(); - return; + else { + *os << "singlehintsindex.size() == multihintsindex.size()" << " failed"; + hintsindextest = false; } - cTheoreticalSpectrum tstmp; - tstmp.setParameters(¶meters); - tstmp.compareMSSpectrum(i, ts, unmatchedpeaks[i], hintsindex); - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { - parameters.peaklistseries[i].clear(); + if (hintsindextest) { + *os << endl << "hintsindex test ok - singleThreadMS1 vs. multiThreadMS1" << endl; } - theoreticalspectrumlist->add(tstmp); - } - - if (!((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML))) { - for (int i = 0; i < parameters.peaklistseries.size(); i++) { - if (terminatecomputation) { - emitEndSignals(); - return; - } - - parameters.peaklistseries[i].clear(); + else { + *os << endl << "hintsindex test failed - singleThreadMS1 vs. multiThreadMS1" << endl; } - } - - *os << " ok" << endl << "Total number of spectra: " << parameters.peaklistseries.size() << endl; - - if (parameters.generateisotopepattern) { - *os << endl << "Calculating FDRs... "; - - vector targetscoresvector; - vector decoyscoresvector; - vector allscoresvector; - vector fdrs; - map *targetscores; - map *decoyscores; - map numbersofmatchedenvelopes; - double minfdr; - int targetscoresvectorsize; + bool theoreticalspectrumlisttest = true; + if (singlelistoftheoreticalspectra->size() == multilistoftheoreticalspectra->size()) { + for (int i = 0; i < singlelistoftheoreticalspectra->size(); i++) { + if (singlelistoftheoreticalspectra->size(i) == multilistoftheoreticalspectra->size(i)) { + for (int j = 0; j < singlelistoftheoreticalspectra->size(i); j++) { + if (!singlelistoftheoreticalspectra->get(i, j).equals(multilistoftheoreticalspectra->get(i, j))) { + cout << "(theoreticalspectrumlist in " << i + 1 << " " << j + 1 << ")" << endl << endl; + theoreticalspectrumlisttest = false; - // calculate numbers of matched envelopes in single-pixel spectra - for (int i = 0; i < (int)theoreticalspectrumlist->size(); i++) { - targetscores = &((*theoreticalspectrumlist)[i].getTargetScores()); - decoyscores = &((*theoreticalspectrumlist)[i].getDecoyScores()); + cout << singlelistoftheoreticalspectra->get(i, j).getTheoreticalPeaks()->print(false, true); + cout << multilistoftheoreticalspectra->get(i, j).getTheoreticalPeaks()->print(false, true); - for (auto& it : *targetscores) { - if (numbersofmatchedenvelopes.count(it.first) == 0) { - numbersofmatchedenvelopes.insert(make_pair(it.first, 1)); + break; + } + } } else { - numbersofmatchedenvelopes[it.first]++; + theoreticalspectrumlisttest = false; + break; } } + } + else { + theoreticalspectrumlisttest = false; + } - for (auto& it : *decoyscores) { - if (numbersofmatchedenvelopes.count(it.first) == 0) { - numbersofmatchedenvelopes.insert(make_pair(it.first, 1)); + if (theoreticalspectrumlisttest) { + *os << endl << "theoreticalspectrumlisttest test ok - singleThreadMS1 vs. multiThreadMS1" << endl; + } + else { + *os << endl << "theoreticalspectrumlisttest test failed - singleThreadMS1 vs. multiThreadMS1" << endl; + } + + bool unmatchedpeakstest = true; + if (singleunmatchedpeaks.size() == multiunmatchedpeaks.size()) { + for (int i = 0; i < singleunmatchedpeaks.size(); i++) { + if (singleunmatchedpeaks[i].size() == multiunmatchedpeaks[i].size()) { + for (int j = 0; j < singleunmatchedpeaks[i].size(); j++) { + if (!singleunmatchedpeaks[i][j].equals(multiunmatchedpeaks[i][j])) { + cout << "(unmatchedpeaks in " << i + 1 << " " << j + 1 << ")" << endl << endl; + unmatchedpeakstest = false; + break; + } + } } else { - numbersofmatchedenvelopes[it.first]++; + unmatchedpeakstest = false; + break; } } } - - // divide scores by numbers of matched envelopes in all single-pixel spectra - for (int i = 0; i < (int)theoreticalspectrumlist->size(); i++) { - targetscores = &((*theoreticalspectrumlist)[i].getTargetScores()); - decoyscores = &((*theoreticalspectrumlist)[i].getDecoyScores()); - - for (auto& it : *targetscores) { - //it.second /= sqrt((double)numbersofmatchedenvelopes[it.first]); - targetscoresvector.push_back(it.second); - } - - for (auto& it : *decoyscores) { - //it.second /= sqrt((double)numbersofmatchedenvelopes[it.first]); - decoyscoresvector.push_back(it.second); - } + else { + unmatchedpeakstest = false; } - // calculate FDRs - sort(targetscoresvector.begin(), targetscoresvector.end()); - sort(decoyscoresvector.begin(), decoyscoresvector.end()); - - allscoresvector = targetscoresvector; - allscoresvector.insert(allscoresvector.end(), decoyscoresvector.begin(), decoyscoresvector.end()); - sort(allscoresvector.begin(), allscoresvector.end()); - - targetscoresvectorsize = (int)targetscoresvector.size(); - fdrs.resize(targetscoresvectorsize); - for (int i = 0; i < targetscoresvectorsize; i++) { - fdrs[i] = (double)getNumberOfScoreHits(decoyscoresvector, targetscoresvector[i]) / (double)max(getNumberOfScoreHits(allscoresvector, targetscoresvector[i]), 1); + if (unmatchedpeakstest) { + *os << endl << "unmatchedpeaks test ok - singleThreadMS1 vs. multiThreadMS1" << endl; } - - // calculate q-values - /*for (int i = targetscoresvectorsize - 1; i >= 0; i--) { - if ((i == targetscoresvectorsize - 1) || (fdrs[i] < minfdr)) { - minfdr = fdrs[i]; - } - if (fdrs[i] > minfdr) { - fdrs[i] = minfdr; - } - }*/ - - for (int i = 0; i < (int)theoreticalspectrumlist->size(); i++) { - (*theoreticalspectrumlist)[i].setFDRs(targetscoresvector, fdrs, unmatchedpeaks[i]); + else { + *os << endl << "unmatchedpeaks test failed - singleThreadMS1 vs. multiThreadMS1" << endl; } - *os << "ok" << endl; - - } + delete singletest; + delete multitest; - for (int i = 0; i < (int)theoreticalspectrumlist->size(); i++) { - (*theoreticalspectrumlist)[i].finalizeMSSpectrum(unmatchedpeaks[i], true); + delete singlelistoftheoreticalspectra; + delete multilistoftheoreticalspectra; } - } if ((parameters.mode == denovoengine) || (parameters.mode == singlecomparison) || (parameters.mode == databasesearch)) { *os << "Comparing theoretical spectra of candidates with the peak list... " << endl; - theoreticalspectrumlist->initialize(*os, parameters, &graph); - if (theoreticalspectrumlist->parallelCompareAndStore(candidates, terminatecomputation) == -1) { + listoftheoreticalspectra->initialize(*os, parameters, &graph); + listoftheoreticalspectra->resize(1); + if (listoftheoreticalspectra->parallelCompareAndStore(0, candidates, terminatecomputation) == -1) { emitEndSignals(); return; } *os << " ok" << endl; } - secs = time.elapsed() / 1000; - mins = (secs / 60) % 60; - hrs = (secs / 3600); - secs = secs % 60; - *os << endl << appname.toStdString() << " successfully finished at " << time.currentTime().toString().toStdString(); - *os << " (time elapsed: " << to_string(hrs) << " hrs, " << to_string(mins) << " min, " << to_string(secs) << " sec)." << endl; + *os << " (time elapsed: " << getCurrentTime(time) << ")." << endl; *os << "====================================================================================================" << endl; diff --git a/CycloBranch/gui/cMainThread.h b/CycloBranch/gui/cMainThread.h index ba2e26d..a282aa1 100644 --- a/CycloBranch/gui/cMainThread.h +++ b/CycloBranch/gui/cMainThread.h @@ -11,6 +11,7 @@ #include #include #include +#include #include "core/utilities.h" #include "core/cParameters.h" @@ -42,9 +43,34 @@ class cMainThread : public QThread { bool graphreaderisworking; cDeNovoGraph graph; - cTheoreticalSpectrumList* theoreticalspectrumlist; + cTheoreticalSpectrumList* listoftheoreticalspectra; cParameters parameters; + QMutex mutex; + + int paralleloutputstate; + int paralleloutputsize; + + string getCurrentTime(QTime& time); + + void singleThreadMS1(cMainThread* os, QTime& time, cTheoreticalSpectrum* testspectrum = 0, vector< vector< vector > >* testhintsindexvector = 0, cTheoreticalSpectrumList* testlistoftheoreticalspectra = 0, vector< vector >* testunmatchedpeaksvector = 0); + + void multiThreadMS1(cMainThread* os, QTime& time, cTheoreticalSpectrum* testspectrum = 0, vector< vector< vector > >* testhintsindexvector = 0, cTheoreticalSpectrumList* testlistoftheoreticalspectra = 0, vector< vector >* testunmatchedpeaksvector = 0); + + void initParallelOutputState(int size); + + void serializeSpectrumPool(vector& spectrumpool, cTheoreticalSpectrum& ts); + + void serializeHintsIndexPool(vector< vector< vector > >& hintsindexpool, vector< vector >& hintsindex); + + void serializeUnmatchedPeaksPool(int peaklistseriesvectorid, vector< vector >& unmatchedpeakspool, vector< vector >& unmatchedpeaks); + + void serializeTheoreticalSpectrumListPool(int peaklistseriesvectorid, vector& theoreticalspectrumlistpool, cTheoreticalSpectrumList& theoreticalspectrumlist); + + void printMatrix(cPeaksList& peaklist); + + void printIonEstimations(cPeaksList& peaklist); + public: @@ -52,11 +78,11 @@ class cMainThread : public QThread { /** \brief The constructor. \param parameters reference to input paramaters - \param theoreticalspectrumlist a list of theoretical spectra + \param listoftheoreticalspectra lists of theoretical spectra \param enablelogwindow if true then messages are logged into the log window \param enablestdout if true then messages are logged into the standard output */ - cMainThread(cParameters& parameters, cTheoreticalSpectrumList& theoreticalspectrumlist, bool enablelogwindow = true, bool enablestdout = true); + cMainThread(cParameters& parameters, cTheoreticalSpectrumList& listoftheoreticalspectra, bool enablelogwindow = true, bool enablestdout = true); /** @@ -119,6 +145,13 @@ class cMainThread : public QThread { cMainThread& operator<<(StandardEndLine manip); + /** + \brief Add a value to the output state (for internal threads). + \param value value + */ + void addToParallelOutputState(int value); + + protected: diff --git a/CycloBranch/gui/cMainWindow.cpp b/CycloBranch/gui/cMainWindow.cpp index 6c55604..1cb1814 100644 --- a/CycloBranch/gui/cMainWindow.cpp +++ b/CycloBranch/gui/cMainWindow.cpp @@ -29,6 +29,7 @@ cMainWindow::cMainWindow() { menuFile = new QMenu(tr("&File"), this); menuSearch = new QMenu(tr("&Search"), this); menuTools = new QMenu(tr("&Tools"), this); + menuBookmarks = new QMenu(tr("&Bookmarks"), this); menuView = new QMenu(tr("&View"), this); menuHelp = new QMenu(tr("&Help"), this); @@ -73,22 +74,55 @@ cMainWindow::cMainWindow() { actionDrawPeptide->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); actionSummaryTableOfMatchedPeaks = new QAction(QIcon(":/images/icons/table.png"), tr("S&ummary Table of Matched Peaks"), this); - actionSummaryTableOfMatchedPeaks->setShortcut(QKeySequence(Qt::Key_F9)); + actionSummaryTableOfMatchedPeaks->setShortcut(QKeySequence(Qt::Key_F8)); + + actionMultipleDatasets = new QAction(QIcon(":/images/icons/features.png"), tr("&Annotated Features Overview"), this); + actionMultipleDatasets->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F8)); actionChromatogramWindow = new QAction(QIcon(":/images/icons/chromatography.png"), tr("C&hromatogram"), this); - actionChromatogramWindow->setShortcut(QKeySequence(Qt::Key_F10)); + actionChromatogramWindow->setShortcut(QKeySequence(Qt::Key_F9)); actionChromatogramWindow->setDisabled(true); - actionImageWindow = new QAction(QIcon(":/images/icons/image.png"), tr("&CrossVis"), this); - actionImageWindow->setShortcut(QKeySequence(Qt::Key_F11)); + actionImageWindow = new QAction(QIcon(":/images/icons/image_edit.png"), tr("Image &Fusion"), this); + actionImageWindow->setShortcut(QKeySequence(Qt::Key_F10)); actionImageWindow->setDisabled(true); - actionBookMark1 = new QAction(QIcon(":/images/icons/25.png"), tr("&Norine"), this); + actionPatternSimulatorWindow = new QAction(QIcon(":/images/icons/pattern.png"), tr("&Simulate Isotopic Pattern"), this); + actionPatternSimulatorWindow->setShortcut(QKeySequence(Qt::Key_F11)); + + actionFormulaPredictor = new QAction(QIcon(":/images/icons/formula.png"), tr("Calculate Molecula&r Formula"), this); + actionFormulaPredictor->setShortcut(QKeySequence(Qt::Key_F12)); + + actionBookMark1 = new QAction("", this); actionBookMark1->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1)); - actionBookMark2 = new QAction(QIcon(":/images/icons/5.png"), tr("Gene&rate Blocks and Sequences using BBDGNC"), this); + actionBookMark2 = new QAction("", this); actionBookMark2->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2)); + actionBookMark3 = new QAction("", this); + actionBookMark3->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_3)); + + actionBookMark4 = new QAction("", this); + actionBookMark4->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_4)); + + actionBookMark5 = new QAction("", this); + actionBookMark5->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_5)); + + actionBookMark6 = new QAction("", this); + actionBookMark6->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_6)); + + actionBookMark7 = new QAction("", this); + actionBookMark7->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_7)); + + actionBookMark8 = new QAction("", this); + actionBookMark8->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_8)); + + actionBookMark9 = new QAction("", this); + actionBookMark9->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_9)); + + actionBookMark10 = new QAction("", this); + actionBookMark10->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0)); + actionShowIsomers = new QAction(QIcon(":/images/icons/95.png"), tr("Show &Isomers"), this); actionShowIsomers->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)); actionShowIsomers->setCheckable(true); @@ -129,11 +163,11 @@ cMainWindow::cMainWindow() { toolbarTools->addAction(actionModifications); toolbarTools->addAction(actionDrawPeptide); toolbarTools->addAction(actionSummaryTableOfMatchedPeaks); + toolbarTools->addAction(actionMultipleDatasets); toolbarTools->addAction(actionChromatogramWindow); toolbarTools->addAction(actionImageWindow); - toolbarTools->addSeparator(); - toolbarTools->addAction(actionBookMark1); - toolbarTools->addAction(actionBookMark2); + toolbarTools->addAction(actionPatternSimulatorWindow); + toolbarTools->addAction(actionFormulaPredictor); toolbarView = addToolBar(tr("View")); toolbarView->addAction(actionShowIsomers); @@ -145,6 +179,42 @@ cMainWindow::cMainWindow() { toolbarHelp->addAction(actionPDFManual); toolbarHelp->addAction(actionAbout); + addToolBarBreak(); + + toolbarBookmarks = addToolBar(tr("Bookmarks")); + toolbarBookmarks->addAction(actionBookMark1); + toolbarBookmarks->addAction(actionBookMark2); + toolbarBookmarks->addAction(actionBookMark3); + toolbarBookmarks->addAction(actionBookMark4); + toolbarBookmarks->addAction(actionBookMark5); + toolbarBookmarks->addAction(actionBookMark6); + toolbarBookmarks->addAction(actionBookMark7); + toolbarBookmarks->addAction(actionBookMark8); + toolbarBookmarks->addAction(actionBookMark9); + toolbarBookmarks->addAction(actionBookMark10); + + inputfiltercombobox = new QComboBox(); + inputfiltercombobox->setToolTip("Select the input file."); + inputfiltercombobox->setSizeAdjustPolicy(QComboBox::AdjustToContents); + + inputfilterbutton = new QPushButton("Select"); + inputfilterbutton->setToolTip("Select the input file."); + inputfilterbutton->setMinimumWidth(75); + + inputfilterhbox = new QHBoxLayout(); + inputfilterhbox->addWidget(inputfiltercombobox); + inputfilterhbox->addSpacing(10); + inputfilterhbox->addWidget(inputfilterbutton); + + inputfilterwidget = new QWidget(); + inputfilterwidget->setLayout(inputfilterhbox); + + addToolBarBreak(); + + toolbarInputFilter = addToolBar(tr("Input")); + toolbarInputFilter->addWidget(inputfilterwidget); + toolbarInputFilter->setVisible(false); + rowsfilteroperator = new QComboBox(); rowsfilteroperator->setToolTip("OR = any condition must be met; AND = all conditions must be met."); rowsfilteroperator->addItem("OR"); @@ -227,8 +297,9 @@ cMainWindow::cMainWindow() { rowsfilterwidget->setLayout(rowsfilterhbox); addToolBarBreak(); - toolbarFilter = addToolBar(tr("Filter")); - toolbarFilter->addWidget(rowsfilterwidget); + + toolbarRowsFilter = addToolBar(tr("Filter")); + toolbarRowsFilter->addWidget(rowsfilterwidget); results = new QTableView(this); resultsmodel = new QStandardItemModel(0, 0, this); @@ -250,10 +321,13 @@ cMainWindow::cMainWindow() { drawpeptidewidget = new cDrawPeptideWidget(this); summarytableofmatchedpeaks = new cSummaryPeaksTableWidget(&globalpreferences, this); imagewindow = new cImageWindow(&globalpreferences, this); - chromatogramwindow = new cChromatogramWindow(&globalpreferences, theoreticalspectrumlist, this); + chromatogramwindow = new cChromatogramWindow(&globalpreferences, listoftheoreticalspectra, this); parameterswidget = new cParametersWidget(&globalpreferences, this); htmlexportdialog = new cHTMLExportDialog(this); preferencesdialog = new cPreferencesDialog(globalpreferences, this); + multipledatasetswidget = new cMultipleDatasetsTableWidget(&globalpreferences, this); + patternsimulatorwidget = new cPatternSimulatorWidget(&globalpreferences, this); + formulapredictor = new cFormulaPredictor(&globalpreferences, this); connect(actionOpenResults, SIGNAL(triggered()), this, SLOT(openResultsFile())); connect(actionSaveResults, SIGNAL(triggered()), this, SLOT(saveResultsFile())); @@ -270,25 +344,42 @@ cMainWindow::cMainWindow() { connect(actionDrawPeptide, SIGNAL(triggered()), this, SLOT(showDrawPeptideWidget())); connect(actionBookMark1, SIGNAL(triggered()), this, SLOT(gotoBookMark1())); connect(actionBookMark2, SIGNAL(triggered()), this, SLOT(gotoBookMark2())); + connect(actionBookMark3, SIGNAL(triggered()), this, SLOT(gotoBookMark3())); + connect(actionBookMark4, SIGNAL(triggered()), this, SLOT(gotoBookMark4())); + connect(actionBookMark5, SIGNAL(triggered()), this, SLOT(gotoBookMark5())); + connect(actionBookMark6, SIGNAL(triggered()), this, SLOT(gotoBookMark6())); + connect(actionBookMark7, SIGNAL(triggered()), this, SLOT(gotoBookMark7())); + connect(actionBookMark8, SIGNAL(triggered()), this, SLOT(gotoBookMark8())); + connect(actionBookMark9, SIGNAL(triggered()), this, SLOT(gotoBookMark9())); + connect(actionBookMark10, SIGNAL(triggered()), this, SLOT(gotoBookMark10())); connect(actionShowIsomers, SIGNAL(triggered()), this, SLOT(showIsomersStateChanged())); connect(actionGraph, SIGNAL(triggered()), this, SLOT(showGraph())); connect(actionSummaryTableOfMatchedPeaks, SIGNAL(triggered()), this, SLOT(showSummaryTableOfMatchedPeaks())); - connect(actionImageWindow, SIGNAL(triggered()), this, SLOT(showImageWindow())); + connect(actionMultipleDatasets, SIGNAL(triggered()), this, SLOT(showMultipleDatasetsOverview())); connect(actionChromatogramWindow, SIGNAL(triggered()), this, SLOT(showChromatogramWindow())); + connect(actionImageWindow, SIGNAL(triggered()), this, SLOT(showImageWindow())); + connect(actionPatternSimulatorWindow, SIGNAL(triggered()), this, SLOT(showPatternSimulatorWindow())); + connect(actionFormulaPredictor, SIGNAL(triggered()), this, SLOT(showFormulaPredictor())); connect(actionLog, SIGNAL(triggered()), this, SLOT(showHideLog())); connect(actionHTMLDocumentation, SIGNAL(triggered()), this, SLOT(showHTMLDocumentation())); connect(actionPDFManual, SIGNAL(triggered()), this, SLOT(showPDFManual())); connect(actionAbout, SIGNAL(triggered()), this, SLOT(showAbout())); + connect(inputfilterbutton, SIGNAL(released()), this, SLOT(inputFilterButtonReleased())); + connect(rowsfilterbutton, SIGNAL(released()), this, SLOT(filterResults())); connect(rowsfilterclearbutton, SIGNAL(released()), this, SLOT(resetFilter())); connect(summarytableofmatchedpeaks, SIGNAL(tableCancelled()), this, SLOT(summaryPeaksTableCancelled())); connect(summarytableofmatchedpeaks, SIGNAL(summaryPeaksTableRowDoubleClicked(int, double)), this, SLOT(summaryPeaksTableRowDoubleClicked(int, double))); + connect(multipledatasetswidget, SIGNAL(tableCancelled()), this, SLOT(multipleDatasetsTableCancelled())); + connect(multipledatasetswidget, SIGNAL(multipleDatasetsTableRowClicked(int, int, int, int, int, string, string, string)), this, SLOT(multipleDatasetsTableRowClicked(int, int, int, int, int, string, string, string))); 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())); + connect(multipledatasetswidget, SIGNAL(filterSummaryTable()), this, SLOT(filterSummaryTableIfPrepared())); + connect(chromatogramwindow, SIGNAL(doubleClickedScanIDSignal(int)), this, SLOT(chromatogramDoubleClicked(int))); connect(imagewindow, SIGNAL(doubleClickedSpectrumIDSignal(int)), this, SLOT(imageWindowDoubleClicked(int))); @@ -314,11 +405,23 @@ cMainWindow::cMainWindow() { menuTools->addAction(actionDrawPeptide); menuTools->addSeparator(); menuTools->addAction(actionSummaryTableOfMatchedPeaks); + menuTools->addAction(actionMultipleDatasets); menuTools->addAction(actionChromatogramWindow); menuTools->addAction(actionImageWindow); menuTools->addSeparator(); - menuTools->addAction(actionBookMark1); - menuTools->addAction(actionBookMark2); + menuTools->addAction(actionPatternSimulatorWindow); + menuTools->addAction(actionFormulaPredictor); + + menuBookmarks->addAction(actionBookMark1); + menuBookmarks->addAction(actionBookMark2); + menuBookmarks->addAction(actionBookMark3); + menuBookmarks->addAction(actionBookMark4); + menuBookmarks->addAction(actionBookMark5); + menuBookmarks->addAction(actionBookMark6); + menuBookmarks->addAction(actionBookMark7); + menuBookmarks->addAction(actionBookMark8); + menuBookmarks->addAction(actionBookMark9); + menuBookmarks->addAction(actionBookMark10); menuView->addAction(actionShowIsomers); menuView->addSeparator(); @@ -333,6 +436,7 @@ cMainWindow::cMainWindow() { menuBar->addMenu(menuFile); menuBar->addMenu(menuSearch); menuBar->addMenu(menuTools); + menuBar->addMenu(menuBookmarks); menuBar->addMenu(menuView); menuBar->addMenu(menuHelp); @@ -362,6 +466,15 @@ cMainWindow::cMainWindow() { chromatogramwindow->hide(); parameterswidget->hide(); + multipledatasetswidget->hide(); + multipledatasetswidget->getPubChemSearchWidget()->hide(); + multipledatasetswidget->getPubChemSearchWidget()->setHTML(""); + multipledatasetswidget->getDefineCalibrationWidget()->hide(); + multipledatasetswidget->getCalibrationChartWidget()->hide(); + + patternsimulatorwidget->hide(); + formulapredictor->hide(); + splitter->setOrientation(Qt::Vertical); splitter->addWidget(results); splitter->addWidget(logWindow); @@ -371,7 +484,8 @@ cMainWindow::cMainWindow() { resize(defaultwinsizex, defaultwinsizey); - theoreticalspectrumlist.clear(); + listoftheoreticalspectra.clear(); + eicchromatograms.clear(); spectradetails.clear(); parameters.clear(); @@ -388,6 +502,21 @@ cMainWindow::cMainWindow() { applyGlobalPreferences(); summarytableisprepared = false; + multipledatasetsisprepared = false; + + lastactivedetail = -1; + + othernormalgeometry = QRect(); + otherismaximized = false; + otherprofilespectrum = false; + otherabsoluteintensity = false; + othermatchedpeaks = false; + otherunmatchedpeaks = false; + otherscrambledpeaks = false; + otherlabelspeaks = false; + othermzselection = true; + + activefileid = 0; quitapp = false; } @@ -396,6 +525,11 @@ cMainWindow::cMainWindow() { cMainWindow::~cMainWindow() { deleteResults(); + delete inputfiltercombobox; + delete inputfilterbutton; + delete inputfilterhbox; + delete inputfilterwidget; + delete rowsfilteroperator; delete rowsfiltercombobox1; delete rowsfiltercomparatorcombobox1; @@ -424,11 +558,14 @@ cMainWindow::~cMainWindow() { delete modificationswidget; delete drawpeptidewidget; delete summarytableofmatchedpeaks; - delete imagewindow; delete chromatogramwindow; + delete imagewindow; delete parameterswidget; delete htmlexportdialog; delete preferencesdialog; + delete multipledatasetswidget; + delete patternsimulatorwidget; + delete formulapredictor; delete actionOpenResults; delete actionSaveResults; @@ -444,11 +581,22 @@ cMainWindow::~cMainWindow() { delete actionDrawPeptide; delete actionBookMark1; delete actionBookMark2; + delete actionBookMark3; + delete actionBookMark4; + delete actionBookMark5; + delete actionBookMark6; + delete actionBookMark7; + delete actionBookMark8; + delete actionBookMark9; + delete actionBookMark10; delete actionShowIsomers; delete actionGraph; delete actionSummaryTableOfMatchedPeaks; - delete actionImageWindow; + delete actionMultipleDatasets; delete actionChromatogramWindow; + delete actionImageWindow; + delete actionPatternSimulatorWindow; + delete actionFormulaPredictor; delete actionLog; delete actionHTMLDocumentation; delete actionPDFManual; @@ -457,6 +605,7 @@ cMainWindow::~cMainWindow() { delete menuFile; delete menuSearch; delete menuTools; + delete menuBookmarks; delete menuView; delete menuHelp; @@ -528,7 +677,7 @@ void cMainWindow::closeEvent(QCloseEvent *event) { void cMainWindow::preparePeptideSequence(int row, string& peptidesequence, bool reportisomers) { int spectrumindex = resultsmodel->item(row, 1)->data(Qt::DisplayRole).toInt() - 1; - peptidesequence = theoreticalspectrumlist[spectrumindex].getCandidate().getAcronymPeptideNameWithHTMLReferences(); + peptidesequence = listoftheoreticalspectra.get(activefileid, spectrumindex).getCandidate().getAcronymPeptideNameWithHTMLReferences(); peptidesequence = stripHTML(peptidesequence); if (!reportisomers) { @@ -648,7 +797,7 @@ void cMainWindow::reportSpectrum(int row, cTheoreticalSpectrum& theoreticalspect if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { int mscol = 2; - if ((parameters.peaklistfileformat != mis) && (parameters.peaklistfileformat != imzML)) { + if ((parameters.peaklistfileformats[activefileid] != mis) && (parameters.peaklistfileformats[activefileid] != imzML)) { resultsmodel->setItem(row, mscol, new QStandardItem()); resultsmodel->item(row, mscol)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(theoreticalspectrum.getExperimentalSpectrum().getRetentionTime())), Qt::DisplayRole); mscol++; @@ -674,7 +823,7 @@ void cMainWindow::reportSpectrum(int row, cTheoreticalSpectrum& theoreticalspect resultsmodel->item(row, mscol)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(theoreticalspectrum.getWeightedRatioOfMatchedPeaks() * 100)), Qt::DisplayRole); mscol++; - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { + if ((parameters.peaklistfileformats[activefileid] == mis) || (parameters.peaklistfileformats[activefileid] == imzML)) { resultsmodel->setItem(row, mscol, new QStandardItem()); resultsmodel->item(row, mscol)->setData(QVariant::fromValue(theoreticalspectrum.getExperimentalSpectrum().getCoordinateX()), Qt::DisplayRole); mscol++; @@ -685,7 +834,9 @@ void cMainWindow::reportSpectrum(int row, cTheoreticalSpectrum& theoreticalspect } - spectradetails[row].initialize(row + 1, &globalpreferences, ¶meters, theoreticalspectrum, this); + spectradetails[row].initialize(row + 1, activefileid, &globalpreferences, ¶meters, theoreticalspectrum, this); + + connect(&spectradetails[row], SIGNAL(lastActiveDetail(int)), this, SLOT(lastActiveDetailSlot(int))); } @@ -759,7 +910,7 @@ bool cMainWindow::prepareSummaryTableOfMatchedPeaks() { if (!summarytableisprepared) { rowsfilterwidget->setEnabled(false); - summarytableisprepared = summarytableofmatchedpeaks->prepareToShow(resultsmodel, resultsproxymodel, ¶meters, &theoreticalspectrumlist, actionShowIsomers->isChecked()); + summarytableisprepared = summarytableofmatchedpeaks->prepareToShow(resultsmodel, resultsproxymodel, ¶meters, &listoftheoreticalspectra, activefileid, actionShowIsomers->isChecked()); rowsfilterwidget->setEnabled(true); } @@ -783,7 +934,7 @@ void cMainWindow::showSummaryTableOfMatchedPeaks() { void cMainWindow::showImageWindow() { if (prepareSummaryTableOfMatchedPeaks()) { - imagewindow->setDefaultMaxXY(parameters.defaultmaxx, parameters.defaultmaxy, parameters.defaultpixelsizex, parameters.defaultpixelsizey, parameters.vendor); + imagewindow->setDefaultValues(parameters.peaklistfilenames[activefileid], parameters.defaultmaxx, parameters.defaultmaxy, parameters.defaultpixelsizex, parameters.defaultpixelsizey, parameters.vendor); imagewindow->show(); imagewindow->activateWindow(); if (imagewindow->isMinimized()) { @@ -795,7 +946,7 @@ void cMainWindow::showImageWindow() { void cMainWindow::showChromatogramWindow() { if (prepareSummaryTableOfMatchedPeaks()) { - chromatogramwindow->recalculateTICChromatogram(); + chromatogramwindow->recalculateTICChromatogram(activefileid); chromatogramwindow->show(); chromatogramwindow->activateWindow(); if (chromatogramwindow->isMinimized()) { @@ -823,6 +974,40 @@ void cMainWindow::showProperties() { } +void cMainWindow::showMultipleDatasetsOverview() { + if (!multipledatasetsisprepared) { + multipledatasetswidget->resetStandard(); + multipledatasetsisprepared = multipledatasetswidget->prepareToShow(¶meters, &listoftheoreticalspectra, activefileid); + multipledatasetswidget->updateListofStandards(); + } + if (multipledatasetsisprepared) { + multipledatasetswidget->show(); + multipledatasetswidget->activateWindow(); + if (multipledatasetswidget->isMinimized()) { + multipledatasetswidget->showNormal(); + } + } +} + + +void cMainWindow::showPatternSimulatorWindow() { + patternsimulatorwidget->show(); + patternsimulatorwidget->activateWindow(); + if (patternsimulatorwidget->isMinimized()) { + patternsimulatorwidget->showNormal(); + } +} + + +void cMainWindow::showFormulaPredictor() { + formulapredictor->show(); + formulapredictor->activateWindow(); + if (formulapredictor->isMinimized()) { + formulapredictor->showNormal(); + } +} + + void cMainWindow::run() { enableRunButtonAndSettings(false); enableStopButton(true); @@ -834,7 +1019,8 @@ void cMainWindow::run() { deleteResults(); - theoreticalspectrumlist.clear(); + listoftheoreticalspectra.clear(); + eicchromatograms.clear(); spectradetails.clear(); parameters.clear(); @@ -849,10 +1035,10 @@ void cMainWindow::run() { regex rx; rx = "\\.[iI][mM][zZ][mM][lL]$"; localparameters.profiledatafilename = ""; - if (regex_search(localparameters.peaklistfilename, rx)) { - localparameters.profiledatafilename = localparameters.peaklistfilename; + if (regex_search(localparameters.peaklistfilenames[0], rx)) { + localparameters.profiledatafilename = localparameters.peaklistfilenames[0]; - string convertedimzml = localparameters.peaklistfilename.substr(0, (int)localparameters.peaklistfilename.size() - 6); + string convertedimzml = localparameters.peaklistfilenames[0].substr(0, (int)localparameters.peaklistfilenames[0].size() - 6); string convertedibd = convertedimzml; convertedimzml += "_converted_fwhm_"; convertedimzml += to_string(localparameters.fwhm); @@ -864,13 +1050,13 @@ void cMainWindow::run() { if (QFile::exists(convertedimzml.c_str()) && QFile::exists(convertedibd.c_str())) { QMessageBox::StandardButton reply; string s = "The converted imzML file '" + convertedimzml.substr(convertedimzml.rfind('/') + 1) + "' has been found.\n\nDo you want to proceed with this file instead of the original imzML file '"; - s += localparameters.peaklistfilename.substr(localparameters.peaklistfilename.rfind('/') + 1) + "' ?"; + s += localparameters.peaklistfilenames[0].substr(localparameters.peaklistfilenames[0].rfind('/') + 1) + "' ?"; s += "\n\nClick 'Yes' to proceed the converted file.\nClick 'No' to convert the original file again. Note: The conversion may be time-consuming."; reply = QMessageBox::question(this, "Do you want to proceed the converted file ?", s.c_str(), QMessageBox::Yes|QMessageBox::No); if (reply == QMessageBox::Yes) { - localparameters.peaklistfilename = convertedimzml; + localparameters.peaklistfilenames[0] = convertedimzml; } } } @@ -900,41 +1086,65 @@ void cMainWindow::run() { #if OS_TYPE == WIN if (localparameters.useprofiledata) { + rx = "\\.[bB][aA][fF]$"; - if (regex_search(localparameters.peaklistfilename, rx)) { - int i = 1; - string profiledata = localparameters.peaklistfilename + ".profile.1.csv"; - while (QFile::exists(profiledata.c_str())) { - i++; - profiledata = localparameters.peaklistfilename + ".profile." + to_string(i) + ".csv"; - } - i--; - - localparameters.convertprofiledata = true; - if (i > 0) { - QMessageBox::StandardButton reply; - string s = "The file '" + localparameters.peaklistfilename.substr(localparameters.peaklistfilename.rfind('/') + 1) + ".profile.1.csv'"; - if (i > 1) { - s += " and " + to_string(i - 1) + " other files containing profile spectra have been found."; + if (regex_search(localparameters.peaklistfilenames[0], rx)) { + + if (globalpreferences.profilebafprocessingmethod == 0) { + if (localparameters.peaklistfilenames.size() == 1) { + int i = 1; + string profiledata = localparameters.peaklistfilenames[0] + ".profile.1.csv"; + while (QFile::exists(profiledata.c_str())) { + i++; + profiledata = localparameters.peaklistfilenames[0] + ".profile." + to_string(i) + ".csv"; + } + i--; + + localparameters.convertprofiledata = true; + if (i > 0) { + QMessageBox::StandardButton reply; + string s = "The file '" + localparameters.peaklistfilenames[0].substr(localparameters.peaklistfilenames[0].rfind('/') + 1) + ".profile.1.csv'"; + if (i > 1) { + s += " and " + to_string(i - 1) + " other files containing profile spectra have been found."; + } + else { + s += " containing a profile spectrum has been found."; + } + + s += "\n\nDo you want to proceed the existing file(s) ?"; + s += "\n\nClick 'Yes' to proceed the existing file(s).\nClick 'No' to convert the profile data again. Note: The conversion of many profile spectra may be time-consuming."; + + reply = QMessageBox::question(this, "Do you want to proceed the existing file(s) ?", s.c_str(), QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::Yes) { + localparameters.convertprofiledata = false; + } + } } else { - s += " containing a profile spectrum has been found."; - } - - s += "\n\nDo you want to proceed the existing file(s) ?"; - s += "\n\nClick 'Yes' to proceed the existing file(s).\nClick 'No' to convert the profile data again. Note: The conversion of many profile spectra may be time-consuming."; - - reply = QMessageBox::question(this, "Do you want to proceed the existing file(s) ?", s.c_str(), QMessageBox::Yes | QMessageBox::No); - - if (reply == QMessageBox::Yes) { localparameters.convertprofiledata = false; + + QMessageBox msgBox; + QString errstr = "You tried to convert the profile spectra from multiple *.baf files using CompassXport. "; + errstr += "This feature may be time-consuming and it will be disabled. "; + errstr += "If you would like to see the profile spectra, go to 'Preferences->Data Processing' and select CompassXtract as a profile data converter or use only one input *.baf file."; + msgBox.setText(errstr); + msgBox.exec(); } } + + if (globalpreferences.profilebafprocessingmethod == 1) { + localparameters.convertprofiledata = false; + } + } + } + + localparameters.linebafprocessing = globalpreferences.linebafprocessingmethod; #endif - cMainThread* thread = new cMainThread(localparameters, theoreticalspectrumlist, true, false); + cMainThread* thread = new cMainThread(localparameters, listoftheoreticalspectra, true, false); connect(thread, SIGNAL(message(QString)), this, SLOT(updateLog(QString))); connect(thread, SIGNAL(enableRunButtonAndSettings(bool)), this, SLOT(enableRunButtonAndSettings(bool))); connect(thread, SIGNAL(enableStopButton(bool)), this, SLOT(enableStopButton(bool))); @@ -946,10 +1156,34 @@ void cMainWindow::run() { summarytableofmatchedpeaks->deleteTable(); summarytableofmatchedpeaks->hide(); + summarytableofmatchedpeaks->getPubChemSearchWidget()->setHTML(""); summarytableisprepared = false; + + lastactivedetail = -1; + + othernormalgeometry = QRect(); + otherismaximized = false; + otherprofilespectrum = false; + otherabsoluteintensity = false; + othermatchedpeaks = false; + otherunmatchedpeaks = false; + otherscrambledpeaks = false; + otherlabelspeaks = false; + othermzselection = true; + + activefileid = 0; + imagewindow->hide(); chromatogramwindow->hide(); + multipledatasetswidget->deleteTable(); + multipledatasetswidget->hide(); + multipledatasetswidget->getPubChemSearchWidget()->hide(); + multipledatasetswidget->getPubChemSearchWidget()->setHTML(""); + multipledatasetswidget->getDefineCalibrationWidget()->hide(); + multipledatasetswidget->getCalibrationChartWidget()->hide(); + multipledatasetsisprepared = false; + thread->start(); } @@ -995,11 +1229,12 @@ void cMainWindow::enableButtonsHandlingResults(bool enable) { actionPreferences->setEnabled(enable); rowsfilterwidget->setEnabled(enable); actionSummaryTableOfMatchedPeaks->setEnabled(enable); + actionMultipleDatasets->setEnabled(enable); if (enable) { if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { actionShowIsomers->setEnabled(false); - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { + if ((parameters.peaklistfileformats[0] == mis) || (parameters.peaklistfileformats[0] == imzML)) { actionImageWindow->setEnabled(true); actionChromatogramWindow->setEnabled(false); } @@ -1208,7 +1443,7 @@ void cMainWindow::reportSpectra() { if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { + if ((parameters.peaklistfileformats[activefileid] == mis) || (parameters.peaklistfileformats[activefileid] == imzML)) { resultsmodel->setColumnCount(9); } else { @@ -1227,7 +1462,7 @@ void cMainWindow::reportSpectra() { results->setItemDelegateForColumn(mscol, new QItemDelegate()); mscol++; - if ((parameters.peaklistfileformat != mis) && (parameters.peaklistfileformat != imzML)) { + if ((parameters.peaklistfileformats[activefileid] != mis) && (parameters.peaklistfileformats[activefileid] != imzML)) { resultsmodel->setHorizontalHeaderItem(mscol, new QStandardItem()); resultsmodel->horizontalHeaderItem(mscol)->setText("Time"); results->setItemDelegateForColumn(mscol, new QItemDelegate()); @@ -1259,7 +1494,7 @@ void cMainWindow::reportSpectra() { results->setItemDelegateForColumn(mscol, new QItemDelegate()); mscol++; - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { + if ((parameters.peaklistfileformats[activefileid] == mis) || (parameters.peaklistfileformats[activefileid] == imzML)) { resultsmodel->setHorizontalHeaderItem(mscol, new QStandardItem()); resultsmodel->horizontalHeaderItem(mscol)->setText("Coordinate X"); results->setItemDelegateForColumn(mscol, new QItemDelegate()); @@ -1280,22 +1515,28 @@ void cMainWindow::reportSpectra() { results->resizeColumnsToContents(); + if (listoftheoreticalspectra.size() == 0) { + listoftheoreticalspectra.resize(1); + listoftheoreticalspectra.clear(0); + activefileid = 0; + } + if (parameters.useprofiledata) { - if (parameters.peaklistfileformat == baf) { - rawdata.resize(theoreticalspectrumlist.size()); + if (parameters.peaklistfileformats[activefileid] == baf) { + rawdata.resize(listoftheoreticalspectra.size(activefileid)); } - if (parameters.peaklistfileformat == dat) { - rawdata.resize(theoreticalspectrumlist.size()); + if (parameters.peaklistfileformats[activefileid] == dat) { + rawdata.resize(listoftheoreticalspectra.size(activefileid)); } - if ((parameters.peaklistfileformat == mzML) || (parameters.peaklistfileformat == raw)) { - rawdata.resize(theoreticalspectrumlist.size()); + if ((parameters.peaklistfileformats[activefileid] == mzML) || (parameters.peaklistfileformats[activefileid] == raw)) { + rawdata.resize(listoftheoreticalspectra.size(activefileid)); } - if ((parameters.peaklistfileformat == imzML) && ((parameters.mode == dereplication) || (parameters.mode == compoundsearch))) { - rawdata.resize(theoreticalspectrumlist.size()); + if ((parameters.peaklistfileformats[activefileid] == imzML) && ((parameters.mode == dereplication) || (parameters.mode == compoundsearch))) { + rawdata.resize(listoftheoreticalspectra.size(activefileid)); imzmlprofilemetadata.clear(); profilemz64precision = false; profileintensity64precision = false; @@ -1317,24 +1558,25 @@ void cMainWindow::reportSpectra() { } } - - QProgressDialog progress("Preparing the report...", /*"Cancel"*/0, 0, theoreticalspectrumlist.size(), this); + + QProgressDialog progress("Preparing the report...", /*"Cancel"*/0, 0, listoftheoreticalspectra.size(activefileid), this); progress.setMinimumWidth(250); cEventFilter filter; progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); results->setModel(0); resultsproxymodel->setSourceModel(0); results->setSortingEnabled(false); spectradetails.clear(); - spectradetails.resize(theoreticalspectrumlist.size()); - resultsmodel->setRowCount(theoreticalspectrumlist.size()); + spectradetails.resize(listoftheoreticalspectra.size(activefileid)); + resultsmodel->setRowCount(listoftheoreticalspectra.size(activefileid)); bool reportisomers = actionShowIsomers->isChecked(); - for (int i = 0; i < theoreticalspectrumlist.size(); i++) { - reportSpectrum(i, theoreticalspectrumlist[i], reportisomers); + for (int i = 0; i < listoftheoreticalspectra.size(activefileid); i++) { + reportSpectrum(i, listoftheoreticalspectra.get(activefileid, i), reportisomers); progress.setValue(i); //if (progress.wasCanceled()) { // break; @@ -1350,8 +1592,37 @@ void cMainWindow::reportSpectra() { results->resizeColumnToContents(i); } - progress.setValue(theoreticalspectrumlist.size()); + if (parameters.peaklistseriesvector.size() > 1) { + toolbarInputFilter->setVisible(true); + } + else { + toolbarInputFilter->setVisible(false); + } + inputfiltercombobox->clear(); + for (int i = 0; i < parameters.peaklistseriesvector.size(); i++) { + inputfiltercombobox->addItem(parameters.peaklistfilenames[i].c_str()); + } + inputfiltercombobox->setCurrentIndex(activefileid); + + //eicchromatograms.clear(); + //if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { + // if ((parameters.peaklistfileformats[activefileid] != mis) && (parameters.peaklistfileformats[activefileid] != imzML)) { + // int sizei = listoftheoreticalspectra.size(); + // int sizej; + // eicchromatograms.resize(sizei); + // for (int i = 0; i < sizei; i++) { + // eicchromatograms[i].clear(); + // sizej = listoftheoreticalspectra.size(i); + // for (int j = 0; j < sizej; j++) { + // addEICPeak(¶meters, eicchromatograms[i], listoftheoreticalspectra.get(i, j), listoftheoreticalspectra.get(i, j).getExperimentalSpectrum()); + // } + // eicchromatograms[i].normalizeIntenzity(); + // } + // } + //} + + progress.setValue(listoftheoreticalspectra.size(activefileid)); } @@ -1373,12 +1644,13 @@ void cMainWindow::showIsomersStateChanged() { bool reportisomers = actionShowIsomers->isChecked(); string peptidesequence; - QProgressDialog progress("Updating the report...", 0, 0, theoreticalspectrumlist.size(), this); + QProgressDialog progress("Updating the report...", 0, 0, listoftheoreticalspectra.size(activefileid), this); progress.setMinimumWidth(250); cEventFilter filter; progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); for (int i = 0; i < resultsmodel->rowCount(); i++) { preparePeptideSequence(i, peptidesequence, reportisomers); @@ -1393,7 +1665,7 @@ void cMainWindow::showIsomersStateChanged() { graph->updateView(reportisomers); - progress.setValue(theoreticalspectrumlist.size()); + progress.setValue(listoftheoreticalspectra.size(activefileid)); } @@ -1416,28 +1688,202 @@ 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; } + + actionBookMark1->setText(globalpreferences.bookmarkname1); + if (globalpreferences.bookmarkname1.isEmpty() || globalpreferences.bookmarkurl1.isEmpty()) { + actionBookMark1->setEnabled(false); + actionBookMark1->setVisible(false); + } + else { + actionBookMark1->setEnabled(true); + actionBookMark1->setVisible(true); + } + + actionBookMark2->setText(globalpreferences.bookmarkname2); + if (globalpreferences.bookmarkname2.isEmpty() || globalpreferences.bookmarkurl2.isEmpty()) { + actionBookMark2->setEnabled(false); + actionBookMark2->setVisible(false); + } + else { + actionBookMark2->setEnabled(true); + actionBookMark2->setVisible(true); + } + + actionBookMark3->setText(globalpreferences.bookmarkname3); + if (globalpreferences.bookmarkname3.isEmpty() || globalpreferences.bookmarkurl3.isEmpty()) { + actionBookMark3->setEnabled(false); + actionBookMark3->setVisible(false); + } + else { + actionBookMark3->setEnabled(true); + actionBookMark3->setVisible(true); + } + + actionBookMark4->setText(globalpreferences.bookmarkname4); + if (globalpreferences.bookmarkname4.isEmpty() || globalpreferences.bookmarkurl4.isEmpty()) { + actionBookMark4->setEnabled(false); + actionBookMark4->setVisible(false); + } + else { + actionBookMark4->setEnabled(true); + actionBookMark4->setVisible(true); + } + + actionBookMark5->setText(globalpreferences.bookmarkname5); + if (globalpreferences.bookmarkname5.isEmpty() || globalpreferences.bookmarkurl5.isEmpty()) { + actionBookMark5->setEnabled(false); + actionBookMark5->setVisible(false); + } + else { + actionBookMark5->setEnabled(true); + actionBookMark5->setVisible(true); + } + + actionBookMark6->setText(globalpreferences.bookmarkname6); + if (globalpreferences.bookmarkname6.isEmpty() || globalpreferences.bookmarkurl6.isEmpty()) { + actionBookMark6->setEnabled(false); + actionBookMark6->setVisible(false); + } + else { + actionBookMark6->setEnabled(true); + actionBookMark6->setVisible(true); + } + + actionBookMark7->setText(globalpreferences.bookmarkname7); + if (globalpreferences.bookmarkname7.isEmpty() || globalpreferences.bookmarkurl7.isEmpty()) { + actionBookMark7->setEnabled(false); + actionBookMark7->setVisible(false); + } + else { + actionBookMark7->setEnabled(true); + actionBookMark7->setVisible(true); + } + + actionBookMark8->setText(globalpreferences.bookmarkname8); + if (globalpreferences.bookmarkname8.isEmpty() || globalpreferences.bookmarkurl8.isEmpty()) { + actionBookMark8->setEnabled(false); + actionBookMark8->setVisible(false); + } + else { + actionBookMark8->setEnabled(true); + actionBookMark8->setVisible(true); + } + + actionBookMark9->setText(globalpreferences.bookmarkname9); + if (globalpreferences.bookmarkname9.isEmpty() || globalpreferences.bookmarkurl9.isEmpty()) { + actionBookMark9->setEnabled(false); + actionBookMark9->setVisible(false); + } + else { + actionBookMark9->setEnabled(true); + actionBookMark9->setVisible(true); + } + + actionBookMark10->setText(globalpreferences.bookmarkname10); + if (globalpreferences.bookmarkname10.isEmpty() || globalpreferences.bookmarkurl10.isEmpty()) { + actionBookMark10->setEnabled(false); + actionBookMark10->setVisible(false); + } + else { + actionBookMark10->setEnabled(true); + actionBookMark10->setVisible(true); + } + + if (globalpreferences.viewbookmarks) { + toolbarBookmarks->setVisible(true); + } + else { + toolbarBookmarks->setVisible(false); + } } -void cMainWindow::rowDoubleClicked(const QModelIndex& item) { - int row = resultsproxymodel->mapToSource(item).row(); - int rowid = resultsmodel->item(row, 1)->data(Qt::DisplayRole).toInt() - 1; +void cMainWindow::openDetail(int rowid) { + int last = lastactivedetail; + + QRect geometry; + bool usedefaultsize = true; + bool ishidden = spectradetails[rowid].isHidden(); + + if ((last != -1) /*&& (last != rowid)*/) { + if (last == -2) { + geometry = othernormalgeometry; + } + else { + geometry = spectradetails[last].normalGeometry(); + } + + if (ishidden) { + spectradetails[rowid].move(geometry.x(), geometry.y()); + spectradetails[rowid].setGeometry(geometry); + } + + usedefaultsize = false; + } + + spectradetails[rowid].prepareToShow(actionShowIsomers, &rawdata, &imzmlprofilemetadata, profilemz64precision, profileintensity64precision, usedefaultsize); - spectradetails[rowid].prepareToShow(actionShowIsomers, &rawdata, &imzmlprofilemetadata, profilemz64precision, profileintensity64precision); spectradetails[rowid].show(); spectradetails[rowid].activateWindow(); if (spectradetails[rowid].isMinimized()) { spectradetails[rowid].showNormal(); } + + if ((last != -1) /*&& (last != rowid)*/) { + if (ishidden) { + spectradetails[rowid].setGeometry(geometry); + } + + if (last == -2) { + if (otherismaximized) { + spectradetails[rowid].showMaximized(); + } + else { + spectradetails[rowid].showNormal(); + } + spectradetails[rowid].setProfileSpectrumEnabled(otherprofilespectrum); + spectradetails[rowid].setAbsoluteIntensityEnabled(otherabsoluteintensity); + spectradetails[rowid].setHideMatchedPeaksEnabled(othermatchedpeaks); + spectradetails[rowid].setHideUnmatchedPeaksEnabled(otherunmatchedpeaks); + spectradetails[rowid].setHideScrambledPeaksEnabled(otherscrambledpeaks); + spectradetails[rowid].setHidePeakLabelsEnabled(otherlabelspeaks); + spectradetails[rowid].setMouseMzSelectionEnabled(othermzselection); + } + else { + if (spectradetails[last].isMaximized()) { + spectradetails[rowid].showMaximized(); + } + else { + spectradetails[rowid].showNormal(); + } + spectradetails[rowid].setProfileSpectrumEnabled(spectradetails[last].hasProfileSpectrumEnabled()); + spectradetails[rowid].setAbsoluteIntensityEnabled(spectradetails[last].hasAbsoluteIntensityEnabled()); + spectradetails[rowid].setHideMatchedPeaksEnabled(spectradetails[last].hasHideMatchedPeaksEnabled()); + spectradetails[rowid].setHideUnmatchedPeaksEnabled(spectradetails[last].hasHideUnmatchedPeaksEnabled()); + spectradetails[rowid].setHideScrambledPeaksEnabled(spectradetails[last].hasHideScrambledPeaksEnabled()); + spectradetails[rowid].setHidePeakLabelsEnabled(spectradetails[last].hasHidePeakLabelsEnabled()); + spectradetails[rowid].setMouseMzSelectionEnabled(spectradetails[last].hasMouseMzSelectionEnabled()); + } + } +} + + +void cMainWindow::rowDoubleClicked(const QModelIndex& item) { + int row = resultsproxymodel->mapToSource(item).row(); + int rowid = resultsmodel->item(row, 1)->data(Qt::DisplayRole).toInt() - 1; + openDetail(rowid); } @@ -1458,6 +1904,7 @@ void cMainWindow::exportToCsv() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); bool removefile = false; QFile file(filename); @@ -1522,6 +1969,7 @@ void cMainWindow::exportToHTML() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); bool removefile = false; QFile file(filename); @@ -1619,9 +2067,14 @@ void cMainWindow::exportToHTML() { int columncount; string tdwidth; if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { + if ((parameters.peaklistfileformats[activefileid] == mis) || (parameters.peaklistfileformats[activefileid] == imzML)) { if (parameters.generateisotopepattern) { - columncount = 15; + if (parameters.calculatefdrs) { + columncount = 15; + } + else { + columncount = 13; + } } else { columncount = 12; @@ -1629,7 +2082,12 @@ void cMainWindow::exportToHTML() { } else { if (parameters.generateisotopepattern) { - columncount = 14; + if (parameters.calculatefdrs) { + columncount = 14; + } + else { + columncount = 12; + } } else { columncount = 11; @@ -1658,7 +2116,7 @@ void cMainWindow::exportToHTML() { out << "ID"; if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { + if ((parameters.peaklistfileformats[activefileid] == mis) || (parameters.peaklistfileformats[activefileid] == imzML)) { out << "Coordinate X"; out << "Coordinate Y"; } @@ -1693,7 +2151,7 @@ void cMainWindow::exportToHTML() { out << "Error [ppm]"; if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { - if (parameters.generateisotopepattern) { + if (parameters.generateisotopepattern && parameters.calculatefdrs) { out << "Score"; out << "FDR"; } @@ -1804,6 +2262,9 @@ void cMainWindow::showPreferences() { bricksdatabasewidget->applyGlobalPreferences(&globalpreferences); sequencedatabasewidget->applyGlobalPreferences(&globalpreferences); modificationswidget->applyGlobalPreferences(&globalpreferences); + multipledatasetswidget->applyGlobalPreferences(&globalpreferences); + patternsimulatorwidget->applyGlobalPreferences(&globalpreferences); + formulapredictor->applyGlobalPreferences(); applyGlobalPreferences(); @@ -1842,12 +2303,18 @@ void cMainWindow::saveResultsFile() { if (!filename.isEmpty()) { lastdirsaveresults = filename; - QProgressDialog progress("Saving the report...", "Cancel", 0, theoreticalspectrumlist.size(), this); + int savesize = 0; + for (int h = 0; h < listoftheoreticalspectra.size(); h++) { + savesize += listoftheoreticalspectra.size(h); + } + + QProgressDialog progress("Saving the report...", "Cancel", 0, savesize, this); progress.setMinimumWidth(250); cEventFilter filter; progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); bool removefile = false; ofstream outfile; @@ -1873,18 +2340,34 @@ void cMainWindow::saveResultsFile() { // store parameters parameters.store(outfile); + // store an auxiliary value for progress dialog + outfile.write((char *)&savesize, sizeof(int)); + // store theoretical spectra - size = theoreticalspectrumlist.size(); + int progresscount = 0; + size = listoftheoreticalspectra.size(); outfile.write((char *)&size, sizeof(int)); - for (int i = 0; i < theoreticalspectrumlist.size(); i++) { - theoreticalspectrumlist[i].store(outfile); - progress.setValue(i); - if (progress.wasCanceled()) { - removefile = true; - break; + for (int h = 0; h < listoftheoreticalspectra.size(); h++) { + size = listoftheoreticalspectra.size(h); + outfile.write((char *)&size, sizeof(int)); + for (int i = 0; i < listoftheoreticalspectra.size(h); i++) { + listoftheoreticalspectra.get(h, i).store(outfile); + progress.setValue(progresscount); + progresscount++; + if (progress.wasCanceled()) { + removefile = true; + break; + } } } + // store results from PubChem + summarytableofmatchedpeaks->getPubChemSearchWidget()->store(outfile); + multipledatasetswidget->getPubChemSearchWidget()->store(outfile); + + // store calibration data + multipledatasetswidget->getDefineCalibrationWidget()->store(outfile); + // close file outfile.close(); @@ -1893,7 +2376,7 @@ void cMainWindow::saveResultsFile() { } } - progress.setValue(theoreticalspectrumlist.size()); + progress.setValue(savesize); } @@ -1901,13 +2384,8 @@ void cMainWindow::saveResultsFile() { void cMainWindow::openResultsFile() { - - #if OS_TYPE == WIN - string filetypes = appname.toStdString() + " " + appversion.toStdString() + " Results Files (*.res)"; - #else - string filetypes = "Results Files (*.res)"; - #endif - + string filetypes = "Results Files (*.res)"; + QString filename = QFileDialog::getOpenFileName(this, tr("Open Results..."), lastdiropenresults, tr(filetypes.c_str())); if (!filename.isEmpty()) { @@ -1925,12 +2403,85 @@ void cMainWindow::openResultsFile() { infile.read((char *)&size, sizeof(int)); s.resize(size); infile.read(&s[0], s.size()); - QString appinfo = appname + " " + appversion; - if (appinfo.toStdString().compare(s) != 0) { + + + string fileversion = s; + fileversion = fileversion.substr(fileversion.find('.') + 2); + fileversion = fileversion.substr(0, fileversion.rfind('(') - 1); + + int fileversionpart1 = QString(fileversion.substr(0, fileversion.find('.')).c_str()).toInt(); + + fileversion = fileversion.substr(fileversion.find('.') + 1); + int fileversionpart2 = QString(fileversion.substr(0, fileversion.find('.')).c_str()).toInt(); + + fileversion = fileversion.substr(fileversion.find('.') + 1); + int fileversionpart3 = QString(fileversion.c_str()).toInt(); + + + string lastcompatible = lastcompatibleappversion.toStdString(); + lastcompatible = lastcompatible.substr(lastcompatible.find('.') + 2); + lastcompatible = lastcompatible.substr(0, lastcompatible.rfind('(') - 1); + + int lastcompatiblepart1 = QString(lastcompatible.substr(0, lastcompatible.find('.')).c_str()).toInt(); + + lastcompatible = lastcompatible.substr(lastcompatible.find('.') + 1); + int lastcompatiblepart2 = QString(lastcompatible.substr(0, lastcompatible.find('.')).c_str()).toInt(); + + lastcompatible = lastcompatible.substr(lastcompatible.find('.') + 1); + int lastcompatiblepart3 = QString(lastcompatible.c_str()).toInt(); + + + string currentversion = appversion.toStdString(); + currentversion = currentversion.substr(currentversion.find('.') + 2); + currentversion = currentversion.substr(0, currentversion.rfind('(') - 1); + + int currentversionpart1 = QString(currentversion.substr(0, currentversion.find('.')).c_str()).toInt(); + + currentversion = currentversion.substr(currentversion.find('.') + 1); + int currentversionpart2 = QString(currentversion.substr(0, currentversion.find('.')).c_str()).toInt(); + + currentversion = currentversion.substr(currentversion.find('.') + 1); + int currentversionpart3 = QString(currentversion.c_str()).toInt(); + + + if (!isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, lastcompatiblepart1, lastcompatiblepart2, lastcompatiblepart3)) { QMessageBox msgBox; - QString errstr = "The results file cannot be opened because it was created in the different version of " + appname + " ("; + QString errstr = "The results file cannot be opened. The file was created in "; errstr += s.c_str(); - errstr += ")."; + errstr += " but the minimum required version is " + appname + " " + lastcompatibleappversion + "."; + msgBox.setText(errstr); + msgBox.exec(); + + infile.close(); + return; + } + + + bool oldversion = false; + if (currentversionpart3 < fileversionpart3) { + oldversion = true; + } + if (currentversionpart3 > fileversionpart3) { + oldversion = false; + } + if (currentversionpart2 < fileversionpart2) { + oldversion = true; + } + if (currentversionpart2 > fileversionpart2) { + oldversion = false; + } + if (currentversionpart1 < fileversionpart1) { + oldversion = true; + } + if (currentversionpart1 > fileversionpart1) { + oldversion = false; + } + + if (oldversion) { + QMessageBox msgBox; + QString errstr = "The results file cannot be opened. The file was created in "; + errstr += s.c_str(); + errstr += " but your current version is only " + appname + " " + appversion + "."; msgBox.setText(errstr); msgBox.exec(); @@ -1946,10 +2497,33 @@ void cMainWindow::openResultsFile() { imagewindow->hide(); chromatogramwindow->hide(); + + multipledatasetswidget->deleteTable(); + multipledatasetswidget->hide(); + multipledatasetswidget->getPubChemSearchWidget()->hide(); + multipledatasetswidget->getPubChemSearchWidget()->setHTML(""); + multipledatasetswidget->getDefineCalibrationWidget()->hide(); + multipledatasetswidget->getCalibrationChartWidget()->hide(); + multipledatasetsisprepared = false; - theoreticalspectrumlist.clear(); + listoftheoreticalspectra.clear(); + eicchromatograms.clear(); spectradetails.clear(); + lastactivedetail = -1; + + othernormalgeometry = QRect(); + otherismaximized = false; + otherprofilespectrum = false; + otherabsoluteintensity = false; + othermatchedpeaks = false; + otherunmatchedpeaks = false; + otherscrambledpeaks = false; + otherlabelspeaks = false; + othermzselection = true; + + activefileid = 0; + parameters.clear(); rawdata.clear(); @@ -1970,12 +2544,12 @@ void cMainWindow::openResultsFile() { sb->setValue(sb->maximum()); // load parameters - parameters.load(infile); + parameters.load(infile, fileversionpart1, fileversionpart2, fileversionpart3); parameterswidget->setAndRestoreParameters(parameters); if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { actionShowIsomers->setEnabled(false); - if ((parameters.peaklistfileformat == mis) || (parameters.peaklistfileformat == imzML)) { + if ((parameters.peaklistfileformats[activefileid] == mis) || (parameters.peaklistfileformats[activefileid] == imzML)) { actionImageWindow->setEnabled(true); actionChromatogramWindow->setEnabled(false); } @@ -1990,26 +2564,69 @@ void cMainWindow::openResultsFile() { actionChromatogramWindow->setEnabled(false); } + int loadsize; + // load theoretical spectra - infile.read((char *)&size, sizeof(int)); + infile.read((char *)&loadsize, sizeof(int)); - QProgressDialog progress("Loading the report...", 0, 0, size, this); + QProgressDialog progress("Loading the report...", 0, 0, loadsize, this); progress.setMinimumWidth(250); cEventFilter filter; progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); - - for (int i = 0; i < size; i++) { - theoreticalspectrum.load(infile); - theoreticalspectrumlist.add(theoreticalspectrum); - progress.setValue(i); + progress.setValue(0); + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 0)) { + int progresscount = 0; + infile.read((char *)&size, sizeof(int)); + listoftheoreticalspectra.resize(size); + + for (int h = 0; h < listoftheoreticalspectra.size(); h++) { + infile.read((char *)&size, sizeof(int)); + for (int i = 0; i < size; i++) { + theoreticalspectrum.load(infile, fileversionpart1, fileversionpart2, fileversionpart3); + listoftheoreticalspectra.add(h, theoreticalspectrum); + progress.setValue(progresscount); + progresscount++; + } + } + } + else { + listoftheoreticalspectra.resize(1); + for (int i = 0; i < loadsize; i++) { + theoreticalspectrum.load(infile, fileversionpart1, fileversionpart2, fileversionpart3); + listoftheoreticalspectra.add(0, theoreticalspectrum); + progress.setValue(i); + } } - progress.setValue(size); + progress.setValue(loadsize); reportSpectra(); + // load results from PubChem + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 0, 22)) { + summarytableofmatchedpeaks->getPubChemSearchWidget()->load(infile); + } + else { + summarytableofmatchedpeaks->getPubChemSearchWidget()->setHTML(""); + } + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 6)) { + multipledatasetswidget->getPubChemSearchWidget()->load(infile); + } + else { + multipledatasetswidget->getPubChemSearchWidget()->setHTML(""); + } + + if (isCompatibleVersion(fileversionpart1, fileversionpart2, fileversionpart3, 2, 1, 14)) { + multipledatasetswidget->getDefineCalibrationWidget()->load(infile, fileversionpart1, fileversionpart2, fileversionpart3); + } + else { + // nothing to do + } + // close file infile.close(); } @@ -2097,6 +2714,11 @@ void cMainWindow::resetFilter() { } +void cMainWindow::lastActiveDetailSlot(int rowid) { + lastactivedetail = rowid - 1; +} + + void cMainWindow::gotoBookMark1() { QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl1)); } @@ -2107,22 +2729,121 @@ void cMainWindow::gotoBookMark2() { } +void cMainWindow::gotoBookMark3() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl3)); +} + + +void cMainWindow::gotoBookMark4() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl4)); +} + + +void cMainWindow::gotoBookMark5() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl5)); +} + + +void cMainWindow::gotoBookMark6() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl6)); +} + + +void cMainWindow::gotoBookMark7() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl7)); +} + + +void cMainWindow::gotoBookMark8() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl8)); +} + + +void cMainWindow::gotoBookMark9() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl9)); +} + + +void cMainWindow::gotoBookMark10() { + QDesktopServices::openUrl(QUrl(globalpreferences.bookmarkurl10)); +} + + void cMainWindow::summaryPeaksTableCancelled() { summarytableisprepared = false; } +void cMainWindow::multipleDatasetsTableCancelled() { + multipledatasetsisprepared = false; +} + + void cMainWindow::summaryPeaksTableRowDoubleClicked(int rowid, double experimentalmz) { - spectradetails[rowid].prepareToShow(actionShowIsomers, &rawdata, &imzmlprofilemetadata, profilemz64precision, profileintensity64precision); - spectradetails[rowid].show(); - spectradetails[rowid].activateWindow(); - if (spectradetails[rowid].isMinimized()) { - spectradetails[rowid].showNormal(); - } + openDetail(rowid); spectradetails[rowid].zoomToPeak(experimentalmz); } +void cMainWindow::multipleDatasetsTableRowClicked(int datasetid, int spectrumid, int peakid, int datatypeview, int peakshape, string name, string iontype, string mzstr) { + bool ctrlpressed = false; + if (QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier)) { + ctrlpressed = true; + } + + bool activatetable = true; + int last = lastactivedetail; + + if (last == -1) { + activatetable = false; + } + + if (datasetid != activefileid) { + inputfiltercombobox->setCurrentIndex(datasetid); + inputFilterButtonReleased(); + } + + if (prepareSummaryTableOfMatchedPeaks()) { + summarytableofmatchedpeaks->filterCompound(name, iontype, datatypeview, mzstr); + + if ((parameters.mode == dereplication) || (parameters.mode == compoundsearch)) { + if ((parameters.peaklistfileformats[activefileid] == mis) || (parameters.peaklistfileformats[activefileid] == imzML)) { + if (imagewindow->isHidden()) { + showImageWindow(); + activatetable = false; + } + } + else { + if (chromatogramwindow->isHidden()) { + showChromatogramWindow(); + activatetable = false; + } + + //if (datatypeview == 0) { + // chromatogramwindow->setAbsoluteIntensityEnabled(false); + //} + //else { + // chromatogramwindow->setAbsoluteIntensityEnabled(true); + //} + + chromatogramwindow->setAbsoluteIntensityEnabled(true); + + chromatogramwindow->setPeakShape(peakshape); + } + } + } + + if (ctrlpressed) { + openDetail(spectrumid); + spectradetails[spectrumid].zoomToPeak(listoftheoreticalspectra.get(datasetid, spectrumid)[peakid].matchedmz); + } + + if (activatetable) { + multipledatasetswidget->activateWindow(); + } +} + + void cMainWindow::updateSummaryPeaksTableFilterSlot(int xmin, int xmax, int ymin, int ymax) { summarytableofmatchedpeaks->updateFilterBySelectedRegion(xmin, xmax, ymin, ymax); } @@ -2130,24 +2851,60 @@ void cMainWindow::updateSummaryPeaksTableFilterSlot(int xmin, int xmax, int ymin void cMainWindow::chromatogramDoubleClicked(int scanid) { if ((scanid >= 0) && (scanid < spectradetails.size())) { - spectradetails[scanid].prepareToShow(actionShowIsomers, &rawdata, &imzmlprofilemetadata, profilemz64precision, profileintensity64precision); - spectradetails[scanid].show(); - spectradetails[scanid].activateWindow(); - if (spectradetails[scanid].isMinimized()) { - spectradetails[scanid].showNormal(); - } + openDetail(scanid); } } void cMainWindow::imageWindowDoubleClicked(int spectrumid) { if ((spectrumid >= 0) && (spectrumid < spectradetails.size())) { - spectradetails[spectrumid].prepareToShow(actionShowIsomers, &rawdata, &imzmlprofilemetadata, profilemz64precision, profileintensity64precision); - spectradetails[spectrumid].show(); - spectradetails[spectrumid].activateWindow(); - if (spectradetails[spectrumid].isMinimized()) { - spectradetails[spectrumid].showNormal(); + openDetail(spectrumid); + } +} + + +void cMainWindow::inputFilterButtonReleased() { + if (inputfiltercombobox->count() > 0) { + if (lastactivedetail >= 0) { + othernormalgeometry = spectradetails[lastactivedetail].normalGeometry(); + otherismaximized = spectradetails[lastactivedetail].isMaximized(); + otherprofilespectrum = spectradetails[lastactivedetail].hasProfileSpectrumEnabled(); + otherabsoluteintensity = spectradetails[lastactivedetail].hasAbsoluteIntensityEnabled(); + othermatchedpeaks = spectradetails[lastactivedetail].hasHideMatchedPeaksEnabled(); + otherunmatchedpeaks = spectradetails[lastactivedetail].hasHideUnmatchedPeaksEnabled(); + otherscrambledpeaks = spectradetails[lastactivedetail].hasHideScrambledPeaksEnabled(); + otherlabelspeaks = spectradetails[lastactivedetail].hasHidePeakLabelsEnabled(); + othermzselection = spectradetails[lastactivedetail].hasMouseMzSelectionEnabled(); + lastactivedetail = -2; } + + summarytableofmatchedpeaks->deleteTable(); + summarytableisprepared = false; + + spectradetails.clear(); + + rawdata.clear(); + + activefileid = inputfiltercombobox->currentIndex(); + + reportSpectra(); + + resetFilter(); + + if (chromatogramwindow->isVisible() || imagewindow->isVisible() || summarytableofmatchedpeaks->isVisible()) { + if (prepareSummaryTableOfMatchedPeaks()) { + if (chromatogramwindow->isVisible()) { + chromatogramwindow->recalculateTICChromatogram(activefileid); + } + } + } + } +} + + +void cMainWindow::filterSummaryTableIfPrepared() { + if (summarytableisprepared) { + summarytableofmatchedpeaks->filterTablerows(); } } diff --git a/CycloBranch/gui/cMainWindow.h b/CycloBranch/gui/cMainWindow.h index 1a03d98..5adab0b 100644 --- a/CycloBranch/gui/cMainWindow.h +++ b/CycloBranch/gui/cMainWindow.h @@ -34,6 +34,9 @@ #include "gui/cChromatogramWindow.h" #include "gui/cMainWindowProxyModel.h" #include "gui/cPreferencesDialog.h" +#include "gui/cPatternSimulatorWidget.h" +#include "gui/cFormulaPredictor.h" +#include "gui/cMultipleDatasetsTableWidget.h" // forward declaration @@ -80,15 +83,18 @@ class cMainWindow : public QMainWindow QMenu* menuFile; QMenu* menuSearch; QMenu* menuTools; + QMenu* menuBookmarks; QMenu* menuView; QMenu* menuHelp; QToolBar* toolbarFile; QToolBar* toolbarSearch; QToolBar* toolbarTools; + QToolBar* toolbarBookmarks; QToolBar* toolbarView; QToolBar* toolbarHelp; - QToolBar* toolbarFilter; + QToolBar* toolbarInputFilter; + QToolBar* toolbarRowsFilter; QAction* actionOpenResults; QAction* actionSaveResults; @@ -105,16 +111,32 @@ class cMainWindow : public QMainWindow QAction *actionDrawPeptide; QAction *actionBookMark1; QAction *actionBookMark2; + QAction *actionBookMark3; + QAction *actionBookMark4; + QAction *actionBookMark5; + QAction *actionBookMark6; + QAction *actionBookMark7; + QAction *actionBookMark8; + QAction *actionBookMark9; + QAction *actionBookMark10; QAction* actionShowIsomers; QAction* actionGraph; QAction* actionSummaryTableOfMatchedPeaks; - QAction* actionImageWindow; + QAction* actionMultipleDatasets; QAction* actionChromatogramWindow; + QAction* actionImageWindow; + QAction* actionPatternSimulatorWindow; + QAction* actionFormulaPredictor; QAction* actionLog; QAction* actionHTMLDocumentation; QAction* actionPDFManual; QAction* actionAbout; + QWidget* inputfilterwidget; + QHBoxLayout* inputfilterhbox; + QComboBox* inputfiltercombobox; + QPushButton* inputfilterbutton; + QWidget* rowsfilterwidget; QHBoxLayout* rowsfilterhbox; QComboBox* rowsfilteroperator; @@ -133,7 +155,8 @@ class cMainWindow : public QMainWindow QStandardItemModel* resultsmodel; cMainWindowProxyModel* resultsproxymodel; - cTheoreticalSpectrumList theoreticalspectrumlist; + cTheoreticalSpectrumList listoftheoreticalspectra; + cPeakListSeries eicchromatograms; vector spectradetails; cGlobalPreferences globalpreferences; @@ -159,6 +182,9 @@ class cMainWindow : public QMainWindow cParametersWidget* parameterswidget; cHTMLExportDialog* htmlexportdialog; cPreferencesDialog* preferencesdialog; + cMultipleDatasetsTableWidget* multipledatasetswidget; + cPatternSimulatorWidget* patternsimulatorwidget; + cFormulaPredictor* formulapredictor; int resultsbasecolumncount; int resultsspecificcolumncount; @@ -171,6 +197,21 @@ class cMainWindow : public QMainWindow QString lastdiropenresults; bool summarytableisprepared; + bool multipledatasetsisprepared; + + int lastactivedetail; + + QRect othernormalgeometry; + bool otherismaximized; + bool otherprofilespectrum; + bool otherabsoluteintensity; + bool othermatchedpeaks; + bool otherunmatchedpeaks; + bool otherscrambledpeaks; + bool otherlabelspeaks; + bool othermzselection; + + int activefileid; bool quitapp; @@ -184,6 +225,8 @@ class cMainWindow : public QMainWindow void applyGlobalPreferences(); + void openDetail(int rowid); + private slots: @@ -213,6 +256,12 @@ private slots: void showProperties(); + void showMultipleDatasetsOverview(); + + void showPatternSimulatorWindow(); + + void showFormulaPredictor(); + void run(); void stop(); @@ -261,20 +310,46 @@ private slots: void resetFilter(); + void lastActiveDetailSlot(int rowid); + void gotoBookMark1(); void gotoBookMark2(); + void gotoBookMark3(); + + void gotoBookMark4(); + + void gotoBookMark5(); + + void gotoBookMark6(); + + void gotoBookMark7(); + + void gotoBookMark8(); + + void gotoBookMark9(); + + void gotoBookMark10(); + void summaryPeaksTableCancelled(); + void multipleDatasetsTableCancelled(); + void summaryPeaksTableRowDoubleClicked(int rowid, double experimentalmz); + void multipleDatasetsTableRowClicked(int datasetid, int spectrumid, int peakid, int datatypeview, int peakshape, string name, string iontype, string mzstr); + void updateSummaryPeaksTableFilterSlot(int xmin, int xmax, int ymin, int ymax); void chromatogramDoubleClicked(int scanid); void imageWindowDoubleClicked(int spectrumid); + void inputFilterButtonReleased(); + + void filterSummaryTableIfPrepared(); + //void showContextMenu(const QPoint &pt); signals: diff --git a/CycloBranch/gui/cModificationsWidget.cpp b/CycloBranch/gui/cModificationsWidget.cpp index eed3e8d..9daf37a 100644 --- a/CycloBranch/gui/cModificationsWidget.cpp +++ b/CycloBranch/gui/cModificationsWidget.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include cModificationsWidget::cModificationsWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { @@ -420,6 +422,34 @@ void cModificationsWidget::keyPressEvent(QKeyEvent *event) { rowsfilterwholeword->setChecked(!rowsfilterwholeword->isChecked()); } + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C)) { + QModelIndexList selectedindexes = database->selectionModel()->selectedIndexes(); + QStandardItem* item; + + QString selectedtext; + string itemtext; + + int selectedcount = selectedindexes.count(); + for (int i = 0; i < selectedcount; i++) { + if (i > 0) { + if (proxymodel->mapToSource(selectedindexes[i - 1]).row() != proxymodel->mapToSource(selectedindexes[i]).row()) { + selectedtext += "\n"; + } + else { + selectedtext += "\t"; + } + } + + item = databasemodel->itemFromIndex(proxymodel->mapToSource(selectedindexes[i])); + if (item) { + itemtext = item->text().toStdString(); + selectedtext += stripHTML(itemtext).c_str(); + } + } + selectedtext += "\n"; + QApplication::clipboard()->setText(selectedtext); + } + event->accept(); } @@ -472,6 +502,7 @@ void cModificationsWidget::openDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); database->setModel(0); proxymodel->setSourceModel(0); @@ -564,6 +595,7 @@ bool cModificationsWidget::saveDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); cFragmentIonType modification; modifications.clear(); @@ -777,6 +809,7 @@ void cModificationsWidget::importDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); database->setModel(0); proxymodel->setSourceModel(0); diff --git a/CycloBranch/gui/cMultipleDatasetsTableProxyModel.cpp b/CycloBranch/gui/cMultipleDatasetsTableProxyModel.cpp new file mode 100644 index 0000000..bcb2654 --- /dev/null +++ b/CycloBranch/gui/cMultipleDatasetsTableProxyModel.cpp @@ -0,0 +1,35 @@ +#include "gui/cMultipleDatasetsTableProxyModel.h" + + +cMultipleDatasetsTableProxyModel::cMultipleDatasetsTableProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { + // nothing to do +} + + +bool cMultipleDatasetsTableProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { + QVariant leftData = sourceModel()->data(left); + QVariant rightData = sourceModel()->data(right); + + if (leftData.toString().isEmpty()) { + return (sortOrder() == Qt::AscendingOrder) ? false : true; + } + + if (rightData.toString().isEmpty()) { + return (sortOrder() == Qt::AscendingOrder) ? true : false; + } + + if (leftData.type() == QVariant::ByteArray) { + return leftData.toDouble() < rightData.toDouble(); + } + + if (leftData.type() == QVariant::String) { + return leftData.toString().toLower() < rightData.toString().toLower(); + } + + if (leftData.type() == QVariant::Int) { + return leftData.toInt() < rightData.toInt(); + } + + return QSortFilterProxyModel::lessThan(left, right); +} + diff --git a/CycloBranch/gui/cMultipleDatasetsTableProxyModel.h b/CycloBranch/gui/cMultipleDatasetsTableProxyModel.h new file mode 100644 index 0000000..84e5abf --- /dev/null +++ b/CycloBranch/gui/cMultipleDatasetsTableProxyModel.h @@ -0,0 +1,47 @@ +/** + \file cMultipleDatasetsTableProxyModel.h + \brief A table proxy model. +*/ + + +#ifndef _CMULTIPLEDATASETSTABLEPROXYMODEL_H +#define _CMULTIPLEDATASETSTABLEPROXYMODEL_H + +#include +#include +#include +#include +#include +#include "core/cParameters.h" + + +/** + \brief A table proxy model. +*/ +class cMultipleDatasetsTableProxyModel : public QSortFilterProxyModel { + + Q_OBJECT + +public: + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + cMultipleDatasetsTableProxyModel(QObject *parent = 0); + +protected: + + /** + \brief Reimplementation of lessThan. + \param left QModelIndex + \param right QModelIndex + \retval bool bool + */ + bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; + +}; + + +#endif + diff --git a/CycloBranch/gui/cMultipleDatasetsTableWidget.cpp b/CycloBranch/gui/cMultipleDatasetsTableWidget.cpp new file mode 100644 index 0000000..07b2ea9 --- /dev/null +++ b/CycloBranch/gui/cMultipleDatasetsTableWidget.cpp @@ -0,0 +1,2891 @@ +#include "gui/cMultipleDatasetsTableWidget.h" +#include "core/cParameters.h" +#include "core/cTheoreticalSpectrumList.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +void calculateLineParameterA(vector& x, vector& y, double& a) { + size_t size = x.size(); + double tmp = 0; + + if (size < 1) { + return; + } + + a = 0; + for (size_t i = 0; i < size; i++) { + a += x[i] * y[i]; + tmp += x[i] * x[i]; + } + + if (tmp != 0) { + a /= tmp; + } + else { + a = 1; + } +} + + +void calculateLineParameters(vector& x, vector& y, double& a, double& b) { + int xsize = (int)x.size(); + int ysize = (int)y.size(); + + a = 1; + b = 0; + + if (xsize != ysize) { + return; + } + + //for (int i = 0; i < xsize; i++) { + // cout << x[i] << " " << y[i] << endl; + //} + //cout << endl; + + double sumx; + double sumx2; + + double sumy; + double sumxy; + + double n = xsize + 1; + double tmp; + + sumx = 0; + sumx2 = 0; + + sumy = 0; + sumxy = 0; + + for (int j = 0; j < xsize; j++) { + sumx += x[j]; + sumx2 += x[j] * x[j]; + + sumy += y[j]; + sumxy += x[j] * y[j]; + } + + a = sumxy * n - sumy * sumx; + tmp = sumx2 * n - sumx * sumx; + if (tmp == 0) { + return; + } + a /= tmp; + + b = sumy - a * sumx; + tmp = n; + if (tmp == 0) { + return; + } + b /= tmp; + + //cout << "a: " << a << ", "; + //cout << "b: " << b << endl; +} + + +void calculateLineParametersWithIterations(vector& x, vector& y, int iterations, double& a, double& b) { + int xsize = (int)x.size(); + int ysize = (int)y.size(); + + a = 1; + b = 0; + + if (xsize != ysize) { + return; + } + + //for (int i = 0; i < xsize; i++) { + // cout << x[i] << " " << y[i] << endl; + //} + //cout << endl; + + double sumy2; + + double sumx; + double sumx2; + + double sumy; + double sumxy; + + double y2; + double tmp; + + double S; + double oldS = DBL_MAX; + double olda, oldb; + + for (int i = 0; i < iterations; i++) { + + sumy2 = 0; + + sumx = 0; + sumx2 = 0; + + sumy = 0; + sumxy = 0; + + y2 = 0; + + for (int j = 0; j < xsize; j++) { + if (i == 0) { + y2 = y[j] * y[j]; + } + else { + y2 = a * x[j] + b; + y2 *= y2; + } + + sumy2 += y2; + + sumx += x[j] * y2; + sumx2 += x[j] * x[j] * y2; + + sumy += y[j] * y2; + sumxy += x[j] * y[j] * y2; + } + + a = sumxy * sumy2 - sumy * sumx; + tmp = sumx2 * sumy2 - sumx * sumx; + if (tmp == 0) { + return; + } + a /= tmp; + + b = sumy - a * sumx; + tmp = sumy2; + if (tmp == 0) { + return; + } + b /= tmp; + + //b = 0; + + //cout << "iteration: " << i + 1 << ", "; + //cout << "a: " << a << ", "; + //cout << "b: " << b << endl; + + S = 0; + for (int j = 0; j < xsize; j++) { + tmp = y[j] - (a * x[j] + b); + S += tmp * tmp; + } + + //cout << "iteration: " << i + 1 << ", "; + //cout << "S: " << S << ", oldS: " << oldS << endl; + //cout << endl; + + if (i > 0) { + if (oldS <= S) { + a = olda; + b = oldb; + return; + } + } + + olda = a; + oldb = b; + oldS = S; + + } + + //cout << endl; +} + + +cMultipleDatasetsTableWidget::cMultipleDatasetsTableWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { + title = "Annotated Features Overview"; + + this->globalpreferences = globalpreferences; + this->parent = parent; + + parameters = 0; + listoftheoreticalspectra = 0; + + setWindowTitle(title); + setWindowIcon(QIcon(":/images/icons/features.png")); + + pubchemsearchwidget = new cPubChemSearchWidget(); + pubchemsearchwidget->hide(); + + definecalibrationwidget = new cDefineCalibrationWidget(); + definecalibrationwidget->hide(); + + connect(definecalibrationwidget, SIGNAL(calibrationRedefined()), this, SLOT(calibrationCurveRedefined())); + + calibrationchartwidget = new cCalibrationChart(globalpreferences, this); + calibrationchartwidget->hide(); + + menuBar = new QMenuBar(this); + menuBar->setNativeMenuBar(false); + menuFile = new QMenu(tr("&File"), this); + menuSearch = new QMenu(tr("&Search"), this); + menuHelp = new QMenu(tr("&Help"), this); + + datatypelabel = new QLabel(); + datatypelabel->setText("View: "); + + comboboxdatatype = new QComboBox(); + comboboxdatatype->setToolTip("Select data to be displayed."); + comboboxdatatype->setSizeAdjustPolicy(QComboBox::AdjustToContents); + connect(comboboxdatatype, SIGNAL(currentIndexChanged(int)), this, SLOT(dataTypeViewChanged(int))); + + datatypehboxlayout = new QHBoxLayout(); + datatypehboxlayout->addWidget(datatypelabel); + datatypehboxlayout->addWidget(comboboxdatatype); + + datatypewidget = new QWidget(); + datatypewidget->setLayout(datatypehboxlayout); + + peakshapelabel = new QLabel(); + peakshapelabel->setText("Peak Shape: "); + + comboboxpeakshape = new QComboBox(); + comboboxpeakshape->setToolTip("Select chromatographic peak shape to be used for area and concentration calculations:\nGaussian = basic Gaussian function,\nex-Gaussian (tailing) = Exponentially Modified Gaussian for chromatographic peaks with tailing,\nex-Gaussian (fronting) = Exponentially Modified Gaussian for chromatographic peaks with fronting."); + comboboxpeakshape->setSizeAdjustPolicy(QComboBox::AdjustToContents); + comboboxpeakshape->addItem("Gaussian"); + comboboxpeakshape->addItem("ex-Gaussian (tailing)"); + comboboxpeakshape->addItem("ex-Gaussian (fronting)"); + connect(comboboxpeakshape, SIGNAL(currentIndexChanged(int)), this, SLOT(peakShapeChanged(int))); + + peakshapehboxlayout = new QHBoxLayout(); + peakshapehboxlayout->addWidget(peakshapelabel); + peakshapehboxlayout->addWidget(comboboxpeakshape); + + peakshapewidget = new QWidget(); + peakshapewidget->setLayout(peakshapehboxlayout); + + standardlabel = new QLabel(); + standardlabel->setText("Standard: "); + + comboboxstandard = new QComboBox(); + comboboxstandard->setToolTip("Select compound standard."); + comboboxstandard->addItem("None"); + comboboxstandard->setSizeAdjustPolicy(QComboBox::AdjustToContents); + connect(comboboxstandard, SIGNAL(currentIndexChanged(int)), this, SLOT(standardChanged(int))); + + standardhboxlayout = new QHBoxLayout(); + standardhboxlayout->addWidget(standardlabel); + standardhboxlayout->addWidget(comboboxstandard); + + standardwidget = new QWidget(); + standardwidget->setLayout(standardhboxlayout); + + calibrationlabely = new QLabel(); + calibrationlabely->setText("Calibration Curve: y = "); + + calibrationspinboxa = new QDoubleSpinBox(); + calibrationspinboxa->setRange(-DBL_MAX, DBL_MAX); + calibrationspinboxa->setDecimals(6); + calibrationspinboxa->setValue(1); + calibrationspinboxa->setToolTip("Enter the value of 'a' in the calibration curve 'y = a*x + b'."); + + calibrationlabelx = new QLabel(); + calibrationlabelx->setText(" * x + "); + + calibrationspinboxb = new QDoubleSpinBox(); + calibrationspinboxb->setRange(-DBL_MAX, DBL_MAX); + calibrationspinboxb->setDecimals(6); + calibrationspinboxb->setValue(0); + calibrationspinboxb->setToolTip("Enter the value of 'b' in the calibration curve 'y = a*x + b'."); + + calibrationsetbutton = new QPushButton("Set"); + calibrationsetbutton->setToolTip("Set the calibration curve and recalculate the table."); + connect(calibrationsetbutton, SIGNAL(released()), this, SLOT(calibrationSetButtonReleased())); + + calibrationdefinebutton = new QPushButton("Define"); + calibrationdefinebutton->setToolTip("Define samples, calibration curve and recalculate the table."); + connect(calibrationdefinebutton, SIGNAL(released()), this, SLOT(calibrationDefineButtonReleased())); + + calibrationviewbutton = new QPushButton("View"); + calibrationviewbutton->setToolTip("View the calibration curve and statistics."); + connect(calibrationviewbutton, SIGNAL(released()), this, SLOT(calibrationViewButtonReleased())); + + calibrationhboxlayout = new QHBoxLayout(); + calibrationhboxlayout->addWidget(calibrationlabely); + calibrationhboxlayout->addWidget(calibrationspinboxa); + calibrationhboxlayout->addWidget(calibrationlabelx); + calibrationhboxlayout->addWidget(calibrationspinboxb); + calibrationhboxlayout->addWidget(calibrationsetbutton); + calibrationhboxlayout->addWidget(calibrationdefinebutton); + calibrationhboxlayout->addWidget(calibrationviewbutton); + + calibrationwidget = new QWidget(); + calibrationwidget->setLayout(calibrationhboxlayout); + + database = new QTableView(this); + databasemodel = new QStandardItemModel(0, 0, this); + proxymodel = new cMultipleDatasetsTableProxyModel(this); + proxymodel->setSourceModel(databasemodel); + proxymodel->setDynamicSortFilter(false); + database->setModel(proxymodel); + database->setSortingEnabled(true); + database->setSelectionBehavior(QAbstractItemView::SelectItems); + database->setSelectionMode(QAbstractItemView::ContiguousSelection); + database->setEditTriggers(QAbstractItemView::NoEditTriggers); + database->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); + database->horizontalHeader()->setSectionsMovable(true); + //database->verticalHeader()->setDefaultSectionSize(30); + connect(database, SIGNAL(clicked(const QModelIndex&)), this, SLOT(rowClicked(const QModelIndex&))); + + toolbarFile = addToolBar(tr("File")); + + 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); + connect(actionExportCSV, SIGNAL(triggered()), this, SLOT(exportToCsv())); + + actionExportDatabase = new QAction(QIcon(":/images/icons/db_export.png"), tr("Export to &Database"), this); + actionExportDatabase->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D)); + actionExportDatabase->setToolTip("Export to Database (Ctrl + D)"); + toolbarFile->addAction(actionExportDatabase); + connect(actionExportDatabase, SIGNAL(triggered()), this, SLOT(exportToDatabase())); + + actionCloseWindow = new QAction(QIcon(":/images/icons/33.png"), tr("&Close"), this); + actionCloseWindow->setShortcut(QKeySequence(Qt::Key_Escape)); + actionCloseWindow->setToolTip("Close (Esc)"); + toolbarFile->addAction(actionCloseWindow); + connect(actionCloseWindow, SIGNAL(triggered()), this, SLOT(closeWindow())); + + toolbarSearch = addToolBar(tr("Search")); + + actionSearchPubChem = new QAction(QIcon(":/images/icons/search.png"), tr("Search &PubChem..."), this); + actionSearchPubChem->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); + actionSearchPubChem->setToolTip("Search PubChem... (Ctrl + P)"); + toolbarSearch->addAction(actionSearchPubChem); + connect(actionSearchPubChem, SIGNAL(triggered()), this, SLOT(searchPubChem())); + + toolbarHelp = addToolBar(tr("Help")); + + actionHTMLDocumentation = new QAction(QIcon(":/images/icons/3.png"), tr("&HTML Documentation"), this); + actionHTMLDocumentation->setShortcut(QKeySequence(Qt::Key_F1)); + actionHTMLDocumentation->setToolTip("Show HTML Documentation (F1)"); + toolbarHelp->addAction(actionHTMLDocumentation); + connect(actionHTMLDocumentation, SIGNAL(triggered()), this, SLOT(showHTMLDocumentation())); + + addToolBarBreak(); + + toolbarView = addToolBar(tr("View")); + toolbarView->addWidget(datatypewidget); + toolbarView->addWidget(peakshapewidget); + toolbarView->addWidget(standardwidget); + + addToolBarBreak(); + + toolbarCalibration = addToolBar(tr("Calibration")); + toolbarCalibration->addWidget(calibrationwidget); + + menuFile->addAction(actionExportCSV); + menuFile->addAction(actionExportDatabase); + menuFile->addSeparator(); + menuFile->addAction(actionCloseWindow); + + menuSearch->addAction(actionSearchPubChem); + + menuHelp->addAction(actionHTMLDocumentation); + + menuBar->addMenu(menuFile); + menuBar->addMenu(menuSearch); + menuBar->addMenu(menuHelp); + + setMenuBar(menuBar); + + mainlayout = new QVBoxLayout(); + mainlayout->addWidget(database); + + mainwidget = new QWidget(); + mainwidget->setLayout(mainlayout); + + setCentralWidget(mainwidget); + + resize(defaultwinsizex, defaultwinsizey); + + applyGlobalPreferences(globalpreferences); + + identifieditems.clear(); + identifieditemswithmultimap.clear(); + + activefileid = 0; + + // default datatypeview cannot be relative intensity + // updateTable causes a bug if multiple peaks have 100% relative intensity + datatypeview = 1; + + peakshape = 0; + standard = 0; + calibrationa = 1; + calibrationb = 0; + systemcolumns = 0; +} + + +cMultipleDatasetsTableWidget::~cMultipleDatasetsTableWidget() { + deleteTable(); + + delete datatypelabel; + delete comboboxdatatype; + delete datatypehboxlayout; + delete datatypewidget; + + delete peakshapelabel; + delete comboboxpeakshape; + delete peakshapehboxlayout; + delete peakshapewidget; + + delete standardlabel; + delete comboboxstandard; + delete standardhboxlayout; + delete standardwidget; + + delete calibrationlabely; + delete calibrationspinboxa; + delete calibrationlabelx; + delete calibrationspinboxb; + delete calibrationsetbutton; + delete calibrationdefinebutton; + delete calibrationviewbutton; + delete calibrationhboxlayout; + delete calibrationwidget; + + delete pubchemsearchwidget; + delete definecalibrationwidget; + delete calibrationchartwidget; + + delete databasemodel; + delete proxymodel; + delete database; + delete mainlayout; + delete mainwidget; + + delete actionExportCSV; + delete actionExportDatabase; + delete actionCloseWindow; + delete actionSearchPubChem; + delete actionHTMLDocumentation; + + delete menuFile; + delete menuSearch; + delete menuHelp; + + delete menuBar; +} + + +void cMultipleDatasetsTableWidget::closeEvent(QCloseEvent *event) { + closeWindow(); + event->accept(); +} + + +bool cMultipleDatasetsTableWidget::prepareToShow(cParameters* parameters, cTheoreticalSpectrumList* listoftheoreticalspectra, int activefileid) { + QMessageBox msgBox; + QString errstr; + + if (!parameters || !listoftheoreticalspectra || (listoftheoreticalspectra->size() == 0) || (activefileid >= listoftheoreticalspectra->size())) { + QString errstr = "Nothing to show. Perform an analysis first (MS, LC-MS or MSI) !"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + + if ((parameters->mode != dereplication) && (parameters->mode != compoundsearch)) { + QString errstr = "This feature is available only for MS, LC-MS, and MSI data."; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + + this->parameters = parameters; + this->listoftheoreticalspectra = listoftheoreticalspectra; + this->activefileid = activefileid; + + int numberofdatasets = listoftheoreticalspectra->size(); + + deleteTable(); + + if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { + comboboxdatatype->blockSignals(true); + + comboboxdatatype->clear(); + comboboxdatatype->addItem("Maximum Relative Intensity"); + comboboxdatatype->addItem("Maximum Absolute Intensity"); + + if ((parameters->peaklistfileformats[activefileid] != mis) && (parameters->peaklistfileformats[activefileid] != imzML)) { + comboboxdatatype->addItem("Peak Area (Chromatogram) - All Isotopes"); + comboboxdatatype->addItem("Concentration - All Isotopes"); + comboboxdatatype->addItem("Peak Area (Chromatogram) - Highest Peak"); + comboboxdatatype->addItem("Concentration - Highest Peak"); + + standardlabel->show(); + comboboxstandard->show(); + + peakshapelabel->show(); + comboboxpeakshape->show(); + + toolbarCalibration->show(); + + calibrationlabely->show(); + calibrationspinboxa->show(); + calibrationlabelx->show(); + calibrationspinboxb->show(); + calibrationsetbutton->show(); + calibrationdefinebutton->show(); + calibrationviewbutton->show(); + } + else { + standardlabel->hide(); + comboboxstandard->hide(); + + peakshapelabel->hide(); + comboboxpeakshape->hide(); + + toolbarCalibration->hide(); + + calibrationlabely->hide(); + calibrationspinboxa->hide(); + calibrationlabelx->hide(); + calibrationspinboxb->hide(); + calibrationsetbutton->hide(); + calibrationdefinebutton->hide(); + calibrationviewbutton->hide(); + } + + // default datatypeview cannot be relative intensity + // updateTable causes a bug if multiple peaks have 100% relative intensity + if (datatypeview == 0) { + datatypeview = 1; + } + + if (datatypeview < comboboxdatatype->count()) { + comboboxdatatype->setCurrentIndex(datatypeview); + } + + comboboxdatatype->blockSignals(false); + } + + string tmpstr; + size_t pos; + + if (parameters->mode == dereplication) { + systemcolumns = 6; + } + else { + systemcolumns = 5; + } + + int currentcolumn = 0; + + databasemodel->setColumnCount(numberofdatasets + systemcolumns); + + if (parameters->mode == dereplication) { + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Name"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + } + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Ion Type"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Formula (M)"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical m/z"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("PubChem Results"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + databasemodel->horizontalHeaderItem(currentcolumn)->setText("Num. of Datasets"); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + + for (int i = 0; i < numberofdatasets; i++) { + databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); + + tmpstr = parameters->peaklistfilenames[i]; + pos = tmpstr.rfind('/'); + if (pos != string::npos) { + pos = tmpstr.substr(0, pos).rfind('/'); + if (pos != string::npos) { + tmpstr = tmpstr.substr(pos + 1); + } + } + + databasemodel->horizontalHeaderItem(currentcolumn)->setText(tmpstr.c_str()); + database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); + currentcolumn++; + } + + // prepare the data + identifieditems.clear(); + identifieditemswithmultimap.clear(); + + vector< vector > rtimes; + vector rtimeunits; + + cTheoreticalSpectrum* currentspectrum; + cPeak* currentpeak; + int sizei, sizej, sizek; + string compounddesc; + + sizei = listoftheoreticalspectra->size(); + rtimes.resize(sizei); + rtimeunits.resize(sizei); + + for (int i = 0; i < sizei; i++) { + + sizej = listoftheoreticalspectra->size(i); + rtimes[i].resize(sizej); + + for (int j = 0; j < sizej; j++) { + rtimes[i][j] = listoftheoreticalspectra->get(i, j).getExperimentalSpectrum().getRetentionTime(); + + if (j == 0) { + rtimeunits[i] = listoftheoreticalspectra->get(i, j).getExperimentalSpectrum().getRetentionTimeUnit(); + } + + currentspectrum = &(listoftheoreticalspectra->get(i, j)); + sizek = currentspectrum->getNumberOfPeaks(); + for (int k = 0; k < sizek; k++) { + currentpeak = &((*currentspectrum)[k]); + if (currentpeak->matched) { + if (parameters->generateisotopepattern) { + // nothing to do - the highest intensity peak (non-isotopic) is selected automatically below + } + else { + if (currentpeak->isotope) { + continue; + } + } + + compounddesc.clear(); + if (currentpeak->descriptionid != -1) { + currentpeak->description = parameters->peakidtodesc[currentpeak->descriptionid]; + + pos = currentpeak->description.find('>'); + if (pos != string::npos) { + tmpstr = currentpeak->description.substr(pos + 1); + pos = tmpstr.rfind('<'); + if (pos != string::npos) { + compounddesc = tmpstr.substr(0, pos); + } + } + + pos = currentpeak->description.find(" <"); + if (pos != string::npos) { + compounddesc += "\t"; + compounddesc += currentpeak->description.substr(0, pos); + } + + if (parameters->mode == dereplication) { + if ((currentpeak->compoundid >= 0) && (currentpeak->compoundid < parameters->sequencedatabase.size())) { + compounddesc += "\t"; + compounddesc += parameters->sequencedatabase[currentpeak->compoundid].getSummaryFormula(); + } + } + + compounddesc += "\t"; + + identifieditemswithmultimap[compounddesc].insert(make_pair(i, make_pair(j, k))); + } + } + } + } + } + + map tempmap; + + for (auto& it : identifieditemswithmultimap) { + + for (int i = 0; i < sizei; i++) { + + pair< multimap >::iterator, multimap >::iterator> result = identifieditemswithmultimap[it.first].equal_range(i); + tempmap.clear(); + + for (multimap >::iterator it2 = result.first; it2 != result.second; it2++) { + if (tempmap.count(it2->second.first) == 1) { + if (listoftheoreticalspectra->get(i, it2->second.first)[it2->second.second].relativeintensity > listoftheoreticalspectra->get(i, it2->second.first)[tempmap[it2->second.first]].relativeintensity) { + tempmap[it2->second.first] = it2->second.second; + } + } + else { + tempmap[it2->second.first] = it2->second.second; + } + } + + for (auto& it2 : tempmap) { + if (identifieditems[it.first].count(i) == 1) { + if (listoftheoreticalspectra->get(i, it2.first)[it2.second].matchedabsoluteintensity > listoftheoreticalspectra->get(i, identifieditems[it.first][i].first)[identifieditems[it.first][i].second].matchedabsoluteintensity) { + identifieditems[it.first][i] = make_pair(it2.first, it2.second); + } + } + else { + identifieditems[it.first][i] = make_pair(it2.first, it2.second); + } + } + + } + + } + + int numberofrows = (int)identifieditems.size(); + if (numberofrows > 50000) { + QMessageBox::StandardButton reply; + string msg = "The table contains " + to_string(numberofrows) + " rows. Do you wish to continue ?\n\nTip: Re-run the search using adjusted search settings to limit the number of rows. You may increase the minimum threshold of relative peak intensity, the minimum m/z ratio, decrease the m/z error tolerance or limit the number of selected ion types in theoretical spectra."; + reply = QMessageBox::question(this, appname, msg.c_str(), QMessageBox::Yes | QMessageBox::No); + if (reply == QMessageBox::No) { + return false; + } + } + + // fill the data + QProgressDialog* progress; + cEventFilter filter; + + progress = new QProgressDialog("Preparing the data...", "Cancel", 0, numberofrows, this); + progress->setMinimumWidth(250); + progress->installEventFilter(&filter); + progress->setMinimumDuration(0); + progress->setWindowModality(Qt::ApplicationModal); + progress->setValue(0); + + database->setModel(0); + proxymodel->setSourceModel(0); + database->setSortingEnabled(false); + + double value; + int hits; + int currentrow = 0; + string datastr; + + cPeaksList eicchromatogram; + vector nys; + vector sigmas; + vector as; + vector bases; + vector taus; + + double maxheight; + int tmpsize; + bool badhit; + + bool fronting = false; + if (peakshape == 2) { + fronting = true; + } + + for (auto& it : identifieditems) { + + progress->setValue(currentrow); + + currentrow = databasemodel->rowCount(); + currentcolumn = 0; + + databasemodel->insertRow(currentrow); + + if (parameters->mode == dereplication) { + datastr.clear(); + tmpstr = it.first; + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setText(datastr.c_str()); + currentcolumn++; + + datastr.clear(); + tmpstr = tmpstr.substr(pos + 1); + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setText(datastr.c_str()); + currentcolumn++; + + datastr.clear(); + tmpstr = tmpstr.substr(pos + 1); + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setText(datastr.c_str()); + currentcolumn++; + } + else { + datastr.clear(); + tmpstr = it.first; + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->setItem(currentrow, 1, new QStandardItem()); + databasemodel->item(currentrow, 1)->setText(datastr.c_str()); + + datastr.clear(); + tmpstr = tmpstr.substr(pos + 1); + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->setItem(currentrow, 0, new QStandardItem()); + databasemodel->item(currentrow, 0)->setText(datastr.c_str()); + + currentcolumn += 2; + } + + value = listoftheoreticalspectra->get(it.second.begin()->first, it.second.begin()->second.first)[it.second.begin()->second.second].mzratio; + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + datastr = databasemodel->item(currentrow, currentcolumn - 2)->text().toStdString(); + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + if (parameters->pchemresults.count(datastr) == 1) { + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(parameters->pchemresults[datastr]), Qt::DisplayRole); + } + currentcolumn++; + + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + currentcolumn++; + + hits = 0; + for (int i = systemcolumns; i < numberofdatasets + systemcolumns; i++) { + value = 0; + if (it.second.count(i - systemcolumns) > 0) { + switch (datatypeview) { + case 0: + value = listoftheoreticalspectra->get(i - systemcolumns, it.second[i - systemcolumns].first)[it.second[i - systemcolumns].second].matchedrelativeintensity; + break; + case 1: + value = listoftheoreticalspectra->get(i - systemcolumns, it.second[i - systemcolumns].first)[it.second[i - systemcolumns].second].matchedabsoluteintensity; + break; + case 2: + case 3: + getEICFromMultiMap(i - systemcolumns, identifieditemswithmultimap[it.first], eicchromatogram, false); + + calculateGaussianParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, nys, sigmas, as); + + if (peakshape > 0) { + calculateExponentialParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, fronting, 1.0, bases, taus); + } + + badhit = false; + + maxheight = 0; + tmpsize = eicchromatogram.size(); + for (int j = 0; j < tmpsize; j++) { + if (eicchromatogram[j].absoluteintensity > maxheight) { + maxheight = eicchromatogram[j].absoluteintensity; + } + } + + tmpsize = (int)nys.size(); + for (int j = 0; j < tmpsize; j++) { + if (as[j] > 2 * maxheight) { + nys[j] = 0; + sigmas[j] = 0; + as[j] = 0; + badhit = true; + } + } + + if (peakshape == 0) { + value = getGaussianAreas(sigmas, as); + } + else { + value = getExponentiallyModifiedGaussianAreas(nys, as, nys, sigmas, taus, fronting); + if (value == 0) { + badhit = true; + } + } + + if (badhit) { + value = -1; + } + break; + case 4: + case 5: + getEICFromMultiMap(i - systemcolumns, identifieditemswithmultimap[it.first], eicchromatogram, true); + calculateGaussianParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, nys, sigmas, as); + + if (peakshape > 0) { + calculateExponentialParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, fronting, 1.0, bases, taus); + } + + badhit = false; + + maxheight = 0; + tmpsize = eicchromatogram.size(); + for (int j = 0; j < tmpsize; j++) { + if (eicchromatogram[j].absoluteintensity > maxheight) { + maxheight = eicchromatogram[j].absoluteintensity; + } + } + + tmpsize = (int)nys.size(); + for (int j = 0; j < tmpsize; j++) { + if (as[j] > 2 * maxheight) { + nys[j] = 0; + sigmas[j] = 0; + as[j] = 0; + badhit = true; + } + } + + if (peakshape == 0) { + value = getGaussianAreas(sigmas, as); + } + else { + value = getExponentiallyModifiedGaussianAreas(nys, as, nys, sigmas, taus, fronting); + if (value == 0) { + badhit = true; + } + } + + if (badhit) { + value = -1; + } + break; + default: + break; + } + } + + databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); + + if (value != 0) { + //databasemodel->item(currentrow, currentcolumn)->setBackground(Qt::yellow); + hits++; + } + + if (value != 0) { + switch (datatypeview) { + case 0: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 1: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 2: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 3: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 4: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 5: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + default: + break; + } + } + + currentcolumn++; + } + + databasemodel->item(currentrow, systemcolumns - 1)->setData(QVariant::fromValue(hits), Qt::DisplayRole); + + if (progress->wasCanceled()) { + deleteTable(); + emit tableCancelled(); + break; + } + + } + + double stdvalue; + if (!progress->wasCanceled()) { + + if ((datatypeview == 2) || (datatypeview == 4)) { + if (standard > 0) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + stdvalue = 0; + if (databasemodel->item(standard - 1, j) && (databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble() > 0)) { + stdvalue = databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble(); + } + + for (int i = 0; i < databasemodel->rowCount(); i++) { + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() > 0)) { + if (stdvalue > 0) { + value = databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() / stdvalue; + databasemodel->item(i, j)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + } + else { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + } + } + } + + if ((datatypeview == 3) || (datatypeview == 5)) { + // standard selected + if (standard > 0) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + stdvalue = 0; + if (databasemodel->item(standard - 1, j) && (databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble() > 0)) { + stdvalue = databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble(); + } + + for (int i = 0; i < databasemodel->rowCount(); i++) { + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() > 0)) { + if ((stdvalue > 0) && (calibrationa > 0)) { + value = databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() / stdvalue; + value = (value - calibrationb) / calibrationa; + databasemodel->item(i, j)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + } + else { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + } + } + // standard not selected + else { + for (int i = 0; i < databasemodel->rowCount(); i++) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + value = 0; + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() > 0)) { + value = databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble(); + + if (calibrationa > 0) { + value = (value - calibrationb) / calibrationa; + databasemodel->item(i, j)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + } + else { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + } + } + } + + // clear badhits + concentrations below zero + for (int i = 0; i < databasemodel->rowCount(); i++) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() < 0)) { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + + } + + proxymodel->setSourceModel(databasemodel); + database->setModel(proxymodel); + database->setSortingEnabled(true); + proxymodel->sort(-1); + + if (!progress->wasCanceled()) { + for (int i = 0; i < databasemodel->columnCount(); i++) { + database->resizeColumnToContents(i); + } + } + + vector filenames; + for (int i = systemcolumns; i < numberofdatasets + systemcolumns; i++) { + filenames.push_back(databasemodel->horizontalHeaderItem(i)->text().toStdString()); + } + + vector compounds; + string compound; + int rowcount = databasemodel->rowCount(); + for (int i = 0; i < rowcount; i++) { + compound.clear(); + if (parameters->mode == dereplication) { + compound = databasemodel->item(i, 0)->text().toStdString(); + compound += ", "; + compound += databasemodel->item(i, 1)->text().toStdString(); + compound += ", "; + compound += databasemodel->item(i, 2)->text().toStdString(); + } + else { + compound = databasemodel->item(i, 0)->text().toStdString(); + compound += ", "; + compound += databasemodel->item(i, 1)->text().toStdString(); + } + compounds.push_back(compound); + } + + definecalibrationwidget->prepareWidget(filenames, compounds); + + vector tmpx; + vector tmpy; + + vector tmpsd; + + calibrationchartwidget->setLineParameters(0, calibrationa, calibrationb, tmpx, tmpy, tmpsd); + + progress->setValue(numberofrows); + delete progress; + + return true; +} + + +void cMultipleDatasetsTableWidget::updateTable() { + QMessageBox msgBox; + QString errstr; + + if (!parameters || !listoftheoreticalspectra || (listoftheoreticalspectra->size() == 0) || (activefileid >= listoftheoreticalspectra->size())) { + QString errstr = "Nothing to show. Perform an analysis first (MS, LC-MS or MSI) !"; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + if ((parameters->mode != dereplication) && (parameters->mode != compoundsearch)) { + QString errstr = "This feature is available only for MS, LC-MS, and MSI data."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + int numberofdatasets = listoftheoreticalspectra->size(); + + string tmpstr; + size_t pos; + + if (parameters->mode == dereplication) { + systemcolumns = 6; + } + else { + systemcolumns = 5; + } + + int currentcolumn = 0; + + vector< vector > rtimes; + vector rtimeunits; + + int sizei, sizej; + string compounddesc; + + sizei = listoftheoreticalspectra->size(); + rtimes.resize(sizei); + rtimeunits.resize(sizei); + for (int i = 0; i < sizei; i++) { + sizej = listoftheoreticalspectra->size(i); + rtimes[i].resize(sizej); + for (int j = 0; j < sizej; j++) { + rtimes[i][j] = listoftheoreticalspectra->get(i, j).getExperimentalSpectrum().getRetentionTime(); + + if (j == 0) { + rtimeunits[i] = listoftheoreticalspectra->get(i, j).getExperimentalSpectrum().getRetentionTimeUnit(); + } + } + } + + int numberofrows = (int)identifieditems.size(); + + // fill the data + QProgressDialog* progress; + cEventFilter filter; + + progress = new QProgressDialog("Updating the data...", /*"Cancel"*/0, 0, numberofrows, this); + progress->setMinimumWidth(250); + progress->installEventFilter(&filter); + progress->setMinimumDuration(0); + progress->setWindowModality(Qt::ApplicationModal); + progress->setValue(0); + + double value; + int hits; + int currentrow = -1; + string datastr; + + cPeaksList eicchromatogram; + vector nys; + vector sigmas; + vector as; + vector bases; + vector taus; + + double maxheight; + int tmpsize; + bool badhit; + + bool fronting = false; + if (peakshape == 2) { + fronting = true; + } + + for (auto& it : identifieditems) { + + progress->setValue(currentrow); + + currentrow++; + currentcolumn = 0; + + if (parameters->mode == dereplication) { + datastr.clear(); + tmpstr = it.first; + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->item(currentrow, currentcolumn)->setText(datastr.c_str()); + currentcolumn++; + + datastr.clear(); + tmpstr = tmpstr.substr(pos + 1); + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->item(currentrow, currentcolumn)->setText(datastr.c_str()); + currentcolumn++; + + datastr.clear(); + tmpstr = tmpstr.substr(pos + 1); + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->item(currentrow, currentcolumn)->setText(datastr.c_str()); + currentcolumn++; + } + else { + datastr.clear(); + tmpstr = it.first; + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->item(currentrow, 1)->setText(datastr.c_str()); + + datastr.clear(); + tmpstr = tmpstr.substr(pos + 1); + pos = tmpstr.find("\t"); + if (pos != string::npos) { + datastr = tmpstr.substr(0, pos); + } + + databasemodel->item(currentrow, 0)->setText(datastr.c_str()); + + currentcolumn += 2; + } + + value = listoftheoreticalspectra->get(it.second.begin()->first, it.second.begin()->second.first)[it.second.begin()->second.second].mzratio; + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + currentcolumn++; + + datastr = databasemodel->item(currentrow, currentcolumn - 2)->text().toStdString(); + if (parameters->pchemresults.count(datastr) == 1) { + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(parameters->pchemresults[datastr]), Qt::DisplayRole); + } + + currentcolumn += 2; + + hits = 0; + for (int i = systemcolumns; i < numberofdatasets + systemcolumns; i++) { + value = 0; + if (it.second.count(i - systemcolumns) > 0) { + switch (datatypeview) { + case 0: + value = listoftheoreticalspectra->get(i - systemcolumns, it.second[i - systemcolumns].first)[it.second[i - systemcolumns].second].matchedrelativeintensity; + break; + case 1: + value = listoftheoreticalspectra->get(i - systemcolumns, it.second[i - systemcolumns].first)[it.second[i - systemcolumns].second].matchedabsoluteintensity; + break; + case 2: + case 3: + getEICFromMultiMap(i - systemcolumns, identifieditemswithmultimap[it.first], eicchromatogram, false); + + calculateGaussianParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, nys, sigmas, as); + + if (peakshape > 0) { + calculateExponentialParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, fronting, 1.0, bases, taus); + } + + badhit = false; + + maxheight = 0; + tmpsize = eicchromatogram.size(); + for (int j = 0; j < tmpsize; j++) { + if (eicchromatogram[j].absoluteintensity > maxheight) { + maxheight = eicchromatogram[j].absoluteintensity; + } + } + + tmpsize = (int)nys.size(); + for (int j = 0; j < tmpsize; j++) { + if (as[j] > 2 * maxheight) { + nys[j] = 0; + sigmas[j] = 0; + as[j] = 0; + badhit = true; + } + } + + if (peakshape == 0) { + value = getGaussianAreas(sigmas, as); + } + else { + value = getExponentiallyModifiedGaussianAreas(nys, as, nys, sigmas, taus, fronting); + if (value == 0) { + badhit = true; + } + } + + if (badhit) { + value = -1; + } + break; + case 4: + case 5: + getEICFromMultiMap(i - systemcolumns, identifieditemswithmultimap[it.first], eicchromatogram, true); + calculateGaussianParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, nys, sigmas, as); + + if (peakshape > 0) { + calculateExponentialParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, fronting, 1.0, bases, taus); + } + + badhit = false; + + maxheight = 0; + tmpsize = eicchromatogram.size(); + for (int j = 0; j < tmpsize; j++) { + if (eicchromatogram[j].absoluteintensity > maxheight) { + maxheight = eicchromatogram[j].absoluteintensity; + } + } + + tmpsize = (int)nys.size(); + for (int j = 0; j < tmpsize; j++) { + if (as[j] > 2 * maxheight) { + nys[j] = 0; + sigmas[j] = 0; + as[j] = 0; + badhit = true; + } + } + + if (peakshape == 0) { + value = getGaussianAreas(sigmas, as); + } + else { + value = getExponentiallyModifiedGaussianAreas(nys, as, nys, sigmas, taus, fronting); + if (value == 0) { + badhit = true; + } + } + + if (badhit) { + value = -1; + } + break; + default: + break; + } + } + + if (value != 0) { + hits++; + } + + if (value != 0) { + switch (datatypeview) { + case 0: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 1: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 2: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 3: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 4: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + case 5: + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + break; + default: + break; + } + } + + currentcolumn++; + } + + databasemodel->item(currentrow, systemcolumns - 1)->setData(QVariant::fromValue(hits), Qt::DisplayRole); + + //if (progress->wasCanceled()) { + // break; + //} + + } + + double stdvalue; + //if (!progress->wasCanceled()) { + + if ((datatypeview == 2) || (datatypeview == 4)) { + if (standard > 0) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + stdvalue = 0; + if (databasemodel->item(standard - 1, j) && (databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble() > 0)) { + stdvalue = databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble(); + } + + for (int i = 0; i < databasemodel->rowCount(); i++) { + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() > 0)) { + if (stdvalue > 0) { + value = databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() / stdvalue; + databasemodel->item(i, j)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + } + else { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + } + } + } + + if ((datatypeview == 3) || (datatypeview == 5)) { + // standard selected + if (standard > 0) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + stdvalue = 0; + if (databasemodel->item(standard - 1, j) && (databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble() > 0)) { + stdvalue = databasemodel->item(standard - 1, j)->data(Qt::DisplayRole).toDouble(); + } + + for (int i = 0; i < databasemodel->rowCount(); i++) { + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() > 0)) { + if ((stdvalue > 0) && (calibrationa > 0)) { + value = databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() / stdvalue; + value = (value - calibrationb) / calibrationa; + databasemodel->item(i, j)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + } + else { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + } + } + // standard not selected + else { + for (int i = 0; i < databasemodel->rowCount(); i++) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + value = 0; + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() > 0)) { + value = databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble(); + + if (calibrationa > 0) { + value = (value - calibrationb) / calibrationa; + databasemodel->item(i, j)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(value)), Qt::DisplayRole); + } + else { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + } + } + } + + // clear badhits + concentrations below zero + for (int i = 0; i < databasemodel->rowCount(); i++) { + for (int j = systemcolumns; j < databasemodel->columnCount(); j++) { + if (databasemodel->item(i, j) && (databasemodel->item(i, j)->data(Qt::DisplayRole).toDouble() < 0)) { + databasemodel->item(i, j)->setText("DETECTED"); + } + } + } + + //} + + progress->setValue(numberofrows); + delete progress; + + if (database->selectionModel()->selectedIndexes().count() > 0) { + if (proxymodel->mapToSource(database->selectionModel()->selectedIndexes()[0]).column() >= systemcolumns) { + rowClicked(database->selectionModel()->selectedIndexes()[0]); + } + } +} + + +void cMultipleDatasetsTableWidget::resetStandard() { + standard = 0; +} + + +void cMultipleDatasetsTableWidget::updateListofStandards() { + if (!parameters) { + return; + } + + comboboxstandard->blockSignals(true); + comboboxstandard->clear(); + comboboxstandard->addItem("None"); + + string tmpstr; + for (int i = 0; i < databasemodel->rowCount(); i++) { + tmpstr.clear(); + + if (parameters->mode == dereplication) { + if (databasemodel->item(i, 0)) { + tmpstr += databasemodel->item(i, 0)->text().toStdString(); + tmpstr += ", "; + } + if (databasemodel->item(i, 1)) { + tmpstr += databasemodel->item(i, 1)->text().toStdString(); + tmpstr += ", "; + } + if (databasemodel->item(i, 2)) { + tmpstr += databasemodel->item(i, 2)->text().toStdString(); + } + + comboboxstandard->addItem(tmpstr.c_str()); + } + + if (parameters->mode == compoundsearch) { + if (databasemodel->item(i, 0)) { + tmpstr += databasemodel->item(i, 0)->text().toStdString(); + tmpstr += ", "; + } + if (databasemodel->item(i, 1)) { + tmpstr += databasemodel->item(i, 1)->text().toStdString(); + } + + comboboxstandard->addItem(tmpstr.c_str()); + } + } + + comboboxstandard->blockSignals(false); +} + + +void cMultipleDatasetsTableWidget::deleteTable() { + for (int i = 0; i < databasemodel->columnCount(); i++) { + if (database->itemDelegateForColumn(i)) { + delete database->itemDelegateForColumn(i); + } + } + databasemodel->clear(); +} + + +void cMultipleDatasetsTableWidget::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + if (lastdirexporttocsv.right(4).compare(".csv", Qt::CaseInsensitive) != 0) { + lastdirexporttocsv = globalpreferences->exportcsvdefaultdir; + } + if (lastdirexportdatabase.right(4).compare(".txt", Qt::CaseInsensitive) != 0) { + lastdirexportdatabase = globalpreferences->sequencesdefaultdir; + } + } +} + + +cPubChemSearchWidget* cMultipleDatasetsTableWidget::getPubChemSearchWidget() { + return pubchemsearchwidget; +} + + +cDefineCalibrationWidget* cMultipleDatasetsTableWidget::getDefineCalibrationWidget() { + return definecalibrationwidget; +} + + +cCalibrationChart* cMultipleDatasetsTableWidget::getCalibrationChartWidget() { + return calibrationchartwidget; +} + + +void cMultipleDatasetsTableWidget::getEICFromMultiMap(int datafileid, multimap >& compoundmultimap, cPeaksList& eicchromatogram, bool highestpeaks) { + eicchromatogram.clear(); + + int size = listoftheoreticalspectra->size(datafileid); + eicchromatogram.resize(size); + for (int i = 0; i < size; i++) { + eicchromatogram[i].clear(); + eicchromatogram[i].mzratio = (double)(i + 1); + eicchromatogram[i].absoluteintensity = 0; + } + + pair< multimap >::iterator, multimap >::iterator> result = compoundmultimap.equal_range(datafileid); + map tempmap; + + if (highestpeaks) { + for (multimap >::iterator it = result.first; it != result.second; it++) { + if (tempmap.count(it->second.first) == 1) { + if (listoftheoreticalspectra->get(datafileid, it->second.first)[it->second.second].relativeintensity > listoftheoreticalspectra->get(datafileid, it->second.first)[tempmap[it->second.first]].relativeintensity) { + tempmap[it->second.first] = it->second.second; + } + } + else { + tempmap[it->second.first] = it->second.second; + } + } + + for (auto& it : tempmap) { + if (listoftheoreticalspectra->get(datafileid, it.first)[it.second].matchedabsoluteintensity > eicchromatogram[it.first].absoluteintensity) { + eicchromatogram[it.first].absoluteintensity = listoftheoreticalspectra->get(datafileid, it.first)[it.second].matchedabsoluteintensity; + } + } + } + else { + for (multimap >::iterator it = result.first; it != result.second; it++) { + eicchromatogram[it->second.first].absoluteintensity += listoftheoreticalspectra->get(datafileid, it->second.first)[it->second.second].matchedabsoluteintensity; + } + } + + eicchromatogram.normalizeIntenzity(); +} + + +void cMultipleDatasetsTableWidget::keyPressEvent(QKeyEvent *event) { + if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { + if (calibrationspinboxa->hasFocus() || calibrationspinboxb->hasFocus() || calibrationsetbutton->hasFocus()) { + calibrationSetButtonReleased(); + } + else { + if (database->selectionModel()->selectedIndexes().count() > 0) { + rowClicked(database->selectionModel()->selectedIndexes()[0]); + } + } + } + + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C)) { + QModelIndexList selectedindexes = database->selectionModel()->selectedIndexes(); + QStandardItem* item; + + QString selectedtext; + string itemtext; + + int selectedcount = selectedindexes.count(); + for (int i = 0; i < selectedcount; i++) { + if (i > 0) { + if (proxymodel->mapToSource(selectedindexes[i - 1]).row() != proxymodel->mapToSource(selectedindexes[i]).row()) { + selectedtext += "\n"; + } + else { + selectedtext += "\t"; + } + } + + item = databasemodel->itemFromIndex(proxymodel->mapToSource(selectedindexes[i])); + if (item) { + itemtext = item->text().toStdString(); + selectedtext += stripHTML(itemtext).c_str(); + } + } + selectedtext += "\n"; + QApplication::clipboard()->setText(selectedtext); + } + + event->accept(); +} + + +void cMultipleDatasetsTableWidget::closeWindow() { + pubchemsearchwidget->hide(); + definecalibrationwidget->hide(); + calibrationchartwidget->hide(); + hide(); +} + + +void cMultipleDatasetsTableWidget::exportToCsv() { + QString filename = QFileDialog::getSaveFileName(this, tr("Export to CSV"), lastdirexporttocsv, tr("Files (*.csv)")); + + if (!filename.isEmpty()) { + lastdirexporttocsv = filename; + + QProgressDialog progress("Exporting CSV file...", "Cancel", 0, proxymodel->rowCount(), this); + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + + bool removefile = false; + QFile file(filename); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + return; + } + + QTextStream out(&file); + + for (int i = 0; i < databasemodel->columnCount(); i++) { + out << "\"" << databasemodel->horizontalHeaderItem(i)->text() << "\""; + if (i < databasemodel->columnCount() - 1) { + out << ","; + } + } + out << endl; + + QStandardItem* item; + string str; + for (int i = 0; i < proxymodel->rowCount(); i++) { + + for (int j = 0; j < databasemodel->columnCount(); j++) { + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, j))); + if (item) { + str = item->data(Qt::DisplayRole).toString().toStdString(); + out << "\"" << stripHTML(str).c_str() << "\""; + if (j < databasemodel->columnCount() - 1) { + out << ","; + } + } + else { + if (j < databasemodel->columnCount() - 1) { + out << ","; + } + } + } + out << endl; + + progress.setValue(i); + if (progress.wasCanceled()) { + removefile = true; + break; + } + + } + + file.close(); + + if (removefile) { + file.remove(); + } + + progress.setValue(proxymodel->rowCount()); + } +} + + +void cMultipleDatasetsTableWidget::exportToDatabase() { + + if (!parameters) { + return; + } + + if (parameters->mode != compoundsearch) { + QMessageBox msgBox; + QString msg = "The feature is available only in 'Compound Search - MS, LC-MS, MSI' mode !"; + msgBox.setText(msg); + msgBox.exec(); + return; + } + + QString filename = QFileDialog::getSaveFileName(this, tr("Export Database"), lastdirexportdatabase, tr("Files (*.txt)")); + + if (!filename.isEmpty()) { + lastdirexportdatabase = filename; + + set formulas; + QStandardItem* item; + + for (int i = 0; i < proxymodel->rowCount(); i++) { + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 1))); + if (item) { + formulas.insert(item->text().toStdString()); + } + } + + cSequenceDatabase seqdb; + cSequence seq; + + seq.setPeptideType(other); + for (auto& it : formulas) { + seq.setName(it); + seq.setSummaryFormula(it); + seqdb.push_back(seq); + } + + ofstream output; + output.open(filename.toStdString()); + seqdb.storeToPlainTextStream(output, false); + output.close(); + } + +} + + +void cMultipleDatasetsTableWidget::dataTypeViewChanged(int index) { + datatypeview = index; + updateTable(); + + vector tmpx; + vector tmpy; + + vector tmpsd; + + calibrationchartwidget->setLineParameters(0, calibrationa, calibrationb, tmpx, tmpy, tmpsd); +} + + +void cMultipleDatasetsTableWidget::peakShapeChanged(int index) { + peakshape = index; + updateTable(); + + vector tmpx; + vector tmpy; + + vector tmpsd; + + calibrationchartwidget->setLineParameters(0, calibrationa, calibrationb, tmpx, tmpy, tmpsd); +} + + +void cMultipleDatasetsTableWidget::standardChanged(int index) { + standard = index; + updateTable(); + + vector tmpx; + vector tmpy; + + vector tmpsd; + + calibrationchartwidget->setLineParameters(0, calibrationa, calibrationb, tmpx, tmpy, tmpsd); +} + + +void cMultipleDatasetsTableWidget::calibrationSetButtonReleased() { + calibrationa = calibrationspinboxa->value(); + calibrationb = calibrationspinboxb->value(); + updateTable(); + + vector tmpx; + vector tmpy; + + vector tmpsd; + + calibrationchartwidget->setLineParameters(0, calibrationa, calibrationb, tmpx, tmpy, tmpsd); +} + + +void cMultipleDatasetsTableWidget::calibrationDefineButtonReleased() { + definecalibrationwidget->show(); + definecalibrationwidget->activateWindow(); + if (definecalibrationwidget->isMinimized()) { + definecalibrationwidget->showNormal(); + } +} + + +void cMultipleDatasetsTableWidget::calibrationViewButtonReleased() { + calibrationchartwidget->show(); + calibrationchartwidget->activateWindow(); + if (calibrationchartwidget->isMinimized()) { + calibrationchartwidget->showNormal(); + } +} + + +void cMultipleDatasetsTableWidget::calibrationCurveRedefined() { + vector usedvector; + vector datatypes; + vector groupsvector; + vector concentrationsvector; + vector selectedionsvector; + + int equationtype; + double manuala; + double manualb; + int eictype; + int peakshapetype; + int standardtype; + + definecalibrationwidget->getData(usedvector, datatypes, groupsvector, concentrationsvector, selectedionsvector, equationtype, manuala, manualb, eictype, peakshapetype, standardtype); + + comboboxdatatype->blockSignals(true); + comboboxpeakshape->blockSignals(true); + comboboxstandard->blockSignals(true); + + if (eictype == 0) { + comboboxdatatype->setCurrentIndex(5); + datatypeview = 5; + } + // eictype == 1 + else { + comboboxdatatype->setCurrentIndex(3); + datatypeview = 3; + } + + comboboxpeakshape->setCurrentIndex(peakshapetype); + peakshape = peakshapetype; + + comboboxstandard->setCurrentIndex(standardtype); + standard = standardtype; + + comboboxdatatype->blockSignals(false); + comboboxpeakshape->blockSignals(false); + comboboxstandard->blockSignals(false); + + int selectedions = 0; + for (int i = 0; i < selectedionsvector.size(); i++) { + if (selectedionsvector[i]) { + selectedions++; + } + } + + if (selectedions == 0) { + return; + } + + int numberofdatasets = listoftheoreticalspectra->size(); + + vector< vector > rtimes; + vector rtimeunits; + + int sizei, sizej; + + sizei = listoftheoreticalspectra->size(); + rtimes.resize(sizei); + rtimeunits.resize(sizei); + for (int i = 0; i < sizei; i++) { + sizej = listoftheoreticalspectra->size(i); + rtimes[i].resize(sizej); + for (int j = 0; j < sizej; j++) { + rtimes[i][j] = listoftheoreticalspectra->get(i, j).getExperimentalSpectrum().getRetentionTime(); + + if (j == 0) { + rtimeunits[i] = listoftheoreticalspectra->get(i, j).getExperimentalSpectrum().getRetentionTimeUnit(); + } + } + } + + double value; + + cPeaksList eicchromatogram; + vector nys; + vector sigmas; + vector as; + vector bases; + vector taus; + + double maxheight; + int tmpsize; + bool badhit; + + bool fronting = false; + if (peakshape == 2) { + fronting = true; + } + + map calibrationareas; + multimap calibrationsubareas; + map calibrationcounts; + + map dataareas; + multimap datasubareas; + map datacounts; + + double stdarea; + double cumarea; + + int c, k; + + for (int i = systemcolumns; i < numberofdatasets + systemcolumns; i++) { + + if (usedvector[i - systemcolumns] == 0) { + continue; + } + + stdarea = 0; + cumarea = 0; + + k = 0; + + for (auto& it : identifieditems) { + + value = 0; + if (it.second.count(i - systemcolumns) > 0) { + + switch (datatypeview) { + case 2: + case 3: + getEICFromMultiMap(i - systemcolumns, identifieditemswithmultimap[it.first], eicchromatogram, false); + + calculateGaussianParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, nys, sigmas, as); + + if (peakshape > 0) { + calculateExponentialParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, fronting, 1.0, bases, taus); + } + + badhit = false; + + maxheight = 0; + tmpsize = eicchromatogram.size(); + for (int j = 0; j < tmpsize; j++) { + if (eicchromatogram[j].absoluteintensity > maxheight) { + maxheight = eicchromatogram[j].absoluteintensity; + } + } + + tmpsize = (int)nys.size(); + for (int j = 0; j < tmpsize; j++) { + if (as[j] > 2 * maxheight) { + nys[j] = 0; + sigmas[j] = 0; + as[j] = 0; + badhit = true; + } + } + + if (peakshape == 0) { + value = getGaussianAreas(sigmas, as); + } + else { + value = getExponentiallyModifiedGaussianAreas(nys, as, nys, sigmas, taus, fronting); + if (value == 0) { + badhit = true; + } + } + + if (badhit) { + value = -1; + } + break; + case 0: + case 1: + case 4: + case 5: + getEICFromMultiMap(i - systemcolumns, identifieditemswithmultimap[it.first], eicchromatogram, true); + calculateGaussianParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, nys, sigmas, as); + + if (peakshape > 0) { + calculateExponentialParameters(eicchromatogram, rtimes[i - systemcolumns], rtimeunits[i - systemcolumns], true, true, fronting, 1.0, bases, taus); + } + + badhit = false; + + maxheight = 0; + tmpsize = eicchromatogram.size(); + for (int j = 0; j < tmpsize; j++) { + if (eicchromatogram[j].absoluteintensity > maxheight) { + maxheight = eicchromatogram[j].absoluteintensity; + } + } + + tmpsize = (int)nys.size(); + for (int j = 0; j < tmpsize; j++) { + if (as[j] > 2 * maxheight) { + nys[j] = 0; + sigmas[j] = 0; + as[j] = 0; + badhit = true; + } + } + + if (peakshape == 0) { + value = getGaussianAreas(sigmas, as); + } + else { + value = getExponentiallyModifiedGaussianAreas(nys, as, nys, sigmas, taus, fronting); + if (value == 0) { + badhit = true; + } + } + + if (badhit) { + value = -1; + } + break; + default: + break; + } + + } + + if (value < 0) { + value = 0; + } + + if ((standard > 0) && (standard - 1 == k)) { + stdarea = value; + } + + if (selectedionsvector[k]) { + cumarea += value; + } + + k++; + + } + + if (datatypes[i - systemcolumns] == 0) { + + c = groupsvector[i - systemcolumns]; + + if (dataareas.count(c) == 0) { + if (stdarea > 0) { + dataareas[c] = cumarea / stdarea; + } + else { + dataareas[c] = cumarea; + } + } + else { + if (stdarea > 0) { + dataareas[c] += cumarea / stdarea; + } + else { + dataareas[c] += cumarea; + } + } + + if (stdarea > 0) { + datasubareas.insert(pair(c, cumarea / stdarea)); + } + else { + datasubareas.insert(pair(c, cumarea)); + } + + if (datacounts.count(c) == 0) { + datacounts[c] = 1; + } + else { + datacounts[c] += 1; + } + + } + else { + c = (int)(concentrationsvector[i - systemcolumns] * 1000.0); + + if (calibrationareas.count(c) == 0) { + if (stdarea > 0) { + calibrationareas[c] = cumarea / stdarea; + } + else { + calibrationareas[c] = cumarea; + } + } + else { + if (stdarea > 0) { + calibrationareas[c] += cumarea / stdarea; + } + else { + calibrationareas[c] += cumarea; + } + } + + if (stdarea > 0) { + calibrationsubareas.insert(pair(c, cumarea / stdarea)); + } + else { + calibrationsubareas.insert(pair(c, cumarea)); + } + + if (calibrationcounts.count(c) == 0) { + calibrationcounts[c] = 1; + } + else { + calibrationcounts[c] += 1; + } + } + + } + + double xvalue, yvalue, dev; + double avg; + + vector calibrationxvalues; + vector calibrationyvalues; + vector calibrationsd; + + //calibrationxvalues.push_back(0); + //calibrationyvalues.push_back(0); + + for (auto& it : calibrationareas) { + xvalue = (double)it.first / 1000.0; + calibrationxvalues.push_back(xvalue); + + yvalue = it.second / (double)(calibrationcounts[it.first]); + calibrationyvalues.push_back(yvalue); + + if (calibrationcounts[it.first] > 1) { + avg = 0; + auto range = calibrationsubareas.equal_range(it.first); + for (auto it2 = range.first; it2 != range.second; ++it2) { + avg += it2->second; + } + + avg /= (double)(calibrationcounts[it.first]); + + dev = 0; + for (auto it2 = range.first; it2 != range.second; ++it2) { + dev += (it2->second - avg) * (it2->second - avg); + } + + dev /= (double)(calibrationcounts[it.first] - 1); + dev = sqrt(dev); + + calibrationsd.push_back(dev); + } + else { + calibrationsd.push_back(0); + } + } + + double a = 1; + double b = 0; + + if (equationtype == 0) { + calculateLineParameterA(calibrationxvalues, calibrationyvalues, a); + } + + if (equationtype == 1) { + calculateLineParameters(calibrationxvalues, calibrationyvalues, a, b); + //calculateLineParametersWithIterations(xvalues, yvalues, 10, a, b); + } + + if (equationtype == 2) { + a = manuala; + b = manualb; + } + + calibrationspinboxa->setValue(a); + calibrationspinboxb->setValue(b); + + calibrationsetbutton->click(); + + // fix xvalues and yvalues + calibrationchartwidget->setLineParameters(equationtype, a, b, calibrationxvalues, calibrationyvalues, calibrationsd); + + vector dataxvalues; + vector datayvalues; + vector datasd; + vector datagroups; + + for (auto& it : dataareas) { + yvalue = it.second / (double)(datacounts[it.first]); + datayvalues.push_back(yvalue); + + xvalue = yvalue - b; + + if (a != 0) { + xvalue /= a; + } + else { + xvalue = 0; + } + + dataxvalues.push_back(xvalue); + + if (datacounts[it.first] > 1) { + avg = 0; + auto range = datasubareas.equal_range(it.first); + for (auto it2 = range.first; it2 != range.second; ++it2) { + avg += it2->second; + } + + avg /= (double)(datacounts[it.first]); + + dev = 0; + for (auto it2 = range.first; it2 != range.second; ++it2) { + dev += (it2->second - avg) * (it2->second - avg); + } + + dev /= (double)(datacounts[it.first] - 1); + dev = sqrt(dev); + + datasd.push_back(dev); + } + else { + datasd.push_back(0); + } + + datagroups.push_back(it.first); + } + + calibrationchartwidget->setData(dataxvalues, datayvalues, datasd, datagroups); + + calibrationchartwidget->createTable(a, b, calibrationxvalues, calibrationyvalues, calibrationsd, datagroups, dataxvalues, datayvalues, datasd); +} + + +void cMultipleDatasetsTableWidget::showHTMLDocumentation() { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/annotatedfeatures.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/annotatedfeatures.html").absoluteFilePath())); + #endif +} + + +void cMultipleDatasetsTableWidget::rowClicked(const QModelIndex& item) { + if (!parameters || (systemcolumns == 0)) { + return; + } + + int row = proxymodel->mapToSource(item).row(); + int column = proxymodel->mapToSource(item).column(); + + if (database->selectionModel()->selectedIndexes().count() > 0) { + database->selectionModel()->select(item, QItemSelectionModel::ClearAndSelect); + } + + int datasetid; + int spectrumid; + int peakid; + + string clickedcompound; + if (parameters->mode == dereplication) { + clickedcompound = databasemodel->item(row, 0)->text().toStdString(); + clickedcompound += "\t"; + clickedcompound += databasemodel->item(row, 1)->text().toStdString(); + clickedcompound += "\t"; + clickedcompound += databasemodel->item(row, 2)->text().toStdString(); + clickedcompound += "\t"; + } + else { + clickedcompound = databasemodel->item(row, 1)->text().toStdString(); + clickedcompound += "\t"; + clickedcompound += databasemodel->item(row, 0)->text().toStdString(); + clickedcompound += "\t"; + } + + if (column < systemcolumns) { + string url = "https://pubchem.ncbi.nlm.nih.gov/#query="; + + if ((parameters->mode == dereplication) && (column == 0)) { + if (identifieditems.count(clickedcompound) > 0) { + datasetid = identifieditems[clickedcompound].begin()->first; + spectrumid = identifieditems[clickedcompound].begin()->second.first; + peakid = identifieditems[clickedcompound].begin()->second.second; + + string stmp = parameters->sequencedatabase[listoftheoreticalspectra->get(datasetid, spectrumid)[peakid].compoundid].getNameWithReferenceAsHTMLString(); + size_t pos = stmp.find('\"'); + if (pos + 1 != string::npos) { + stmp = stmp.substr(pos + 1); + pos = stmp.rfind('\"'); + if (pos != string::npos) { + stmp = stmp.substr(0, pos); + + // crop RT info + pos = stmp.rfind('@'); + if (pos != string::npos) { + stmp = stmp.substr(0, pos); + } + + QDesktopServices::openUrl(QUrl(stmp.c_str())); + } + } + } + } + + if ((parameters->mode == dereplication) && ((column == 2) || (column == 4))) { + url += databasemodel->item(row, 2)->text().toStdString(); + QDesktopServices::openUrl(QUrl(url.c_str())); + } + + if ((parameters->mode == compoundsearch) && ((column == 1) || (column == 3))) { + url += databasemodel->item(row, 1)->text().toStdString(); + QDesktopServices::openUrl(QUrl(url.c_str())); + } + + return; + } + + column -= systemcolumns; + + if (identifieditems.count(clickedcompound) > 0) { + if (identifieditems[clickedcompound].count(column) > 0) { + spectrumid = identifieditems[clickedcompound][column].first; + peakid = identifieditems[clickedcompound][column].second; + + if (parameters->mode == dereplication) { + emit multipleDatasetsTableRowClicked(column, spectrumid, peakid, datatypeview, peakshape, databasemodel->item(row, 0)->text().toStdString(), databasemodel->item(row, 1)->text().toStdString(), databasemodel->item(row, 3)->text().toStdString()); + } + else { + emit multipleDatasetsTableRowClicked(column, spectrumid, peakid, datatypeview, peakshape, databasemodel->item(row, 1)->text().toStdString(), databasemodel->item(row, 0)->text().toStdString(), databasemodel->item(row, 2)->text().toStdString()); + } + } + } +} + + +void cMultipleDatasetsTableWidget::searchPubChem() { + if (!parameters) { + return; + } + + if ((parameters->mode != dereplication) && (parameters->mode != compoundsearch)) { + QMessageBox msgBox; + QString msg = "This feature is available only in 'Compare Peaklist(s) with Database - MS, LC-MS, MSI' and 'Compound Search - MS, LC-MS, MSI' modes !"; + msgBox.setText(msg); + msgBox.exec(); + return; + } + + bool repeatsearch = false; + if (!pubchemsearchwidget->getHTML().empty()) { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, "Search PubChem...", "Search again ?", QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::Yes) { + repeatsearch = true; + } + } + + if (repeatsearch || pubchemsearchwidget->getHTML().empty()) { + + //resetFilter(); + + int iontypecol; + int formulacol; + int theoreticalmzcol; + + if (parameters->mode == compoundsearch) { + iontypecol = 0; + formulacol = 1; + theoreticalmzcol = 2; + } + else { + iontypecol = 1; + formulacol = 2; + theoreticalmzcol = 3; + } + + set formulas; + map formulasmap; + multimap invertedmultimap; + //map > scanids; + set errorset; + //QStandardItem* itemid; + QStandardItem* itemiontype; + QStandardItem* itemtheoreticalmz; + //QStandardItem* itemexperimentalint; + QStandardItem* itemname; + ostringstream outhtml; + + cRowItemInfo rowitem; + string tmpstr; + + for (int i = 0; i < proxymodel->rowCount(); i++) { + //itemid = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, idcol))); + itemiontype = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, iontypecol))); + itemtheoreticalmz = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, theoreticalmzcol))); + //itemexperimentalint = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, experimentalintcol))); + itemname = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, formulacol))); + + if (/*itemid &&*/ itemiontype && itemtheoreticalmz && /*itemexperimentalint &&*/ itemname) { + formulas.insert(itemname->text().toStdString()); + + rowitem.id = 0; //itemid->text().toInt(); + rowitem.iontype = itemiontype->text().toStdString(); + rowitem.theoreticalmz = itemtheoreticalmz->text().toDouble(); + rowitem.experimentalint = 0; //itemexperimentalint->text().toDouble(); + + tmpstr = itemname->text().toStdString() + ", " + rowitem.iontype; + + if (formulasmap.count(tmpstr) == 0) { + formulasmap[tmpstr] = rowitem; + } + //else { + // if (formulasmap[tmpstr].id == rowitem.id) { + // if (rowitem.experimentalint > formulasmap[tmpstr].experimentalint) { + // formulasmap[tmpstr].experimentalint = rowitem.experimentalint; + // formulasmap[tmpstr].theoreticalmz = rowitem.theoreticalmz; + // } + // } + //} + + //if (scanids.count(tmpstr) == 0) { + // set tmpset; + // tmpset.insert(rowitem.id); + // scanids[tmpstr] = tmpset; + //} + //else { + // scanids[tmpstr].insert(rowitem.id); + //} + } + } + + if (formulas.size() == 0) { + return; + } + + const int limit = 500; + + if (formulas.size() > limit) { + QMessageBox msgBox; + QString errstr = "The maximum number of formulas to be searched is " + QVariant(limit).toString() + ". You generated " + QVariant((int)formulas.size()).toString() + " formulas. "; + errstr += "Please, optimize the search settings."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + for (auto& it : formulasmap) { + invertedmultimap.insert(make_pair(it.second.theoreticalmz, it.first)); + } + + parameters->pchemresults.clear(); + vector cidsvector; + + //vector allcids; + + bool allempty = true; + + bool writelog = false; + ofstream pchemlog; + + if (writelog) { + pchemlog.open("pubchem.log", ofstream::out); + } + + int maxthreadsbackup = QThreadPool::globalInstance()->maxThreadCount(); + int maxparallelqueries = 2; + + QThreadPool::globalInstance()->setMaxThreadCount(maxparallelqueries); + + vector vformulas; + for (auto& it : formulas) { + vformulas.push_back(it); + } + + QProgressDialog firstdialog("Searching compounds (CIDs)...", "Cancel", 0, (int)formulas.size(), this); + firstdialog.setMinimumWidth(250); + cEventFilter firstfilter; + firstdialog.installEventFilter(&firstfilter); + firstdialog.setMinimumDuration(0); + firstdialog.setWindowModality(Qt::ApplicationModal); + firstdialog.setValue(0); + + QFutureWatcher firstfuturewatcher; + QObject::connect(&firstfuturewatcher, SIGNAL(finished()), &firstdialog, SLOT(reset())); + QObject::connect(&firstdialog, SIGNAL(canceled()), &firstfuturewatcher, SLOT(cancel())); + QObject::connect(&firstfuturewatcher, SIGNAL(progressRangeChanged(int, int)), &firstdialog, SLOT(setRange(int, int))); + QObject::connect(&firstfuturewatcher, SIGNAL(progressValueChanged(int)), &firstdialog, SLOT(setValue(int))); + + QFuture firstfuture = QtConcurrent::mapped(vformulas.begin(), vformulas.end(), cPubchemCIDReader()); + + firstfuturewatcher.setFuture(firstfuture); + + firstdialog.exec(); + + if (firstfuturewatcher.isCanceled()) { + QThreadPool::globalInstance()->clear(); + } + + firstfuturewatcher.waitForFinished(); + + if (!firstfuturewatcher.isCanceled()) { + + cidsvector.resize(vformulas.size()); + + cPubchemCIDReader pubchemformulareader; + int count; + string firstfutureresult; + for (int i = 0; i < (int)vformulas.size(); i++) { + firstfutureresult = firstfuture.resultAt(i); + + if (firstfutureresult.substr(0, 6).compare("@ERROR") == 0) { + if (writelog) { + pchemlog << firstfutureresult; + } + firstfutureresult.clear(); + } + + if (!firstfutureresult.empty()) { + allempty = false; + } + + count = pubchemformulareader.getNumberOfCIDs(firstfutureresult); + if (count > 0) { + parameters->pchemresults.insert(make_pair(vformulas[i], count)); + pubchemformulareader.getCommaSeparatedCIDs(firstfutureresult, cidsvector[i]); + //pubchemformulareader.attachVectorOfCIDs(firstfutureresult, allcids); + } + + if (firstfutureresult.find("Status:") != string::npos) { + if (firstfutureresult.find("Status: 404") == string::npos) { + errorset.insert(vformulas[i]); + } + } + + if (writelog) { + pchemlog << "Formula: \"" << vformulas[i] << "\"" << endl; + pchemlog << "Result: \"" << firstfutureresult << "\"" << endl; + pchemlog << "Reduced result: \"" << cidsvector[i] << "\"" << endl; + pchemlog << "-----" << endl << endl; + } + } + + QProgressDialog seconddialog("Searching compounds (Names)...", "Cancel", 0, (int)cidsvector.size(), this); + seconddialog.setMinimumWidth(250); + cEventFilter secondfilter; + seconddialog.installEventFilter(&secondfilter); + seconddialog.setMinimumDuration(0); + seconddialog.setWindowModality(Qt::ApplicationModal); + seconddialog.setValue(0); + + QFutureWatcher secondfuturewatcher; + QObject::connect(&secondfuturewatcher, SIGNAL(finished()), &seconddialog, SLOT(reset())); + QObject::connect(&seconddialog, SIGNAL(canceled()), &secondfuturewatcher, SLOT(cancel())); + QObject::connect(&secondfuturewatcher, SIGNAL(progressRangeChanged(int, int)), &seconddialog, SLOT(setRange(int, int))); + QObject::connect(&secondfuturewatcher, SIGNAL(progressValueChanged(int)), &seconddialog, SLOT(setValue(int))); + + QFuture secondfuture = QtConcurrent::mapped(cidsvector.begin(), cidsvector.end(), cPubchemNameReader()); + + secondfuturewatcher.setFuture(secondfuture); + + seconddialog.exec(); + + if (secondfuturewatcher.isCanceled()) { + QThreadPool::globalInstance()->clear(); + } + + secondfuturewatcher.waitForFinished(); + + if (!secondfuturewatcher.isCanceled()) { + + cPubchemNameReader pubchemnamereader; + set reducednames; + string link; + + map > namesmap; + string secondfutureresult; + + bool servererror = false; + + for (int i = 0; i < (int)vformulas.size(); i++) { + if (cidsvector[i].empty()) { + continue; + } + + reducednames.clear(); + secondfutureresult = secondfuture.resultAt(i); + + if (secondfutureresult.substr(0, 6).compare("@ERROR") == 0) { + if (writelog) { + pchemlog << secondfutureresult; + } + secondfutureresult.clear(); + } + + pubchemnamereader.getReducedNames(secondfutureresult, reducednames); + + if (!reducednames.empty()) { + namesmap[vformulas[i]] = reducednames; + } + + if (secondfutureresult.find("Status:") != string::npos) { + if (secondfutureresult.find("Status: 404") == string::npos) { + set tmperrset; + string status; + + if (secondfutureresult.find("Status: 414") != string::npos) { + tmperrset.insert("Too many names, this item must be checked manually."); + namesmap[vformulas[i]] = tmperrset; + } + else { + tmperrset.insert("No names found, try again or later."); + namesmap[vformulas[i]] = tmperrset; + + servererror = true; + + status = vformulas[i]; + status += ", "; + status += "https://pubchem.ncbi.nlm.nih.gov/#query=" + vformulas[i]; + status += ""; + + errorset.insert(status); + } + } + } + + if (writelog) { + pchemlog << "Formula: \"" << vformulas[i] << "\"" << endl; + pchemlog << "Result: \"" << secondfutureresult << "\"" << endl; + pchemlog << "Reduced result: " << endl; + for (auto& it : reducednames) { + pchemlog << it << endl; + } + pchemlog << "-----" << endl << endl; + } + } + + if (errorset.size() > 0) { + outhtml << "
"; + outhtml << "The queries on the following formulas returned an error:
"; + for (auto& it : errorset) { + outhtml << it << "
"; + } + outhtml << "
"; + } + + if (servererror) { + outhtml << "
Try to repeat the search process again or later !
"; + } + else { + if (allempty) { + outhtml << "
Failed to connect to the server. Please, check your Internet connection, firewall or antivirus settings !
"; + } + else { + outhtml << "
The search process has been completed successfully !
"; + } + } + + outhtml << "

---
"; + + for (auto& it : invertedmultimap) { + tmpstr = it.second.substr(0, it.second.find(",")); + + if (namesmap[tmpstr].size() > 0) { + link = "https://pubchem.ncbi.nlm.nih.gov/#query=" + tmpstr; + + outhtml << "
"; + outhtml << std::fixed << std::setprecision(6); + outhtml << "m/z " << it.first << ", " << it.second << ", " << link << " ("; + outhtml << parameters->pchemresults[tmpstr]; + outhtml << " result"; + if (parameters->pchemresults[tmpstr] > 1) { + outhtml << "s"; + } + outhtml << ")
"; + + //vector scanidsvector; + //if (scanids.count(it.second) == 1) { + // scanidsvector.assign(scanids[it.second].begin(), scanids[it.second].end()); + //} + + //outhtml << "Scans: "; + //int scanssize = (int)scanidsvector.size(); + //for (int i = 0; i < scanssize; i++) { + // if (i == 0) { + // outhtml << scanidsvector[i]; + // continue; + // } + // if (i == scanssize - 1) { + // if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + // outhtml << "-"; + // } + // else { + // outhtml << ", "; + // } + // outhtml << scanidsvector[i]; + // break; + // } + // if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + // if (scanidsvector[i] + 1 != scanidsvector[i + 1]) { + // outhtml << "-" << scanidsvector[i]; + // } + // } + // else { + // outhtml << ", " << scanidsvector[i]; + // } + //} + //outhtml << "
"; + + //if ((rtimes.size() > 0) && (rtimes[rtimes.size() - 1] > 0)) { + // outhtml << "RT: "; + // outhtml << std::fixed << std::setprecision(3); + // for (int i = 0; i < scanssize; i++) { + // if (i == 0) { + // outhtml << rtimes[scanidsvector[i] - 1]; + // continue; + // } + // if (i == scanssize - 1) { + // if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + // outhtml << "-"; + // } + // else { + // outhtml << ", "; + // } + // outhtml << rtimes[scanidsvector[i] - 1]; + // break; + // } + // if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + // if (scanidsvector[i] + 1 != scanidsvector[i + 1]) { + // outhtml << "-" << rtimes[scanidsvector[i] - 1]; + // } + // } + // else { + // outhtml << ", " << rtimes[scanidsvector[i] - 1]; + // } + // } + // outhtml << "
"; + //} + + outhtml << "Names: " << "
"; + for (auto& it2 : namesmap[tmpstr]) { + outhtml << it2 << "
"; + } + outhtml << "
"; + } + } + + } + + } + + //ofstream of("out.sh"); + //for (auto& it : allcids) { + // of << "wget https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/data/compound/" << it << "/xml -O " << it << ".xml" << endl; + //} + + QThreadPool::globalInstance()->setMaxThreadCount(maxthreadsbackup); + + if (writelog) { + pchemlog.close(); + } + + //resetFilter(); + + prepareToShow(parameters, listoftheoreticalspectra, activefileid); + + emit filterSummaryTable(); + + pubchemsearchwidget->setHTML(outhtml.str()); + } + + pubchemsearchwidget->show(); + pubchemsearchwidget->activateWindow(); + if (pubchemsearchwidget->isMinimized()) { + pubchemsearchwidget->showNormal(); + } +} diff --git a/CycloBranch/gui/cMultipleDatasetsTableWidget.h b/CycloBranch/gui/cMultipleDatasetsTableWidget.h new file mode 100644 index 0000000..f539660 --- /dev/null +++ b/CycloBranch/gui/cMultipleDatasetsTableWidget.h @@ -0,0 +1,332 @@ +/** + \file cMultipleDatasetsTableWidget.h + \brief Aggregated results from multiple datasets. +*/ + + +#ifndef _CMULTIPLEDATASETSTABLEWIDGET_H +#define _CMULTIPLEDATASETSTABLEWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "core/utilities.h" +#include "core/cGlobalPreferences.h" +#include "gui/cMultipleDatasetsTableProxyModel.h" +#include "gui/cPubChemSearchWidget.h" +#include "gui/cEventFilter.h" +#include "gui/cChromatogramWindowWidget.h" +#include "gui/cDefineCalibrationWidget.h" +#include "gui/cCalibrationChart.h" + + +// forward declarations +class cParameters; +class cTheoreticalSpectrumList; +class QVBoxLayout; +class QMenuBar; +class QMenu; + + +/** + \brief Calculate parameter a of a line. + \param x input vector of x-coordinates + \param y input vector of y-coordinates + \param a output value a +*/ +void calculateLineParameterA(vector& x, vector& y, double& a); + + +/** + \brief Calculate parameters a and b of a line. + \param x input vector of x-coordinates + \param y input vector of y-coordinates + \param a output value a + \param b output value b +*/ +void calculateLineParameters(vector& x, vector& y, double& a, double& b); + + +/** + \brief Calculate parameters a and b of a line. + \param x input vector of x-coordinates + \param y input vector of y-coordinates + \param iterations number of iterations + \param a output value a + \param b output value b +*/ +void calculateLineParametersWithIterations(vector& x, vector& y, int iterations, double& a, double& b); + + +/** + \brief Aggregated results from multiple datasets. +*/ +class cMultipleDatasetsTableWidget : public QMainWindow { + + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + cMultipleDatasetsTableWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0); + + + /** + \brief The destructor. + */ + ~cMultipleDatasetsTableWidget(); + + + /** + \brief Handle the window close event. + \param event pointer to QCloseEvent + */ + void closeEvent(QCloseEvent *event); + + + /** + \brief Prepare the widget to show. + \param parameters parameters of the application + \param listoftheoreticalspectra lists of theoretical spectra + \param activefileid id of the active file + \retval bool true if the table was successfully prepared, false otherwise + */ + bool prepareToShow(cParameters* parameters, cTheoreticalSpectrumList* listoftheoreticalspectra, int activefileid); + + + /** + \brief Update the table if attributes were changed. + */ + void updateTable(); + + + /** + \brief Reset the compound standard. + */ + void resetStandard(); + + + /** + \brief Update the list of compound standards. + */ + void updateListofStandards(); + + + /** + \brief Delete the table content. + */ + void deleteTable(); + + + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + + /** + \brief Get the reference to cPubChemSearchWidget. + \retval cPubChemSearchWidget reference to cPubChemSearchWidget + */ + cPubChemSearchWidget* getPubChemSearchWidget(); + + + /** + \brief Get the reference to cDefineCalibrationWidget. + \retval cDefineCalibrationWidget reference to cDefineCalibrationWidget + */ + cDefineCalibrationWidget* getDefineCalibrationWidget(); + + + /** + \brief Get the reference to cCalibrationChart widget. + \retval cCalibrationChart reference to cCalibrationChart + */ + cCalibrationChart* getCalibrationChartWidget(); + + +private: + + QString title; + + cGlobalPreferences* globalpreferences; + QWidget* parent; + + cParameters* parameters; + cTheoreticalSpectrumList* listoftheoreticalspectra; + + cPubChemSearchWidget* pubchemsearchwidget; + cDefineCalibrationWidget* definecalibrationwidget; + cCalibrationChart* calibrationchartwidget; + + QMenuBar* menuBar; + QMenu* menuFile; + QMenu* menuSearch; + QMenu* menuHelp; + + QToolBar* toolbarFile; + QAction* actionExportCSV; + QAction* actionExportDatabase; + QAction* actionCloseWindow; + + QToolBar* toolbarView; + + QToolBar* toolbarCalibration; + + QToolBar* toolbarSearch; + QAction* actionSearchPubChem; + + QToolBar* toolbarHelp; + QAction* actionHTMLDocumentation; + + QLabel* datatypelabel; + QComboBox* comboboxdatatype; + QHBoxLayout* datatypehboxlayout; + QWidget* datatypewidget; + + QLabel* peakshapelabel; + QComboBox* comboboxpeakshape; + QHBoxLayout* peakshapehboxlayout; + QWidget* peakshapewidget; + + QLabel* standardlabel; + QComboBox* comboboxstandard; + QHBoxLayout* standardhboxlayout; + QWidget* standardwidget; + + QLabel* calibrationlabely; + QDoubleSpinBox* calibrationspinboxa; + QLabel* calibrationlabelx; + QDoubleSpinBox* calibrationspinboxb; + QPushButton* calibrationsetbutton; + QPushButton* calibrationdefinebutton; + QPushButton* calibrationviewbutton; + QHBoxLayout* calibrationhboxlayout; + QWidget* calibrationwidget; + + QTableView* database; + QStandardItemModel* databasemodel; + cMultipleDatasetsTableProxyModel* proxymodel; + QVBoxLayout* mainlayout; + QWidget* mainwidget; + + QString lastdirexporttocsv; + QString lastdirexportdatabase; + + map > > identifieditems; + map > > identifieditemswithmultimap; + + int activefileid; + int datatypeview; + int peakshape; + int standard; + double calibrationa; + double calibrationb; + int systemcolumns; + + void getEICFromMultiMap(int datafileid, multimap >& compoundmultimap, cPeaksList& eicchromatogram, bool highestpeaks); + + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + void keyPressEvent(QKeyEvent *event); + + +private slots: + + void closeWindow(); + + + void exportToCsv(); + + + void exportToDatabase(); + + + void dataTypeViewChanged(int index); + + + void peakShapeChanged(int index); + + + void standardChanged(int index); + + + void calibrationSetButtonReleased(); + + + void calibrationDefineButtonReleased(); + + + void calibrationViewButtonReleased(); + + + void calibrationCurveRedefined(); + + + void showHTMLDocumentation(); + + + void rowClicked(const QModelIndex& item); + + + void searchPubChem(); + + +signals: + + + /** + \brief The table was not generated because the process was cancelled. + */ + void tableCancelled(); + + + /** + \brief Update chromatogram via summary table of matched peaks. + */ + void filterSummaryTable(); + + + /** + \brief Process a row click event. + \param datasetid id of a dataset + \param spectrumid id of a spectrum + \param peakid id of a peak + \param datatypeview type of data shown + \param peakshape type of chromatographic peak + \param name compound name + \param iontype ion type + \param mzstr theoretical m/z value converted to a string + */ + void multipleDatasetsTableRowClicked(int datasetid, int spectrumid, int peakid, int datatypeview, int peakshape, string name, string iontype, string mzstr); + +}; + +#endif + diff --git a/CycloBranch/gui/cNeutralLossesListWidget.cpp b/CycloBranch/gui/cNeutralLossesListWidget.cpp index d17be24..4c0711e 100644 --- a/CycloBranch/gui/cNeutralLossesListWidget.cpp +++ b/CycloBranch/gui/cNeutralLossesListWidget.cpp @@ -6,7 +6,9 @@ #include -cNeutralLossesListWidget::cNeutralLossesListWidget(QObject* parent) { +cNeutralLossesListWidget::cNeutralLossesListWidget(bool showdefaultbutton, bool showhconbutton, QObject* parent) { + this->showdefaultbutton = showdefaultbutton; + this->showhconbutton = showhconbutton; this->parent = parent; vbox1 = new QVBoxLayout(); @@ -26,10 +28,14 @@ cNeutralLossesListWidget::cNeutralLossesListWidget(QObject* parent) { addbutton->setToolTip("Add a new item."); removebutton = new QPushButton("Remove"); removebutton->setToolTip("Remove selected items."); - defaultbutton = new QPushButton("Default"); - defaultbutton->setToolTip("Set default items."); - hconbutton = new QPushButton("HCON"); - hconbutton->setToolTip("Set the default chemical elements H, C, O, N, S, and P."); + if (showdefaultbutton) { + defaultbutton = new QPushButton("Default"); + defaultbutton->setToolTip("Set a list of default neutral losses."); + } + if (showhconbutton) { + hconbutton = new QPushButton("HCON"); + hconbutton->setToolTip("Set a list of default chemical elements (H, C, O, N, S, and P)."); + } vbox1->addWidget(list); vbox1->addStretch(1); @@ -38,8 +44,12 @@ cNeutralLossesListWidget::cNeutralLossesListWidget(QObject* parent) { vbox2->addWidget(clearallbutton); vbox2->addWidget(addbutton); vbox2->addWidget(removebutton); - vbox2->addWidget(defaultbutton); - vbox2->addWidget(hconbutton); + if (showdefaultbutton) { + vbox2->addWidget(defaultbutton); + } + if (showhconbutton) { + vbox2->addWidget(hconbutton); + } vbox2->addStretch(1); hbox->setMargin(0); @@ -50,12 +60,21 @@ cNeutralLossesListWidget::cNeutralLossesListWidget(QObject* parent) { connect(clearallbutton, SIGNAL(released()), this, SLOT(clearAllItems())); connect(addbutton, SIGNAL(released()), this, SLOT(addEmptyItem())); connect(removebutton, SIGNAL(released()), this, SLOT(removeItem())); - connect(defaultbutton, SIGNAL(released()), this, SLOT(setDefaultItems())); - connect(hconbutton, SIGNAL(released()), this, SLOT(setHCON())); + if (showdefaultbutton) { + connect(defaultbutton, SIGNAL(released()), this, SLOT(setDefaultItems())); + } + if (showhconbutton) { + connect(hconbutton, SIGNAL(released()), this, SLOT(setHCON())); + } setLayout(hbox); - setDefaultItems(); + if (showdefaultbutton) { + setDefaultItems(); + } + else { + setHCON(); + } } @@ -65,8 +84,12 @@ cNeutralLossesListWidget::~cNeutralLossesListWidget() { delete clearallbutton; delete addbutton; delete removebutton; - delete defaultbutton; - delete hconbutton; + if (showdefaultbutton) { + delete defaultbutton; + } + if (showhconbutton) { + delete hconbutton; + } delete vbox1; delete vbox2; @@ -101,7 +124,12 @@ void cNeutralLossesListWidget::clearAllItems() { void cNeutralLossesListWidget::addEmptyItem() { - addItem("type a formula here"); + if (showdefaultbutton) { + addItem("type a formula here"); + } + else { + addItem("type an element here"); + } list->setCurrentRow(list->count() - 1); QListWidgetItem* item = list->item(list->count() - 1); list->editItem(item); diff --git a/CycloBranch/gui/cNeutralLossesListWidget.h b/CycloBranch/gui/cNeutralLossesListWidget.h index 3c9ff6e..31ef224 100644 --- a/CycloBranch/gui/cNeutralLossesListWidget.h +++ b/CycloBranch/gui/cNeutralLossesListWidget.h @@ -31,9 +31,11 @@ class cNeutralLossesListWidget : public QWidget /** \brief The constructor. + \param showdefaultbutton if true, the default button is shown + \param showhconbutton if true, the HCON button is shown \param parent pointer to a parent widget */ - cNeutralLossesListWidget(QObject* parent); + cNeutralLossesListWidget(bool showdefaultbutton, bool showhconbutton, QObject* parent); /** @@ -59,6 +61,9 @@ class cNeutralLossesListWidget : public QWidget private: QObject* parent; + bool showdefaultbutton; + bool showhconbutton; + QListWidget* list; QPushButton* selectallbutton; QPushButton* clearallbutton; diff --git a/CycloBranch/gui/cParametersWidget.cpp b/CycloBranch/gui/cParametersWidget.cpp index 1b49954..d1a4414 100644 --- a/CycloBranch/gui/cParametersWidget.cpp +++ b/CycloBranch/gui/cParametersWidget.cpp @@ -24,13 +24,21 @@ #include #include +// C++17 begin +#if OS_TYPE == WIN + #include +#endif +// C++17 end + cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { + hideunusedparameters = true; + this->globalpreferences = globalpreferences; this->parent = parent; - int leftdefaultwidth = 400; - int rightdefaultwidth = 400; + int leftdefaultwidth = 420; + int rightdefaultwidth = 420; int searchedsequencedefaultwidth = 510; int checkboxfieldwidth = 80; @@ -120,11 +128,11 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid useprofiledata->setToolTip("Use profile data (if applicable)."); peaklistbutton = new QPushButton("Select"); #if OS_TYPE != WIN - peaklistline->setToolTip("Select a file. Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists)."); - peaklistbutton->setToolTip("Select a file. Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists)."); + peaklistline->setToolTip("Select input file(s). Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists)."); + peaklistbutton->setToolTip("Select input file(s). Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists)."); #else - peaklistline->setToolTip("Select a file. Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists),\nbaf (profile spectra),\nraw (profile spectra or peaklists),\ndat (peaklists),\nmis (deprecated),\nser (deprecated)."); - peaklistbutton->setToolTip("Select a file. Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists),\nbaf (profile spectra),\nraw (profile spectra or peaklists),\ndat (peaklists),\nmis (deprecated),\nser (deprecated)."); + peaklistline->setToolTip("Select input file(s). Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists),\nbaf (profile spectra),\nraw (profile spectra or peaklists),\ndat (peaklists),\nmis (deprecated),\nser (deprecated)."); + peaklistbutton->setToolTip("Select input file(s). Supported file formats:\ntxt (peaklists),\nmgf (peaklists),\nmzML (profile spectra or peaklists),\nmzXML (peaklists),\nimzML (profile spectra or peaklists),\nbaf (profile spectra),\nraw (profile spectra or peaklists),\ndat (peaklists),\nmis (deprecated),\nser (deprecated)."); #endif peaklistbutton->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); peaklistlayout = new QHBoxLayout(); @@ -241,6 +249,31 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid experimentalspectragridlayout->addWidget(mzratiolabel, 10, 0); experimentalspectragridlayout->addWidget(mzratiowidget, 10, 1); + minimumrt = new QDoubleSpinBox(); + minimumrt->setToolTip("Enter the minimum retention time (0 = disabled). Units depend on your input file. Seconds or minutes can be used."); + minimumrt->setDecimals(3); + minimumrt->setRange(0, 100000); + minimumrt->setSingleStep(1); + minimumrt->setPrefix("minimum: "); + + maximumrt = new QDoubleSpinBox(); + maximumrt->setToolTip("Enter the maximum retention time (0 = disabled). Units depend on your input file. Seconds or minutes can be used."); + maximumrt->setDecimals(3); + maximumrt->setRange(0, 100000); + maximumrt->setSingleStep(1); + maximumrt->setPrefix("maximum: "); + + rtlayout = new QHBoxLayout(); + rtlayout->addWidget(minimumrt); + rtlayout->addWidget(maximumrt); + rtlayout->setMargin(0); + rtwidget = new QWidget(); + rtwidget->setLayout(rtlayout); + rtwidget->setFixedWidth(leftdefaultwidth); + rtlabel = new QLabel("Retention Time:"); + experimentalspectragridlayout->addWidget(rtlabel, 11, 0); + experimentalspectragridlayout->addWidget(rtwidget, 11, 1); + fwhm = new QDoubleSpinBox(); fwhm->setToolTip("Full width at half maximum. The value is used if the profile spectra are converted into peaklists (mzML and imzML) and if the full isotope patterns of compounds are generated."); fwhm->setDecimals(6); @@ -249,8 +282,35 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid fwhm->setSuffix(" Da"); fwhm->setFixedWidth(leftdefaultwidth); fwhmlabel = new QLabel("FWHM:"); - experimentalspectragridlayout->addWidget(fwhmlabel, 11, 0); - experimentalspectragridlayout->addWidget(fwhm, 11, 1); + experimentalspectragridlayout->addWidget(fwhmlabel, 12, 0); + experimentalspectragridlayout->addWidget(fwhm, 12, 1); + + minratio54Fe56Fe = new QDoubleSpinBox(); + minratio54Fe56Fe->setToolTip("Enter the minimum intensity ratio of 54Fe/56Fe."); + minratio54Fe56Fe->setDecimals(3); + minratio54Fe56Fe->setRange(0, 1); + minratio54Fe56Fe->setSingleStep(0.01); + minratio54Fe56Fe->setValue(0.01); + minratio54Fe56Fe->setPrefix("minimum: "); + + maxratio54Fe56Fe = new QDoubleSpinBox(); + maxratio54Fe56Fe->setToolTip("Enter the maximum intensity ratio of 54Fe/56Fe."); + maxratio54Fe56Fe->setDecimals(3); + maxratio54Fe56Fe->setRange(0, 1); + maxratio54Fe56Fe->setSingleStep(0.01); + maxratio54Fe56Fe->setValue(0.1); + maxratio54Fe56Fe->setPrefix("maximum: "); + + ratio54Fe56Felayout = new QHBoxLayout(); + ratio54Fe56Felayout->addWidget(minratio54Fe56Fe); + ratio54Fe56Felayout->addWidget(maxratio54Fe56Fe); + ratio54Fe56Felayout->setMargin(0); + ratio54Fe56Fewidget = new QWidget(); + ratio54Fe56Fewidget->setLayout(ratio54Fe56Felayout); + ratio54Fe56Fewidget->setFixedWidth(leftdefaultwidth); + ratio54Fe56Felabel = new QLabel("54Fe/56Fe Ratio:"); + experimentalspectragridlayout->addWidget(ratio54Fe56Felabel, 13, 0); + experimentalspectragridlayout->addWidget(ratio54Fe56Fewidget, 13, 1); experimentalspectragroupbox = new QGroupBox("Experimental Spectrum/Spectra"); experimentalspectragroupbox->setLayout(experimentalspectragridlayout); @@ -449,22 +509,38 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid theoreticalspectragridlayout->addWidget(iontypeslabel, 4, 0); theoreticalspectragridlayout->addWidget(iontypes, 4, 1); - neutrallosstypes = new cNeutralLossesListWidget(this); - neutrallosstypes->setToolTip("Define and select the types of neutral losses or chemical elements which will be used when generating theoretical spectra."); + neutrallosstypes = new cNeutralLossesListWidget(true, true, this); + neutrallosstypes->setToolTip("Define and select the types of neutral losses."); neutrallosstypes->setFixedWidth(rightdefaultwidth); - neutrallosstypeslabel = new QLabel("Neutral Losses / Chemical Elements:"); + neutrallosstypeslabel = new QLabel("Neutral Losses:"); theoreticalspectragridlayout->addWidget(neutrallosstypeslabel, 5, 0); theoreticalspectragridlayout->addWidget(neutrallosstypes, 5, 1); maximumcombinedlosses = new QSpinBox(); - maximumcombinedlosses->setToolTip("Maximum number of combined neutral losses or chemical elements."); + maximumcombinedlosses->setToolTip("Maximum number of combined neutral losses."); maximumcombinedlosses->setRange(0, 10000); maximumcombinedlosses->setSingleStep(1); maximumcombinedlosses->setFixedWidth(rightdefaultwidth); - maximumcombinedlosseslabel = new QLabel("Maximum Number of Combined Losses/Elements:"); + maximumcombinedlosseslabel = new QLabel("Maximum Number of Combined Losses:"); theoreticalspectragridlayout->addWidget(maximumcombinedlosseslabel, 6, 0); theoreticalspectragridlayout->addWidget(maximumcombinedlosses, 6, 1); + elementstypes = new cNeutralLossesListWidget(false, true, this); + elementstypes->setToolTip("Define and select chemical elements."); + elementstypes->setFixedWidth(rightdefaultwidth); + elementstypeslabel = new QLabel("Chemical Elements:"); + theoreticalspectragridlayout->addWidget(elementstypeslabel, 7, 0); + theoreticalspectragridlayout->addWidget(elementstypes, 7, 1); + + maximumcombinedelements = new QSpinBox(); + maximumcombinedelements->setToolTip("Maximum number of combined chemical elements."); + maximumcombinedelements->setRange(0, 10000); + maximumcombinedelements->setSingleStep(1); + maximumcombinedelements->setFixedWidth(rightdefaultwidth); + maximumcombinedelementslabel = new QLabel("Maximum Number of Combined Elements:"); + theoreticalspectragridlayout->addWidget(maximumcombinedelementslabel, 8, 0); + theoreticalspectragridlayout->addWidget(maximumcombinedelements, 8, 1); + //clearhitswithoutparent = new QCheckBox(); //clearhitswithoutparent->setToolTip("If checked, a peak is not matched if the corresponding parent peak is not matched (e.g., a dehydrated b-ion is not matched if corresponding b-ion is not matched)."); //theoreticalspectraformlayout->addRow(tr("Remove Hits of Fragments without Hits of Parent Fragments: "), clearhitswithoutparent); @@ -473,16 +549,16 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid reportunmatchedtheoreticalpeaks->setToolTip("If checked, all unmatched theoretical peaks are reported.\nIf unchecked, unmatched theoretical peaks are reported only if a corresponding isotope pattern has been matched.\nThis feature may spend a lot of main memory, keep it disabled if possible."); reportunmatchedtheoreticalpeaks->setFixedWidth(rightdefaultwidth); reportunmatchedtheoreticalpeakslabel = new QLabel("Report Unmatched Theoretical Peaks:"); - theoreticalspectragridlayout->addWidget(reportunmatchedtheoreticalpeakslabel, 7, 0); - theoreticalspectragridlayout->addWidget(reportunmatchedtheoreticalpeaks, 7, 1); + theoreticalspectragridlayout->addWidget(reportunmatchedtheoreticalpeakslabel, 9, 0); + theoreticalspectragridlayout->addWidget(reportunmatchedtheoreticalpeaks, 9, 1); generateisotopepattern = new QCheckBox(); generateisotopepattern->setChecked(true); generateisotopepattern->setToolTip("The full isotope patterns of compounds are generated in theoretical spectra.\nThe FWHM value is used for this purpose. If checked, the deisotoping is disabled automatically."); generateisotopepattern->setFixedWidth(rightdefaultwidth); generateisotopepatternlabel = new QLabel("Generate Full Isotope Patterns:"); - theoreticalspectragridlayout->addWidget(generateisotopepatternlabel, 8, 0); - theoreticalspectragridlayout->addWidget(generateisotopepattern, 8, 1); + theoreticalspectragridlayout->addWidget(generateisotopepatternlabel, 10, 0); + theoreticalspectragridlayout->addWidget(generateisotopepattern, 10, 1); minimumpatternsize = new QSpinBox(); minimumpatternsize->setToolTip("The minimum number of peaks which must be annotated in an isotopic pattern. The option \"Generate Full Isotope Patterns\" must be enabled."); @@ -490,8 +566,8 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid minimumpatternsize->setSingleStep(1); minimumpatternsize->setFixedWidth(rightdefaultwidth); minimumpatternsizelabel = new QLabel("Minimum Number of Isotopic Peaks:"); - theoreticalspectragridlayout->addWidget(minimumpatternsizelabel, 9, 0); - theoreticalspectragridlayout->addWidget(minimumpatternsize, 9, 1); + theoreticalspectragridlayout->addWidget(minimumpatternsizelabel, 11, 0); + theoreticalspectragridlayout->addWidget(minimumpatternsize, 11, 1); minimumfeaturesize = new QSpinBox(); minimumfeaturesize->setToolTip("The minimum number of spectra in which a compound must be identified to be reported.\nLC-MS data = the minimum number of consecutive scans;\nMSI data = the minimum number of pixels."); @@ -499,8 +575,8 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid minimumfeaturesize->setSingleStep(1); minimumfeaturesize->setFixedWidth(rightdefaultwidth); minimumfeaturesizelabel = new QLabel("Minimum Number of Spectra:"); - theoreticalspectragridlayout->addWidget(minimumfeaturesizelabel, 10, 0); - theoreticalspectragridlayout->addWidget(minimumfeaturesize, 10, 1); + theoreticalspectragridlayout->addWidget(minimumfeaturesizelabel, 12, 0); + theoreticalspectragridlayout->addWidget(minimumfeaturesize, 12, 1); minimumiontypes = new QSpinBox(); minimumiontypes->setToolTip("The minimum number of ion types which must be matched to report a given compound."); @@ -508,51 +584,83 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid minimumiontypes->setSingleStep(1); minimumiontypes->setFixedWidth(rightdefaultwidth); minimumiontypeslabel = new QLabel("Minimum Number of Ion Types:"); - theoreticalspectragridlayout->addWidget(minimumiontypeslabel, 11, 0); - theoreticalspectragridlayout->addWidget(minimumiontypes, 11, 1); + theoreticalspectragridlayout->addWidget(minimumiontypeslabel, 13, 0); + theoreticalspectragridlayout->addWidget(minimumiontypes, 13, 1); basicformulacheck = new QCheckBox(); basicformulacheck->setToolTip("Apply Senior's filtering rules."); basicformulacheck->setFixedWidth(rightdefaultwidth); basicformulachecklabel = new QLabel("Basic Formula Check:"); - theoreticalspectragridlayout->addWidget(basicformulachecklabel, 12, 0); - theoreticalspectragridlayout->addWidget(basicformulacheck, 12, 1); + theoreticalspectragridlayout->addWidget(basicformulachecklabel, 14, 0); + theoreticalspectragridlayout->addWidget(basicformulacheck, 14, 1); advancedformulacheck = new QCheckBox(); advancedformulacheck->setToolTip("Apply advanced filtering rules if molecular formulas of compounds are generated."); advancedformulacheck->setFixedWidth(rightdefaultwidth); advancedformulachecklabel = new QLabel("Advanced Formula Check:"); - theoreticalspectragridlayout->addWidget(advancedformulachecklabel, 13, 0); - theoreticalspectragridlayout->addWidget(advancedformulacheck, 13, 1); + theoreticalspectragridlayout->addWidget(advancedformulachecklabel, 15, 0); + theoreticalspectragridlayout->addWidget(advancedformulacheck, 15, 1); noratiocheck = new QCheckBox(); noratiocheck->setToolTip("Check if the number of nitrogen atoms is less or equal to the number of oxygen atoms."); noratiocheck->setFixedWidth(rightdefaultwidth); noratiochecklabel = new QLabel("N/O Ratio Check:"); - theoreticalspectragridlayout->addWidget(noratiochecklabel, 14, 0); - theoreticalspectragridlayout->addWidget(noratiocheck, 14, 1); + theoreticalspectragridlayout->addWidget(noratiochecklabel, 16, 0); + theoreticalspectragridlayout->addWidget(noratiocheck, 16, 1); + + calculatefdrs = new QCheckBox(); + calculatefdrs->setToolTip("Calculate false discovery rates (experimental feature)."); + calculatefdrs->setFixedWidth(rightdefaultwidth); + calculatefdrslabel = new QLabel("Calculate FDRs:"); + theoreticalspectragridlayout->addWidget(calculatefdrslabel, 17, 0); + theoreticalspectragridlayout->addWidget(calculatefdrs, 17, 1); + + minimumannotationintensityrelative = new QDoubleSpinBox(); + minimumannotationintensityrelative->setToolTip("Enter the minimum relative intensity of the most intense peak in an isotopic pattern. Isotopic patterns with relative intensities below this value will be kept in the spectrum but not annotated."); + minimumannotationintensityrelative->setDecimals(3); + minimumannotationintensityrelative->setRange(0, 100); + minimumannotationintensityrelative->setSingleStep(1); + minimumannotationintensityrelative->setPrefix("relative: "); + minimumannotationintensityrelative->setSuffix(" %"); + + minimumannotationintensityabsolute = new QSpinBox(); + minimumannotationintensityabsolute->setToolTip("Enter the minimum absolute intensity of the most intense peak in an isotopic pattern. Isotopic patterns with absolute intensities below this value will be kept in the spectrum but not annotated."); + minimumannotationintensityabsolute->setRange(0, INT32_MAX); + minimumannotationintensityabsolute->setSingleStep(100); + minimumannotationintensityabsolute->setPrefix("absolute: "); + + minimumannotationintensitylayout = new QHBoxLayout(); + minimumannotationintensitylayout->addWidget(minimumannotationintensityrelative); + minimumannotationintensitylayout->addWidget(minimumannotationintensityabsolute); + minimumannotationintensitylayout->setMargin(0); + minimumannotationintensitywidget = new QWidget(); + minimumannotationintensitywidget->setLayout(minimumannotationintensitylayout); + minimumannotationintensitywidget->setFixedWidth(rightdefaultwidth); + minimumannotationintensitylabel = new QLabel("Minimum Intensity of Highest Peak in Isotopic Pattern:"); + theoreticalspectragridlayout->addWidget(minimumannotationintensitylabel, 18, 0); + theoreticalspectragridlayout->addWidget(minimumannotationintensitywidget, 18, 1); mzdifftolerance = new QDoubleSpinBox(); - mzdifftolerance->setToolTip("The maximum m/z error of difference between an isotopic peak and the monoisotopic peak in an experimental and theoretical isotopic pattern (0 = disabled) [ppm]."); + mzdifftolerance->setToolTip("The maximum m/z error of difference between an isotopic peak and the most intense peak in an experimental and theoretical isotopic pattern (0 = disabled) [ppm]."); mzdifftolerance->setDecimals(3); mzdifftolerance->setRange(0, 10000); mzdifftolerance->setSingleStep(1); mzdifftolerance->setSuffix(" ppm"); mzdifftolerance->setFixedWidth(rightdefaultwidth); mzdifftolerancelabel = new QLabel("Isotope m/z Tolerance:"); - theoreticalspectragridlayout->addWidget(mzdifftolerancelabel, 15, 0); - theoreticalspectragridlayout->addWidget(mzdifftolerance, 15, 1); + theoreticalspectragridlayout->addWidget(mzdifftolerancelabel, 19, 0); + theoreticalspectragridlayout->addWidget(mzdifftolerance, 19, 1); intensitytolerance = new QDoubleSpinBox(); - intensitytolerance->setToolTip("The maximum error tolerance of intensities of matched isotopes (0 = disabled) [in % of relative intensity of monoisotopic peak].\nExample:\nIsotope Intensity Tolerance = 10%, Relative Intensity of Monoisotopic Peak = 100% => the tolerance of relative intensities of isotopes is 10%;\nIsotope Intensity Tolerance = 10%, Relative Intensity of Monoisotopic Peak = 50% => the tolerance of relative intensities of isotopes is 5%; etc."); + intensitytolerance->setToolTip("The maximum error tolerance of intensities of matched isotopes (0 = disabled) [in % of relative intensity of the most intense peak].\nExample:\nIsotope Intensity Tolerance = 10%, Relative Intensity of the Most Intense Peak = 100% => the tolerance of relative intensities of isotopes is 10%;\nIsotope Intensity Tolerance = 10%, Relative Intensity of the Most Intense Peak = 50% => the tolerance of relative intensities of isotopes is 5%; etc."); intensitytolerance->setDecimals(3); intensitytolerance->setRange(0, 100); intensitytolerance->setSingleStep(1); intensitytolerance->setSuffix(" %"); intensitytolerance->setFixedWidth(rightdefaultwidth); intensitytolerancelabel = new QLabel("Isotope Intensity Tolerance:"); - theoreticalspectragridlayout->addWidget(intensitytolerancelabel, 16, 0); - theoreticalspectragridlayout->addWidget(intensitytolerance, 16, 1); + theoreticalspectragridlayout->addWidget(intensitytolerancelabel, 20, 0); + theoreticalspectragridlayout->addWidget(intensitytolerance, 20, 1); theoreticalspectragroupbox = new QGroupBox("Theoretical Spectrum/Spectra"); theoreticalspectragroupbox->setLayout(theoreticalspectragridlayout); @@ -618,10 +726,16 @@ cParametersWidget::cParametersWidget(cGlobalPreferences* globalpreferences, QWid vlayout1->addWidget(experimentalspectragroupbox); vlayout1->addWidget(brickdatabasegroupbox); vlayout1->addWidget(miscgroupbox); + if (hideunusedparameters) { + vlayout1->addStretch(1); + } vlayout2 = new QVBoxLayout(); vlayout2->addWidget(theoreticalspectragroupbox); vlayout2->addWidget(searchedsequencegroupbox); + if (hideunusedparameters) { + vlayout2->addStretch(1); + } hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0, 0, 0, 0); @@ -717,8 +831,18 @@ cParametersWidget::~cParametersWidget() { delete maximummz; delete mzratiolayout; delete mzratiowidget; + delete rtlabel; + delete minimumrt; + delete maximumrt; + delete rtlayout; + delete rtwidget; delete fwhmlabel; delete fwhm; + delete ratio54Fe56Felabel; + delete minratio54Fe56Fe; + delete maxratio54Fe56Fe; + delete ratio54Fe56Felayout; + delete ratio54Fe56Fewidget; delete experimentalspectragridlayout; delete experimentalspectragroupbox; @@ -777,6 +901,10 @@ cParametersWidget::~cParametersWidget() { delete neutrallosstypes; delete maximumcombinedlosseslabel; delete maximumcombinedlosses; + delete elementstypeslabel; + delete elementstypes; + delete maximumcombinedelementslabel; + delete maximumcombinedelements; //delete clearhitswithoutparent; delete reportunmatchedtheoreticalpeakslabel; delete reportunmatchedtheoreticalpeaks; @@ -794,6 +922,13 @@ cParametersWidget::~cParametersWidget() { delete advancedformulacheck; delete noratiochecklabel; delete noratiocheck; + delete calculatefdrslabel; + delete calculatefdrs; + delete minimumannotationintensitylabel; + delete minimumannotationintensityrelative; + delete minimumannotationintensityabsolute; + delete minimumannotationintensitylayout; + delete minimumannotationintensitywidget; delete mzdifftolerancelabel; delete mzdifftolerance; delete intensitytolerancelabel; @@ -837,7 +972,7 @@ void cParametersWidget::setAndRestoreParameters(cParameters& parameters) { this->parameters = parameters; this->parameters.bricksdatabase.clear(); - this->parameters.peaklistseries.clear(); + this->parameters.peaklistseriesvector.clear(); this->parameters.fragmentionsfordenovograph.clear(); this->parameters.sequencetag = this->parameters.originalsequencetag; this->parameters.searchedsequence = this->parameters.originalsearchedsequence; @@ -959,7 +1094,11 @@ void cParametersWidget::loadSettings() { minimumabsoluteintensitythreshold->setValue(settings.value("minimumabsoluteintensitythreshold", 0).toUInt()); minimummz->setValue(settings.value("minimummz", 150).toDouble()); maximummz->setValue(settings.value("maximummz", 0).toDouble()); + minimumrt->setValue(settings.value("minimumrt", 0).toDouble()); + maximumrt->setValue(settings.value("maximumrt", 0).toDouble()); fwhm->setValue(settings.value("fwhm", 0.05).toDouble()); + minratio54Fe56Fe->setValue(settings.value("minratio54Fe56Fe", 0.01).toDouble()); + maxratio54Fe56Fe->setValue(settings.value("maxratio54Fe56Fe", 0.1).toDouble()); brickdatabaseline->setText(settings.value("brickdatabase", "").toString()); maximumbricksincombinationbegin->setValue(settings.value("maximumbricksincombinationbegin", 1).toInt()); @@ -1024,6 +1163,39 @@ void cParametersWidget::loadSettings() { } maximumcombinedlosses->setValue(settings.value("maximumcombinedlosses", 2).toInt()); + + elementstypes->getList()->clear(); + i = 0; + qloadstring = ("elementsformula_" + to_string(i)).c_str(); + while (settings.value(qloadstring, "XXX").toString().compare("XXX") != 0) { + elementstypes->addItem(settings.value(qloadstring).toString()); + + qloadstring = ("elementstype_" + to_string(i)).c_str(); + settings.value(qloadstring, 0).toInt() == 0 ? elementstypes->getList()->item(i)->setSelected(false) : elementstypes->getList()->item(i)->setSelected(true); + + i++; + qloadstring = ("elementsformula_" + to_string(i)).c_str(); + } + + maximumcombinedelements->setValue(settings.value("maximumcombinedelements", 200).toInt()); + + if ((eModeType)mode->currentIndex() == compoundsearch) { + if (!settings.contains("maximumcombinedelements")) { + elementstypes->getList()->clear(); + for (int i = 0; i < neutrallosstypes->getList()->count(); i++) { + elementstypes->getList()->addItem(neutrallosstypes->getList()->item(i)->text()); + if (neutrallosstypes->getList()->item(i)->isSelected()) { + elementstypes->getList()->item(i)->setSelected(true); + } + } + + maximumcombinedelements->setValue(maximumcombinedlosses->value()); + + neutrallosstypes->getList()->clear(); + maximumcombinedlosses->setValue(0); + } + } + //settings.value("clearhitswithoutparent", 0).toInt() == 0 ? clearhitswithoutparent->setChecked(false) : clearhitswithoutparent->setChecked(true); settings.value("reportunmatchedtheoreticalpeaks", 0).toInt() == 0 ? reportunmatchedtheoreticalpeaks->setChecked(false) : reportunmatchedtheoreticalpeaks->setChecked(true); settings.value("generateisotopepattern", 0).toInt() == 0 ? generateisotopepattern->setChecked(false) : generateisotopepattern->setChecked(true); @@ -1033,6 +1205,11 @@ void cParametersWidget::loadSettings() { settings.value("basicformulacheck", 1).toInt() == 0 ? basicformulacheck->setChecked(false) : basicformulacheck->setChecked(true); settings.value("advancedformulacheck", 1).toInt() == 0 ? advancedformulacheck->setChecked(false) : advancedformulacheck->setChecked(true); settings.value("noratiocheck", 1).toInt() == 0 ? noratiocheck->setChecked(false) : noratiocheck->setChecked(true); + settings.value("calculatefdrs", 1).toInt() == 0 ? calculatefdrs->setChecked(false) : calculatefdrs->setChecked(true); + + minimumannotationintensityrelative->setValue(settings.value("minimumannotationintensityrelative", 0).toDouble()); + minimumannotationintensityabsolute->setValue(settings.value("minimumannotationintensityabsolute", 0).toUInt()); + mzdifftolerance->setValue(settings.value("mzdifftolerance", 0).toDouble()); intensitytolerance->setValue(settings.value("intensitytolerance", 0).toDouble()); @@ -1074,7 +1251,11 @@ void cParametersWidget::saveSettings() { settings.setValue("minimumabsoluteintensitythreshold", minimumabsoluteintensitythreshold->value()); settings.setValue("minimummz", minimummz->value()); settings.setValue("maximummz", maximummz->value()); + settings.setValue("minimumrt", minimumrt->value()); + settings.setValue("maximumrt", maximumrt->value()); settings.setValue("fwhm", fwhm->value()); + settings.setValue("minratio54Fe56Fe", minratio54Fe56Fe->value()); + settings.setValue("maxratio54Fe56Fe", maxratio54Fe56Fe->value()); settings.setValue("brickdatabase", brickdatabaseline->text()); settings.setValue("maximumbricksincombinationbegin", maximumbricksincombinationbegin->value()); @@ -1122,6 +1303,17 @@ void cParametersWidget::saveSettings() { } settings.setValue("maximumcombinedlosses", maximumcombinedlosses->value()); + + for (int i = 0; i < elementstypes->getList()->count(); i++) { + qsavestring = ("elementstype_" + to_string(i)).c_str(); + elementstypes->getList()->item(i)->isSelected() ? settings.setValue(qsavestring, 1) : settings.setValue(qsavestring, 0); + + qsavestring = ("elementsformula_" + to_string(i)).c_str(); + settings.setValue(qsavestring, elementstypes->getList()->item(i)->text()); + } + + settings.setValue("maximumcombinedelements", maximumcombinedelements->value()); + //clearhitswithoutparent->isChecked() ? settings.setValue("clearhitswithoutparent", 1) : settings.setValue("clearhitswithoutparent", 0); reportunmatchedtheoreticalpeaks->isChecked() ? settings.setValue("reportunmatchedtheoreticalpeaks", 1) : settings.setValue("reportunmatchedtheoreticalpeaks", 0); generateisotopepattern->isChecked() ? settings.setValue("generateisotopepattern", 1) : settings.setValue("generateisotopepattern", 0); @@ -1131,6 +1323,11 @@ void cParametersWidget::saveSettings() { basicformulacheck->isChecked() ? settings.setValue("basicformulacheck", 1) : settings.setValue("basicformulacheck", 0); advancedformulacheck->isChecked() ? settings.setValue("advancedformulacheck", 1) : settings.setValue("advancedformulacheck", 0); noratiocheck->isChecked() ? settings.setValue("noratiocheck", 1) : settings.setValue("noratiocheck", 0); + calculatefdrs->isChecked() ? settings.setValue("calculatefdrs", 1) : settings.setValue("calculatefdrs", 0); + + settings.setValue("minimumannotationintensityrelative", minimumannotationintensityrelative->value()); + settings.setValue("minimumannotationintensityabsolute", minimumannotationintensityabsolute->value()); + settings.setValue("mzdifftolerance", mzdifftolerance->value()); settings.setValue("intensitytolerance", intensitytolerance->value()); @@ -1158,18 +1355,24 @@ void cParametersWidget::saveSettingsAs() { void cParametersWidget::peaklistButtonReleased() { QString currentdir = peaklistline->text(); + + size_t pos = currentdir.toStdString().find(';'); + if (pos != string::npos) { + currentdir = currentdir.toStdString().substr(0, pos).c_str(); + } + if (!checkFile(currentdir.toStdString())) { currentdir = defaultdirselectpeaklist; } #if OS_TYPE != WIN - QString filename = QFileDialog::getOpenFileName(this, tr("Select Peaklist..."), currentdir, tr("Peak Lists (*.txt *.mgf *.mzML *.mzXML *.imzML)")); + QStringList filenames = QFileDialog::getOpenFileNames(this, tr("Select Peaklist(s)..."), currentdir, tr("Peaklists (*.txt *.mgf *.mzML *.mzXML *.imzML)")); #else - QString filename = QFileDialog::getOpenFileName(this, tr("Select Peaklist..."), currentdir, tr("Peak Lists (*.txt *.mgf *.mzML *.mzXML *.imzML *.baf *.raw *.dat *.mis ser)")); + QStringList filenames = QFileDialog::getOpenFileNames(this, tr("Select Peaklist(s)..."), currentdir, tr("Peaklists (*.txt *.mgf *.mzML *.mzXML *.imzML *.baf *.raw *.dat *.mis ser)")); #endif - if (!filename.isEmpty()) { - peaklistline->setText(filename); + if (!filenames.isEmpty()) { + peaklistline->setText(filenames.join(";")); } } @@ -1224,13 +1427,101 @@ bool cParametersWidget::updateParameters() { string tmpstring; string errmsg; - if (peaklistline->text().toStdString().compare("") == 0) { + QStringList multiplefiles = peaklistline->text().split(";"); + + if ((peaklistline->text().toStdString().compare("") == 0) || (multiplefiles.size() == 0)) { errstr = "A peaklist must be specified !"; msgBox.setText(errstr); msgBox.exec(); return false; } + // C++17 begin + #if OS_TYPE == WIN + QStringList tmpmultiplefiles; + + regex tmprx; + string tmppath; + + for (auto& it : multiplefiles) { + QFileInfo fileinfo(it); + if (fileinfo.exists()) { + if (fileinfo.isDir()) { + for (auto& p : filesystem::recursive_directory_iterator(it.toStdString())) { + tmppath = filesystem::absolute(p.path()).string(); + replace(tmppath.begin(), tmppath.end(), '\\', '/'); + + tmprx = "\\.[bB][aA][fF]$"; + if (regex_search(tmppath, tmprx)) { + tmpmultiplefiles.push_back(tmppath.c_str()); + } + + tmprx = "PEAKS.[rR][aA][wW]\\/\\_[fF][uU][nN][cC]001.[dD][aA][tT]$"; + if (!regex_search(tmppath, tmprx)) { + tmprx = "\\_[fF][uU][nN][cC]001.[dD][aA][tT]$"; + if (regex_search(tmppath, tmprx)) { + tmpmultiplefiles.push_back(tmppath.c_str()); + } + } + } + } + else { + tmpmultiplefiles.push_back(it); + } + } + else { + errstr = "The path '" + it + "' does not exist !"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + } + + multiplefiles = tmpmultiplefiles; + #endif + // C++17 end + + int msi = 0; + regex rx; + for (auto& it : multiplefiles) { + #if OS_TYPE == WIN + rx = "\\.[mM][iI][sS]$"; + // flexImaging File + if (regex_search(it.toStdString(), rx)) { + msi++; + } + #endif + + rx = "\\.[iI][mM][zZ][mM][lL]$"; + // imzML File + if (regex_search(it.toStdString(), rx)) { + msi++; + } + } + + if ((msi == multiplefiles.size()) && (multiplefiles.size() > 1)) { + errstr = "Please, select only one mass spectrometry imaging input file !"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + + if ((msi > 0) && (msi < multiplefiles.size()) && (multiplefiles.size() > 1)) { + errstr = "Please, do not mix conventional/LC-MS input files with mass spectrometry imaging files !"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + + if (((eModeType)mode->currentIndex() == denovoengine) || ((eModeType)mode->currentIndex() == databasesearch) || ((eModeType)mode->currentIndex() == singlecomparison)) { + if (multiplefiles.size() > 1) { + errstr = "Multiple files cannot be selected in this mode !"; + 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 !"; msgBox.setText(errstr); @@ -1286,6 +1577,47 @@ bool cParametersWidget::updateParameters() { return false; } + if (((eModeType)mode->currentIndex() == compoundsearch) || ((eModeType)mode->currentIndex() == dereplication)) { + if ((minimumrt->value() != 0) && (maximumrt->value() != 0)) { + if (maximumrt->value() <= minimumrt->value()) { + regex rx; + bool lcms; + + for (auto& it : multiplefiles) { + lcms = true; + + rx = "\\.[iI][mM][zZ][mM][lL]$"; + // imzML File + if (regex_search(it.toStdString(), rx)) { + lcms = false; + } + + #if OS_TYPE == WIN + rx = "\\.[mM][iI][sS]$"; + // flexImaging File + if (regex_search(it.toStdString(), rx)) { + lcms = false; + } + #endif + + if (lcms) { + errstr = "The maximum retention time must be bigger than the minimum retention time !"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + } + } + } + + if (minratio54Fe56Fe->value() >= maxratio54Fe56Fe->value()) { + errstr = "The minimum ratio 54Fe/56Fe must be lower than the maximum ratio of 54Fe/56Fe !"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + } + if ((eModeType)mode->currentIndex() == denovoengine) { if ((ePeptideType)peptidetype->currentIndex() == other) { errstr = "The peptide type 'Other' cannot be used in this mode !"; @@ -1325,28 +1657,81 @@ bool cParametersWidget::updateParameters() { } */ - for (int i = 0; i < neutrallosstypes->getList()->count(); i++) { - tmpstring = neutrallosstypes->getList()->item(i)->text().toStdString(); - - if (tmpstring.rfind(':') != string::npos) { - tmpstring = tmpstring.substr(0, tmpstring.rfind(':')); - } - - tmpformula.setFormula(tmpstring, false); - if (!tmpformula.isValid(errmsg)) { - errstr = "A molecular formula of a neutral loss is not valid!\n\n"; - errstr += errmsg.c_str(); + if ((eModeType)mode->currentIndex() == compoundsearch) { + if (elementstypes->getList()->count() == 0) { + errstr = "The list of chemical elements is empty!"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + + if (maximumcombinedelements->value() == 0) { + errstr = "The maximum number of combined elements is zero (use e.g. 150 or 200)!"; + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + + bool somethingselected = false; + for (int i = 0; i < elementstypes->getList()->count(); i++) { + tmpstring = elementstypes->getList()->item(i)->text().toStdString(); + + if (tmpstring.rfind(':') != string::npos) { + tmpstring = tmpstring.substr(0, tmpstring.rfind(':')); + } + + tmpformula.setFormula(tmpstring, false); + if (!tmpformula.isValid(errmsg)) { + errstr = "A formula in the list of elements is not valid!\n\n"; + errstr += errmsg.c_str(); + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + + if (elementstypes->getList()->item(i)->isSelected()) { + somethingselected = true; + } + } + + if (!somethingselected) { + errstr = "Please, select some chemical elements!"; msgBox.setText(errstr); msgBox.exec(); return false; } } + else { + for (int i = 0; i < neutrallosstypes->getList()->count(); i++) { + tmpstring = neutrallosstypes->getList()->item(i)->text().toStdString(); + + if (tmpstring.rfind(':') != string::npos) { + tmpstring = tmpstring.substr(0, tmpstring.rfind(':')); + } + + tmpformula.setFormula(tmpstring, false); + if (!tmpformula.isValid(errmsg)) { + errstr = "A molecular formula of a neutral loss is not valid!\n\n"; + errstr += errmsg.c_str(); + msgBox.setText(errstr); + msgBox.exec(); + return false; + } + } + } parameters.mode = (eModeType)mode->currentIndex(); parameters.maximumnumberofthreads = maximumnumberofthreads->value(); parameters.peptidetype = (ePeptideType)peptidetype->currentIndex(); - parameters.peaklistfilename = peaklistline->text().toStdString(); + + parameters.peaklistfilenames.clear(); + for (auto& it : multiplefiles) { + parameters.peaklistfilenames.push_back(it.toStdString()); + } + + parameters.originalpeaklistfilenames = peaklistline->text().toStdString(); + parameters.useprofiledata = useprofiledata->isChecked(); parameters.scannumber = scannumber->value(); parameters.precursormass = precursormass->value(); @@ -1358,7 +1743,11 @@ bool cParametersWidget::updateParameters() { parameters.minimumabsoluteintensitythreshold = minimumabsoluteintensitythreshold->value(); parameters.minimummz = minimummz->value(); parameters.maximummz = maximummz->value(); + parameters.minimumrt = minimumrt->value(); + parameters.maximumrt = maximumrt->value(); parameters.fwhm = fwhm->value(); + parameters.minratio54Fe56Fe = minratio54Fe56Fe->value(); + parameters.maxratio54Fe56Fe = maxratio54Fe56Fe->value(); parameters.bricksdatabasefilename = brickdatabaseline->text().toStdString(); parameters.maximumbricksincombinationbegin = maximumbricksincombinationbegin->value(); @@ -1436,6 +1825,21 @@ bool cParametersWidget::updateParameters() { } parameters.maximumcombinedlosses = maximumcombinedlosses->value(); + + parameters.originalelementsdefinitions.clear(); + parameters.originalelementsfortheoreticalspectra.clear(); + neutralLoss element; + for (int i = 0; i < elementstypes->getList()->count(); i++) { + element.clear(); + element.summary = elementstypes->getList()->item(i)->text().toStdString(); + parameters.originalelementsdefinitions.push_back(element); + if (elementstypes->getList()->item(i)->isSelected()) { + parameters.originalelementsfortheoreticalspectra.push_back(i); + } + } + + parameters.maximumcombinedelements = maximumcombinedelements->value(); + //parameters.clearhitswithoutparent = clearhitswithoutparent->isChecked(); parameters.reportunmatchedtheoreticalpeaks = reportunmatchedtheoreticalpeaks->isChecked(); parameters.generateisotopepattern = generateisotopepattern->isChecked(); @@ -1445,6 +1849,11 @@ bool cParametersWidget::updateParameters() { parameters.basicformulacheck = basicformulacheck->isChecked(); parameters.advancedformulacheck = advancedformulacheck->isChecked(); parameters.noratiocheck = noratiocheck->isChecked(); + parameters.calculatefdrs = calculatefdrs->isChecked(); + + parameters.minimumannotationintensityrelative = minimumannotationintensityrelative->value(); + parameters.minimumannotationintensityabsolute = minimumannotationintensityabsolute->value(); + parameters.mzdifftolerance = mzdifftolerance->value(); parameters.intensitytolerance = intensitytolerance->value(); @@ -1475,7 +1884,20 @@ void cParametersWidget::restoreParameters() { maximumnumberofthreads->setValue(parameters.maximumnumberofthreads); peptidetype->setCurrentIndex(parameters.peptidetype); - peaklistline->setText(parameters.peaklistfilename.c_str()); + + //if (parameters.peaklistfilenames.size() > 0) { + // QStringList strlist; + // for (auto& it : parameters.peaklistfilenames) { + // strlist << it.c_str(); + // } + // peaklistline->setText(strlist.join(";")); + //} + //else { + // peaklistline->setText(""); + //} + + peaklistline->setText(parameters.originalpeaklistfilenames.c_str()); + useprofiledata->setChecked(parameters.useprofiledata); scannumber->setValue(parameters.scannumber); precursormass->setValue(parameters.precursormass); @@ -1487,7 +1909,11 @@ void cParametersWidget::restoreParameters() { minimumabsoluteintensitythreshold->setValue(parameters.minimumabsoluteintensitythreshold); minimummz->setValue(parameters.minimummz); maximummz->setValue(parameters.maximummz); + minimumrt->setValue(parameters.minimumrt); + maximumrt->setValue(parameters.maximumrt); fwhm->setValue(parameters.fwhm); + minratio54Fe56Fe->setValue(parameters.minratio54Fe56Fe); + maxratio54Fe56Fe->setValue(parameters.maxratio54Fe56Fe); brickdatabaseline->setText(parameters.bricksdatabasefilename.c_str()); maximumbricksincombinationbegin->setValue(parameters.maximumbricksincombinationbegin); @@ -1552,7 +1978,6 @@ void cParametersWidget::restoreParameters() { } } - neutrallosstypes->getList()->clear(); for (int i = 0; i < (int)parameters.originalneutrallossesdefinitions.size(); i++) { neutrallosstypes->addItem(parameters.originalneutrallossesdefinitions[i].summary.c_str()); @@ -1563,6 +1988,18 @@ void cParametersWidget::restoreParameters() { } maximumcombinedlosses->setValue(parameters.maximumcombinedlosses); + + elementstypes->getList()->clear(); + for (int i = 0; i < (int)parameters.originalelementsdefinitions.size(); i++) { + elementstypes->addItem(parameters.originalelementsdefinitions[i].summary.c_str()); + } + + for (int i = 0; i < (int)parameters.originalelementsfortheoreticalspectra.size(); i++) { + elementstypes->getList()->item(parameters.originalelementsfortheoreticalspectra[i])->setSelected(true); + } + + maximumcombinedelements->setValue(parameters.maximumcombinedelements); + //clearhitswithoutparent->setChecked(parameters.clearhitswithoutparent); reportunmatchedtheoreticalpeaks->setChecked(parameters.reportunmatchedtheoreticalpeaks); generateisotopepattern->setChecked(parameters.generateisotopepattern); @@ -1572,6 +2009,11 @@ void cParametersWidget::restoreParameters() { basicformulacheck->setChecked(parameters.basicformulacheck); advancedformulacheck->setChecked(parameters.advancedformulacheck); noratiocheck->setChecked(parameters.noratiocheck); + calculatefdrs->setChecked(parameters.calculatefdrs); + + minimumannotationintensityrelative->setValue(parameters.minimumannotationintensityrelative); + minimumannotationintensityabsolute->setValue(parameters.minimumannotationintensityabsolute); + mzdifftolerance->setValue(parameters.mzdifftolerance); intensitytolerance->setValue(parameters.intensitytolerance); @@ -1594,6 +2036,9 @@ void cParametersWidget::restoreParameters() { void cParametersWidget::updateSettingsWhenPeptideTypeChanged(int index) { + if (((eModeType)mode->currentIndex() == dereplication) || ((eModeType)mode->currentIndex() == compoundsearch)) { + return; + } if (!(((eModeType)mode->currentIndex() != oldmodetype) && (((eModeType)mode->currentIndex() == denovoengine) || ((eModeType)mode->currentIndex() == singlecomparison) || ((eModeType)mode->currentIndex() == databasesearch)) @@ -1781,7 +2226,6 @@ void cParametersWidget::updateSettingsWhenPeptideTypeChanged(int index) { void cParametersWidget::updateSettingsWhenModeChanged(int index) { - switch ((eModeType)index) { case denovoengine: peptidetype->setDisabled(false); @@ -1791,7 +2235,11 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { precursorcharge->setDisabled(false); precursormasserrortolerance->setDisabled(false); maximummz->setDisabled(true); + minimumrt->setDisabled(true); + maximumrt->setDisabled(true); fwhm->setDisabled(false); + minratio54Fe56Fe->setDisabled(true); + maxratio54Fe56Fe->setDisabled(true); brickdatabaseline->setDisabled(false); brickdatabasebutton->setDisabled(false); maximumbricksincombinationbegin->setDisabled(false); @@ -1811,10 +2259,15 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { iontypes->setDisabled(false); neutrallosstypes->setDisabled(false); maximumcombinedlosses->setDisabled(false); + elementstypes->setDisabled(true); + maximumcombinedelements->setDisabled(true); //clearhitswithoutparent->setDisabled(false); basicformulacheck->setDisabled(false); advancedformulacheck->setDisabled(true); noratiocheck->setDisabled(true); + calculatefdrs->setDisabled(true); + minimumannotationintensityrelative->setDisabled(true); + minimumannotationintensityabsolute->setDisabled(true); mzdifftolerance->setDisabled(true); intensitytolerance->setDisabled(true); reportunmatchedtheoreticalpeaks->setDisabled(false); @@ -1826,6 +2279,102 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { searchedsequencebutton->setDisabled(false); updateSettingsWhenPeptideTypeChanged(peptidetype->currentIndex()); + + if (hideunusedparameters) { + + maximumnumberofthreadslabel->setHidden(false); + maximumnumberofthreads->setHidden(false); + + peptidetypelabel->setHidden(false); + peptidetype->setHidden(false); + + scannumberlabel->setHidden(false); + scannumber->setHidden(false); + + precursormasslabel->setHidden(false); + precursormass->setHidden(false); + + precursoradductlabel->setHidden(false); + precursoradduct->setHidden(false); + + precursormasserrortolerancelabel->setHidden(false); + precursormasserrortolerance->setHidden(false); + + rtlabel->setHidden(true); + minimumrt->setHidden(true); + maximumrt->setHidden(true); + + ratio54Fe56Felabel->setHidden(true); + minratio54Fe56Fe->setHidden(true); + maxratio54Fe56Fe->setHidden(true); + + maximumbricksincombinatiolabel->setHidden(false); + maximumbricksincombinationbegin->setHidden(false); + maximumbricksincombinationmiddle->setHidden(false); + maximumbricksincombinationend->setHidden(false); + + blindedgeslabel->setHidden(false); + blindedges->setHidden(false); + + maximumcumulativemasslabel->setHidden(false); + maximumcumulativemass->setHidden(false); + + sequencedatabaselabel->setHidden(true); + sequencedatabaseline->setHidden(true); + sequencedatabasebutton->setHidden(true); + + scoretypelabel->setHidden(false); + scoretype->setHidden(false); + + hitsreportedlabel->setHidden(false); + hitsreported->setHidden(false); + + sequencetaglabel->setHidden(false); + sequencetag->setHidden(false); + + neutrallosstypeslabel->setHidden(false); + neutrallosstypes->setHidden(false); + + maximumcombinedlosseslabel->setHidden(false); + maximumcombinedlosses->setHidden(false); + + elementstypeslabel->setHidden(true); + elementstypes->setHidden(true); + + maximumcombinedelementslabel->setHidden(true); + maximumcombinedelements->setHidden(true); + + minimumfeaturesizelabel->setHidden(true); + minimumfeaturesize->setHidden(true); + + minimumiontypeslabel->setHidden(true); + minimumiontypes->setHidden(true); + + advancedformulachecklabel->setHidden(true); + advancedformulacheck->setHidden(true); + + noratiochecklabel->setHidden(true); + noratiocheck->setHidden(true); + + calculatefdrslabel->setHidden(true); + calculatefdrs->setHidden(true); + + minimumannotationintensitylabel->setHidden(true); + minimumannotationintensityrelative->setHidden(true); + minimumannotationintensityabsolute->setHidden(true); + + mzdifftolerancelabel->setHidden(true); + mzdifftolerance->setHidden(true); + + intensitytolerancelabel->setHidden(true); + intensitytolerance->setHidden(true); + + brickdatabasegroupbox->setHidden(false); + miscgroupbox->setHidden(false); + searchedsequencegroupbox->setHidden(false); + + } + break; case singlecomparison: peptidetype->setDisabled(false); @@ -1835,7 +2384,11 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { precursorcharge->setDisabled(false); precursormasserrortolerance->setDisabled(false); maximummz->setDisabled(true); + minimumrt->setDisabled(true); + maximumrt->setDisabled(true); fwhm->setDisabled(false); + minratio54Fe56Fe->setDisabled(true); + maxratio54Fe56Fe->setDisabled(true); brickdatabaseline->setDisabled(false); brickdatabasebutton->setDisabled(false); maximumbricksincombinationbegin->setDisabled(true); @@ -1855,10 +2408,15 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { iontypes->setDisabled(false); neutrallosstypes->setDisabled(false); maximumcombinedlosses->setDisabled(false); + elementstypes->setDisabled(true); + maximumcombinedelements->setDisabled(true); //clearhitswithoutparent->setDisabled(false); basicformulacheck->setDisabled(false); advancedformulacheck->setDisabled(true); noratiocheck->setDisabled(true); + calculatefdrs->setDisabled(true); + minimumannotationintensityrelative->setDisabled(true); + minimumannotationintensityabsolute->setDisabled(true); mzdifftolerance->setDisabled(true); intensitytolerance->setDisabled(true); reportunmatchedtheoreticalpeaks->setDisabled(false); @@ -1870,6 +2428,102 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { searchedsequencebutton->setDisabled(false); updateSettingsWhenPeptideTypeChanged(peptidetype->currentIndex()); + + if (hideunusedparameters) { + + maximumnumberofthreadslabel->setHidden(true); + maximumnumberofthreads->setHidden(true); + + peptidetypelabel->setHidden(false); + peptidetype->setHidden(false); + + scannumberlabel->setHidden(true); + scannumber->setHidden(true); + + precursormasslabel->setHidden(false); + precursormass->setHidden(false); + + precursoradductlabel->setHidden(false); + precursoradduct->setHidden(false); + + precursormasserrortolerancelabel->setHidden(false); + precursormasserrortolerance->setHidden(false); + + rtlabel->setHidden(true); + minimumrt->setHidden(true); + maximumrt->setHidden(true); + + ratio54Fe56Felabel->setHidden(true); + minratio54Fe56Fe->setHidden(true); + maxratio54Fe56Fe->setHidden(true); + + maximumbricksincombinatiolabel->setHidden(true); + maximumbricksincombinationbegin->setHidden(true); + maximumbricksincombinationmiddle->setHidden(true); + maximumbricksincombinationend->setHidden(true); + + blindedgeslabel->setHidden(true); + blindedges->setHidden(true); + + maximumcumulativemasslabel->setHidden(true); + maximumcumulativemass->setHidden(true); + + sequencedatabaselabel->setHidden(true); + sequencedatabaseline->setHidden(true); + sequencedatabasebutton->setHidden(true); + + scoretypelabel->setHidden(true); + scoretype->setHidden(true); + + hitsreportedlabel->setHidden(true); + hitsreported->setHidden(true); + + sequencetaglabel->setHidden(true); + sequencetag->setHidden(true); + + neutrallosstypeslabel->setHidden(false); + neutrallosstypes->setHidden(false); + + maximumcombinedlosseslabel->setHidden(false); + maximumcombinedlosses->setHidden(false); + + elementstypeslabel->setHidden(true); + elementstypes->setHidden(true); + + maximumcombinedelementslabel->setHidden(true); + maximumcombinedelements->setHidden(true); + + minimumfeaturesizelabel->setHidden(true); + minimumfeaturesize->setHidden(true); + + minimumiontypeslabel->setHidden(true); + minimumiontypes->setHidden(true); + + advancedformulachecklabel->setHidden(true); + advancedformulacheck->setHidden(true); + + noratiochecklabel->setHidden(true); + noratiocheck->setHidden(true); + + calculatefdrslabel->setHidden(true); + calculatefdrs->setHidden(true); + + minimumannotationintensitylabel->setHidden(true); + minimumannotationintensityrelative->setHidden(true); + minimumannotationintensityabsolute->setHidden(true); + + mzdifftolerancelabel->setHidden(true); + mzdifftolerance->setHidden(true); + + intensitytolerancelabel->setHidden(true); + intensitytolerance->setHidden(true); + + brickdatabasegroupbox->setHidden(false); + miscgroupbox->setHidden(false); + searchedsequencegroupbox->setHidden(false); + + } + break; case databasesearch: peptidetype->setDisabled(false); @@ -1879,7 +2533,11 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { precursorcharge->setDisabled(false); precursormasserrortolerance->setDisabled(false); maximummz->setDisabled(true); + minimumrt->setDisabled(true); + maximumrt->setDisabled(true); fwhm->setDisabled(false); + minratio54Fe56Fe->setDisabled(true); + maxratio54Fe56Fe->setDisabled(true); brickdatabaseline->setDisabled(false); brickdatabasebutton->setDisabled(false); maximumbricksincombinationbegin->setDisabled(true); @@ -1899,10 +2557,15 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { iontypes->setDisabled(false); neutrallosstypes->setDisabled(false); maximumcombinedlosses->setDisabled(false); + elementstypes->setDisabled(true); + maximumcombinedelements->setDisabled(true); //clearhitswithoutparent->setDisabled(false); basicformulacheck->setDisabled(false); advancedformulacheck->setDisabled(true); noratiocheck->setDisabled(true); + calculatefdrs->setDisabled(true); + minimumannotationintensityrelative->setDisabled(true); + minimumannotationintensityabsolute->setDisabled(true); mzdifftolerance->setDisabled(true); intensitytolerance->setDisabled(true); reportunmatchedtheoreticalpeaks->setDisabled(false); @@ -1914,6 +2577,102 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { searchedsequencebutton->setDisabled(false); updateSettingsWhenPeptideTypeChanged(peptidetype->currentIndex()); + + if (hideunusedparameters) { + + maximumnumberofthreadslabel->setHidden(false); + maximumnumberofthreads->setHidden(false); + + peptidetypelabel->setHidden(false); + peptidetype->setHidden(false); + + scannumberlabel->setHidden(false); + scannumber->setHidden(false); + + precursormasslabel->setHidden(false); + precursormass->setHidden(false); + + precursoradductlabel->setHidden(false); + precursoradduct->setHidden(false); + + precursormasserrortolerancelabel->setHidden(false); + precursormasserrortolerance->setHidden(false); + + rtlabel->setHidden(true); + minimumrt->setHidden(true); + maximumrt->setHidden(true); + + ratio54Fe56Felabel->setHidden(true); + minratio54Fe56Fe->setHidden(true); + maxratio54Fe56Fe->setHidden(true); + + maximumbricksincombinatiolabel->setHidden(true); + maximumbricksincombinationbegin->setHidden(true); + maximumbricksincombinationmiddle->setHidden(true); + maximumbricksincombinationend->setHidden(true); + + blindedgeslabel->setHidden(true); + blindedges->setHidden(true); + + maximumcumulativemasslabel->setHidden(true); + maximumcumulativemass->setHidden(true); + + sequencedatabaselabel->setHidden(false); + sequencedatabaseline->setHidden(false); + sequencedatabasebutton->setHidden(false); + + scoretypelabel->setHidden(false); + scoretype->setHidden(false); + + hitsreportedlabel->setHidden(false); + hitsreported->setHidden(false); + + sequencetaglabel->setHidden(false); + sequencetag->setHidden(false); + + neutrallosstypeslabel->setHidden(false); + neutrallosstypes->setHidden(false); + + maximumcombinedlosseslabel->setHidden(false); + maximumcombinedlosses->setHidden(false); + + elementstypeslabel->setHidden(true); + elementstypes->setHidden(true); + + maximumcombinedelementslabel->setHidden(true); + maximumcombinedelements->setHidden(true); + + minimumfeaturesizelabel->setHidden(true); + minimumfeaturesize->setHidden(true); + + minimumiontypeslabel->setHidden(true); + minimumiontypes->setHidden(true); + + advancedformulachecklabel->setHidden(true); + advancedformulacheck->setHidden(true); + + noratiochecklabel->setHidden(true); + noratiocheck->setHidden(true); + + calculatefdrslabel->setHidden(true); + calculatefdrs->setHidden(true); + + minimumannotationintensitylabel->setHidden(true); + minimumannotationintensityrelative->setHidden(true); + minimumannotationintensityabsolute->setHidden(true); + + mzdifftolerancelabel->setHidden(true); + mzdifftolerance->setHidden(true); + + intensitytolerancelabel->setHidden(true); + intensitytolerance->setHidden(true); + + brickdatabasegroupbox->setHidden(false); + miscgroupbox->setHidden(false); + searchedsequencegroupbox->setHidden(false); + + } + break; case dereplication: peptidetype->setDisabled(true); @@ -1923,7 +2682,11 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { precursorcharge->setDisabled(false); precursormasserrortolerance->setDisabled(true); maximummz->setDisabled(false); + minimumrt->setDisabled(false); + maximumrt->setDisabled(false); fwhm->setDisabled(false); + minratio54Fe56Fe->setDisabled(false); + maxratio54Fe56Fe->setDisabled(false); brickdatabaseline->setDisabled(true); brickdatabasebutton->setDisabled(true); maximumbricksincombinationbegin->setDisabled(true); @@ -1936,17 +2699,22 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { similaritysearch->setDisabled(true); sequencedatabaseline->setDisabled(false); sequencedatabasebutton->setDisabled(false); - maximumnumberofthreads->setDisabled(true); + maximumnumberofthreads->setDisabled(false); scoretype->setDisabled(true); hitsreported->setDisabled(true); sequencetag->setDisabled(true); iontypes->setDisabled(false); neutrallosstypes->setDisabled(false); maximumcombinedlosses->setDisabled(false); + elementstypes->setDisabled(true); + maximumcombinedelements->setDisabled(true); //clearhitswithoutparent->setDisabled(true); basicformulacheck->setDisabled(false); advancedformulacheck->setDisabled(true); noratiocheck->setDisabled(true); + calculatefdrs->setDisabled(false); + minimumannotationintensityrelative->setDisabled(false); + minimumannotationintensityabsolute->setDisabled(false); mzdifftolerance->setDisabled(false); intensitytolerance->setDisabled(false); reportunmatchedtheoreticalpeaks->setDisabled(false); @@ -1976,6 +2744,102 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { searchedsequenceCtermmodif->setDisabled(true); searchedsequenceTmodif->setDisabled(true); searchedsequenceformula->setDisabled(true); + + if (hideunusedparameters) { + + maximumnumberofthreadslabel->setHidden(false); + maximumnumberofthreads->setHidden(false); + + peptidetypelabel->setHidden(true); + peptidetype->setHidden(true); + + scannumberlabel->setHidden(true); + scannumber->setHidden(true); + + precursormasslabel->setHidden(true); + precursormass->setHidden(true); + + precursoradductlabel->setHidden(true); + precursoradduct->setHidden(true); + + precursormasserrortolerancelabel->setHidden(true); + precursormasserrortolerance->setHidden(true); + + rtlabel->setHidden(false); + minimumrt->setHidden(false); + maximumrt->setHidden(false); + + ratio54Fe56Felabel->setHidden(false); + minratio54Fe56Fe->setHidden(false); + maxratio54Fe56Fe->setHidden(false); + + maximumbricksincombinatiolabel->setHidden(true); + maximumbricksincombinationbegin->setHidden(true); + maximumbricksincombinationmiddle->setHidden(true); + maximumbricksincombinationend->setHidden(true); + + blindedgeslabel->setHidden(true); + blindedges->setHidden(true); + + maximumcumulativemasslabel->setHidden(true); + maximumcumulativemass->setHidden(true); + + sequencedatabaselabel->setHidden(false); + sequencedatabaseline->setHidden(false); + sequencedatabasebutton->setHidden(false); + + scoretypelabel->setHidden(true); + scoretype->setHidden(true); + + hitsreportedlabel->setHidden(true); + hitsreported->setHidden(true); + + sequencetaglabel->setHidden(true); + sequencetag->setHidden(true); + + neutrallosstypeslabel->setHidden(false); + neutrallosstypes->setHidden(false); + + maximumcombinedlosseslabel->setHidden(false); + maximumcombinedlosses->setHidden(false); + + elementstypeslabel->setHidden(true); + elementstypes->setHidden(true); + + maximumcombinedelementslabel->setHidden(true); + maximumcombinedelements->setHidden(true); + + minimumfeaturesizelabel->setHidden(false); + minimumfeaturesize->setHidden(false); + + minimumiontypeslabel->setHidden(false); + minimumiontypes->setHidden(false); + + advancedformulachecklabel->setHidden(true); + advancedformulacheck->setHidden(true); + + noratiochecklabel->setHidden(true); + noratiocheck->setHidden(true); + + calculatefdrslabel->setHidden(false); + calculatefdrs->setHidden(false); + + minimumannotationintensitylabel->setHidden(false); + minimumannotationintensityrelative->setHidden(false); + minimumannotationintensityabsolute->setHidden(false); + + mzdifftolerancelabel->setHidden(false); + mzdifftolerance->setHidden(false); + + intensitytolerancelabel->setHidden(false); + intensitytolerance->setHidden(false); + + brickdatabasegroupbox->setHidden(true); + miscgroupbox->setHidden(true); + searchedsequencegroupbox->setHidden(true); + + } + break; case compoundsearch: peptidetype->setDisabled(true); @@ -1985,7 +2849,11 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { precursorcharge->setDisabled(false); precursormasserrortolerance->setDisabled(true); maximummz->setDisabled(false); + minimumrt->setDisabled(false); + maximumrt->setDisabled(false); fwhm->setDisabled(false); + minratio54Fe56Fe->setDisabled(false); + maxratio54Fe56Fe->setDisabled(false); brickdatabaseline->setDisabled(true); brickdatabasebutton->setDisabled(true); maximumbricksincombinationbegin->setDisabled(true); @@ -1998,17 +2866,22 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { similaritysearch->setDisabled(true); sequencedatabaseline->setDisabled(true); sequencedatabasebutton->setDisabled(true); - maximumnumberofthreads->setDisabled(true); + maximumnumberofthreads->setDisabled(false); scoretype->setDisabled(true); hitsreported->setDisabled(true); sequencetag->setDisabled(true); iontypes->setDisabled(false); - neutrallosstypes->setDisabled(false); - maximumcombinedlosses->setDisabled(false); + neutrallosstypes->setDisabled(true); + maximumcombinedlosses->setDisabled(true); + elementstypes->setDisabled(false); + maximumcombinedelements->setDisabled(false); //clearhitswithoutparent->setDisabled(true); basicformulacheck->setDisabled(false); advancedformulacheck->setDisabled(false); noratiocheck->setDisabled(false); + calculatefdrs->setDisabled(false); + minimumannotationintensityrelative->setDisabled(false); + minimumannotationintensityabsolute->setDisabled(false); mzdifftolerance->setDisabled(false); intensitytolerance->setDisabled(false); reportunmatchedtheoreticalpeaks->setDisabled(false); @@ -2038,6 +2911,102 @@ void cParametersWidget::updateSettingsWhenModeChanged(int index) { searchedsequenceCtermmodif->setDisabled(true); searchedsequenceTmodif->setDisabled(true); searchedsequenceformula->setDisabled(true); + + if (hideunusedparameters) { + + maximumnumberofthreadslabel->setHidden(false); + maximumnumberofthreads->setHidden(false); + + peptidetypelabel->setHidden(true); + peptidetype->setHidden(true); + + scannumberlabel->setHidden(true); + scannumber->setHidden(true); + + precursormasslabel->setHidden(true); + precursormass->setHidden(true); + + precursoradductlabel->setHidden(true); + precursoradduct->setHidden(true); + + precursormasserrortolerancelabel->setHidden(true); + precursormasserrortolerance->setHidden(true); + + rtlabel->setHidden(false); + minimumrt->setHidden(false); + maximumrt->setHidden(false); + + ratio54Fe56Felabel->setHidden(false); + minratio54Fe56Fe->setHidden(false); + maxratio54Fe56Fe->setHidden(false); + + maximumbricksincombinatiolabel->setHidden(true); + maximumbricksincombinationbegin->setHidden(true); + maximumbricksincombinationmiddle->setHidden(true); + maximumbricksincombinationend->setHidden(true); + + blindedgeslabel->setHidden(true); + blindedges->setHidden(true); + + maximumcumulativemasslabel->setHidden(true); + maximumcumulativemass->setHidden(true); + + sequencedatabaselabel->setHidden(true); + sequencedatabaseline->setHidden(true); + sequencedatabasebutton->setHidden(true); + + scoretypelabel->setHidden(true); + scoretype->setHidden(true); + + hitsreportedlabel->setHidden(true); + hitsreported->setHidden(true); + + sequencetaglabel->setHidden(true); + sequencetag->setHidden(true); + + neutrallosstypeslabel->setHidden(true); + neutrallosstypes->setHidden(true); + + maximumcombinedlosseslabel->setHidden(true); + maximumcombinedlosses->setHidden(true); + + elementstypeslabel->setHidden(false); + elementstypes->setHidden(false); + + maximumcombinedelementslabel->setHidden(false); + maximumcombinedelements->setHidden(false); + + minimumfeaturesizelabel->setHidden(false); + minimumfeaturesize->setHidden(false); + + minimumiontypeslabel->setHidden(false); + minimumiontypes->setHidden(false); + + advancedformulachecklabel->setHidden(false); + advancedformulacheck->setHidden(false); + + noratiochecklabel->setHidden(false); + noratiocheck->setHidden(false); + + calculatefdrslabel->setHidden(false); + calculatefdrs->setHidden(false); + + minimumannotationintensitylabel->setHidden(false); + minimumannotationintensityrelative->setHidden(false); + minimumannotationintensityabsolute->setHidden(false); + + mzdifftolerancelabel->setHidden(false); + mzdifftolerance->setHidden(false); + + intensitytolerancelabel->setHidden(false); + intensitytolerance->setHidden(false); + + brickdatabasegroupbox->setHidden(true); + miscgroupbox->setHidden(true); + searchedsequencegroupbox->setHidden(true); + + } + break; default: break; @@ -2055,6 +3024,9 @@ void cParametersWidget::resetFragmentIonTypes() { if (globalpreferences) { for (int i = 0; i < (int)globalpreferences->customions.size(); i++) { iontypes->getList()->addItem(globalpreferences->customions[i].name.c_str()); + if (globalpreferences->customions[i].name.compare("[M+H]+") == 0) { + iontypes->getList()->item(i)->setSelected(true); + } } } } diff --git a/CycloBranch/gui/cParametersWidget.h b/CycloBranch/gui/cParametersWidget.h index 09e79fd..ae577ae 100644 --- a/CycloBranch/gui/cParametersWidget.h +++ b/CycloBranch/gui/cParametersWidget.h @@ -117,6 +117,8 @@ class cParametersWidget : public QWidget private: + bool hideunusedparameters; + QWidget* parent; cGlobalPreferences* globalpreferences; @@ -177,9 +179,20 @@ class cParametersWidget : public QWidget QDoubleSpinBox* maximummz; QHBoxLayout* mzratiolayout; QWidget* mzratiowidget; + QLabel* rtlabel; + QDoubleSpinBox* minimumrt; + QDoubleSpinBox* maximumrt; + QHBoxLayout* rtlayout; + QWidget* rtwidget; QLabel* fwhmlabel; QDoubleSpinBox* fwhm; + QLabel* ratio54Fe56Felabel; + QDoubleSpinBox* minratio54Fe56Fe; + QDoubleSpinBox* maxratio54Fe56Fe; + QHBoxLayout* ratio54Fe56Felayout; + QWidget* ratio54Fe56Fewidget; + QGroupBox* brickdatabasegroupbox; QGridLayout* brickdatabasegridlayout; QLabel* brickdatabaselabel; @@ -237,6 +250,10 @@ class cParametersWidget : public QWidget cNeutralLossesListWidget* neutrallosstypes; QLabel* maximumcombinedlosseslabel; QSpinBox* maximumcombinedlosses; + QLabel* elementstypeslabel; + cNeutralLossesListWidget* elementstypes; + QLabel* maximumcombinedelementslabel; + QSpinBox* maximumcombinedelements; //QCheckBox* clearhitswithoutparent; QLabel* reportunmatchedtheoreticalpeakslabel; QCheckBox* reportunmatchedtheoreticalpeaks; @@ -254,6 +271,15 @@ class cParametersWidget : public QWidget QCheckBox* advancedformulacheck; QLabel* noratiochecklabel; QCheckBox* noratiocheck; + QLabel* calculatefdrslabel; + QCheckBox* calculatefdrs; + + QLabel* minimumannotationintensitylabel; + QDoubleSpinBox* minimumannotationintensityrelative; + QSpinBox* minimumannotationintensityabsolute; + QHBoxLayout* minimumannotationintensitylayout; + QWidget* minimumannotationintensitywidget; + QLabel* mzdifftolerancelabel; QDoubleSpinBox* mzdifftolerance; QLabel* intensitytolerancelabel; diff --git a/CycloBranch/gui/cPatternSimulatorSceneWidget.cpp b/CycloBranch/gui/cPatternSimulatorSceneWidget.cpp new file mode 100644 index 0000000..82af3d0 --- /dev/null +++ b/CycloBranch/gui/cPatternSimulatorSceneWidget.cpp @@ -0,0 +1,917 @@ +#include "gui/cPatternSimulatorSceneWidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +double computeGaussFunction(double x, double a, double ny, double sigma) { + if (sigma == 0) { + return 0; + } + + double value = x - ny; + value *= value; + value /= 2.0 * sigma * sigma; + value = -value; + value = pow(econst, value); + return a * value; +} + + +double computeGaussHeight(double x, double y, double ny, double sigma) { + if (sigma == 0) { + return 0; + } + + double value = x - ny; + value *= value; + value /= 2.0 * sigma * sigma; + value = -value; + value = pow(econst, value); + + if (value != 0) { + return y / value; + } + + return 0; +} + + +cPatternSimulatorSceneWidget::cPatternSimulatorSceneWidget(QWidget* parent) { + this->parent = parent; + isotopicpattern.clear(); + origwidth = 0; + origheight = 0; + calledbyresizeevent = false; + oldwidth.clear(); + oldheight.clear(); + currentscale = 1; + absoluteintensity = false; + rawdatastate = true; + hidelabels = true; + factor = 0.2; + pressedx = -1; + pressedy = -1; + currentx = 0; + currenty = 0; + minmzratio = 0; + maxmzratio = 0; + + topmargin = 0; + bottommargin = 0; + leftmargin = 0; + rightmargin = 0; + + firstshow = true; + enablemousemzselection = true; + + mzoverhead = 1.0; + fwhm = 0.05; + + scene = new QGraphicsScene(this); + + zoomgroup = new QGraphicsItemGroup(); + zoomrect = new QGraphicsRectItem(); + zoomgroup->addToGroup(zoomrect); + zoomsimpletextitem = new QGraphicsSimpleTextItem(); + zoomgroup->addToGroup(zoomsimpletextitem); + scene->addItem(zoomgroup); + + cursorsimpletextitem = new QGraphicsSimpleTextItem(); + scene->addItem(cursorsimpletextitem); +} + + +cPatternSimulatorSceneWidget::~cPatternSimulatorSceneWidget() { + delete scene; +} + + +void cPatternSimulatorSceneWidget::initialize(cPeaksList isotopicpattern, double fwhm) { + this->isotopicpattern = isotopicpattern; + this->fwhm = fwhm; + + minmzratio = max(isotopicpattern.getMinimumMZRatio() - mzoverhead, 0.0); + maxmzratio = isotopicpattern.getMaximumMZRatio() + mzoverhead; + emit updateMZInterval(minmzratio, maxmzratio); + + setScene(scene); + + origwidth = viewport()->width() * 4 / 5; + origheight = viewport()->height() * 3 / 5; + + // a visualization fix + origwidth = (origwidth / 10) * 10; + origheight = (origheight / 10) * 10; + + originalmatrix = matrix(); + + redrawScene(); +} + + +void cPatternSimulatorSceneWidget::exportToPDF(QString filename, bool postscript) { + QPrinter printer; + if (postscript) { + printer.setPaperSize(QSizeF(scene->width() + 100, scene->height() + 100), QPrinter::DevicePixel); + printer.setPageMargins (50, 50, 50, 50, QPrinter::DevicePixel); + } + else { + printer.setPaperSize(QSizeF(scene->width(), scene->height()), QPrinter::DevicePixel); + printer.setPageMargins (0, 0, 0, 0, QPrinter::DevicePixel); + } + printer.setOutputFormat(QPrinter::NativeFormat); + printer.setOutputFileName(filename); + + QPainter painter; + 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 + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + painter.setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing|QPainter::SmoothPixmapTransform); + scene->render(&painter); + painter.end(); +} + + +void cPatternSimulatorSceneWidget::exportToSVG(QString filename) { + QSvgGenerator generator; + generator.setFileName(filename); + generator.setSize(QSize(scene->width(), scene->height())); + generator.setViewBox(QRect(0, 0, scene->width(), scene->height())); + + QPainter painter; + if (!painter.begin(&generator)) { + QMessageBox msgBox; + QString errstr = "The file cannot be created."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + painter.fillRect(QRect(0, 0, scene->width(), scene->height()), Qt::white); + scene->render(&painter); + painter.end(); +} + + +void cPatternSimulatorSceneWidget::exportToPNG(QString filename) { + QImage image(scene->width(), scene->height(), QImage::Format_ARGB32); + image.fill(Qt::white); + + QPainter painter; + if (!painter.begin(&image)) { + QMessageBox msgBox; + QString errstr = "The file cannot be created."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + scene->render(&painter); + painter.end(); + image.save(filename); +} + + +void cPatternSimulatorSceneWidget::hidePeakLabels(bool state) { + hidelabels = state; + redrawScene(); +} + + +void cPatternSimulatorSceneWidget::wheelEvent(QWheelEvent *event) { + double part, newmin, newmax; + + if (event->delta() > 0) { + part = fabs(maxmzratio - minmzratio) / 10.0; + newmin = minmzratio + part; + newmax = maxmzratio - part; + } + else { + part = fabs(maxmzratio - minmzratio) / 8.0; + newmin = max(minmzratio - part, 0.0); + newmax = min(maxmzratio + part, isotopicpattern.getMaximumMZRatio() + mzoverhead); + } + + if (newmin < newmax) { + minmzratio = newmin; + maxmzratio = newmax; + emit updateMZInterval(minmzratio, maxmzratio); + redrawScene(); + viewport()->update(); + } + + event->accept(); +} + + +void cPatternSimulatorSceneWidget::mouseMoveEvent(QMouseEvent *event) { + QGraphicsView::mouseMoveEvent(event); + + QPointF p = mapToScene(event->x(), event->y()); + + QPointF curpos; + curpos.setX(p.x() + 15); + curpos.setY(p.y() - 2); + + double mz = getMZRatioFromXPosition((int)p.x(), origwidth); + double intensity = getIntensityFromYPosition((int)p.y(), origheight); + QString curtext = "m/z: " + QString::number(mz) + ", int: " + QString::number(intensity); + if (!absoluteintensity) { + curtext += " %"; + } + + cursorsimpletextitem->setPos(curpos); + cursorsimpletextitem->setText(curtext); + + if ((pressedx != -1) && (pressedy != -1)) { + cursorsimpletextitem->setVisible(false); + + currentx = (int)p.x(); + currenty = (int)p.y(); + + if (enablemousemzselection) { + updateZoomGroup(); + } + else { + calculateMinMaxMZ(); + + emit updateMZInterval(minmzratio, maxmzratio); + + pressedx = currentx; + pressedy = currenty; + + redrawScene(); + } + } + else { + if (((int)p.x() >= leftmargin) && ((int)p.x() <= origwidth - rightmargin) && ((int)p.y() >= topmargin) && ((int)p.y() <= origheight - bottommargin)) { + cursorsimpletextitem->setVisible(true); + } + else { + cursorsimpletextitem->setVisible(false); + } + } + + event->accept(); +} + + +void cPatternSimulatorSceneWidget::mouseReleaseEvent(QMouseEvent *event) { + QGraphicsView::mouseReleaseEvent(event); + + if (pressedx == currentx) { + pressedx = -1; + currentx = -1; + + redrawScene(); + } + + if ((event->button() == Qt::LeftButton) && (pressedx != -1) && (pressedy != -1)) { + calculateMinMaxMZ(); + + emit updateMZInterval(minmzratio, maxmzratio); + + pressedx = -1; + pressedy = -1; + + redrawScene(); + } + + QPointF p = mapToScene(event->x(), event->y()); + + QPointF curpos; + curpos.setX(p.x() + 15); + curpos.setY(p.y() - 2); + + double mz = getMZRatioFromXPosition((int)p.x(), origwidth); + double intensity = getIntensityFromYPosition((int)p.y(), origheight); + QString curtext = "m/z: " + QString::number(mz) + ", int: " + QString::number(intensity); + if (!absoluteintensity) { + curtext += " %"; + } + + cursorsimpletextitem->setPos(curpos); + cursorsimpletextitem->setText(curtext); + + if (((int)p.x() >= leftmargin) && ((int)p.x() <= origwidth - rightmargin) && ((int)p.y() >= topmargin) && ((int)p.y() <= origheight - bottommargin)) { + cursorsimpletextitem->setVisible(true); + } + else { + cursorsimpletextitem->setVisible(false); + } + + event->accept(); +} + + +void cPatternSimulatorSceneWidget::mousePressEvent(QMouseEvent *event) { + QGraphicsView::mousePressEvent(event); + + cursorsimpletextitem->setVisible(false); + + if (event->button() == Qt::LeftButton) { + QPointF p = mapToScene(event->x(), event->y()); + pressedx = (int)p.x(); + pressedy = (int)p.y(); + + currentx = pressedx; + currenty = pressedy; + + if (enablemousemzselection) { + updateZoomGroup(); + } + } + + if (event->button() == Qt::RightButton) { + pressedx = -1; + pressedy = -1; + + redrawScene(); + } + + //if (enablemousemzselection) { + if (event->button() == Qt::MiddleButton) { + pressedx = -1; + pressedy = -1; + + resetMZInterval(); + + redrawScene(); + } + //} + + event->accept(); +} + + +void cPatternSimulatorSceneWidget::showEvent(QShowEvent *event) { + QGraphicsView::showEvent(event); + + if (firstshow) { + normalSize(); + firstshow = false; + } +} + + +void cPatternSimulatorSceneWidget::resizeEvent(QResizeEvent *event) { + QGraphicsView::resizeEvent(event); + + origwidth = viewport()->width() * 4 / 5; + origheight = viewport()->height() * 3 / 5; + + // a visualization fix + origwidth = (origwidth / 10) * 10; + origheight = (origheight / 10) * 10; + + calledbyresizeevent = true; + + redrawScene(); +} + + +double cPatternSimulatorSceneWidget::getMZRatioFromXPosition(int x, int w) { + double mz = (double)(x - leftmargin) / (double)(w - leftmargin - rightmargin) * (maxmzratio - minmzratio) + minmzratio; + return max(0.0, mz); +} + + +int cPatternSimulatorSceneWidget::getXPositionFromMZRatio(double mzratio, int w) { + double val = mzratio - minmzratio; + val /= maxmzratio - minmzratio; + val *= double(w - leftmargin - rightmargin); + return (int)val + leftmargin; +} + + +double cPatternSimulatorSceneWidget::getIntensityFromYPosition(int y, int h) { + double maximumintensity = getMaximumIntensity(); + double intensity = (double)(y - topmargin) / (double)(h - topmargin - bottommargin) * maximumintensity; + intensity = maximumintensity - intensity; + return max(0.0, intensity); +} + + +int cPatternSimulatorSceneWidget::getYPositionFromIntensity(double intensity, int h) { + double maximumintensity = getMaximumIntensity(); + double val = maximumintensity - intensity; + val /= maximumintensity; + val *= double(h - topmargin - bottommargin); + return (int)val + topmargin; +} + + +void cPatternSimulatorSceneWidget::redrawScene() { + QGraphicsSimpleTextItem* simpletext; + QGraphicsTextItem* text; + QGraphicsLineItem* line; + + int x; + double y; + qreal tx, ty, tw, th, sumh; + + char tmpbuf[30]; + string s; + + int xstep, ystep; + int w = origwidth; + int h = origheight; + int rulergranularity = 10; + + cPeaksList visiblepeaks; + visiblepeaks.clear(); + + QList hiddenitems; + + vector hits; + size_t pos1, pos2; + string tmpsubstr; + + QFont myFont("Arial", 8); + QFontMetrics fm(myFont); + + double maxintensity = getMaximumIntensity(); + + scene->removeItem(zoomgroup); + scene->removeItem(cursorsimpletextitem); + + scene->clear(); + + zoomgroup->setVisible(false); + scene->addItem(zoomgroup); + + cursorsimpletextitem->setVisible(false); + scene->addItem(cursorsimpletextitem); + + + // x axis + line = scene->addLine(leftmargin, h - bottommargin, w - rightmargin, h - bottommargin, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + // x axis ruler + xstep = (w - leftmargin - rightmargin) / rulergranularity; + for (int i = 0; i < rulergranularity; i++) { + line = scene->addLine(leftmargin + xstep * i, h - bottommargin, leftmargin + xstep * i, h - bottommargin + 10, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + } + line = scene->addLine(w - rightmargin, h - bottommargin, w - rightmargin, h - bottommargin + 10, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + simpletext = scene->addSimpleText(QString::number(minmzratio), myFont); + simpletext->setPos(QPointF(leftmargin - simpletext->boundingRect().width() / 2, h - bottommargin + 12)); + simpletext->setZValue(1); + + if (maxmzratio - minmzratio > 0.01) { + xstep = (w - leftmargin - rightmargin) / rulergranularity; + for (int i = 1; i < rulergranularity; i++) { + simpletext = scene->addSimpleText(QString::number(minmzratio + (maxmzratio - minmzratio) / (double)rulergranularity * (double)i), myFont); + simpletext->setPos(QPointF(leftmargin + xstep * i - simpletext->boundingRect().width() / 2, h - bottommargin + 12)); + simpletext->setZValue(1); + } + } + + simpletext = scene->addSimpleText(QString::number(maxmzratio), myFont); + simpletext->setPos(QPointF(w - rightmargin - simpletext->boundingRect().width() / 2, h - bottommargin + 12)); + simpletext->setZValue(1); + + + // y axis + line = scene->addLine(leftmargin, h - bottommargin, leftmargin, h - bottommargin - std::max(h - topmargin - bottommargin, 0), QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + // y axis ruler + ystep = (h - topmargin - bottommargin) / rulergranularity; + for (int i = 0; i < rulergranularity; i++) { + line = scene->addLine(leftmargin - 10, h - bottommargin - ystep * i, leftmargin, h - bottommargin - ystep * i, QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + } + line = scene->addLine(leftmargin - 10, h - bottommargin - std::max(h - topmargin - bottommargin, 0), leftmargin, h - bottommargin - std::max(h - topmargin - bottommargin, 0), QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + if (absoluteintensity) { + simpletext = scene->addSimpleText(QString::number(0), myFont); + } + else { + simpletext = scene->addSimpleText(QString::number(0) + " %", myFont); + } + simpletext->setPos(QPointF(leftmargin - 15 - simpletext->boundingRect().width(), h - bottommargin - simpletext->boundingRect().height() / 2)); + simpletext->setZValue(1); + + ystep = (h - topmargin - bottommargin) / rulergranularity; + if (absoluteintensity) { + if (maxintensity > rulergranularity) { + for (int i = 1; i < rulergranularity; i++) { + simpletext = scene->addSimpleText(QString::number((unsigned long long)maxintensity / (unsigned long long)rulergranularity * (unsigned long long)i), myFont); + simpletext->setPos(QPointF(leftmargin - 15 - simpletext->boundingRect().width(), h - bottommargin - simpletext->boundingRect().height() / 2 - ystep * i)); + simpletext->setZValue(1); + } + } + } + else { + if (maxintensity > 0) { + for (int i = 1; i < rulergranularity; i++) { + simpletext = scene->addSimpleText(QString::number(maxintensity / (double)rulergranularity * (double)i) + " %", myFont); + simpletext->setPos(QPointF(leftmargin - 15 - simpletext->boundingRect().width(), h - bottommargin - simpletext->boundingRect().height() / 2 - ystep * i)); + simpletext->setZValue(1); + } + } + } + + if (absoluteintensity) { + simpletext = scene->addSimpleText(QString::number((unsigned long long)maxintensity), myFont); + } + else { + simpletext = scene->addSimpleText(QString::number(maxintensity) + " %", myFont); + } + simpletext->setPos(QPointF(leftmargin - 15 - simpletext->boundingRect().width(), h - bottommargin - std::max(h - topmargin - bottommargin, 0) - simpletext->boundingRect().height() / 2)); + simpletext->setZValue(1); + + + // select visible peaks + for (int i = 0; i < isotopicpattern.size(); i++) { + // skip peaks which are out of range + if ((isotopicpattern[i].mzratio < minmzratio) || (isotopicpattern[i].mzratio > maxmzratio)) { + continue; + } + visiblepeaks.add(isotopicpattern[i]); + } + visiblepeaks.sortbyRelativeIntensityDesc(); + + + // visible peaks only + for (int i = 0; i < (int)visiblepeaks.size(); i++) { + + x = getXPositionFromMZRatio(visiblepeaks[i].mzratio, w); + + if (absoluteintensity) { + y = visiblepeaks[i].absoluteintensity / maxintensity * (h - topmargin - bottommargin); + } + else { + y = visiblepeaks[i].relativeintensity / maxintensity * (h - topmargin - bottommargin); + } + + hits.clear(); + + pos1 = 0; + pos2 = visiblepeaks[i].description.find(";"); + while (pos2 != string::npos) { + tmpsubstr = visiblepeaks[i].description.substr(pos1, pos2 - pos1); + + if (!tmpsubstr.empty()) { + hits.push_back(tmpsubstr); + } + else { + break; + } + + pos1 = pos2 + 1; + pos2 = visiblepeaks[i].description.find(";", pos1); + } + + sprintf_s(tmpbuf,"%.5f\0",visiblepeaks[i].mzratio); + s = tmpbuf; + hits.push_back(s); + + if (hits.size() > 1) { + line = scene->addLine(x, h - bottommargin - 2, x, h - bottommargin - std::max((int)y, 2), QPen(Qt::red, 2, Qt::SolidLine)); + line->setZValue(2); + + 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); + //if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { + // 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; + } + + if (hidelabels) { + break; + } + } + } + else { + line = scene->addLine(x, h - bottommargin - 2, x, h - bottommargin - std::max((int)y, 2), QPen(Qt::black, 2, Qt::SolidLine)); + line->setZValue(1); + + simpletext = scene->addSimpleText(hits[0].c_str(), myFont); + tw = simpletext->boundingRect().width(); + th = simpletext->boundingRect().height(); + tx = x - 2; + ty = h - bottommargin - std::max((int)y, 2) - th - 1 - 4; + simpletext->setPos(tx, ty); + simpletext->setBrush(Qt::black); + simpletext->setZValue(1); + + if (scene->items(tx, ty, tw, th, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder).size() > 1) { + scene->removeItem(simpletext); + } + } + + } + + + // draw profile spectrum + if (rawdatastate) { + + QPainterPath rpath; + + visiblepeaks.sortbyMass(); + + const int step = 1; + + int xmin = getXPositionFromMZRatio(minmzratio, w); + int xmax = getXPositionFromMZRatio(maxmzratio, w); + int a, ny, yval; + double sigma; + double relint; + + for (int i = xmin; i < xmax; i += step) { + relint = 0; + for (int j = 0; j < visiblepeaks.size(); j++) { + if (absoluteintensity) { + a = getYPositionFromIntensity(visiblepeaks[j].absoluteintensity, h); + } + else { + a = getYPositionFromIntensity(visiblepeaks[j].relativeintensity, h); + } + ny = getXPositionFromMZRatio(visiblepeaks[j].mzratio, w); + + sigma = fwhm / (2.0 * sqrt(2.0 * log(2.0))); + sigma /= maxmzratio - minmzratio; + sigma *= double(w - leftmargin - rightmargin); + + a = h - topmargin - bottommargin - a; + + relint += computeGaussFunction((double)i, (double)a, (double)ny, sigma); + } + + yval = h - topmargin - bottommargin - (int)relint; + + if (i == xmin) { + rpath.moveTo(i, yval); + } + else { + rpath.lineTo(i, yval); + } + } + + scene->addPath(rpath, QPen(Qt::gray, 1, Qt::SolidLine)); + + } + + + scene->removeItem(zoomgroup); + scene->removeItem(cursorsimpletextitem); + + if (calledbyresizeevent) { + oldwidth.push_back(origwidth); + oldheight.push_back(origheight); + } + else { + oldwidth.clear(); + oldheight.clear(); + } + + bool blocksignal = false; + // detection of cyclic calls redrawScene<->resizeEvent + if ((oldwidth.size() == 4) && (oldheight.size() == 4)) { + if ((oldwidth[3] == oldwidth[1]) && (oldheight[3] == oldheight[1]) && (oldwidth[2] == oldwidth[0]) && (oldheight[2] == oldheight[0])) { + blocksignal = true; + } + } + + if (blocksignal) { + scene->blockSignals(true); + } + + scene->setSceneRect(scene->itemsBoundingRect()); + + if (blocksignal) { + scene->blockSignals(false); + } + + zoomgroup->setVisible(false); + scene->addItem(zoomgroup); + + cursorsimpletextitem->setVisible(false); + scene->addItem(cursorsimpletextitem); + + while (oldwidth.size() > 3) { + oldwidth.pop_front(); + } + + while (oldheight.size() > 3) { + oldheight.pop_front(); + } + + calledbyresizeevent = false; + +} + + +void cPatternSimulatorSceneWidget::updateZoomGroup() { + qreal rx1, rx2, ry1, ry2; + QFont myFont("Arial", 8); + + if (currentx < pressedx) { + rx1 = currentx; + rx2 = pressedx; + } + else { + rx1 = pressedx; + rx2 = currentx; + } + + if (currenty < pressedy) { + ry1 = currenty; + ry2 = pressedy; + } + else { + ry1 = pressedy; + ry2 = currenty; + } + + zoomrect->setPen(QPen(Qt::black, 1, Qt::DashLine)); + zoomrect->setRect(QRectF(QPointF(rx1, ry1), QPointF(rx2, ry2))); + + QString qstr = "m/z: "; + qstr += QString::number(getMZRatioFromXPosition((pressedx < currentx)?pressedx:currentx, origwidth)); + qstr += "-"; + qstr += QString::number(getMZRatioFromXPosition((pressedx < currentx)?currentx:pressedx, origwidth)); + qstr += "\ndiff: "; + qstr += QString::number(getMZRatioFromXPosition((pressedx < currentx)?currentx:pressedx, origwidth) - getMZRatioFromXPosition((pressedx < currentx)?pressedx:currentx, origwidth)); + + zoomsimpletextitem->setFont(myFont); + zoomsimpletextitem->setText(qstr); + zoomsimpletextitem->setPos(QPointF(pressedx, pressedy - 2)); + + zoomgroup->setVisible(true); +} + + +void cPatternSimulatorSceneWidget::calculateMinMaxMZ() { + if (pressedx < leftmargin) { + pressedx = leftmargin; + } + + if (pressedx > origwidth - rightmargin) { + pressedx = origwidth - rightmargin; + } + + if (currentx < leftmargin) { + currentx = leftmargin; + } + + if (currentx > origwidth - rightmargin) { + currentx = origwidth - rightmargin; + } + + double tmpminmzratio = getMZRatioFromXPosition((pressedx < currentx) ? pressedx : currentx, origwidth); + double tmpmaxmzratio = getMZRatioFromXPosition((pressedx < currentx) ? currentx : pressedx, origwidth); + + if (enablemousemzselection) { + minmzratio = tmpminmzratio; + maxmzratio = tmpmaxmzratio; + } + else { + if (pressedx > currentx) { + minmzratio = min(minmzratio + tmpmaxmzratio - tmpminmzratio, isotopicpattern.getMaximumMZRatio() + mzoverhead); + maxmzratio = min(maxmzratio + tmpmaxmzratio - tmpminmzratio, isotopicpattern.getMaximumMZRatio() + mzoverhead); + } + else { + minmzratio = max(0.0, minmzratio - tmpmaxmzratio + tmpminmzratio); + maxmzratio = max(0.0, maxmzratio - tmpmaxmzratio + tmpminmzratio); + } + } +} + + +double cPatternSimulatorSceneWidget::getMaximumIntensity() { + double maxintensity = 0; + + if (absoluteintensity) { + maxintensity = isotopicpattern.getMaximumAbsoluteIntensityFromMZInterval(minmzratio, maxmzratio, false, false, other, false); + } + else { + maxintensity = isotopicpattern.getMaximumRelativeIntensityFromMZInterval(minmzratio, maxmzratio, false, false, other, false); + } + + return maxintensity; +} + + +void cPatternSimulatorSceneWidget::zoomIn() { + if (currentscale < 32) { + currentscale += factor; + setMatrix(originalmatrix); + scale(currentscale, currentscale); + verticalScrollBar()->setSliderPosition(verticalScrollBar()->maximum()); + } +} + + +void cPatternSimulatorSceneWidget::zoomOut() { + if (currentscale > 1) { + currentscale -= factor; + setMatrix(originalmatrix); + scale(currentscale, currentscale); + verticalScrollBar()->setSliderPosition(verticalScrollBar()->maximum()); + } +} + + +void cPatternSimulatorSceneWidget::normalSize() { + currentscale = 1; + setMatrix(originalmatrix); + verticalScrollBar()->setSliderPosition(verticalScrollBar()->maximum()); +} + + +void cPatternSimulatorSceneWidget::absoluteIntensityStateChanged(bool state) { + absoluteintensity = state; + redrawScene(); +} + + +void cPatternSimulatorSceneWidget::rawDataStateChanged(bool state) { + rawdatastate = state; + redrawScene(); +} + + +void cPatternSimulatorSceneWidget::setMZInterval(double minmz, double maxmz) { + if (maxmz < minmz) { + double tmp = maxmz; + maxmz = minmz; + minmz = tmp; + } + + minmzratio = std::max(0.0, minmz); + maxmzratio = std::min(maxmz, isotopicpattern.getMaximumMZRatio() + mzoverhead); + emit updateMZInterval(minmzratio, maxmzratio); + + redrawScene(); + viewport()->update(); +} + + +void cPatternSimulatorSceneWidget::resetMZInterval() { + minmzratio = max(isotopicpattern.getMinimumMZRatio() - mzoverhead, 0.0); + maxmzratio = isotopicpattern.getMaximumMZRatio() + mzoverhead; + emit updateMZInterval(minmzratio, maxmzratio); + + redrawScene(); +} + + +void cPatternSimulatorSceneWidget::enableMouseMzSelectionTool(bool enable) { + enablemousemzselection = enable; + pressedx = -1; + pressedy = -1; + + redrawScene(); +} + diff --git a/CycloBranch/gui/cPatternSimulatorSceneWidget.h b/CycloBranch/gui/cPatternSimulatorSceneWidget.h new file mode 100644 index 0000000..becd776 --- /dev/null +++ b/CycloBranch/gui/cPatternSimulatorSceneWidget.h @@ -0,0 +1,268 @@ +/** + \file cPatternSimulatorSceneWidget.h + \brief The implementation of an isotopic pattern simulator (graphics). +*/ + + +#ifndef _CPATTERNSIMULATORSCENEWIDGET_H +#define _CPATTERNSIMULATORSCENEWIDGET_H + +#include +#include +#include + +#include "core/cTheoreticalSpectrum.h" + + +using namespace std; + + +// forward declaration +class QPaintEvent; +class QGraphicsScene; +class QMatrix; +class QGraphicsItemGroup; +class QGraphicsRectItem; +class QGraphicsSimpleTextItem; + + +/** + \brief Compute value of Gaussian function. + \param x x + \param a a + \param ny ny + \param sigma sigma + \retval double f(x) +*/ +double computeGaussFunction(double x, double a, double ny, double sigma); + + +/** + \brief Compute height of Gaussian function (a). + \param x x + \param y y + \param ny ny + \param sigma sigma + \retval double a +*/ +double computeGaussHeight(double x, double y, double ny, double sigma); + + +/** + \brief The implementation of an isotopic pattern simulator (graphics). +*/ +class cPatternSimulatorSceneWidget : public QGraphicsView +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param parent pointer to a parent widget + */ + cPatternSimulatorSceneWidget(QWidget* parent = 0); + + + /** + \brief The destructor. + */ + ~cPatternSimulatorSceneWidget(); + + + /** + \brief Initialize the widget. + \param isotopicpattern an isotopic pattern + \param fwhm fwhm + */ + void initialize(cPeaksList isotopicpattern, double fwhm); + + + /** + \brief Export spectrum scene into a PDF or a PS file. + \param filename filename + \param postscript if true then PS file is generated instead of PDF + */ + void exportToPDF(QString filename, bool postscript); + + + /** + \brief Export spectrum scene into a SVG file. + \param filename filename + */ + void exportToSVG(QString filename); + + + /** + \brief Export spectrum scene into a PNG file. + \param filename filename + */ + void exportToPNG(QString filename); + + + /** + \brief Hide/Show labels of peaks. + \param state the peak labels are hidden when \a state is true + */ + void hidePeakLabels(bool state); + + +protected: + + + /** + \brief Handle the mouse wheel event. + \param event pointer to QWheelEvent + */ + void wheelEvent(QWheelEvent *event); + + + /** + \brief Handle the mouse move event. + \param event pointer to QMouseEvent + */ + void mouseMoveEvent(QMouseEvent *event); + + + /** + \brief Handle the mouse release event. + \param event pointer to QMouseEvent + */ + void mouseReleaseEvent(QMouseEvent *event); + + + /** + \brief Handle the mouse press event. + \param event pointer to QMouseEvent + */ + void mousePressEvent(QMouseEvent *event); + + + /** + \brief Handle the widget show event. + \param event pointer to QShowEvent + */ + void showEvent(QShowEvent *event); + + + /** + \brief Handle the widget resize event. + \param event pointer to QResizeEvent + */ + void resizeEvent(QResizeEvent *event); + + +private: + + QWidget* parent; + QGraphicsScene* scene; + QMatrix originalmatrix; + + QGraphicsItemGroup* zoomgroup; + QGraphicsRectItem* zoomrect; + QGraphicsSimpleTextItem* zoomsimpletextitem; + + QGraphicsSimpleTextItem* cursorsimpletextitem; + + cPeaksList isotopicpattern; + + qreal currentscale; + qreal factor; + + int origwidth; + int origheight; + + bool calledbyresizeevent; + deque oldwidth; + deque oldheight; + + bool absoluteintensity; + bool rawdatastate; + bool hidelabels; + + int pressedx; + int pressedy; + + int currentx; + int currenty; + + double minmzratio; + double maxmzratio; + + int topmargin; + int bottommargin; + int leftmargin; + int rightmargin; + + bool firstshow; + bool enablemousemzselection; + + double mzoverhead; + double fwhm; + + + double getMZRatioFromXPosition(int x, int w); + + + int getXPositionFromMZRatio(double mzratio, int w); + + + double getIntensityFromYPosition(int y, int h); + + + int getYPositionFromIntensity(double intensity, int h); + + + void redrawScene(); + + + void updateZoomGroup(); + + + void calculateMinMaxMZ(); + + + double getMaximumIntensity(); + + +signals: + + + /** + \brief The signal is emitted when the range of m/z ratios has been changed. + \param minmz a minimum threshold of m/z ratio + \param maxmz a maximum threshold of m/z ratio + */ + void updateMZInterval(double minmz, double maxmz); + + +private slots: + + + void zoomIn(); + + + void zoomOut(); + + + void normalSize(); + + + void absoluteIntensityStateChanged(bool state); + + + void rawDataStateChanged(bool state); + + + void setMZInterval(double minmz, double maxmz); + + + void resetMZInterval(); + + + void enableMouseMzSelectionTool(bool enable); + +}; + +#endif diff --git a/CycloBranch/gui/cPatternSimulatorWidget.cpp b/CycloBranch/gui/cPatternSimulatorWidget.cpp new file mode 100644 index 0000000..a8994f0 --- /dev/null +++ b/CycloBranch/gui/cPatternSimulatorWidget.cpp @@ -0,0 +1,782 @@ +#include "gui/cPatternSimulatorWidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +cPatternSimulatorWidget::cPatternSimulatorWidget(cGlobalPreferences* globalpreferences, QWidget *parent) { + this->parent = parent; + this->globalpreferences = globalpreferences; + + setWindowTitle("Simulate Isotopic Pattern"); + setWindowIcon(QIcon(":/images/icons/pattern.png")); + + vsplitter = new QSplitter(); + vsplitter->setOrientation(Qt::Vertical); + + hsplitter1 = new QSplitter(); + hsplitter1->setOrientation(Qt::Horizontal); + + hsplitter2 = new QSplitter(); + hsplitter2->setOrientation(Qt::Horizontal); + + spectrumscene = new cPatternSimulatorSceneWidget(this); + + menuBar = new QMenuBar(this); + menuBar->setNativeMenuBar(false); + menuFile = new QMenu(tr("&File"), this); + menuView = new QMenu(tr("&View"), this); + menuHelp = new QMenu(tr("&Help"), this); + + toolbarFile = addToolBar(tr("File")); + + 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); + connect(actionExportTable, SIGNAL(triggered()), this, SLOT(exportTableToCSV())); + + actionExportSpectrum = new QAction(QIcon(":/images/icons/66.png"), tr("Export Ima&ge"), this); + actionExportSpectrum->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_G)); + actionExportSpectrum->setToolTip("Export Image (Ctrl + G)"); + toolbarFile->addAction(actionExportSpectrum); + connect(actionExportSpectrum, SIGNAL(triggered()), this, SLOT(exportSpectrum())); + + actionCloseWindow = new QAction(QIcon(":/images/icons/33.png"), tr("&Close"), this); + actionCloseWindow->setShortcut(QKeySequence(Qt::Key_Escape)); + actionCloseWindow->setToolTip("Close (Esc)"); + toolbarFile->addAction(actionCloseWindow); + connect(actionCloseWindow, SIGNAL(triggered()), this, SLOT(closeWindow())); + + toolbarView = addToolBar(tr("View")); + + actionZoomIn = new QAction(QIcon(":/images/icons/83.png"), tr("Zoom &In"), this); + actionZoomIn->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Plus)); + actionZoomIn->setToolTip("Zoom In (Ctrl +)"); + toolbarView->addAction(actionZoomIn); + connect(actionZoomIn, SIGNAL(triggered()), spectrumscene, SLOT(zoomIn())); + + actionZoomOut = new QAction(QIcon(":/images/icons/82.png"), tr("Zoom &Out"), this); + actionZoomOut->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Minus)); + actionZoomOut->setToolTip("Zoom Out (Ctrl -)"); + toolbarView->addAction(actionZoomOut); + connect(actionZoomOut, SIGNAL(triggered()), spectrumscene, SLOT(zoomOut())); + + actionZoomReset = new QAction(QIcon(":/images/icons/84.png"), tr("&Reset Zoom"), this); + actionZoomReset->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R)); + actionZoomReset->setToolTip("Zoom Reset (Ctrl + R)"); + toolbarView->addAction(actionZoomReset); + connect(actionZoomReset, SIGNAL(triggered()), spectrumscene, SLOT(normalSize())); + + toolbarView->addSeparator(); + + actionAbsoluteIntensity = new QAction(QIcon(":/images/icons/11.png"), tr("&Absolute Intensity"), this); + actionAbsoluteIntensity->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)); + actionAbsoluteIntensity->setToolTip("Absolute Intensity (Ctrl + I)"); + actionAbsoluteIntensity->setCheckable(true); + toolbarView->addAction(actionAbsoluteIntensity); + connect(actionAbsoluteIntensity, SIGNAL(toggled(bool)), spectrumscene, SLOT(absoluteIntensityStateChanged(bool))); + + actionRawData = new QAction(QIcon(":/images/icons/chromatography.png"), tr("&Profile Spectrum"), this); + actionRawData->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); + actionRawData->setToolTip("Profile Spectrum (Ctrl + P)"); + actionRawData->setCheckable(true); + actionRawData->setChecked(true); + toolbarView->addAction(actionRawData); + connect(actionRawData, SIGNAL(toggled(bool)), this, SLOT(rawDataStateChanged(bool))); + connect(this, SIGNAL(rawDataStateChangedSignal(bool)), spectrumscene, SLOT(rawDataStateChanged(bool))); + + toolbarView->addSeparator(); + + actionHideLabels = new QAction(QIcon(":/images/icons/79.png"), tr("Hide Peak &Labels"), this); + actionHideLabels->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L)); + actionHideLabels->setToolTip("Hide Peak Labels (Ctrl + L)"); + actionHideLabels->setCheckable(true); + actionHideLabels->setChecked(true); + toolbarView->addAction(actionHideLabels); + connect(actionHideLabels, SIGNAL(toggled(bool)), this, SLOT(hidePeakLabels(bool))); + + toolbarHelp = addToolBar(tr("Help")); + + actionHTMLDocumentation = new QAction(QIcon(":/images/icons/3.png"), tr("&HTML Documentation"), this); + actionHTMLDocumentation->setShortcut(QKeySequence(Qt::Key_F1)); + actionHTMLDocumentation->setToolTip("Show HTML Documentation (F1)"); + toolbarHelp->addAction(actionHTMLDocumentation); + connect(actionHTMLDocumentation, SIGNAL(triggered()), this, SLOT(showHTMLDocumentation())); + + peakstable = new QTableView(this); + peakstablemodel = new QStandardItemModel(0, 0, this); + proxymodel = new cSpectrumDetailProxyModel(this); + proxymodel->setSourceModel(peakstablemodel); + proxymodel->setDynamicSortFilter(false); + peakstable->setModel(proxymodel); + peakstable->setSortingEnabled(true); + + labelmz = new QLabel(tr("m/z: ")); + + minmz = new QDoubleSpinBox(); + minmz->setDecimals(6); + minmz->setRange(0, 100000); + minmz->setSingleStep(1); + + labelseparator = new QLabel(tr("-")); + + maxmz = new QDoubleSpinBox(); + maxmz->setDecimals(6); + maxmz->setRange(0, 100000); + maxmz->setSingleStep(1); + + setmzinterval = new QPushButton("Set"); + setmzinterval->setMinimumWidth(75); + connect(setmzinterval, SIGNAL(released()), this, SLOT(setMZInterval())); + connect(this, SIGNAL(emitMZInterval(double, double)), spectrumscene, SLOT(setMZInterval(double, double))); + + resetmzinterval = new QPushButton("Reset"); + resetmzinterval->setMinimumWidth(75); + connect(resetmzinterval, SIGNAL(released()), spectrumscene, SLOT(resetMZInterval())); + connect(spectrumscene, SIGNAL(updateMZInterval(double, double)), this, SLOT(updateMZInterval(double, double))); + + hboxmz = new QHBoxLayout(); + hboxmz->addWidget(labelmz); + hboxmz->addWidget(minmz); + hboxmz->addWidget(labelseparator); + hboxmz->addWidget(maxmz); + hboxmz->addSpacing(5); + hboxmz->addWidget(setmzinterval); + hboxmz->addSpacing(5); + hboxmz->addWidget(resetmzinterval); + + widgetmz = new QWidget(); + widgetmz->setLayout(hboxmz); + + toolbarMz = addToolBar(tr("m/z")); + + actionMouseMzSelection = new QAction(QIcon(":/images/icons/64.png"), tr("Mouse m/z Selection Tool"), this); + actionMouseMzSelection->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_T)); + actionMouseMzSelection->setToolTip("Mouse m/z Selection Tool (Ctrl + T)"); + actionMouseMzSelection->setCheckable(true); + actionMouseMzSelection->setChecked(true); + actionMouseMzSelection->setEnabled(true); + toolbarMz->addAction(actionMouseMzSelection); + connect(actionMouseMzSelection, SIGNAL(toggled(bool)), spectrumscene, SLOT(enableMouseMzSelectionTool(bool))); + + toolbarMz->addWidget(widgetmz); + + addToolBarBreak(); + + toolbarInput = addToolBar(tr("Input")); + + labeliontype = new QLabel(tr("Ion Type: ")); + comboboxiontype = new QComboBox(); + comboboxiontype->setSizeAdjustPolicy(QComboBox::AdjustToContents); + hboxiontype = new QHBoxLayout(); + hboxiontype->addWidget(labeliontype); + hboxiontype->addWidget(comboboxiontype); + widgetiontype = new QWidget(); + widgetiontype->setLayout(hboxiontype); + toolbarInput->addWidget(widgetiontype); + + labelformula = new QLabel("Formula (M): "); + lineeditformula = new QLineEdit(); + hboxformula = new QHBoxLayout(); + hboxformula->addWidget(labelformula); + hboxformula->addWidget(lineeditformula); + widgetformula = new QWidget(); + widgetformula->setLayout(hboxformula); + widgetformula->setMaximumWidth(300); + toolbarInput->addWidget(widgetformula); + + labelfwhm = new QLabel("FWHM: "); + doublespinboxfwhm = new QDoubleSpinBox(); + //doublespinboxfwhm->setMinimumWidth(120); + doublespinboxfwhm->setDecimals(6); + doublespinboxfwhm->setRange(0, 1); + doublespinboxfwhm->setSingleStep(0.001); + doublespinboxfwhm->setSuffix(" Da"); + doublespinboxfwhm->setValue(0.05); + hboxfwhm = new QHBoxLayout(); + hboxfwhm->addWidget(labelfwhm); + hboxfwhm->addWidget(doublespinboxfwhm); + widgetfwhm = new QWidget(); + widgetfwhm->setLayout(hboxfwhm); + toolbarInput->addWidget(widgetfwhm); + + labelcharge = new QLabel("Charge: "); + spinboxcharge = new QSpinBox(); + //spinboxcharge->setMinimumWidth(120); + spinboxcharge->setRange(-100, 100); + spinboxcharge->setSingleStep(1); + spinboxcharge->setValue(1); + hboxcharge = new QHBoxLayout(); + hboxcharge->addWidget(labelcharge); + hboxcharge->addWidget(spinboxcharge); + widgetcharge = new QWidget(); + widgetcharge->setLayout(hboxcharge); + toolbarInput->addWidget(widgetcharge); + + labelabsoluteintensity = new QLabel("Max. Absolute Intensity: "); + doublespinboxabsoluteintensity = new QDoubleSpinBox(); + //doublespinboxabsoluteintensity->setMinimumWidth(120); + doublespinboxabsoluteintensity->setDecimals(0); + doublespinboxabsoluteintensity->setRange(1000.0, DBL_MAX); + doublespinboxabsoluteintensity->setSingleStep(1000000.0); + doublespinboxabsoluteintensity->setValue(1000000.0); + hboxabsoluteintensity = new QHBoxLayout(); + hboxabsoluteintensity->addWidget(labelabsoluteintensity); + hboxabsoluteintensity->addWidget(doublespinboxabsoluteintensity); + widgetabsoluteintensity = new QWidget(); + widgetabsoluteintensity->setLayout(hboxabsoluteintensity); + toolbarInput->addWidget(widgetabsoluteintensity); + + simulatebutton = new QPushButton("Simulate"); + simulatebutton->setMinimumWidth(75); + toolbarInput->addWidget(simulatebutton); + + connect(simulatebutton, SIGNAL(released()), this, SLOT(simulateButtonReleased())); + + hsplitter1->addWidget(spectrumscene); + hsplitter2->addWidget(peakstable); + + QList sizes; + sizes.push_back(300); + sizes.push_back(100); + + vsplitter->addWidget(hsplitter1); + vsplitter->addWidget(hsplitter2); + + vsplitter->setSizes(sizes); + + setCentralWidget(vsplitter); + centralWidget()->setContentsMargins(5, 5, 5, 5); + + exportdialog = new cExportDialog(this); + + menuFile->addAction(actionExportTable); + menuFile->addAction(actionExportSpectrum); + menuFile->addSeparator(); + menuFile->addAction(actionCloseWindow); + + menuView->addAction(actionZoomIn); + menuView->addAction(actionZoomOut); + menuView->addAction(actionZoomReset); + menuView->addSeparator(); + menuView->addAction(actionAbsoluteIntensity); + menuView->addAction(actionRawData); + menuView->addSeparator(); + menuView->addAction(actionHideLabels); + + menuHelp->addAction(actionHTMLDocumentation); + + menuBar->addMenu(menuFile); + menuBar->addMenu(menuView); + menuBar->addMenu(menuHelp); + + setMenuBar(menuBar); + + resize(defaultwinsizex, defaultwinsizey); + + applyGlobalPreferences(globalpreferences); +} + + +cPatternSimulatorWidget::~cPatternSimulatorWidget() { + delete spectrumscene; + + deleteTable(); + + delete peakstablemodel; + delete proxymodel; + delete peakstable; + + delete labelmz; + delete minmz; + delete labelseparator; + delete maxmz; + delete setmzinterval; + delete resetmzinterval; + delete hboxmz; + delete widgetmz; + + delete labeliontype; + delete comboboxiontype; + delete hboxiontype; + delete widgetiontype; + + delete labelformula; + delete lineeditformula; + delete hboxformula; + delete widgetformula; + + delete labelfwhm; + delete doublespinboxfwhm; + delete hboxfwhm; + delete widgetfwhm; + + delete labelcharge; + delete spinboxcharge; + delete hboxcharge; + delete widgetcharge; + + delete labelabsoluteintensity; + delete doublespinboxabsoluteintensity; + delete hboxabsoluteintensity; + delete widgetabsoluteintensity; + + delete simulatebutton; + + delete hsplitter1; + delete hsplitter2; + + delete vsplitter; + + delete actionExportTable; + delete actionExportSpectrum; + delete actionCloseWindow; + delete actionZoomIn; + delete actionZoomOut; + delete actionZoomReset; + delete actionAbsoluteIntensity; + delete actionRawData; + delete actionHideLabels; + delete actionMouseMzSelection; + delete actionHTMLDocumentation; + + delete exportdialog; + + delete menuFile; + delete menuView; + delete menuHelp; + + delete menuBar; +} + + +void cPatternSimulatorWidget::closeEvent(QCloseEvent *event) { + hide(); + event->accept(); +} + + +void cPatternSimulatorWidget::applyGlobalPreferences(cGlobalPreferences* globalpreferences) { + if (globalpreferences) { + comboboxiontype->clear(); + for (auto it : globalpreferences->customions) { + comboboxiontype->addItem(it.name.c_str()); + } + } +} + + +void cPatternSimulatorWidget::keyPressEvent(QKeyEvent *event) { + if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { + if (minmz->hasFocus() || maxmz->hasFocus() || setmzinterval->hasFocus()) { + setMZInterval(); + } + else { + simulateButtonReleased(); + } + } + + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C)) { + QModelIndexList selectedindexes = peakstable->selectionModel()->selectedIndexes(); + QStandardItem* item; + + QString selectedtext; + string itemtext; + + int selectedcount = selectedindexes.count(); + for (int i = 0; i < selectedcount; i++) { + if (i > 0) { + if (proxymodel->mapToSource(selectedindexes[i - 1]).row() != proxymodel->mapToSource(selectedindexes[i]).row()) { + selectedtext += "\n"; + } + else { + selectedtext += "\t"; + } + } + + item = peakstablemodel->itemFromIndex(proxymodel->mapToSource(selectedindexes[i])); + if (item) { + itemtext = item->text().toStdString(); + selectedtext += stripHTML(itemtext).c_str(); + } + } + selectedtext += "\n"; + QApplication::clipboard()->setText(selectedtext); + } + + event->accept(); +} + + +void cPatternSimulatorWidget::preparePeaksTable(cPeaksList& isotopepattern) { + deleteTable(); + + peakstable->setEditTriggers(QAbstractItemView::NoEditTriggers); + peakstable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); + peakstable->horizontalHeader()->setSectionsMovable(true); + //peakstable->verticalHeader()->setDefaultSectionSize(30); + + peakstablemodel->setColumnCount(4); + + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + peakstablemodel->setHorizontalHeaderItem(i, new QStandardItem()); + } + + int currentcolumn = 0; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical m/z"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical Relative Intensity [%]"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Theoretical Absolute Intensity"); + currentcolumn++; + + peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Summary Formula"); + peakstable->setItemDelegateForColumn(currentcolumn, new cHTMLDelegate()); + + int thpeakscount = isotopepattern.size(); + peakstablemodel->setRowCount(thpeakscount); + + peakstable->setModel(0); + proxymodel->setSourceModel(0); + peakstable->setSortingEnabled(false); + + for (int i = 0; i < thpeakscount; i++) { + currentcolumn = 0; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(isotopepattern[i].mzratio)), Qt::DisplayRole); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(isotopepattern[i].relativeintensity)), Qt::DisplayRole); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropDecimalsByteArray(isotopepattern[i].absoluteintensity)), Qt::DisplayRole); + currentcolumn++; + + peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); + peakstablemodel->item(i, currentcolumn)->setText(isotopepattern[i].description.c_str()); + } + + proxymodel->setSourceModel(peakstablemodel); + peakstable->setModel(proxymodel); + peakstable->setSortingEnabled(true); + + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + peakstable->resizeColumnToContents(i); + } + + peakstable->setColumnWidth(3, min(1200, peakstable->columnWidth(3))); +} + + +void cPatternSimulatorWidget::deleteTable() { + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + if (peakstable->itemDelegateForColumn(i)) { + delete peakstable->itemDelegateForColumn(i); + } + } + peakstablemodel->clear(); +} + + +void cPatternSimulatorWidget::simulateButtonReleased() { + QMessageBox msgbox; + string errmsg; + string tmpstring; + string proton = "H+"; + + if (comboboxiontype->currentIndex() == -1) { + errmsg = "A ion type must be defined (go to 'File->Preferences->Ion Types' in the main window) !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + cIonType iontype = globalpreferences->customions[comboboxiontype->currentIndex()]; + + cSummaryFormula formula; + formula.setFormula(lineeditformula->text().toStdString()); + + double fwhm = doublespinboxfwhm->value(); + int charge = spinboxcharge->value(); + double absoluteintensity = doublespinboxabsoluteintensity->value(); + + if (formula.isEmpty()) { + errmsg = "The formula is empty !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + if (!formula.isValid(errmsg)) { + errmsg = "The formula is not valid !\n\n"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + if (fwhm <= 0) { + errmsg = "The FWHM value must be > 0 !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + if (charge == 0) { + errmsg = "The charge cannot be zero !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + if (absoluteintensity < 1000.0) { + errmsg = "The maximum absolute intensity must be >= 1000 !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + if (iontype.positive && (charge < 0)) { + errmsg = "The selected ion type is defined for positive mode but the value of charge is negative !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + if (!iontype.positive && (charge > 0)) { + errmsg = "The selected ion type is defined for negative mode but the value of charge is positive !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + cSummaryFormula ionformula; + for (int i = 0; i < iontype.multiplier; i++) { + tmpstring = formula.getSummary(); + ionformula.addFormula(tmpstring); + } + ionformula.addFormula(iontype.formula); + + for (int i = 1; i < abs(charge); i++) { + if (iontype.positive) { + ionformula.addFormula(proton); + } + else { + ionformula.addFormula(proton, true); + } + } + + double mz = ionformula.getMass(); + if (mz > 25000) { + errmsg = "The mass of compound exceeds the maximum limit 25000 Da !"; + msgbox.setText(errmsg.c_str()); + msgbox.exec(); + return; + } + + cPeaksList isotopepattern = ionformula.getIsotopePattern(fwhm, abs(charge), iontype.positive, 40, true); + for (int i = 0; i < isotopepattern.size(); i++) { + isotopepattern[i].absoluteintensity = isotopepattern[i].relativeintensity / 100.0 * absoluteintensity; + } + + /* + string ionname = iontype.name.substr(0, iontype.name.size() - 1) + " "; + ionname += to_string(abs(charge)); + if (iontype.positive) { + ionname += "+"; + } + else { + ionname += "-"; + } + */ + + preparePeaksTable(isotopepattern); + + spectrumscene->initialize(isotopepattern, fwhm); +} + + +void cPatternSimulatorWidget::updateMZInterval(double minmz, double maxmz) { + this->minmz->setValue(minmz); + this->maxmz->setValue(maxmz); +} + + +void cPatternSimulatorWidget::setMZInterval() { + emit emitMZInterval(minmz->value(), maxmz->value()); +} + + +void cPatternSimulatorWidget::exportSpectrum() { + QString currentdir = "./"; + if (globalpreferences) { + currentdir = globalpreferences->exportimagedefaultdir; + } + + #if OS_TYPE == WIN + 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..."), currentdir, "PDF Files (*.pdf);; PNG Files (*.png);; SVG Files (*.svg)"); + #endif + if (!filename.isEmpty()) { + regex rx; + bool selected = false; + + rx = ".+\\.pdf$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + spectrumscene->exportToPDF(filename, false); + selected = true; + } + + #if OS_TYPE == WIN + rx = ".+\\.ps$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + spectrumscene->exportToPDF(filename, true); + selected = true; + } + #endif + + rx = ".+\\.png$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + spectrumscene->exportToPNG(filename); + selected = true; + } + + rx = ".+\\.svg$"; + if (!selected && (regex_search(filename.toStdString(), rx))) { + spectrumscene->exportToSVG(filename); + selected = true; + } + + if (!selected) { + QMessageBox msgBox; + QString errstr = "Unsupported file format."; + msgBox.setText(errstr); + msgBox.exec(); + } + } +} + + +void cPatternSimulatorWidget::exportTableToCSV() { + QString currentdir = "./"; + if (globalpreferences) { + currentdir = globalpreferences->exportcsvdefaultdir; + } + + QString filename = QFileDialog::getSaveFileName(this, tr("Export Table to CSV..."), currentdir, "Files (*.csv)"); + + if (!filename.isEmpty()) { + + QProgressDialog progress("Exporting the CSV file...", "Cancel", 0, proxymodel->rowCount(), this); + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + + bool removefile = false; + QFile file(filename); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + return; + } + + QTextStream out(&file); + + for (int i = 0; i < peakstablemodel->columnCount(); i++) { + out << "\"" << peakstablemodel->horizontalHeaderItem(i)->text() << "\""; + if (i < peakstablemodel->columnCount() - 1) { + out << ","; + } + } + out << endl; + + QStandardItem* item; + string str; + for (int i = 0; i < proxymodel->rowCount(); i++) { + + for (int j = 0; j < peakstablemodel->columnCount(); j++) { + item = peakstablemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, j))); + if (item) { + str = item->data(Qt::DisplayRole).toString().toStdString(); + out << "\"" << stripHTML(str).c_str() << "\""; + if (j < peakstablemodel->columnCount() - 1) { + out << ","; + } + } + else { + if (j < peakstablemodel->columnCount() - 1) { + out << ","; + } + } + } + out << endl; + + progress.setValue(i); + if (progress.wasCanceled()) { + removefile = true; + break; + } + } + + file.close(); + + if (removefile) { + file.remove(); + } + + progress.setValue(proxymodel->rowCount()); + + } +} + + +void cPatternSimulatorWidget::rawDataStateChanged(bool state) { + emit rawDataStateChangedSignal(state); +} + + +void cPatternSimulatorWidget::hidePeakLabels(bool hide) { + spectrumscene->hidePeakLabels(hide); +} + + +void cPatternSimulatorWidget::showHTMLDocumentation() { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/simulateisotopicpattern.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/simulateisotopicpattern.html").absoluteFilePath())); + #endif +} + + +void cPatternSimulatorWidget::closeWindow() { + hide(); +} + diff --git a/CycloBranch/gui/cPatternSimulatorWidget.h b/CycloBranch/gui/cPatternSimulatorWidget.h new file mode 100644 index 0000000..6b396bb --- /dev/null +++ b/CycloBranch/gui/cPatternSimulatorWidget.h @@ -0,0 +1,228 @@ +/** + \file cPatternSimulatorWidget.h + \brief The implementation of an isotopic pattern simulator (window). +*/ + + +#ifndef _CPATTERNSIMULATORWIDGET_H +#define _CPATTERNSIMULATORWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core/cGlobalPreferences.h" +#include "gui/cPatternSimulatorSceneWidget.h" +#include "gui/cSpectrumDetailProxyModel.h" +#include "gui/cExportDialog.h" +#include "gui/cEventFilter.h" +#include "gui/cHTMLDelegate.h" + + +// forward declaration +class QTextBrowser; +class QHBoxLayout; +class QVBoxLayout; +class QFormLayout; +class QCheckBox; +class QPushButton; +class QSplitter; +class QComboBox; +class QDoubleSpinBox; +class QSpinBox; +class QAction; +class QLabel; + + +/** + \brief The implementation of an isotopic pattern simulator (window). +*/ +class cPatternSimulatorWidget : public QMainWindow +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + \param globalpreferences global preferences of the application + \param parent pointer to a parent widget + */ + cPatternSimulatorWidget(cGlobalPreferences* globalpreferences, QWidget *parent); + + + /** + \brief The destructor. + */ + ~cPatternSimulatorWidget(); + + + /** + \brief Handle the window close event. + \param event pointer to QCloseEvent + */ + void closeEvent(QCloseEvent *event); + + + /** + \brief Apply new global preferences. + \param globalpreferences global preferences of the application + */ + void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + void keyPressEvent(QKeyEvent *event); + + +private: + + cGlobalPreferences* globalpreferences; + QWidget* parent; + + QMenuBar* menuBar; + QMenu* menuFile; + QMenu* menuView; + QMenu* menuHelp; + + QToolBar* toolbarFile; + QToolBar* toolbarView; + QToolBar* toolbarHelp; + QToolBar* toolbarMz; + QToolBar* toolbarInput; + + QAction* actionExportTable; + QAction* actionExportSpectrum; + QAction* actionCloseWindow; + QAction* actionZoomIn; + QAction* actionZoomOut; + QAction* actionZoomReset; + QAction* actionAbsoluteIntensity; + QAction* actionRawData; + QAction* actionHideLabels; + QAction* actionMouseMzSelection; + QAction* actionHTMLDocumentation; + QSplitter* hsplitter1; + QSplitter* hsplitter2; + QSplitter* vsplitter; + + QWidget* widgetmz; + QHBoxLayout* hboxmz; + QLabel* labelmz; + QDoubleSpinBox* minmz; + QLabel* labelseparator; + QDoubleSpinBox* maxmz; + QPushButton* setmzinterval; + QPushButton* resetmzinterval; + + QWidget* widgetiontype; + QHBoxLayout* hboxiontype; + QLabel* labeliontype; + QComboBox* comboboxiontype; + + QWidget* widgetformula; + QHBoxLayout* hboxformula; + QLabel* labelformula; + QLineEdit* lineeditformula; + + QWidget* widgetfwhm; + QHBoxLayout* hboxfwhm; + QLabel* labelfwhm; + QDoubleSpinBox* doublespinboxfwhm; + + QWidget* widgetcharge; + QHBoxLayout* hboxcharge; + QLabel* labelcharge; + QSpinBox* spinboxcharge; + + QWidget* widgetabsoluteintensity; + QHBoxLayout* hboxabsoluteintensity; + QLabel* labelabsoluteintensity; + QDoubleSpinBox* doublespinboxabsoluteintensity; + + QPushButton* simulatebutton; + + QTableView* peakstable; + QStandardItemModel* peakstablemodel; + cSpectrumDetailProxyModel* proxymodel; + + cPatternSimulatorSceneWidget* spectrumscene; + + cExportDialog* exportdialog; + + + void preparePeaksTable(cPeaksList& isotopepattern); + + + void deleteTable(); + + +signals: + + + /** + \brief The signal is emitted when the range of m/z ratios is changed. + \param minmz a minimum threshold of m/z ratio + \param maxmz a maximum threshold of m/z ratio + */ + void emitMZInterval(double minmz, double maxmz); + + + /** + \brief The signal is emitted when raw data state was changed. + \param state current state + */ + void rawDataStateChangedSignal(bool state); + + +private slots: + + + void simulateButtonReleased(); + + + void updateMZInterval(double minmz, double maxmz); + + + void setMZInterval(); + + + void exportSpectrum(); + + + void exportTableToCSV(); + + + void rawDataStateChanged(bool state); + + + void hidePeakLabels(bool hide); + + + void showHTMLDocumentation(); + + + void closeWindow(); + +}; + +#endif + diff --git a/CycloBranch/gui/cPreferencesDialog.cpp b/CycloBranch/gui/cPreferencesDialog.cpp index 94ff4d4..875f7cd 100644 --- a/CycloBranch/gui/cPreferencesDialog.cpp +++ b/CycloBranch/gui/cPreferencesDialog.cpp @@ -15,9 +15,11 @@ cPreferencesDialog::cPreferencesDialog(cGlobalPreferences& globalpreferences, QW tabwidget = new QTabWidget(); tabwidget->addTab(tabiontypes, tr("Ion Types")); - //tabwidget->addTab(tabdataprocessing, tr("Data Processing")); + #if OS_TYPE == WIN + tabwidget->addTab(tabdataprocessing, tr("Data Processing")); + #endif tabwidget->addTab(tabdirectories, tr("Directories")); - tabwidget->addTab(taburls, tr("URLs")); + tabwidget->addTab(taburls, tr("Bookmarks")); buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); diff --git a/CycloBranch/gui/cPreferencesTabDataProcessing.cpp b/CycloBranch/gui/cPreferencesTabDataProcessing.cpp index 3c4a574..e3caf03 100644 --- a/CycloBranch/gui/cPreferencesTabDataProcessing.cpp +++ b/CycloBranch/gui/cPreferencesTabDataProcessing.cpp @@ -4,19 +4,29 @@ 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); + labellinebafprocessingmethod = new QLabel("Line Data Converter (*.baf) : "); + comboboxlinebafprocessingmethod = new QComboBox(); + comboboxlinebafprocessingmethod->addItem("CompassXport"); + comboboxlinebafprocessingmethod->addItem("CompassXtract"); + comboboxlinebafprocessingmethod->setCurrentIndex(globalpreferences.linebafprocessingmethod); + gridlayout->addWidget(labellinebafprocessingmethod, 0, 0); + gridlayout->addWidget(comboboxlinebafprocessingmethod, 0, 1); + + labelprofilebafprocessingmethod = new QLabel("Profile Data Converter (*.baf) : "); + comboboxprofilebafprocessingmethod = new QComboBox(); + comboboxprofilebafprocessingmethod->addItem("CompassXport"); + comboboxprofilebafprocessingmethod->addItem("CompassXtract"); + comboboxprofilebafprocessingmethod->setCurrentIndex(globalpreferences.profilebafprocessingmethod); + gridlayout->addWidget(labelprofilebafprocessingmethod, 1, 0); + gridlayout->addWidget(comboboxprofilebafprocessingmethod, 1, 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); + comboboxrawdataprocessingmethod->addItem("Custom"); + //comboboxrawdataprocessingmethod->setCurrentIndex(globalpreferences.rawdataprocessingmethod); + //gridlayout->addWidget(labelrawdataprocessingmethod, 2, 0); + //gridlayout->addWidget(comboboxrawdataprocessingmethod, 2, 1); gridlayoutwidget = new QWidget(); gridlayoutwidget->setLayout(gridlayout); @@ -40,20 +50,27 @@ cPreferencesTabDataProcessing::cPreferencesTabDataProcessing(cGlobalPreferences& void cPreferencesTabDataProcessing::setPreferences(cGlobalPreferences& globalpreferences) { - globalpreferences.bafprocessingmethod = comboboxbafprocessingmethod->currentIndex(); + globalpreferences.linebafprocessingmethod = comboboxlinebafprocessingmethod->currentIndex(); + globalpreferences.profilebafprocessingmethod = comboboxprofilebafprocessingmethod->currentIndex(); + globalpreferences.rawdataprocessingmethod = comboboxrawdataprocessingmethod->currentIndex(); } void cPreferencesTabDataProcessing::resetPreferences(cGlobalPreferences& globalpreferences) { - comboboxbafprocessingmethod->setCurrentIndex(globalpreferences.bafprocessingmethod); + comboboxlinebafprocessingmethod->setCurrentIndex(globalpreferences.linebafprocessingmethod); + comboboxprofilebafprocessingmethod->setCurrentIndex(globalpreferences.profilebafprocessingmethod); + comboboxrawdataprocessingmethod->setCurrentIndex(globalpreferences.rawdataprocessingmethod); } cPreferencesTabDataProcessing::~cPreferencesTabDataProcessing() { - delete labelbafprocessingmethod; - delete comboboxbafprocessingmethod; + delete labellinebafprocessingmethod; + delete comboboxlinebafprocessingmethod; + + delete labelprofilebafprocessingmethod; + delete comboboxprofilebafprocessingmethod; delete labelrawdataprocessingmethod; delete comboboxrawdataprocessingmethod; @@ -71,7 +88,10 @@ cPreferencesTabDataProcessing::~cPreferencesTabDataProcessing() { void cPreferencesTabDataProcessing::defaultButtonReleased() { cGlobalPreferences gp; - comboboxbafprocessingmethod->setCurrentIndex(gp.bafprocessingmethod); + + comboboxlinebafprocessingmethod->setCurrentIndex(gp.linebafprocessingmethod); + comboboxprofilebafprocessingmethod->setCurrentIndex(gp.profilebafprocessingmethod); + comboboxrawdataprocessingmethod->setCurrentIndex(gp.rawdataprocessingmethod); } diff --git a/CycloBranch/gui/cPreferencesTabDataProcessing.h b/CycloBranch/gui/cPreferencesTabDataProcessing.h index 5ae96ed..6700266 100644 --- a/CycloBranch/gui/cPreferencesTabDataProcessing.h +++ b/CycloBranch/gui/cPreferencesTabDataProcessing.h @@ -15,6 +15,8 @@ #include #include #include +#include +#include /** @@ -62,8 +64,11 @@ class cPreferencesTabDataProcessing : public QWidget QWidget* gridlayoutwidget; QGridLayout* gridlayout; - QLabel* labelbafprocessingmethod; - QComboBox* comboboxbafprocessingmethod; + QLabel* labellinebafprocessingmethod; + QComboBox* comboboxlinebafprocessingmethod; + + QLabel* labelprofilebafprocessingmethod; + QComboBox* comboboxprofilebafprocessingmethod; QLabel* labelrawdataprocessingmethod; QComboBox* comboboxrawdataprocessingmethod; diff --git a/CycloBranch/gui/cPreferencesTabURLs.cpp b/CycloBranch/gui/cPreferencesTabURLs.cpp index 107d7d5..9c6014a 100644 --- a/CycloBranch/gui/cPreferencesTabURLs.cpp +++ b/CycloBranch/gui/cPreferencesTabURLs.cpp @@ -4,17 +4,101 @@ cPreferencesTabURLs::cPreferencesTabURLs(cGlobalPreferences& globalpreferences, QWidget *parent) : QWidget(parent) { gridlayout = new QGridLayout(); - labelurl1 = new QLabel("Norine : "); + labelurl1 = new QLabel("Bookmark 1 : "); + lineeditname1 = new QLineEdit(); + lineeditname1->setText(globalpreferences.bookmarkname1); lineediturl1 = new QLineEdit(); lineediturl1->setText(globalpreferences.bookmarkurl1); gridlayout->addWidget(labelurl1, 0, 0); - gridlayout->addWidget(lineediturl1, 0, 1); + gridlayout->addWidget(lineeditname1, 0, 1); + gridlayout->addWidget(lineediturl1, 0, 2); - labelurl2 = new QLabel("BBDGNC : "); + labelurl2 = new QLabel("Bookmark 2 : "); + lineeditname2 = new QLineEdit(); + lineeditname2->setText(globalpreferences.bookmarkname2); lineediturl2 = new QLineEdit(); lineediturl2->setText(globalpreferences.bookmarkurl2); gridlayout->addWidget(labelurl2, 1, 0); - gridlayout->addWidget(lineediturl2, 1, 1); + gridlayout->addWidget(lineeditname2, 1, 1); + gridlayout->addWidget(lineediturl2, 1, 2); + + labelurl3 = new QLabel("Bookmark 3 : "); + lineeditname3 = new QLineEdit(); + lineeditname3->setText(globalpreferences.bookmarkname3); + lineediturl3 = new QLineEdit(); + lineediturl3->setText(globalpreferences.bookmarkurl3); + gridlayout->addWidget(labelurl3, 2, 0); + gridlayout->addWidget(lineeditname3, 2, 1); + gridlayout->addWidget(lineediturl3, 2, 2); + + labelurl4 = new QLabel("Bookmark 4 : "); + lineeditname4 = new QLineEdit(); + lineeditname4->setText(globalpreferences.bookmarkname4); + lineediturl4 = new QLineEdit(); + lineediturl4->setText(globalpreferences.bookmarkurl4); + gridlayout->addWidget(labelurl4, 3, 0); + gridlayout->addWidget(lineeditname4, 3, 1); + gridlayout->addWidget(lineediturl4, 3, 2); + + labelurl5 = new QLabel("Bookmark 5 : "); + lineeditname5 = new QLineEdit(); + lineeditname5->setText(globalpreferences.bookmarkname5); + lineediturl5 = new QLineEdit(); + lineediturl5->setText(globalpreferences.bookmarkurl5); + gridlayout->addWidget(labelurl5, 4, 0); + gridlayout->addWidget(lineeditname5, 4, 1); + gridlayout->addWidget(lineediturl5, 4, 2); + + labelurl6 = new QLabel("Bookmark 6 : "); + lineeditname6 = new QLineEdit(); + lineeditname6->setText(globalpreferences.bookmarkname6); + lineediturl6 = new QLineEdit(); + lineediturl6->setText(globalpreferences.bookmarkurl6); + gridlayout->addWidget(labelurl6, 5, 0); + gridlayout->addWidget(lineeditname6, 5, 1); + gridlayout->addWidget(lineediturl6, 5, 2); + + labelurl7 = new QLabel("Bookmark 7 : "); + lineeditname7 = new QLineEdit(); + lineeditname7->setText(globalpreferences.bookmarkname7); + lineediturl7 = new QLineEdit(); + lineediturl7->setText(globalpreferences.bookmarkurl7); + gridlayout->addWidget(labelurl7, 6, 0); + gridlayout->addWidget(lineeditname7, 6, 1); + gridlayout->addWidget(lineediturl7, 6, 2); + + labelurl8 = new QLabel("Bookmark 8 : "); + lineeditname8 = new QLineEdit(); + lineeditname8->setText(globalpreferences.bookmarkname8); + lineediturl8 = new QLineEdit(); + lineediturl8->setText(globalpreferences.bookmarkurl8); + gridlayout->addWidget(labelurl8, 7, 0); + gridlayout->addWidget(lineeditname8, 7, 1); + gridlayout->addWidget(lineediturl8, 7, 2); + + labelurl9 = new QLabel("Bookmark 9 : "); + lineeditname9 = new QLineEdit(); + lineeditname9->setText(globalpreferences.bookmarkname9); + lineediturl9 = new QLineEdit(); + lineediturl9->setText(globalpreferences.bookmarkurl9); + gridlayout->addWidget(labelurl9, 8, 0); + gridlayout->addWidget(lineeditname9, 8, 1); + gridlayout->addWidget(lineediturl9, 8, 2); + + labelurl10 = new QLabel("Bookmark 10 : "); + lineeditname10 = new QLineEdit(); + lineeditname10->setText(globalpreferences.bookmarkname10); + lineediturl10 = new QLineEdit(); + lineediturl10->setText(globalpreferences.bookmarkurl10); + gridlayout->addWidget(labelurl10, 9, 0); + gridlayout->addWidget(lineeditname10, 9, 1); + gridlayout->addWidget(lineediturl10, 9, 2); + + labelviewbookmarks = new QLabel("Show Toolbar"); + checkboxviewbookmarks = new QCheckBox(); + checkboxviewbookmarks->setChecked(globalpreferences.viewbookmarks); + gridlayout->addWidget(labelviewbookmarks, 10, 0); + gridlayout->addWidget(checkboxviewbookmarks, 10, 1); gridlayoutwidget = new QWidget(); gridlayoutwidget->setLayout(gridlayout); @@ -38,24 +122,119 @@ cPreferencesTabURLs::cPreferencesTabURLs(cGlobalPreferences& globalpreferences, void cPreferencesTabURLs::setPreferences(cGlobalPreferences& globalpreferences) { + globalpreferences.bookmarkname1 = lineeditname1->text(); globalpreferences.bookmarkurl1 = lineediturl1->text(); + + globalpreferences.bookmarkname2 = lineeditname2->text(); globalpreferences.bookmarkurl2 = lineediturl2->text(); + + globalpreferences.bookmarkname3 = lineeditname3->text(); + globalpreferences.bookmarkurl3 = lineediturl3->text(); + + globalpreferences.bookmarkname4 = lineeditname4->text(); + globalpreferences.bookmarkurl4 = lineediturl4->text(); + + globalpreferences.bookmarkname5 = lineeditname5->text(); + globalpreferences.bookmarkurl5 = lineediturl5->text(); + + globalpreferences.bookmarkname6 = lineeditname6->text(); + globalpreferences.bookmarkurl6 = lineediturl6->text(); + + globalpreferences.bookmarkname7 = lineeditname7->text(); + globalpreferences.bookmarkurl7 = lineediturl7->text(); + + globalpreferences.bookmarkname8 = lineeditname8->text(); + globalpreferences.bookmarkurl8 = lineediturl8->text(); + + globalpreferences.bookmarkname9 = lineeditname9->text(); + globalpreferences.bookmarkurl9 = lineediturl9->text(); + + globalpreferences.bookmarkname10 = lineeditname10->text(); + globalpreferences.bookmarkurl10 = lineediturl10->text(); + + globalpreferences.viewbookmarks = checkboxviewbookmarks->isChecked(); } void cPreferencesTabURLs::resetPreferences(cGlobalPreferences& globalpreferences) { + lineeditname1->setText(globalpreferences.bookmarkname1); lineediturl1->setText(globalpreferences.bookmarkurl1); + + lineeditname2->setText(globalpreferences.bookmarkname2); lineediturl2->setText(globalpreferences.bookmarkurl2); + + lineeditname3->setText(globalpreferences.bookmarkname3); + lineediturl3->setText(globalpreferences.bookmarkurl3); + + lineeditname4->setText(globalpreferences.bookmarkname4); + lineediturl4->setText(globalpreferences.bookmarkurl4); + + lineeditname5->setText(globalpreferences.bookmarkname5); + lineediturl5->setText(globalpreferences.bookmarkurl5); + + lineeditname6->setText(globalpreferences.bookmarkname6); + lineediturl6->setText(globalpreferences.bookmarkurl6); + + lineeditname7->setText(globalpreferences.bookmarkname7); + lineediturl7->setText(globalpreferences.bookmarkurl7); + + lineeditname8->setText(globalpreferences.bookmarkname8); + lineediturl8->setText(globalpreferences.bookmarkurl8); + + lineeditname9->setText(globalpreferences.bookmarkname9); + lineediturl9->setText(globalpreferences.bookmarkurl9); + + lineeditname10->setText(globalpreferences.bookmarkname10); + lineediturl10->setText(globalpreferences.bookmarkurl10); + + checkboxviewbookmarks->setChecked(globalpreferences.viewbookmarks); } cPreferencesTabURLs::~cPreferencesTabURLs() { delete labelurl1; + delete lineeditname1; delete lineediturl1; delete labelurl2; + delete lineeditname2; delete lineediturl2; + delete labelurl3; + delete lineeditname3; + delete lineediturl3; + + delete labelurl4; + delete lineeditname4; + delete lineediturl4; + + delete labelurl5; + delete lineeditname5; + delete lineediturl5; + + delete labelurl6; + delete lineeditname6; + delete lineediturl6; + + delete labelurl7; + delete lineeditname7; + delete lineediturl7; + + delete labelurl8; + delete lineeditname8; + delete lineediturl8; + + delete labelurl9; + delete lineeditname9; + delete lineediturl9; + + delete labelurl10; + delete lineeditname10; + delete lineediturl10; + + delete labelviewbookmarks; + delete checkboxviewbookmarks; + delete defaultbutton; delete hlayout; delete hwidget; @@ -69,7 +248,37 @@ cPreferencesTabURLs::~cPreferencesTabURLs() { void cPreferencesTabURLs::defaultButtonReleased() { cGlobalPreferences gp; + + lineeditname1->setText(gp.bookmarkname1); lineediturl1->setText(gp.bookmarkurl1); + + lineeditname2->setText(gp.bookmarkname2); lineediturl2->setText(gp.bookmarkurl2); + + lineeditname3->setText(gp.bookmarkname3); + lineediturl3->setText(gp.bookmarkurl3); + + lineeditname4->setText(gp.bookmarkname4); + lineediturl4->setText(gp.bookmarkurl4); + + lineeditname5->setText(gp.bookmarkname5); + lineediturl5->setText(gp.bookmarkurl5); + + lineeditname6->setText(gp.bookmarkname6); + lineediturl6->setText(gp.bookmarkurl6); + + lineeditname7->setText(gp.bookmarkname7); + lineediturl7->setText(gp.bookmarkurl7); + + lineeditname8->setText(gp.bookmarkname8); + lineediturl8->setText(gp.bookmarkurl8); + + lineeditname9->setText(gp.bookmarkname9); + lineediturl9->setText(gp.bookmarkurl9); + + lineeditname10->setText(gp.bookmarkname10); + lineediturl10->setText(gp.bookmarkurl10); + + checkboxviewbookmarks->setChecked(gp.viewbookmarks); } diff --git a/CycloBranch/gui/cPreferencesTabURLs.h b/CycloBranch/gui/cPreferencesTabURLs.h index 4b6a991..5e1aa7c 100644 --- a/CycloBranch/gui/cPreferencesTabURLs.h +++ b/CycloBranch/gui/cPreferencesTabURLs.h @@ -16,6 +16,7 @@ #include #include #include +#include /** @@ -64,11 +65,48 @@ class cPreferencesTabURLs : public QWidget QGridLayout* gridlayout; QLabel* labelurl1; + QLineEdit* lineeditname1; QLineEdit* lineediturl1; QLabel* labelurl2; + QLineEdit* lineeditname2; QLineEdit* lineediturl2; + QLabel* labelurl3; + QLineEdit* lineeditname3; + QLineEdit* lineediturl3; + + QLabel* labelurl4; + QLineEdit* lineeditname4; + QLineEdit* lineediturl4; + + QLabel* labelurl5; + QLineEdit* lineeditname5; + QLineEdit* lineediturl5; + + QLabel* labelurl6; + QLineEdit* lineeditname6; + QLineEdit* lineediturl6; + + QLabel* labelurl7; + QLineEdit* lineeditname7; + QLineEdit* lineediturl7; + + QLabel* labelurl8; + QLineEdit* lineeditname8; + QLineEdit* lineediturl8; + + QLabel* labelurl9; + QLineEdit* lineeditname9; + QLineEdit* lineediturl9; + + QLabel* labelurl10; + QLineEdit* lineeditname10; + QLineEdit* lineediturl10; + + QLabel* labelviewbookmarks; + QCheckBox* checkboxviewbookmarks; + QWidget* hwidget; QHBoxLayout* hlayout; QPushButton* defaultbutton; diff --git a/CycloBranch/gui/cPubChemSearchWidget.cpp b/CycloBranch/gui/cPubChemSearchWidget.cpp new file mode 100644 index 0000000..818dff9 --- /dev/null +++ b/CycloBranch/gui/cPubChemSearchWidget.cpp @@ -0,0 +1,82 @@ +#include "gui/cPubChemSearchWidget.h" + +#include +#include +#include +#include + + +cPubChemSearchWidget::cPubChemSearchWidget() { + htmlstring = ""; + + setWindowTitle("Search PubChem..."); + setWindowIcon(QIcon(":/images/icons/search.png")); + + layout = new QVBoxLayout(); + + textbrowser = new QTextBrowser(); + textbrowser->setReadOnly(true); + textbrowser->setFont(QFont("Courier", 9)); + textbrowser->setLineWrapMode(QTextEdit::NoWrap); + textbrowser->setAcceptRichText(true); + textbrowser->setOpenExternalLinks(true); + + layout->addWidget(textbrowser); + + setLayout(layout); + + resize(defaultwinsizex, defaultwinsizey); +} + + +cPubChemSearchWidget::~cPubChemSearchWidget() { + delete textbrowser; + + delete layout; +} + + +void cPubChemSearchWidget::setHTML(string html) { + htmlstring = html; + textbrowser->setHtml(html.c_str()); +} + + +string cPubChemSearchWidget::getHTML() { + return htmlstring; +} + + +void cPubChemSearchWidget::closeEvent(QCloseEvent *event) { + hide(); + event->accept(); +} + + +void cPubChemSearchWidget::store(ofstream& os) { + storeString(htmlstring, os); +} + + +void cPubChemSearchWidget::load(ifstream& is) { + loadString(htmlstring, is); + textbrowser->setHtml(htmlstring.c_str()); +} + + +void cPubChemSearchWidget::keyPressEvent(QKeyEvent *event) { + if (event->key() == Qt::Key_Escape) { + hide(); + } + + if (event->key() == Qt::Key_F1) { + #if OS_TYPE == WIN + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo("docs/html/summarypeakstable.html").absoluteFilePath())); + #else + QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(installdir + "docs/html/summarypeakstable.html").absoluteFilePath())); + #endif + } + + event->accept(); +} + diff --git a/CycloBranch/gui/cPubChemSearchWidget.h b/CycloBranch/gui/cPubChemSearchWidget.h new file mode 100644 index 0000000..7d7d1c8 --- /dev/null +++ b/CycloBranch/gui/cPubChemSearchWidget.h @@ -0,0 +1,369 @@ +/** + \file cPubChemSearchWidget.h + \brief The implementation of the dialog PubChem search widget. +*/ + + +#ifndef _CPUBCHEMSEARCHWIDGET_H +#define _CPUBCHEMSEARCHWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "core/utilities.h" + + +// forward declaration +class QTextBrowser; +class QVBoxLayout; + + +/** + \brief The widget representing the PubChem search widget. +*/ +class cPubChemSearchWidget : public QWidget +{ + Q_OBJECT + +public: + + + /** + \brief The constructor. + */ + cPubChemSearchWidget(); + + + /** + \brief The destructor. + */ + ~cPubChemSearchWidget(); + + + /** + \brief Set the HTML text into the widget. + \param html string with the HTML text + */ + void setHTML(string html); + + + /** + \brief Get the HTML text from the widget. + \retval string HTML string + */ + string getHTML(); + + + /** + \brief Handle the window close event. + \param event pointer to QCloseEvent + */ + void closeEvent(QCloseEvent *event); + + + /** + \brief Store the content into an output stream. + \param os an output stream + */ + void store(ofstream& os); + + + /** + \brief Load the content from an input stream. + \param is an input stream + */ + void load(ifstream& is); + + +private: + + QVBoxLayout* layout; + QTextBrowser* textbrowser; + string htmlstring; + + +protected: + + + /** + \brief Handle a key press event. + \param event pointer to QKeyEvent + */ + void keyPressEvent(QKeyEvent *event); + + +}; + + +/** + \brief The functor used to get the CIDs of compounds with the same formula. +*/ +struct cPubchemCIDReader { + + /** + \brief result_type + */ + typedef string result_type; + + + /** + \brief Get the list of CIDs. + \param compound formula + \retval string list of CIDs + */ + string getCIDList(const string& compound) { + string url = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastformula/"; + url += compound; + url += "/cids/txt"; + + QNetworkAccessManager networkmanager; + QNetworkRequest request(QUrl(url.c_str())); + QNetworkReply *response = networkmanager.get(request); + + QEventLoop loop; + QObject::connect(response, SIGNAL(finished()), &loop, SLOT(quit())); + loop.exec(); + + string cids = response->readAll().toStdString(); + + stringstream errorstream; + if (cids.empty()) { + errorstream << "@ERROR" << endl; + errorstream << "URL: " << url << endl; + errorstream << "ERROR: " << response->errorString().toStdString() << endl; + errorstream << endl; + } + + response->deleteLater(); + + if (cids.empty()) { + return errorstream.str(); + } + + return cids; + } + + + /** + \brief Get a list of CIDs separated by comma. + \param cids input list of CIDs + \param reducedcids output list of CIDs separated by comma + */ + void getCommaSeparatedCIDs(string& cids, string& reducedcids) { + reducedcids.clear(); + if (cids.find("Status:") == string::npos) { + istringstream inputstream(cids); + string line; + while (getline(inputstream, line)) { + if (!reducedcids.empty()) { + reducedcids += ","; + } + reducedcids += line; + } + } + } + + + /** + \brief Attach a vector of CIDs. + \param cids input list of CIDs + \param cidsvector input/output vector of CIDs + */ + void attachVectorOfCIDs(string& cids, vector& cidsvector) { + if (cids.find("Status:") == string::npos) { + istringstream inputstream(cids); + string line; + while (getline(inputstream, line)) { + cidsvector.push_back(line); + } + } + } + + + /** + \brief Get the number of compounds with the same formula. + \param cids list of CIDs + \retval int number of CIDs + */ + int getNumberOfCIDs(string& cids) { + int count = 0; + if (cids.find("Status:") == string::npos) { + istringstream inputstream(cids); + string line; + while (getline(inputstream, line)) { + count++; + } + } + else { + if (cids.find("Status: 404") == string::npos) { + // report error codes 500 (server error), 503 (server busy), etc. + cout << cids << endl << endl; + } + } + + return count; + } + + + /** + \brief Overloaded operator (). + \param compound formula + \retval string list of CIDs + */ + string operator()(const string& compound) { + return getCIDList(compound); + } +}; + + +/** + \brief The functor used to get the names of compounds from CID. +*/ +struct cPubchemNameReader { + + /** + \brief result_type + */ + typedef string result_type; + + + /** + \brief Get the list of names. + \param cid CID + \retval string list of names + */ + string getNameList(const string& cid) { + bool usepost = true; + + string url = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"; + if (!usepost) { + url += cid + "/"; + } + url += "synonyms/txt"; + + if (!usepost) { + // URL too long + if (url.size() > 4000) { + return "Status: 414"; + } + } + + QNetworkAccessManager networkmanager; + QNetworkRequest request(QUrl(url.c_str())); + QNetworkReply *response; + + if (usepost) { + QString body = "cid="; + body += cid.c_str(); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + response = networkmanager.post(request, body.toUtf8()); + } + else { + response = networkmanager.get(request); + } + + QEventLoop loop; + QObject::connect(response, SIGNAL(finished()), &loop, SLOT(quit())); + loop.exec(); + + string names = response->readAll().toStdString(); + + stringstream errorstream; + if (names.empty()) { + errorstream << "@ERROR" << endl; + errorstream << "URL: " << url << endl; + errorstream << "ERROR: " << response->errorString().toStdString() << endl; + errorstream << endl; + } + + response->deleteLater(); + + if (names.empty()) { + return errorstream.str(); + } + + return names; + } + + + /** + \brief Get the reduded list of names. + \param names input list of names + \param reducednames ouput set of reduced names + */ + void getReducedNames(string& names, set& reducednames) { + if (names.find("Status:") == string::npos) { + istringstream inputstream(names); + string line; + while (getline(inputstream, line)) { + if (line.find("SCHEMBL") == string::npos) { + reducednames.insert(line); + } + } + if (reducednames.empty()) { + reducednames.insert("This item has only SCHEMBL name(s)."); + } + } + else { + if (names.find("Status: 404") == string::npos) { + // report error codes 500 (server error), 503 (server busy), etc. + cout << names << endl << endl; + } + } + } + + + /** + \brief Overloaded operator (). + \param cid CID + \retval string list of names + */ + string operator()(const string& cid) { + if (cid.empty()) { + return ""; + } + return getNameList(cid); + } +}; + + +/** + \brief An auxiliary row info structure. +*/ +struct cRowItemInfo { + + /** + \brief Identification ID. + */ + int id; + + + /** + \brief Theoretical m/z. + */ + double theoreticalmz; + + + /** + \brief Experimental intensity. + */ + double experimentalint; + + + /** + \brief Ion type. + */ + string iontype; + +}; + +#endif + diff --git a/CycloBranch/gui/cSequenceDatabaseWidget.cpp b/CycloBranch/gui/cSequenceDatabaseWidget.cpp index d8bfdc3..e801bd6 100644 --- a/CycloBranch/gui/cSequenceDatabaseWidget.cpp +++ b/CycloBranch/gui/cSequenceDatabaseWidget.cpp @@ -16,6 +16,8 @@ #include #include #include +#include +#include cSequenceDatabaseWidget::cSequenceDatabaseWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { @@ -195,6 +197,12 @@ cSequenceDatabaseWidget::cSequenceDatabaseWidget(cGlobalPreferences* globalprefe toolbarEdit->addAction(actionUnselectAll); connect(actionUnselectAll, SIGNAL(triggered()), this, SLOT(unselectAll())); + actionRemoveDuplicateRows = new QAction(QIcon(":/images/icons/db_delete.png"), tr("Remove Dup&licate Rows"), this); + actionRemoveDuplicateRows->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L)); + actionRemoveDuplicateRows->setToolTip("Remove Duplicate Rows (Ctrl + L)"); + toolbarEdit->addAction(actionRemoveDuplicateRows); + connect(actionRemoveDuplicateRows, SIGNAL(triggered()), this, SLOT(removeDuplicateRows())); + toolbarHelp = addToolBar(tr("Help")); actionHTMLDocumentation = new QAction(QIcon(":/images/icons/3.png"), tr("&HTML Documentation"), this); @@ -223,6 +231,8 @@ cSequenceDatabaseWidget::cSequenceDatabaseWidget(cGlobalPreferences* globalprefe menuEdit->addSeparator(); menuEdit->addAction(actionSelectAll); menuEdit->addAction(actionUnselectAll); + menuEdit->addSeparator(); + menuEdit->addAction(actionRemoveDuplicateRows); menuHelp->addAction(actionHTMLDocumentation); @@ -288,6 +298,7 @@ cSequenceDatabaseWidget::~cSequenceDatabaseWidget() { delete actionRemoveSelectedRows; delete actionSelectAll; delete actionUnselectAll; + delete actionRemoveDuplicateRows; delete actionHTMLDocumentation; delete menuFile; @@ -514,6 +525,34 @@ void cSequenceDatabaseWidget::keyPressEvent(QKeyEvent *event) { rowsfilterwholeword->setChecked(!rowsfilterwholeword->isChecked()); } + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_C)) { + QModelIndexList selectedindexes = database->selectionModel()->selectedIndexes(); + QStandardItem* item; + + QString selectedtext; + string itemtext; + + int selectedcount = selectedindexes.count(); + for (int i = 0; i < selectedcount; i++) { + if (i > 0) { + if (proxymodel->mapToSource(selectedindexes[i - 1]).row() != proxymodel->mapToSource(selectedindexes[i]).row()) { + selectedtext += "\n"; + } + else { + selectedtext += "\t"; + } + } + + item = databasemodel->itemFromIndex(proxymodel->mapToSource(selectedindexes[i])); + if (item) { + itemtext = item->text().toStdString(); + selectedtext += stripHTML(itemtext).c_str(); + } + } + selectedtext += "\n"; + QApplication::clipboard()->setText(selectedtext); + } + event->accept(); } @@ -560,7 +599,7 @@ void cSequenceDatabaseWidget::openDatabase() { resetFilter(); sequences.clear(); - sequences.loadFromPlainTextStream(inputstream); + sequences.loadFromPlainTextStream(inputstream, true); QProgressDialog progress("Loading the Sequence Database...", "Cancel", 0, sequences.size(), this); progress.setMinimumWidth(250); @@ -568,6 +607,7 @@ void cSequenceDatabaseWidget::openDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); database->setModel(0); proxymodel->setSourceModel(0); @@ -617,6 +657,13 @@ void cSequenceDatabaseWidget::openDatabase() { pos = stmp.rfind('\"'); if (pos != string::npos) { stmp = stmp.substr(0, pos); + + // crop RT info + pos = stmp.rfind('@'); + if (pos != string::npos) { + stmp = stmp.substr(0, pos); + } + databasemodel->item(i, 10)->setText(stmp.c_str()); } } @@ -681,6 +728,7 @@ bool cSequenceDatabaseWidget::saveDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); // close an editor of a combobox database->setDisabled(true); @@ -743,7 +791,7 @@ bool cSequenceDatabaseWidget::saveDatabase() { progress.setValue(i); } - sequences.storeToPlainTextStream(outputstream); + sequences.storeToPlainTextStream(outputstream, true); progress.setValue(progress.maximum()); @@ -858,6 +906,13 @@ void cSequenceDatabaseWidget::itemChanged(QStandardItem* item) { pos = stmp.rfind('\"'); if (pos != string::npos) { stmp = stmp.substr(0, pos); + + // crop RT info + pos = stmp.rfind('@'); + if (pos != string::npos) { + stmp = stmp.substr(0, pos); + } + databasemodel->item(item->row(), 10)->setText(stmp.c_str()); } } @@ -939,7 +994,7 @@ void cSequenceDatabaseWidget::importDatabase() { size_t pos; cSequenceDatabase importedsequences; - importedsequences.loadFromPlainTextStream(inputstream); + importedsequences.loadFromPlainTextStream(inputstream, true); QProgressDialog progress("Importing the Sequence Database...", "Cancel", 0, importedsequences.size(), this); progress.setMinimumWidth(250); @@ -947,6 +1002,7 @@ void cSequenceDatabaseWidget::importDatabase() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); database->setModel(0); proxymodel->setSourceModel(0); @@ -997,6 +1053,13 @@ void cSequenceDatabaseWidget::importDatabase() { pos = stmp.rfind('\"'); if (pos != string::npos) { stmp = stmp.substr(0, pos); + + // crop RT info + pos = stmp.rfind('@'); + if (pos != string::npos) { + stmp = stmp.substr(0, pos); + } + databasemodel->item(i + originalrowcount, 10)->setText(stmp.c_str()); } } @@ -1077,3 +1140,49 @@ void cSequenceDatabaseWidget::editItem(const QModelIndex& index) { } } + +void cSequenceDatabaseWidget::removeDuplicateRows() { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, appname, "Remove duplicates ?", QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::No) { + return; + } + + resetFilter(); + + set seqset; + string seqhash; + + int origcount = proxymodel->rowCount(); + + int i = 0; + while (i < proxymodel->rowCount()) { + seqhash.clear(); + + for (int j = 1; j < proxymodel->columnCount() - 1; j++) { + if (j == 4) { + continue; + } + + seqhash += proxymodel->index(i, j).data(Qt::DisplayRole).toString().toStdString() + ";"; + } + + if (seqset.count(seqhash) == 1) { + proxymodel->removeRow(i); + setDataModified(true); + } + else { + seqset.insert(seqhash); + i++; + } + } + + QMessageBox msgBox; + QString msg = "Number of duplicate rows removed: "; + msg += QVariant(origcount - proxymodel->rowCount()).toString(); + msg += "."; + msgBox.setText(msg); + msgBox.exec(); +} + diff --git a/CycloBranch/gui/cSequenceDatabaseWidget.h b/CycloBranch/gui/cSequenceDatabaseWidget.h index 57c583b..ffd852f 100644 --- a/CycloBranch/gui/cSequenceDatabaseWidget.h +++ b/CycloBranch/gui/cSequenceDatabaseWidget.h @@ -109,6 +109,7 @@ class cSequenceDatabaseWidget : public QMainWindow QAction* actionRemoveSelectedRows; QAction* actionSelectAll; QAction* actionUnselectAll; + QAction* actionRemoveDuplicateRows; QToolBar* toolbarHelp; QAction* actionHTMLDocumentation; @@ -201,6 +202,8 @@ private slots: void editItem(const QModelIndex& index); + void removeDuplicateRows(); + }; #endif diff --git a/CycloBranch/gui/cSpectrumDetailWidget.cpp b/CycloBranch/gui/cSpectrumDetailWidget.cpp index 25126ee..2cfe1eb 100644 --- a/CycloBranch/gui/cSpectrumDetailWidget.cpp +++ b/CycloBranch/gui/cSpectrumDetailWidget.cpp @@ -19,6 +19,7 @@ #include #include #include +#include cSpectrumDetailWidget::cSpectrumDetailWidget() { @@ -34,6 +35,8 @@ cSpectrumDetailWidget::cSpectrumDetailWidget() { preparedToShow = false; localneutralosses.clear(); theoreticalspectrum = new cTheoreticalSpectrum(); + + activefileid = 0; } @@ -55,11 +58,11 @@ cSpectrumDetailWidget& cSpectrumDetailWidget::operator=(const cSpectrumDetailWid theoreticalspectrum = new cTheoreticalSpectrum(); if (parameters && sd.theoreticalspectrum) { - initialize(rowid, globalpreferences, parameters, *sd.theoreticalspectrum, sd.parent); + initialize(sd.rowid, sd.activefileid, globalpreferences, parameters, *sd.theoreticalspectrum, sd.parent); } if (parameters && sd.preparedToShow) { - prepareToShow(actionShowIsomers, rawdata, imzmlprofilemetadata, profilemz64precision, profileintensity64precision); + prepareToShow(actionShowIsomers, rawdata, imzmlprofilemetadata, profilemz64precision, profileintensity64precision, true); } setWindowTitle(sd.windowTitle()); @@ -68,8 +71,9 @@ cSpectrumDetailWidget& cSpectrumDetailWidget::operator=(const cSpectrumDetailWid } -void cSpectrumDetailWidget::initialize(int rowid, cGlobalPreferences* globalpreferences, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent) { +void cSpectrumDetailWidget::initialize(int rowid, int activefileid, cGlobalPreferences* globalpreferences, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent) { this->rowid = rowid; + this->activefileid = activefileid; this->globalpreferences = globalpreferences; this->parameters = parameters; *this->theoreticalspectrum = theoreticalspectrum; @@ -186,7 +190,12 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { if (parameters->generateisotopepattern) { - columncount = 12; + if (parameters->calculatefdrs) { + columncount = 12; + } + else { + columncount = 10; + } } else { columncount = 9; @@ -227,7 +236,7 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica s += "Error [ppm]"; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { s += "Score"; s += "FDR"; } @@ -297,7 +306,7 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica s += printHTMLTableCell(QVariant(cropDecimalsByteArray(peak->matchedabsoluteintensity)).toString().toStdString(), isred); s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->matchedppm)), isred); if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(theoreticalspectrum->getTargetPatternScore(peak->groupid))), isred); s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(theoreticalspectrum->getTargetPatternFDR(peak->groupid))), isred); } @@ -306,7 +315,7 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica else { s += ""; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { s += ""; } } @@ -382,7 +391,7 @@ string cSpectrumDetailWidget::getPeaksTableAsHTMLString(bool unmatchedtheoretica s += ""; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { s += ""; - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { s += ""; } } @@ -453,7 +462,7 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo s += printHTMLTableCell(to_string(id + 1), isred); if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { s += printHTMLTableCell(to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateX()), isred); s += printHTMLTableCell(to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateY()), isred); } @@ -484,7 +493,7 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo s += printHTMLTableCell(QVariant(cropDecimalsByteArray(peak->matchedabsoluteintensity)).toString().toStdString(), isred); s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(peak->matchedppm)), isred); if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(theoreticalspectrum->getTargetPatternScore(peak->groupid))), isred); s += printHTMLTableCell(to_string(cropPrecisionToSixDecimals(theoreticalspectrum->getTargetPatternFDR(peak->groupid))), isred); } @@ -493,7 +502,7 @@ string cSpectrumDetailWidget::getPartialPeaksTableAsHTMLString(int id, bool expo else { s += ""; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { s += ""; } } @@ -678,7 +687,7 @@ void cSpectrumDetailWidget::closeEvent(QCloseEvent *event) { } -void cSpectrumDetailWidget::prepareToShow(QAction* actionShowIsomers, cPeakListSeries* rawdata, vector* imzmlprofilemetadata, bool profilemz64precision, bool profileintensity64precision) { +void cSpectrumDetailWidget::prepareToShow(QAction* actionShowIsomers, cPeakListSeries* rawdata, vector* imzmlprofilemetadata, bool profilemz64precision, bool profileintensity64precision, bool usedefaultsize) { if (!preparedToShow) { @@ -686,7 +695,7 @@ void cSpectrumDetailWidget::prepareToShow(QAction* actionShowIsomers, cPeakListS if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { string title = "Experimental Spectrum No. " + to_string(rowid); if (theoreticalspectrum) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { title += " - X: " + to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateX()); title += " Y: " + to_string(theoreticalspectrum->getExperimentalSpectrum().getCoordinateY()); } @@ -1206,7 +1215,11 @@ void cSpectrumDetailWidget::prepareToShow(QAction* actionShowIsomers, cPeakListS setMenuBar(menuBar); - resize(defaultwinsizex, defaultwinsizey); + if (usedefaultsize) { + resize(defaultwinsizex, defaultwinsizey); + } + + QRect geometry = normalGeometry(); if (parameters && theoreticalspectrum) { @@ -1245,9 +1258,9 @@ void cSpectrumDetailWidget::prepareToShow(QAction* actionShowIsomers, cPeakListS } - spectrumscene->initialize(parameters, theoreticalspectrum, rawdata, rowid); - - preparePeaksTable(); + spectrumscene->initialize(parameters, theoreticalspectrum, rawdata, rowid, activefileid); + + preparePeaksTable(geometry); if ((parameters->mode == denovoengine) || (parameters->mode == singlecomparison) || (parameters->mode == databasesearch)) { if (localneutralosses.size() > 0) { @@ -1398,6 +1411,76 @@ set& cSpectrumDetailWidget::getLocalNeutralLosses() { } +void cSpectrumDetailWidget::setProfileSpectrumEnabled(bool enable) { + actionRawData->setChecked(enable); +} + + +bool cSpectrumDetailWidget::hasProfileSpectrumEnabled() { + return actionRawData->isChecked(); +} + + +void cSpectrumDetailWidget::setAbsoluteIntensityEnabled(bool enable) { + actionAbsoluteIntensity->setChecked(enable); +} + + +bool cSpectrumDetailWidget::hasAbsoluteIntensityEnabled() { + return actionAbsoluteIntensity->isChecked(); +} + + +void cSpectrumDetailWidget::setHideMatchedPeaksEnabled(bool enable) { + actionHideMatched->setChecked(enable); +} + + +bool cSpectrumDetailWidget::hasHideMatchedPeaksEnabled() { + return actionHideMatched->isChecked(); +} + + +void cSpectrumDetailWidget::setHideUnmatchedPeaksEnabled(bool enable) { + actionHideUnmatched->setChecked(enable); +} + + +bool cSpectrumDetailWidget::hasHideUnmatchedPeaksEnabled() { + return actionHideUnmatched->isChecked(); +} + + +void cSpectrumDetailWidget::setHideScrambledPeaksEnabled(bool enable) { + actionHideScrambled->setChecked(enable); +} + + +bool cSpectrumDetailWidget::hasHideScrambledPeaksEnabled() { + return actionHideScrambled->isChecked(); +} + + +void cSpectrumDetailWidget::setHidePeakLabelsEnabled(bool enable) { + actionHideLabels->setChecked(enable); +} + + +bool cSpectrumDetailWidget::hasHidePeakLabelsEnabled() { + return actionHideLabels->isChecked(); +} + + +void cSpectrumDetailWidget::setMouseMzSelectionEnabled(bool enable) { + actionMouseMzSelection->setChecked(enable); +} + + +bool cSpectrumDetailWidget::hasMouseMzSelectionEnabled() { + return actionMouseMzSelection->isChecked(); +} + + void cSpectrumDetailWidget::keyPressEvent(QKeyEvent *event) { if ((event->key() == Qt::Key_Enter) || (event->key() == Qt::Key_Return)) { setMZInterval(); @@ -1435,8 +1518,12 @@ void cSpectrumDetailWidget::keyPressEvent(QKeyEvent *event) { } -void cSpectrumDetailWidget::preparePeaksTable() { +void cSpectrumDetailWidget::moveEvent(QMoveEvent *event) { + emit lastActiveDetail(rowid); +} + +void cSpectrumDetailWidget::preparePeaksTable(QRect geometry) { peakstable->setEditTriggers(QAbstractItemView::NoEditTriggers); peakstable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); peakstable->horizontalHeader()->setSectionsMovable(true); @@ -1444,7 +1531,12 @@ void cSpectrumDetailWidget::preparePeaksTable() { if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { if (parameters->generateisotopepattern) { - peakstablemodel->setColumnCount(12); + if (parameters->calculatefdrs) { + peakstablemodel->setColumnCount(12); + } + else { + peakstablemodel->setColumnCount(10); + } } else { peakstablemodel->setColumnCount(9); @@ -1499,7 +1591,7 @@ void cSpectrumDetailWidget::preparePeaksTable() { if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { peakstablemodel->horizontalHeaderItem(currentcolumn)->setText("Score"); currentcolumn++; @@ -1546,13 +1638,22 @@ void cSpectrumDetailWidget::preparePeaksTable() { peakstablemodel->setRowCount(thpeakscount + theoreticalspectrum->getUnmatchedExperimentalPeaksCount()); - QProgressDialog progress("Preparing the peaklist...", /*"Cancel"*/0, 0, thpeakscount + theoreticalspectrum->getUnmatchedExperimentalPeaksCount(), parent); + QProgressDialog progress("Preparing the peaklist...", /*"Cancel"*/0, 0, thpeakscount + theoreticalspectrum->getUnmatchedExperimentalPeaksCount(), this); progress.setMinimumWidth(250); cEventFilter filter; progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.move(geometry.x(), geometry.y()); + + QRect progressgeometry; + progressgeometry.setRect(geometry.x() + geometry.width() / 2 - progress.width() / 2, geometry.y() + geometry.height() / 2 - progress.height() / 2, progress.width(), progress.height()); + + progress.setGeometry(progressgeometry); + + progress.setValue(0); + peakstable->setModel(0); proxymodel->setSourceModel(0); peakstable->setSortingEnabled(false); @@ -1638,7 +1739,7 @@ void cSpectrumDetailWidget::preparePeaksTable() { currentcolumn++; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { peakstablemodel->setItem(i, currentcolumn, new QStandardItem()); peakstablemodel->item(i, currentcolumn)->setForeground(brush); peakstablemodel->item(i, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(theoreticalspectrum->getTargetPatternScore(peak->groupid))), Qt::DisplayRole); @@ -1654,7 +1755,7 @@ void cSpectrumDetailWidget::preparePeaksTable() { else { currentcolumn += 4; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { currentcolumn += 2; } } @@ -1782,7 +1883,12 @@ void cSpectrumDetailWidget::preparePeaksTable() { if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { if (parameters->generateisotopepattern) { - peakstable->setColumnWidth(9, min(400, peakstable->columnWidth(9))); + if (parameters->calculatefdrs) { + peakstable->setColumnWidth(9, min(400, peakstable->columnWidth(9))); + } + else { + peakstable->setColumnWidth(7, min(400, peakstable->columnWidth(7))); + } } else { peakstable->setColumnWidth(6, min(400, peakstable->columnWidth(6))); @@ -2057,6 +2163,7 @@ void cSpectrumDetailWidget::exportTableToCSV() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); bool removefile = false; QFile file(filename); @@ -2273,13 +2380,13 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); - progress.setValue(1); + progress.setValue(0); if (parameters && theoreticalspectrum && parameters->useprofiledata) { progress.setValue(10); - if (parameters->peaklistfileformat == baf) { + if (parameters->peaklistfileformats[activefileid] == baf) { if ((parameters->mode == denovoengine) || (parameters->mode == databasesearch)) { fileid = parameters->scannumber; @@ -2291,17 +2398,50 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { if ((targetid >= 0) && (targetid < rawdata->size())) { if (state) { - peakliststream.open(parameters->peaklistfilename + ".profile." + to_string(fileid) + ".csv"); - while (peakliststream.good() && !(strstr(s.c_str(), "M/Z"))) { - getline(peakliststream, s); - } - (*rawdata)[targetid].clear(); - (*rawdata)[targetid].loadFromBAFStream(peakliststream); + progress.setValue(33); - peakliststream.close(); + if (globalpreferences) { - progress.setValue(33); + string datafile = parameters->peaklistfilenames[activefileid] + ".profile." + to_string(fileid) + ".csv"; + + #if OS_TYPE == WIN + if (globalpreferences->profilebafprocessingmethod == 1) { + if (!QFile(datafile.c_str()).exists()) { + //string s = "External\\windows\\profilespectrumreader.exe \"" + parameters->peaklistfilenames[activefileid] + "\" " + to_string(fileid); + //system(s.c_str()); + + QString command = "External\\windows\\profilespectrumreader.exe"; + QString param1 = parameters->peaklistfilenames[activefileid].c_str(); + QString param2 = to_string(fileid).c_str(); + + QStringList params; + params << param1; + params << param2; + + QProcess convert; + convert.start(command, params); + convert.waitForFinished(-1); + } + } + #endif + + if (QFile(datafile.c_str()).exists()) { + peakliststream.open(datafile); + + while (peakliststream.good() && !(strstr(s.c_str(), "M/Z"))) { + getline(peakliststream, s); + } + + (*rawdata)[targetid].clear(); + (*rawdata)[targetid].loadFromBAFStream(peakliststream); + + peakliststream.close(); + } + + } + + progress.setValue(66); (*rawdata)[targetid].sortbyMass(); (*rawdata)[targetid].normalizeIntenzityByValue(theoreticalspectrum->getExperimentalSpectrum().getMaximumAbsoluteIntensity() * 100.0 / theoreticalspectrum->getExperimentalSpectrum().getMaximumRelativeIntensity()); @@ -2311,7 +2451,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { (*rawdata)[targetid].cropMaximumMZRatio(charge(uncharge(parameters->precursormass, parameters->precursorcharge) + maxmzoverhead, (parameters->precursorcharge > 0) ? 1 : -1), parameters->precursormasserrortolerance); } - progress.setValue(66); + progress.setValue(99); } else { (*rawdata)[targetid].clear(); @@ -2322,23 +2462,23 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { } - if (parameters->peaklistfileformat == dat) { + if (parameters->peaklistfileformats[activefileid] == dat) { targetid = rowid - 1; if ((targetid >= 0) && (targetid < rawdata->size())) { if (state) { - string mgfname = parameters->peaklistfilename.substr(0, parameters->peaklistfilename.rfind('/')); + string mgfname = parameters->peaklistfilenames[activefileid].substr(0, parameters->peaklistfilenames[activefileid].rfind('/')); mgfname = mgfname.substr(0, mgfname.size() - 4); mgfname += ".mgf"; peakliststream.open(mgfname); (*rawdata)[targetid].clear(); - (*rawdata)[targetid].loadFromMGFStream(peakliststream); + (*rawdata)[targetid].loadFromMGFStream(peakliststream, 1); while (peakliststream.good() && (theoreticalspectrum->getExperimentalSpectrum().getTitle().compare((*rawdata)[targetid].getTitle()) != 0)) { (*rawdata)[targetid].clear(); - (*rawdata)[targetid].loadFromMGFStream(peakliststream); + (*rawdata)[targetid].loadFromMGFStream(peakliststream, 1); } if ((theoreticalspectrum->getExperimentalSpectrum().getTitle().compare((*rawdata)[targetid].getTitle()) != 0)) { @@ -2368,7 +2508,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { } - if (parameters->peaklistfileformat == raw) { + if (parameters->peaklistfileformats[activefileid] == raw) { if ((parameters->mode == denovoengine) || (parameters->mode == databasesearch)) { fileid = parameters->scannumber - 1; @@ -2385,7 +2525,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { bool terminatecomputation = false; - string basename = parameters->peaklistfilename.substr(0, (int)parameters->peaklistfilename.size() - 3); + string basename = parameters->peaklistfilenames[activefileid].substr(0, (int)parameters->peaklistfilenames[activefileid].size() - 3); string mzmlname = basename + "mzML"; int resultcode = mzml.parse(mzmlname, peaklists, fileid, parameters->mode, 0 /* ok */, terminatecomputation /* ok */); @@ -2398,7 +2538,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { ifstream mgfifstream; mgfifstream.open(mgfname); (*rawdata)[targetid].clear(); - (*rawdata)[targetid].loadFromMGFStream(mgfifstream); + (*rawdata)[targetid].loadFromMGFStream(mgfifstream, 1); mgfifstream.close(); QFile::remove(mgfname.c_str()); @@ -2420,7 +2560,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { } - if (parameters->peaklistfileformat == mzML) { + if (parameters->peaklistfileformats[activefileid] == mzML) { if ((parameters->mode == denovoengine) || (parameters->mode == databasesearch)) { fileid = parameters->scannumber - 1; @@ -2437,7 +2577,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { bool terminatecomputation = false; - string basename = parameters->peaklistfilename.substr(0, (int)parameters->peaklistfilename.size() - 4); + string basename = parameters->peaklistfilenames[activefileid].substr(0, (int)parameters->peaklistfilenames[activefileid].size() - 4); string mzmlname = basename + "mzML"; int resultcode = mzml.parse(mzmlname, peaklists, fileid, parameters->mode, 0 /* ok */, terminatecomputation /* ok */); @@ -2474,7 +2614,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { ifstream mgfifstream; mgfifstream.open(mgfname); (*rawdata)[targetid].clear(); - (*rawdata)[targetid].loadFromMGFStream(mgfifstream); + (*rawdata)[targetid].loadFromMGFStream(mgfifstream, 1); mgfifstream.close(); QFile::remove(mgfname.c_str()); @@ -2496,7 +2636,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { } - if ((parameters->peaklistfileformat == imzML) && ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (imzmlprofilemetadata->size() > 0)) { + if ((parameters->peaklistfileformats[activefileid] == imzML) && ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (imzmlprofilemetadata->size() > 0)) { targetid = rowid - 1; if ((targetid >= 0) && (targetid < rawdata->size())) { @@ -2571,7 +2711,7 @@ void cSpectrumDetailWidget::rawDataStateChanged(bool state) { QFile::remove(mzmlname.c_str()); mgfifstream.open(mgfname); - (*rawdata)[targetid].loadFromMGFStream(mgfifstream); + (*rawdata)[targetid].loadFromMGFStream(mgfifstream, 1); mgfifstream.close(); QFile::remove(mgfname.c_str()); diff --git a/CycloBranch/gui/cSpectrumDetailWidget.h b/CycloBranch/gui/cSpectrumDetailWidget.h index 12e0cf9..756fffb 100644 --- a/CycloBranch/gui/cSpectrumDetailWidget.h +++ b/CycloBranch/gui/cSpectrumDetailWidget.h @@ -120,12 +120,13 @@ class cSpectrumDetailWidget : public QMainWindow /** \brief Initialize the widget. \param rowid id of a row + \param activefileid id of an active file \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, cGlobalPreferences* globalpreferences, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent); + void initialize(int rowid, int activefileid, cGlobalPreferences* globalpreferences, cParameters* parameters, cTheoreticalSpectrum& theoreticalspectrum, QWidget* parent); /** @@ -168,8 +169,9 @@ class cSpectrumDetailWidget : public QMainWindow \param imzmlprofilemetadata imzml profile metadata \param profilemz64precision true if 64 mz precision is used, false if 32 bit mz precision is used \param profileintensity64precision true if 64 intensity precision is used, false if 32 bit intensity precision is used + \param usedefaultsize if true, the default size is used */ - void prepareToShow(QAction* actionShowIsomers, cPeakListSeries* rawdata, vector* imzmlprofilemetadata, bool profilemz64precision, bool profileintensity64precision); + void prepareToShow(QAction* actionShowIsomers, cPeakListSeries* rawdata, vector* imzmlprofilemetadata, bool profilemz64precision, bool profileintensity64precision, bool usedefaultsize); /** @@ -202,6 +204,104 @@ class cSpectrumDetailWidget : public QMainWindow set& getLocalNeutralLosses(); + /** + \brief Set the state of profile spectrum visualization. + \param enable state of profile spectrum visualization + */ + void setProfileSpectrumEnabled(bool enable); + + + /** + \brief Check if the profile spectrum visualization is enabled. + \retval bool true if the profile spectrum is enabled + */ + bool hasProfileSpectrumEnabled(); + + + /** + \brief Set the state of absolute intensity mode. + \param enable state of absolute intensity mode + */ + void setAbsoluteIntensityEnabled(bool enable); + + + /** + \brief Check if the absolute intensity mode is enabled. + \retval bool true if the absolute intensity mode is enabled + */ + bool hasAbsoluteIntensityEnabled(); + + + /** + \brief Set the state of hide matched peaks mode. + \param enable state of hide matched peaks mode + */ + void setHideMatchedPeaksEnabled(bool enable); + + + /** + \brief Check if the hide matched peaks mode is enabled. + \retval bool true if the hide matched peaks mode is enabled + */ + bool hasHideMatchedPeaksEnabled(); + + + /** + \brief Set the state of hide unmatched peaks mode. + \param enable state of hide unmatched peaks mode + */ + void setHideUnmatchedPeaksEnabled(bool enable); + + + /** + \brief Check if the hide unmatched peaks mode is enabled. + \retval bool true if the hide unmatched peaks mode is enabled + */ + bool hasHideUnmatchedPeaksEnabled(); + + + /** + \brief Set the state of hide scrambled peaks mode. + \param enable state of hide scrambled peaks mode + */ + void setHideScrambledPeaksEnabled(bool enable); + + + /** + \brief Check if the hide scrambled peaks mode is enabled. + \retval bool true if the hide scrambled peaks mode is enabled + */ + bool hasHideScrambledPeaksEnabled(); + + + /** + \brief Set the state of hide peak labels mode. + \param enable state of hide peak labels mode + */ + void setHidePeakLabelsEnabled(bool enable); + + + /** + \brief Check if the hide peak labels mode is enabled. + \retval bool true if the hide peak labels mode is enabled + */ + bool hasHidePeakLabelsEnabled(); + + + /** + \brief Set the state of mouse m/z selection tool. + \param enable state of mouse m/z selection tool + */ + void setMouseMzSelectionEnabled(bool enable); + + + /** + \brief Check if the mouse m/z selection tool is enabled. + \retval bool true if the mouse m/z selection tool is enabled + */ + bool hasMouseMzSelectionEnabled(); + + protected: @@ -212,6 +312,13 @@ class cSpectrumDetailWidget : public QMainWindow void keyPressEvent(QKeyEvent *event); + /** + \brief Handle a move event. + \param event pointer to QMoveEvent + */ + void moveEvent(QMoveEvent *event); + + private: QWidget* parent; @@ -319,7 +426,9 @@ class cSpectrumDetailWidget : public QMainWindow bool reportisomers; - void preparePeaksTable(); + int activefileid; + + void preparePeaksTable(QRect geometry); string printHTMLTableCell(string text, bool red); @@ -342,6 +451,13 @@ class cSpectrumDetailWidget : public QMainWindow void rawDataStateChangedSignal(bool state); + /** + \brief The signal is emitted when the widget has been moved. + \param rowid rowid of the widget + */ + void lastActiveDetail(int rowid); + + private slots: diff --git a/CycloBranch/gui/cSpectrumSceneWidget.cpp b/CycloBranch/gui/cSpectrumSceneWidget.cpp index 91220ef..0993b41 100644 --- a/CycloBranch/gui/cSpectrumSceneWidget.cpp +++ b/CycloBranch/gui/cSpectrumSceneWidget.cpp @@ -60,6 +60,8 @@ cSpectrumSceneWidget::cSpectrumSceneWidget(QWidget* parent) { maxmzoverhead = 5.0; + activefileid = 0; + scene = new QGraphicsScene(this); zoomgroup = new QGraphicsItemGroup(); @@ -79,12 +81,13 @@ cSpectrumSceneWidget::~cSpectrumSceneWidget() { } -void cSpectrumSceneWidget::initialize(cParameters* parameters, cTheoreticalSpectrum* theoreticalspectrum, cPeakListSeries* rawdata, int rowid) { +void cSpectrumSceneWidget::initialize(cParameters* parameters, cTheoreticalSpectrum* theoreticalspectrum, cPeakListSeries* rawdata, int rowid, int activefileid) { this->parameters = parameters; this->theoreticalspectrum = theoreticalspectrum; + this->activefileid = activefileid; if (parameters && parameters->useprofiledata) { - if ((parameters->peaklistfileformat == baf) || (parameters->peaklistfileformat == dat) || (parameters->peaklistfileformat == mzML) || (parameters->peaklistfileformat == raw) || (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformat == imzML))) { + if ((parameters->peaklistfileformats[activefileid] == baf) || (parameters->peaklistfileformats[activefileid] == dat) || (parameters->peaklistfileformats[activefileid] == mzML) || (parameters->peaklistfileformats[activefileid] == raw) || (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformats[activefileid] == imzML))) { if ((rowid > 0) && (rowid <= rawdata->size())) { this->rawdatapeaklist = &((*rawdata)[rowid - 1]); } @@ -460,6 +463,8 @@ void cSpectrumSceneWidget::redrawScene() { cursorsimpletextitem->setVisible(false); scene->addItem(cursorsimpletextitem); + // bug fix - mouseMoveEvent is not fired if any QGraphicsTextItem is not in the scene + scene->addText(""); // x axis line = scene->addLine(leftmargin, h - bottommargin, w - rightmargin, h - bottommargin, QPen(Qt::black, 2, Qt::SolidLine)); @@ -890,7 +895,7 @@ void cSpectrumSceneWidget::redrawScene() { // raw data (intersections with other objects are not tested) - if ((maxintensity > 0) && parameters->useprofiledata && ((parameters->peaklistfileformat == baf) || (parameters->peaklistfileformat == dat) || (parameters->peaklistfileformat == mzML) || (parameters->peaklistfileformat == raw) || (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformat == imzML))) && rawdatastate && (rawdatapeaklist->size() > 0)) { + if ((maxintensity > 0) && parameters->useprofiledata && ((parameters->peaklistfileformats[activefileid] == baf) || (parameters->peaklistfileformats[activefileid] == dat) || (parameters->peaklistfileformats[activefileid] == mzML) || (parameters->peaklistfileformats[activefileid] == raw) || (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformats[activefileid] == imzML))) && rawdatastate && (rawdatapeaklist->size() > 0)) { QPainterPath rpath; int rx, ry, lastrx, lastry; @@ -1062,7 +1067,7 @@ double cSpectrumSceneWidget::getMaximumIntensity() { double rawdatamaxintensity = 0; // get the maximum intensity in the interval - if (parameters->useprofiledata && ((parameters->peaklistfileformat == baf) || (parameters->peaklistfileformat == dat) || (parameters->peaklistfileformat == mzML) || (parameters->peaklistfileformat == raw) || (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformat == imzML))) && rawdatastate && (rawdatapeaklist->size() > 0)) { + if (parameters->useprofiledata && ((parameters->peaklistfileformats[activefileid] == baf) || (parameters->peaklistfileformats[activefileid] == dat) || (parameters->peaklistfileformats[activefileid] == mzML) || (parameters->peaklistfileformats[activefileid] == raw) || (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformats[activefileid] == imzML))) && rawdatastate && (rawdatapeaklist->size() > 0)) { if (absoluteintensity) { maxintensity = theoreticalspectrum->getExperimentalSpectrum().getMaximumAbsoluteIntensityFromMZInterval(minmzratio, maxmzratio, false, false, other, false); } diff --git a/CycloBranch/gui/cSpectrumSceneWidget.h b/CycloBranch/gui/cSpectrumSceneWidget.h index b650252..f9fddba 100644 --- a/CycloBranch/gui/cSpectrumSceneWidget.h +++ b/CycloBranch/gui/cSpectrumSceneWidget.h @@ -55,8 +55,9 @@ class cSpectrumSceneWidget : public QGraphicsView \param theoreticalspectrum a pointer to a theoretical spectrum \param rawdata a pointer to a structure handling raw data \param rowid id of a row + \param activefileid id of an active file */ - void initialize(cParameters* parameters, cTheoreticalSpectrum* theoreticalspectrum, cPeakListSeries* rawdata, int rowid); + void initialize(cParameters* parameters, cTheoreticalSpectrum* theoreticalspectrum, cPeakListSeries* rawdata, int rowid, int activefileid); /** @@ -213,6 +214,8 @@ class cSpectrumSceneWidget : public QGraphicsView double maxmzoverhead; + int activefileid; + double getMZRatioFromXPosition(int x, int w); diff --git a/CycloBranch/gui/cSummaryPeaksTableWidget.cpp b/CycloBranch/gui/cSummaryPeaksTableWidget.cpp index 6968a5f..35b8305 100644 --- a/CycloBranch/gui/cSummaryPeaksTableWidget.cpp +++ b/CycloBranch/gui/cSummaryPeaksTableWidget.cpp @@ -1,7 +1,6 @@ #include "gui/cSummaryPeaksTableWidget.h" #include "core/cParameters.h" #include "core/cTheoreticalSpectrumList.h" -#include "gui/cEventFilter.h" #include #include @@ -19,7 +18,55 @@ #include #include #include -#include + + +void addEICPeak(cParameters* parameters, cPeaksList& eicchromatogram, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum) { + if (!parameters) { + return; + } + + double intensity = 0; + int size; + + set matchedcompounds; + string matcheditem; + size_t pos; + + size = experimentalspectrum.size(); + for (int i = 0; i < size; i++) { + 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); + } + } + } + + 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); +} cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(cGlobalPreferences* globalpreferences, QWidget* parent) { @@ -31,9 +78,13 @@ cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(cGlobalPreferences* globalpre setWindowTitle(title); setWindowIcon(QIcon(":/images/icons/table.png")); + pubchemsearchwidget = new cPubChemSearchWidget(); + pubchemsearchwidget->hide(); + menuBar = new QMenuBar(this); menuBar->setNativeMenuBar(false); menuFile = new QMenu(tr("&File"), this); + //menuSearch = new QMenu(tr("&Search"), this); menuHelp = new QMenu(tr("&Help"), this); rowsfilteroperator = new QComboBox(); @@ -170,6 +221,12 @@ cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(cGlobalPreferences* globalpre toolbarFile->addAction(actionExportCSV); connect(actionExportCSV, SIGNAL(triggered()), this, SLOT(exportToCsv())); + actionExportDatabase = new QAction(QIcon(":/images/icons/db_export.png"), tr("Export to &Database"), this); + actionExportDatabase->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D)); + actionExportDatabase->setToolTip("Export to Database (Ctrl + D)"); + toolbarFile->addAction(actionExportDatabase); + connect(actionExportDatabase, SIGNAL(triggered()), this, SLOT(exportToDatabase())); + actionExportStatistics = new QAction(QIcon(":/images/icons/74.png"), tr("Export Stat&istics to CSV"), this); actionExportStatistics->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)); actionExportStatistics->setToolTip("Export Statistics to CSV (Ctrl + I)"); @@ -182,6 +239,14 @@ cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(cGlobalPreferences* globalpre toolbarFile->addAction(actionCloseWindow); connect(actionCloseWindow, SIGNAL(triggered()), this, SLOT(closeWindow())); + //toolbarSearch = addToolBar(tr("Search")); + + //actionSearchPubChem = new QAction(QIcon(":/images/icons/search.png"), tr("Search &PubChem..."), this); + //actionSearchPubChem->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_P)); + //actionSearchPubChem->setToolTip("Search PubChem... (Ctrl + P)"); + //toolbarSearch->addAction(actionSearchPubChem); + //connect(actionSearchPubChem, SIGNAL(triggered()), this, SLOT(searchPubChem())); + toolbarHelp = addToolBar(tr("Help")); actionHTMLDocumentation = new QAction(QIcon(":/images/icons/3.png"), tr("&HTML Documentation"), this); @@ -190,17 +255,23 @@ cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(cGlobalPreferences* globalpre toolbarHelp->addAction(actionHTMLDocumentation); connect(actionHTMLDocumentation, SIGNAL(triggered()), this, SLOT(showHTMLDocumentation())); + addToolBarBreak(); + toolbarFilter = addToolBar(tr("Filter")); toolbarFilter->addWidget(rowsfilterwidget); menuFile->addAction(actionExportCSV); + menuFile->addAction(actionExportDatabase); menuFile->addAction(actionExportStatistics); menuFile->addSeparator(); menuFile->addAction(actionCloseWindow); + //menuSearch->addAction(actionSearchPubChem); + menuHelp->addAction(actionHTMLDocumentation); menuBar->addMenu(menuFile); + //menuBar->addMenu(menuSearch); menuBar->addMenu(menuHelp); setMenuBar(menuBar); @@ -224,6 +295,8 @@ cSummaryPeaksTableWidget::cSummaryPeaksTableWidget(cGlobalPreferences* globalpre resize(defaultwinsizex, defaultwinsizey); applyGlobalPreferences(globalpreferences); + + activefileid = 0; } @@ -259,14 +332,19 @@ cSummaryPeaksTableWidget::~cSummaryPeaksTableWidget() { delete mainwidget; delete actionExportCSV; + delete actionExportDatabase; delete actionExportStatistics; delete actionCloseWindow; + //delete actionSearchPubChem; delete actionHTMLDocumentation; delete menuFile; + //delete menuSearch; delete menuHelp; delete menuBar; + + delete pubchemsearchwidget; } @@ -276,18 +354,30 @@ void cSummaryPeaksTableWidget::closeEvent(QCloseEvent *event) { } -bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandardmodel, cMainWindowProxyModel* resultsproxymodel, cParameters* parameters, cTheoreticalSpectrumList* spectralist, bool showisomers) { - if (!parameters || !spectralist || (resultsstandardmodel->rowCount() != spectralist->size())) { +bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandardmodel, cMainWindowProxyModel* resultsproxymodel, cParameters* parameters, cTheoreticalSpectrumList* listoftheoreticalspectra, int activefileid, bool showisomers) { + QMessageBox msgBox; + QString errstr; + + if (!parameters || !listoftheoreticalspectra || (activefileid >= listoftheoreticalspectra->size()) || (resultsstandardmodel->rowCount() != listoftheoreticalspectra->size(activefileid))) { + QString errstr = "Nothing to show. Perform an analysis first !"; + msgBox.setText(errstr); + msgBox.exec(); return false; } - int spectracount = spectralist->size(); + this->activefileid = activefileid; + + int spectracount = listoftheoreticalspectra->size(activefileid); int thpeakscount = 0; int spectrumindex; int iontypecol; cPeak* peak; + rtimes.clear(); + rtimes.resize(spectracount); + for (int i = 0; i < spectracount; i++) { + rtimes[i] = listoftheoreticalspectra->get(activefileid, i).getExperimentalSpectrum().getRetentionTime(); if (!resultsproxymodel->mapFromSource(resultsstandardmodel->index(i, 0)).isValid()) { continue; @@ -295,12 +385,12 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard spectrumindex = resultsstandardmodel->item(i, 1)->data(Qt::DisplayRole).toInt() - 1; - if ((*spectralist)[spectrumindex].getNumberOfMatchedPeaks() == 0) { + if (listoftheoreticalspectra->get(activefileid, spectrumindex).getNumberOfMatchedPeaks() == 0) { continue; } - for (int j = 0; j < (int)((*spectralist)[spectrumindex].getTheoreticalPeaks()->size()); j++) { - peak = &((*((*spectralist)[spectrumindex].getTheoreticalPeaks()))[j]); + for (int j = 0; j < (int)(listoftheoreticalspectra->get(activefileid, spectrumindex).getTheoreticalPeaks()->size()); j++) { + peak = &((*(listoftheoreticalspectra->get(activefileid, spectrumindex).getTheoreticalPeaks()))[j]); if (peak->matchedmz > 0) { thpeakscount++; } @@ -320,13 +410,18 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard resetFilter(); deleteTable(); - proxymodel->initialize(parameters->mode, parameters->peaklistfileformat, parameters->generateisotopepattern, rowsfilteroperator, rowsfiltercombobox1, rowsfiltercomparatorcombobox1, rowsfilterline1, rowsfiltercombobox2, rowsfiltercomparatorcombobox2, rowsfilterline2); + proxymodel->initialize(parameters->mode, parameters->peaklistfileformats[activefileid], parameters->generateisotopepattern, rowsfilteroperator, rowsfiltercombobox1, rowsfiltercomparatorcombobox1, rowsfilterline1, rowsfiltercombobox2, rowsfiltercomparatorcombobox2, rowsfilterline2); // prepare the header if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { if (parameters->generateisotopepattern) { - databasemodel->setColumnCount(15); + if (parameters->calculatefdrs) { + databasemodel->setColumnCount(15); + } + else { + databasemodel->setColumnCount(13); + } } else { databasemodel->setColumnCount(12); @@ -334,7 +429,12 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard } else { if (parameters->generateisotopepattern) { - databasemodel->setColumnCount(14); + if (parameters->calculatefdrs) { + databasemodel->setColumnCount(14); + } + else { + databasemodel->setColumnCount(12); + } } else { databasemodel->setColumnCount(11); @@ -364,7 +464,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard int currentcolumn = 1; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { iontypecol = 3; databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); @@ -442,7 +542,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard currentcolumn++; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { databasemodel->setHorizontalHeaderItem(currentcolumn, new QStandardItem()); databasemodel->horizontalHeaderItem(currentcolumn)->setText("Score"); database->setItemDelegateForColumn(currentcolumn, new QItemDelegate()); @@ -542,7 +642,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard for (int i = 0; i < spectracount; i++) { if (!resultsproxymodel->mapFromSource(resultsstandardmodel->index(i, 0)).isValid()) { - if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformat != mis) && (parameters->peaklistfileformat != imzML)) { + if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformats[activefileid] != mis) && (parameters->peaklistfileformats[activefileid] != imzML)) { cPeak emptypeak; emptypeak.mzratio = (double)(eicchromatogram.size() + 1); emptypeak.absoluteintensity = 0; @@ -553,21 +653,21 @@ 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], (*spectralist)[spectrumindex].getExperimentalSpectrum()); + if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && (parameters->peaklistfileformats[activefileid] != mis) && (parameters->peaklistfileformats[activefileid] != imzML)) { + addEICPeak(parameters, eicchromatogram, listoftheoreticalspectra->get(activefileid, spectrumindex), listoftheoreticalspectra->get(activefileid, spectrumindex).getExperimentalSpectrum()); } - if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML))) { - addCoordinateInfo(spectrumindex, coordinateinfo, (*spectralist)[spectrumindex], (*spectralist)[spectrumindex].getExperimentalSpectrum()); + if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML))) { + addCoordinateInfo(spectrumindex, coordinateinfo, listoftheoreticalspectra->get(activefileid, spectrumindex), listoftheoreticalspectra->get(activefileid, spectrumindex).getExperimentalSpectrum()); } - if ((*spectralist)[spectrumindex].getNumberOfMatchedPeaks() == 0) { + if (listoftheoreticalspectra->get(activefileid, spectrumindex).getNumberOfMatchedPeaks() == 0) { progress->setValue(i); continue; } - thpeaks = (*spectralist)[spectrumindex].getTheoreticalPeaks(); - thpeakscount = (*spectralist)[spectrumindex].getTheoreticalPeaks()->size(); + thpeaks = listoftheoreticalspectra->get(activefileid, spectrumindex).getTheoreticalPeaks(); + thpeakscount = listoftheoreticalspectra->get(activefileid, spectrumindex).getTheoreticalPeaks()->size(); // theoretical peaks for (int j = 0; j < thpeakscount; j++) { @@ -596,21 +696,21 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard currentcolumn++; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); - databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue((*spectralist)[spectrumindex].getExperimentalSpectrum().getCoordinateX()), Qt::DisplayRole); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(listoftheoreticalspectra->get(activefileid, spectrumindex).getExperimentalSpectrum().getCoordinateX()), Qt::DisplayRole); currentcolumn++; databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); - databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue((*spectralist)[spectrumindex].getExperimentalSpectrum().getCoordinateY()), Qt::DisplayRole); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(listoftheoreticalspectra->get(activefileid, spectrumindex).getExperimentalSpectrum().getCoordinateY()), Qt::DisplayRole); currentcolumn++; } else { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); - databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray((*spectralist)[spectrumindex].getExperimentalSpectrum().getRetentionTime())), Qt::DisplayRole); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(listoftheoreticalspectra->get(activefileid, spectrumindex).getExperimentalSpectrum().getRetentionTime())), Qt::DisplayRole); currentcolumn++; } @@ -624,7 +724,7 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard if (parameters->mode == denovoengine) { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); - databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue((*spectralist)[spectrumindex].getPathId() + 1), Qt::DisplayRole); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(listoftheoreticalspectra->get(activefileid, spectrumindex).getPathId() + 1), Qt::DisplayRole); currentcolumn++; } @@ -668,15 +768,15 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard currentcolumn++; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); - databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray((*spectralist)[spectrumindex].getTargetPatternScore(peak->groupid))), Qt::DisplayRole); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(listoftheoreticalspectra->get(activefileid, spectrumindex).getTargetPatternScore(peak->groupid))), Qt::DisplayRole); currentcolumn++; databasemodel->setItem(currentrow, currentcolumn, new QStandardItem()); databasemodel->item(currentrow, currentcolumn)->setForeground(brush); - databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray((*spectralist)[spectrumindex].getTargetPatternFDR(peak->groupid))), Qt::DisplayRole); + databasemodel->item(currentrow, currentcolumn)->setData(QVariant::fromValue(cropPrecisionToSixDecimalsByteArray(listoftheoreticalspectra->get(activefileid, spectrumindex).getTargetPatternFDR(peak->groupid))), Qt::DisplayRole); currentcolumn++; } @@ -767,13 +867,18 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard } if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { origcoordinateinfo = coordinateinfo; emit resetRegion(); 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))); + if (parameters->calculatefdrs) { + database->setColumnWidth(12, min(400, database->columnWidth(12))); + } + else { + database->setColumnWidth(10, min(400, database->columnWidth(10))); + } } else { database->setColumnWidth(9, min(400, database->columnWidth(9))); @@ -785,7 +890,12 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard emit sendFilterOptionsToChromatogram(eicchromatogram); if (parameters->generateisotopepattern) { - database->setColumnWidth(11, min(400, database->columnWidth(11))); + if (parameters->calculatefdrs) { + database->setColumnWidth(11, min(400, database->columnWidth(11))); + } + else { + database->setColumnWidth(9, min(400, database->columnWidth(9))); + } } else { database->setColumnWidth(8, min(400, database->columnWidth(8))); @@ -818,6 +928,8 @@ bool cSummaryPeaksTableWidget::prepareToShow(QStandardItemModel* resultsstandard progress->setValue(spectracount); delete progress; + resetFilter(); + return true; } @@ -843,6 +955,9 @@ void cSummaryPeaksTableWidget::applyGlobalPreferences(cGlobalPreferences* global if (lastdirexporttocsv.right(4).compare(".csv", Qt::CaseInsensitive) != 0) { lastdirexporttocsv = globalpreferences->exportcsvdefaultdir; } + if (lastdirexportdatabase.right(4).compare(".txt", Qt::CaseInsensitive) != 0) { + lastdirexportdatabase = globalpreferences->sequencesdefaultdir; + } if (lastdirexportstatisticstocsv.right(4).compare(".csv", Qt::CaseInsensitive) != 0) { lastdirexportstatisticstocsv = globalpreferences->exportcsvdefaultdir; } @@ -850,48 +965,43 @@ void cSummaryPeaksTableWidget::applyGlobalPreferences(cGlobalPreferences* global } -void cSummaryPeaksTableWidget::addEICPeak(cPeaksList& eicchromatogram, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum) { - double intensity = 0; - int size; - - set matchedcompounds; - string matcheditem; - size_t pos; +cPubChemSearchWidget* cSummaryPeaksTableWidget::getPubChemSearchWidget() { + return pubchemsearchwidget; +} - size = experimentalspectrum.size(); - for (int i = 0; i < size; i++) { - 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(); +void cSummaryPeaksTableWidget::filterTablerows() { + filterRows(); +} - 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); - } - } +void cSummaryPeaksTableWidget::filterCompound(string name, string iontype, int datatypeview, string mzstr) { + if ((datatypeview == 0) || (datatypeview == 1) || (datatypeview == 4) || (datatypeview == 5)) { + rowsfiltercombobox1->setCurrentText("Theoretical m/z"); + rowsfiltercomparatorcombobox1->setCurrentText("="); + rowsfilterline1->setText(mzstr.c_str()); + } + else { + rowsfiltercombobox1->setCurrentText("Name"); + rowsfiltercomparatorcombobox1->setCurrentText("="); + rowsfilterline1->setText(name.c_str()); } - matcheditem.clear(); - for (auto& it : matchedcompounds) { - matcheditem += it; - matcheditem += "
"; + rowsfilteroperator->setCurrentText("AND"); + + if (parameters->generateisotopepattern) { + rowsfiltercombobox2->setCurrentText("Pattern Type"); + } + else { + rowsfiltercombobox2->setCurrentText("Ion Type"); } + rowsfiltercomparatorcombobox2->setCurrentText("="); + rowsfilterline2->setText(iontype.c_str()); - cPeak peak; - peak.mzratio = (double)(eicchromatogram.size() + 1); - peak.absoluteintensity = intensity; - peak.description = matcheditem; - eicchromatogram.add(peak); + rowsfiltercasesensitive->setChecked(true); + rowsfilterwholeword->setChecked(true); + + filterRows(); } @@ -1018,6 +1128,7 @@ void cSummaryPeaksTableWidget::keyPressEvent(QKeyEvent *event) { void cSummaryPeaksTableWidget::closeWindow() { + pubchemsearchwidget->hide(); hide(); } @@ -1034,13 +1145,21 @@ void cSummaryPeaksTableWidget::filterRows() { eicchromatogram.clear(); if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { iontypecol = 3; if (parameters->generateisotopepattern) { - mzcol = 6; - relintcol = 7; - absintcol = 8; - namecol = 13; + if (parameters->calculatefdrs) { + mzcol = 6; + relintcol = 7; + absintcol = 8; + namecol = 13; + } + else { + mzcol = 6; + relintcol = 7; + absintcol = 8; + namecol = 11; + } } else { mzcol = 5; @@ -1052,10 +1171,18 @@ void cSummaryPeaksTableWidget::filterRows() { else { iontypecol = 2; if (parameters->generateisotopepattern) { - mzcol = 5; - absintcol = 7; - namecol = 12; - referencecol = 13; + if (parameters->calculatefdrs) { + mzcol = 5; + absintcol = 7; + namecol = 12; + referencecol = 13; + } + else { + mzcol = 5; + absintcol = 7; + namecol = 10; + referencecol = 11; + } } else { mzcol = 4; @@ -1079,6 +1206,7 @@ void cSummaryPeaksTableWidget::filterRows() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); // filter table proxymodel->setWholeWord(rowsfilterwholeword->isChecked()); @@ -1093,7 +1221,7 @@ void cSummaryPeaksTableWidget::filterRows() { string tmpdescription; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { int proxymodelrowcount = proxymodel->rowCount(); for (i = 0; i < proxymodelrowcount; i++) { x = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 1)))->data(Qt::DisplayRole).toInt(); @@ -1154,6 +1282,8 @@ void cSummaryPeaksTableWidget::filterRows() { } else { int proxymodelrowcount = proxymodel->rowCount(); + string compname; + for (i = 0; i < proxymodelrowcount; i++) { id = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, 0)))->data(Qt::DisplayRole).toInt() - 1; // ok @@ -1163,15 +1293,24 @@ void cSummaryPeaksTableWidget::filterRows() { experimentalmz[id].insert(tmpdescription); } + compname = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol)))->text().toStdString(); + 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 += compname; tmpdescription += ""; if (eicchromatogram[id].description.find(tmpdescription) == string::npos) { eicchromatogram[id].description += tmpdescription; + + if (parameters->mode == compoundsearch) { + if (parameters->pchemresults.count(compname) == 1) { + eicchromatogram[id].description += ", " + to_string(parameters->pchemresults[compname]) + "x"; + } + } + eicchromatogram[id].description += "
"; } @@ -1186,7 +1325,7 @@ void cSummaryPeaksTableWidget::filterRows() { } if (((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) && !progress.wasCanceled()) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { 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 { @@ -1206,7 +1345,7 @@ void cSummaryPeaksTableWidget::resetFilter() { rowsfilterline2->setText(""); if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { vector coordinateinfo; for (auto& it : origcoordinateinfo) { @@ -1228,6 +1367,11 @@ void cSummaryPeaksTableWidget::resetFilter() { proxymodel->setWholeWord(false); proxymodel->setFilterKeyColumn(-1); proxymodel->setFilterFixedString(""); + + bool lcms = (parameters->peaklistseriesvector[activefileid].size() > 1) && !((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)); + if (lcms && (parameters->mode == compoundsearch)) { + filterRows(); + } } @@ -1243,6 +1387,7 @@ void cSummaryPeaksTableWidget::exportToCsv() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); bool removefile = false; QFile file(filename); @@ -1300,6 +1445,82 @@ void cSummaryPeaksTableWidget::exportToCsv() { } +void cSummaryPeaksTableWidget::exportToDatabase() { + + if (!parameters) { + return; + } + + if (parameters->mode != compoundsearch) { + QMessageBox msgBox; + QString msg = "The feature is available only in 'Compound Search - MS, LC-MS, MSI' mode !"; + msgBox.setText(msg); + msgBox.exec(); + return; + } + + QString filename = QFileDialog::getSaveFileName(this, tr("Export Database"), lastdirexportdatabase, tr("Files (*.txt)")); + + if (!filename.isEmpty()) { + lastdirexportdatabase = filename; + + int namecol; + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { + if (parameters->generateisotopepattern) { + if (parameters->calculatefdrs) { + namecol = 13; + } + else { + namecol = 11; + } + } + else { + namecol = 10; + } + } + else { + if (parameters->generateisotopepattern) { + if (parameters->calculatefdrs) { + namecol = 12; + } + else { + namecol = 10; + } + } + else { + namecol = 9; + } + } + + set formulas; + QStandardItem* item; + + for (int i = 0; i < proxymodel->rowCount(); i++) { + item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol))); + if (item) { + formulas.insert(item->text().toStdString()); + } + } + + cSequenceDatabase seqdb; + cSequence seq; + + seq.setPeptideType(other); + for (auto& it : formulas) { + seq.setName(it); + seq.setSummaryFormula(it); + seqdb.push_back(seq); + } + + ofstream output; + output.open(filename.toStdString()); + seqdb.storeToPlainTextStream(output, false); + output.close(); + } + +} + + void cSummaryPeaksTableWidget::exportStatistics() { if (!parameters) { @@ -1317,6 +1538,7 @@ void cSummaryPeaksTableWidget::exportStatistics() { progress.installEventFilter(&filter); progress.setMinimumDuration(0); progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); bool removefile = false; QFile file(filename); @@ -1344,20 +1566,34 @@ void cSummaryPeaksTableWidget::exportStatistics() { if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { if (parameters->generateisotopepattern) { - iontypecol = 3; - theoreticalmzcol = 4; - summaryformulacol = 12; - namecol = 13; - referencecol = 14; - scorecol = 10; - fdrcol = 11; - idcol = 0; - xcol = 1; - ycol = 2; - relintcol = 7; - absintcol = 8; + if (parameters->calculatefdrs) { + iontypecol = 3; + theoreticalmzcol = 4; + summaryformulacol = 12; + namecol = 13; + referencecol = 14; + scorecol = 10; + fdrcol = 11; + idcol = 0; + xcol = 1; + ycol = 2; + relintcol = 7; + absintcol = 8; + } + else { + iontypecol = 3; + theoreticalmzcol = 4; + summaryformulacol = 10; + namecol = 11; + referencecol = 12; + idcol = 0; + xcol = 1; + ycol = 2; + relintcol = 7; + absintcol = 8; + } } else { iontypecol = 3; @@ -1374,16 +1610,28 @@ void cSummaryPeaksTableWidget::exportStatistics() { } else { if (parameters->generateisotopepattern) { - iontypecol = 2; - theoreticalmzcol = 3; - summaryformulacol = 11; - namecol = 12; - referencecol = 13; - scorecol = 9; - fdrcol = 10; - idcol = 0; - relintcol = 6; - absintcol = 7; + if (parameters->calculatefdrs) { + iontypecol = 2; + theoreticalmzcol = 3; + summaryformulacol = 11; + namecol = 12; + referencecol = 13; + scorecol = 9; + fdrcol = 10; + idcol = 0; + relintcol = 6; + absintcol = 7; + } + else { + iontypecol = 2; + theoreticalmzcol = 3; + summaryformulacol = 9; + namecol = 10; + referencecol = 11; + idcol = 0; + relintcol = 6; + absintcol = 7; + } } else { iontypecol = 2; @@ -1475,7 +1723,7 @@ void cSummaryPeaksTableWidget::exportStatistics() { if (item) { keyms.reference = item->text().toStdString(); } - if (parameters->generateisotopepattern) { + if (parameters->generateisotopepattern && parameters->calculatefdrs) { item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, scorecol))); if (item) { keyms.score = item->text().toStdString(); @@ -1708,7 +1956,7 @@ void cSummaryPeaksTableWidget::exportStatistics() { out << "\"Average Relative Intensity [%]\",\"Median Relative Intensity [%]\",\"Maximum Relative Intensity [%]\","; out << "\"Average Absolute Intensity\",\"Median Absolute Intensity\",\"Maximum Absolute Intensity\","; out << "\"ID (min)\",\"ID (max)\","; - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { out << "\"Coordinate X (min)\",\"Coordinate X (max)\",\"Coordinate Y (min)\",\"Coordinate Y (max)\","; } out << "\"Summary Formula\"" << endl; @@ -1751,7 +1999,7 @@ void cSummaryPeaksTableWidget::exportStatistics() { } } - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { item = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(*it2, xcol))); if (item) { @@ -1810,7 +2058,7 @@ void cSummaryPeaksTableWidget::exportStatistics() { out << ss.str().c_str(); out << idmin << "\",\"" << idmax << "\",\""; - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { out << xmin << "\",\"" << xmax << "\",\"" << ymin << "\",\"" << ymax << "\",\""; } @@ -1875,7 +2123,7 @@ void cSummaryPeaksTableWidget::rowDoubleClicked(const QModelIndex& item) { int experimentalmzcolumn = 0; if ((parameters->mode == dereplication) || (parameters->mode == compoundsearch)) { - if ((parameters->peaklistfileformat == mis) || (parameters->peaklistfileformat == imzML)) { + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { if (parameters->generateisotopepattern) { size = 14; experimentalmzcolumn = 6; @@ -2012,3 +2260,524 @@ void cSummaryPeaksTableWidget::rowsFilterRight2Slot() { } } + +void cSummaryPeaksTableWidget::searchPubChem() { + if (!parameters) { + return; + } + + if (parameters->mode != compoundsearch) { + QMessageBox msgBox; + QString msg = "This feature is available only in 'Compound Search - MS, LC-MS, MSI' mode !"; + msgBox.setText(msg); + msgBox.exec(); + return; + } + + bool repeatsearch = false; + if (!pubchemsearchwidget->getHTML().empty()) { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, "Search PubChem...", "Search again ?", QMessageBox::Yes | QMessageBox::No); + + if (reply == QMessageBox::Yes) { + repeatsearch = true; + } + } + + if (repeatsearch || pubchemsearchwidget->getHTML().empty()) { + + resetFilter(); + + int idcol; + int iontypecol; + int theoreticalmzcol; + int experimentalintcol; + int namecol; + + if ((parameters->peaklistfileformats[activefileid] == mis) || (parameters->peaklistfileformats[activefileid] == imzML)) { + if (parameters->generateisotopepattern) { + if (parameters->calculatefdrs) { + idcol = 0; + iontypecol = 3; + theoreticalmzcol = 4; + experimentalintcol = 7; + namecol = 13; + } + else { + idcol = 0; + iontypecol = 3; + theoreticalmzcol = 4; + experimentalintcol = 7; + namecol = 11; + } + } + else { + idcol = 0; + iontypecol = 3; + theoreticalmzcol = 4; + experimentalintcol = 6; + namecol = 10; + } + } + else { + if (parameters->generateisotopepattern) { + if (parameters->calculatefdrs) { + idcol = 0; + iontypecol = 2; + theoreticalmzcol = 3; + experimentalintcol = 6; + namecol = 12; + } + else { + idcol = 0; + iontypecol = 2; + theoreticalmzcol = 3; + experimentalintcol = 6; + namecol = 10; + } + } + else { + idcol = 0; + iontypecol = 2; + theoreticalmzcol = 3; + experimentalintcol = 5; + namecol = 9; + } + } + + set formulas; + map formulasmap; + multimap invertedmultimap; + map > scanids; + set errorset; + QStandardItem* itemid; + QStandardItem* itemiontype; + QStandardItem* itemtheoreticalmz; + QStandardItem* itemexperimentalint; + QStandardItem* itemname; + ostringstream outhtml; + + cRowItemInfo rowitem; + string tmpstr; + + for (int i = 0; i < proxymodel->rowCount(); i++) { + itemid = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, idcol))); + itemiontype = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, iontypecol))); + itemtheoreticalmz = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, theoreticalmzcol))); + itemexperimentalint = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, experimentalintcol))); + itemname = databasemodel->itemFromIndex(proxymodel->mapToSource(proxymodel->index(i, namecol))); + + if (itemid && itemiontype && itemtheoreticalmz && itemexperimentalint && itemname) { + formulas.insert(itemname->text().toStdString()); + + rowitem.id = itemid->text().toInt(); + rowitem.iontype = itemiontype->text().toStdString(); + rowitem.theoreticalmz = itemtheoreticalmz->text().toDouble(); + rowitem.experimentalint = itemexperimentalint->text().toDouble(); + + tmpstr = itemname->text().toStdString() + ", " + rowitem.iontype; + + if (formulasmap.count(tmpstr) == 0) { + formulasmap[tmpstr] = rowitem; + } + else { + if (formulasmap[tmpstr].id == rowitem.id) { + if (rowitem.experimentalint > formulasmap[tmpstr].experimentalint) { + formulasmap[tmpstr].experimentalint = rowitem.experimentalint; + formulasmap[tmpstr].theoreticalmz = rowitem.theoreticalmz; + } + } + } + + if (scanids.count(tmpstr) == 0) { + set tmpset; + tmpset.insert(rowitem.id); + scanids[tmpstr] = tmpset; + } + else { + scanids[tmpstr].insert(rowitem.id); + } + } + } + + if (formulas.size() == 0) { + return; + } + + const int limit = 500; + + if (formulas.size() > limit) { + QMessageBox msgBox; + QString errstr = "The maximum number of formulas to be searched is " + QVariant(limit).toString() + ". You generated " + QVariant((int)formulas.size()).toString() + " formulas. "; + errstr += "Please, optimize the search settings."; + msgBox.setText(errstr); + msgBox.exec(); + return; + } + + for (auto& it : formulasmap) { + invertedmultimap.insert(make_pair(it.second.theoreticalmz, it.first)); + } + + parameters->pchemresults.clear(); + vector cidsvector; + + //vector allcids; + + bool allempty = true; + + bool writelog = false; + ofstream pchemlog; + + if (writelog) { + pchemlog.open("pubchem.log", ofstream::out); + } + + bool parallel = true; + if (parallel) { + int maxthreadsbackup = QThreadPool::globalInstance()->maxThreadCount(); + int maxqueries = 2; + + QThreadPool::globalInstance()->setMaxThreadCount(maxqueries); + + vector vformulas; + for (auto& it : formulas) { + vformulas.push_back(it); + } + + QProgressDialog firstdialog("Searching compounds (CIDs)...", "Cancel", 0, (int)formulas.size(), this); + firstdialog.setMinimumWidth(250); + cEventFilter firstfilter; + firstdialog.installEventFilter(&firstfilter); + firstdialog.setMinimumDuration(0); + firstdialog.setWindowModality(Qt::ApplicationModal); + firstdialog.setValue(0); + + QFutureWatcher firstfuturewatcher; + QObject::connect(&firstfuturewatcher, SIGNAL(finished()), &firstdialog, SLOT(reset())); + QObject::connect(&firstdialog, SIGNAL(canceled()), &firstfuturewatcher, SLOT(cancel())); + QObject::connect(&firstfuturewatcher, SIGNAL(progressRangeChanged(int, int)), &firstdialog, SLOT(setRange(int, int))); + QObject::connect(&firstfuturewatcher, SIGNAL(progressValueChanged(int)), &firstdialog, SLOT(setValue(int))); + + QFuture firstfuture = QtConcurrent::mapped(vformulas.begin(), vformulas.end(), cPubchemCIDReader()); + + firstfuturewatcher.setFuture(firstfuture); + + firstdialog.exec(); + + if (firstfuturewatcher.isCanceled()) { + QThreadPool::globalInstance()->clear(); + } + + firstfuturewatcher.waitForFinished(); + + if (!firstfuturewatcher.isCanceled()) { + + cidsvector.resize(vformulas.size()); + + cPubchemCIDReader pubchemformulareader; + int count; + string firstfutureresult; + for (int i = 0; i < (int)vformulas.size(); i++) { + firstfutureresult = firstfuture.resultAt(i); + + if (firstfutureresult.substr(0, 6).compare("@ERROR") == 0) { + if (writelog) { + pchemlog << firstfutureresult; + } + firstfutureresult.clear(); + } + + if (!firstfutureresult.empty()) { + allempty = false; + } + + count = pubchemformulareader.getNumberOfCIDs(firstfutureresult); + if (count > 0) { + parameters->pchemresults.insert(make_pair(vformulas[i], count)); + pubchemformulareader.getCommaSeparatedCIDs(firstfutureresult, cidsvector[i]); + //pubchemformulareader.attachVectorOfCIDs(firstfutureresult, allcids); + } + + if (firstfutureresult.find("Status:") != string::npos) { + if (firstfutureresult.find("Status: 404") == string::npos) { + errorset.insert(vformulas[i]); + } + } + + if (writelog) { + pchemlog << "Formula: \"" << vformulas[i] << "\"" << endl; + pchemlog << "Result: \"" << firstfutureresult << "\"" << endl; + pchemlog << "Reduced result: \"" << cidsvector[i] << "\"" << endl; + pchemlog << "-----" << endl << endl; + } + } + + QProgressDialog seconddialog("Searching compounds (Names)...", "Cancel", 0, (int)cidsvector.size(), this); + seconddialog.setMinimumWidth(250); + cEventFilter secondfilter; + seconddialog.installEventFilter(&secondfilter); + seconddialog.setMinimumDuration(0); + seconddialog.setWindowModality(Qt::ApplicationModal); + seconddialog.setValue(0); + + QFutureWatcher secondfuturewatcher; + QObject::connect(&secondfuturewatcher, SIGNAL(finished()), &seconddialog, SLOT(reset())); + QObject::connect(&seconddialog, SIGNAL(canceled()), &secondfuturewatcher, SLOT(cancel())); + QObject::connect(&secondfuturewatcher, SIGNAL(progressRangeChanged(int, int)), &seconddialog, SLOT(setRange(int, int))); + QObject::connect(&secondfuturewatcher, SIGNAL(progressValueChanged(int)), &seconddialog, SLOT(setValue(int))); + + QFuture secondfuture = QtConcurrent::mapped(cidsvector.begin(), cidsvector.end(), cPubchemNameReader()); + + secondfuturewatcher.setFuture(secondfuture); + + seconddialog.exec(); + + if (secondfuturewatcher.isCanceled()) { + QThreadPool::globalInstance()->clear(); + } + + secondfuturewatcher.waitForFinished(); + + if (!secondfuturewatcher.isCanceled()) { + + cPubchemNameReader pubchemnamereader; + set reducednames; + string link; + + map > namesmap; + string secondfutureresult; + + bool servererror = false; + + for (int i = 0; i < (int)vformulas.size(); i++) { + if (cidsvector[i].empty()) { + continue; + } + + reducednames.clear(); + secondfutureresult = secondfuture.resultAt(i); + + if (secondfutureresult.substr(0, 6).compare("@ERROR") == 0) { + if (writelog) { + pchemlog << secondfutureresult; + } + secondfutureresult.clear(); + } + + pubchemnamereader.getReducedNames(secondfutureresult, reducednames); + + if (!reducednames.empty()) { + namesmap[vformulas[i]] = reducednames; + } + + if (secondfutureresult.find("Status:") != string::npos) { + if (secondfutureresult.find("Status: 404") == string::npos) { + set tmperrset; + string status; + + if (secondfutureresult.find("Status: 414") != string::npos) { + tmperrset.insert("Too many names, this item must be checked manually."); + namesmap[vformulas[i]] = tmperrset; + } + else { + tmperrset.insert("No names found, try again or later."); + namesmap[vformulas[i]] = tmperrset; + + servererror = true; + + status = vformulas[i]; + status += ", "; + status += "https://pubchem.ncbi.nlm.nih.gov/#query=" + vformulas[i]; + status += ""; + + errorset.insert(status); + } + } + } + + if (writelog) { + pchemlog << "Formula: \"" << vformulas[i] << "\"" << endl; + pchemlog << "Result: \"" << secondfutureresult << "\"" << endl; + pchemlog << "Reduced result: " << endl; + for (auto& it : reducednames) { + pchemlog << it << endl; + } + pchemlog << "-----" << endl << endl; + } + } + + if (errorset.size() > 0) { + outhtml << "
"; + outhtml << "The queries on the following formulas returned an error:
"; + for (auto& it : errorset) { + outhtml << it << "
"; + } + outhtml << "
"; + } + + if (servererror) { + outhtml << "
Try to repeat the search process again or later !
"; + } + else { + if (allempty) { + outhtml << "
Failed to connect to the server. Please, check your Internet connection, firewall or antivirus settings !
"; + } + else { + outhtml << "
The search process has been completed successfully !
"; + } + } + + outhtml << "

---
"; + + for (auto& it : invertedmultimap) { + tmpstr = it.second.substr(0, it.second.find(",")); + + if (namesmap[tmpstr].size() > 0) { + link = "https://pubchem.ncbi.nlm.nih.gov/#query=" + tmpstr; + + outhtml << "
"; + outhtml << std::fixed << std::setprecision(6); + outhtml << "m/z " << it.first << ", " << it.second << ", " << link << " ("; + outhtml << parameters->pchemresults[tmpstr]; + outhtml << " result"; + if (parameters->pchemresults[tmpstr] > 1) { + outhtml << "s"; + } + outhtml << ")
"; + + vector scanidsvector; + if (scanids.count(it.second) == 1) { + scanidsvector.assign(scanids[it.second].begin(), scanids[it.second].end()); + } + + outhtml << "Scans: "; + int scanssize = (int)scanidsvector.size(); + for (int i = 0; i < scanssize; i++) { + if (i == 0) { + outhtml << scanidsvector[i]; + continue; + } + if (i == scanssize - 1) { + if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + outhtml << "-"; + } + else { + outhtml << ", "; + } + outhtml << scanidsvector[i]; + break; + } + if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + if (scanidsvector[i] + 1 != scanidsvector[i + 1]) { + outhtml << "-" << scanidsvector[i]; + } + } + else { + outhtml << ", " << scanidsvector[i]; + } + } + outhtml << "
"; + + if ((rtimes.size() > 0) && (rtimes[rtimes.size() - 1] > 0)) { + outhtml << "RT: "; + outhtml << std::fixed << std::setprecision(3); + for (int i = 0; i < scanssize; i++) { + if (i == 0) { + outhtml << rtimes[scanidsvector[i] - 1]; + continue; + } + if (i == scanssize - 1) { + if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + outhtml << "-"; + } + else { + outhtml << ", "; + } + outhtml << rtimes[scanidsvector[i] - 1]; + break; + } + if (scanidsvector[i - 1] + 1 == scanidsvector[i]) { + if (scanidsvector[i] + 1 != scanidsvector[i + 1]) { + outhtml << "-" << rtimes[scanidsvector[i] - 1]; + } + } + else { + outhtml << ", " << rtimes[scanidsvector[i] - 1]; + } + } + outhtml << "
"; + } + + outhtml << "Names: " << "
"; + for (auto& it2 : namesmap[tmpstr]) { + outhtml << it2 << "
"; + } + outhtml << "
"; + } + } + + } + + } + + //ofstream of("out.sh"); + //for (auto& it : allcids) { + // of << "wget https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/data/compound/" << it << "/xml -O " << it << ".xml" << endl; + //} + + QThreadPool::globalInstance()->setMaxThreadCount(maxthreadsbackup); + } + else { + QProgressDialog progress("Searching compounds (CIDs)...", "Cancel", 0, (int)formulas.size(), this); + progress.setMinimumWidth(250); + cEventFilter filter; + progress.installEventFilter(&filter); + progress.setMinimumDuration(0); + progress.setWindowModality(Qt::ApplicationModal); + progress.setValue(0); + + string url; + string cids; + int i = 0; + int count; + for (auto& it : formulas) { + cPubchemCIDReader pubchemformulareader; + cids = pubchemformulareader.getCIDList(it); + count = pubchemformulareader.getNumberOfCIDs(cids); + + if (count > 0) { + parameters->pchemresults.insert(make_pair(it, count)); + } + + progress.setValue(i); + + if (progress.wasCanceled()) { + parameters->pchemresults.clear(); + break; + } + + i++; + } + + if (!progress.wasCanceled()) { + progress.setValue((int)formulas.size()); + } + } + + if (writelog) { + pchemlog.close(); + } + + resetFilter(); + + pubchemsearchwidget->setHTML(outhtml.str()); + } + + pubchemsearchwidget->show(); + pubchemsearchwidget->activateWindow(); + if (pubchemsearchwidget->isMinimized()) { + pubchemsearchwidget->showNormal(); + } +} + diff --git a/CycloBranch/gui/cSummaryPeaksTableWidget.h b/CycloBranch/gui/cSummaryPeaksTableWidget.h index 035d3b0..93d8a0c 100644 --- a/CycloBranch/gui/cSummaryPeaksTableWidget.h +++ b/CycloBranch/gui/cSummaryPeaksTableWidget.h @@ -7,6 +7,7 @@ #ifndef _CSUMMARYPEAKSTABLEWIDGET_H #define _CSUMMARYPEAKSTABLEWIDGET_H +#include #include #include #include @@ -22,15 +23,15 @@ #include #include #include -#include + #include "core/utilities.h" #include "core/cGlobalPreferences.h" #include "gui/cViewButtonDelegate.h" #include "gui/cSummaryPeaksTableProxyModel.h" #include "gui/cMainWindowProxyModel.h" #include "gui/cHTMLDelegate.h" - -using namespace std; +#include "gui/cPubChemSearchWidget.h" +#include "gui/cEventFilter.h" // forward declaration @@ -233,6 +234,16 @@ struct cSummaryTableKeyMSMS_comp { }; +/** + \brief Add a peak to an extracted ion chromatogram. + \param parameters application parameters + \param eicchromatogram EIC chromatogram + \param theoreticalspectrum theoretical spectrum + \param experimentalspectrum experimental spectrum +*/ +void addEICPeak(cParameters* parameters, cPeaksList& eicchromatogram, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum); + + /** \brief Summary table of matched peaks. */ @@ -269,11 +280,12 @@ class cSummaryPeaksTableWidget : public QMainWindow \param resultsstandardmodel standard model of the tableview in the main application window \param resultsproxymodel proxy model of the tableview in the main application window \param parameters parameters of the application - \param spectralist list of spectra + \param listoftheoreticalspectra lists of theoretical spectra + \param activefileid id of the active file \param showisomers true if isomers of blocks are reported; false otherwise \retval bool true if the table was successfully prepared, false otherwise */ - bool prepareToShow(QStandardItemModel* resultsstandardmodel, cMainWindowProxyModel* resultsproxymodel, cParameters* parameters, cTheoreticalSpectrumList* spectralist, bool showisomers); + bool prepareToShow(QStandardItemModel* resultsstandardmodel, cMainWindowProxyModel* resultsproxymodel, cParameters* parameters, cTheoreticalSpectrumList* listoftheoreticalspectra, int activefileid, bool showisomers); /** @@ -299,6 +311,29 @@ class cSummaryPeaksTableWidget : public QMainWindow void applyGlobalPreferences(cGlobalPreferences* globalpreferences); + /** + \brief Get the reference to cPubChemSearchWidget. + \retval cPubChemSearchWidget reference to cPubChemSearchWidget + */ + cPubChemSearchWidget* getPubChemSearchWidget(); + + + /** + \brief Filter table rows. + */ + void filterTablerows(); + + + /** + \brief Filter a specific compound. + \param name compound name + \param iontype ion type + \param datatypeview type of data shown + \param mzstr theoretical m/z value converted to a string + */ + void filterCompound(string name, string iontype, int datatypeview, string mzstr); + + private: QString title; @@ -308,15 +343,22 @@ class cSummaryPeaksTableWidget : public QMainWindow cParameters* parameters; QWidget* parent; + cPubChemSearchWidget* pubchemsearchwidget; + QMenuBar* menuBar; QMenu* menuFile; + //QMenu* menuSearch; QMenu* menuHelp; QToolBar* toolbarFile; QAction* actionExportCSV; + QAction* actionExportDatabase; QAction* actionExportStatistics; QAction* actionCloseWindow; + //QToolBar* toolbarSearch; + //QAction* actionSearchPubChem; + QToolBar* toolbarHelp; QAction* actionHTMLDocumentation; @@ -354,13 +396,16 @@ class cSummaryPeaksTableWidget : public QMainWindow QWidget* mainwidget; QString lastdirexporttocsv; + QString lastdirexportdatabase; QString lastdirexportstatisticstocsv; + vector rtimes; + vector origcoordinateinfo; cPeaksList origeicchromatogram; - void addEICPeak(cPeaksList& eicchromatogram, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum); - + int activefileid; + void addCoordinateInfo(int spectrumindex, vector& coordinateinfo, cTheoreticalSpectrum& theoreticalspectrum, cPeaksList& experimentalspectrum); @@ -388,6 +433,9 @@ private slots: void exportToCsv(); + void exportToDatabase(); + + void exportStatistics(); @@ -409,6 +457,8 @@ private slots: void rowsFilterRight2Slot(); + void searchPubChem(); + signals: @@ -428,7 +478,7 @@ private slots: /** - \brief Reset the region in imagw window. + \brief Reset the region in image window. */ void resetRegion(); @@ -459,3 +509,4 @@ private slots: }; #endif + diff --git a/CycloBranch/images.qrc b/CycloBranch/images.qrc index e9e88e5..fab52a2 100644 --- a/CycloBranch/images.qrc +++ b/CycloBranch/images.qrc @@ -29,8 +29,6 @@ images/icons/95.png images/icons/65.png images/icons/56.png - images/icons/5.png - images/icons/25.png images/icons/63.png images/icons/13.png images/icons/14.png @@ -49,8 +47,17 @@ images/icons/12.png images/icons/preferences.png images/icons/table.png - images/icons/image.png images/icons/csv.png images/icons/66.png + images/icons/image_edit.png + images/icons/image_open.png + images/icons/clear.png + images/icons/import.png + images/icons/db_export.png + images/icons/db_delete.png + images/icons/search.png + images/icons/pattern.png + images/icons/formula.png + images/icons/features.png diff --git a/CycloBranch/images/formula.cdr b/CycloBranch/images/formula.cdr new file mode 100644 index 0000000..c33a47e Binary files /dev/null and b/CycloBranch/images/formula.cdr differ diff --git a/CycloBranch/images/icons/25.png b/CycloBranch/images/icons/25.png deleted file mode 100644 index 035c57e..0000000 Binary files a/CycloBranch/images/icons/25.png and /dev/null differ diff --git a/CycloBranch/images/icons/5.png b/CycloBranch/images/icons/5.png deleted file mode 100644 index ce21344..0000000 Binary files a/CycloBranch/images/icons/5.png and /dev/null differ diff --git a/CycloBranch/images/icons/clear.png b/CycloBranch/images/icons/clear.png new file mode 100644 index 0000000..28beb33 Binary files /dev/null and b/CycloBranch/images/icons/clear.png differ diff --git a/CycloBranch/images/icons/db_delete.png b/CycloBranch/images/icons/db_delete.png new file mode 100644 index 0000000..dcb1564 Binary files /dev/null and b/CycloBranch/images/icons/db_delete.png differ diff --git a/CycloBranch/images/icons/db_export.png b/CycloBranch/images/icons/db_export.png new file mode 100644 index 0000000..8b3c73b Binary files /dev/null and b/CycloBranch/images/icons/db_export.png differ diff --git a/CycloBranch/images/icons/features.png b/CycloBranch/images/icons/features.png new file mode 100644 index 0000000..f63bc07 Binary files /dev/null and b/CycloBranch/images/icons/features.png differ diff --git a/CycloBranch/images/icons/formula.png b/CycloBranch/images/icons/formula.png new file mode 100644 index 0000000..345092e Binary files /dev/null and b/CycloBranch/images/icons/formula.png differ diff --git a/CycloBranch/images/icons/image.png b/CycloBranch/images/icons/image_edit.png similarity index 100% rename from CycloBranch/images/icons/image.png rename to CycloBranch/images/icons/image_edit.png diff --git a/CycloBranch/images/icons/image_open.png b/CycloBranch/images/icons/image_open.png new file mode 100644 index 0000000..130b64c Binary files /dev/null and b/CycloBranch/images/icons/image_open.png differ diff --git a/CycloBranch/images/icons/import.png b/CycloBranch/images/icons/import.png new file mode 100644 index 0000000..bd472e7 Binary files /dev/null and b/CycloBranch/images/icons/import.png differ diff --git a/CycloBranch/images/icons/pattern.png b/CycloBranch/images/icons/pattern.png new file mode 100644 index 0000000..9cb229b Binary files /dev/null and b/CycloBranch/images/icons/pattern.png differ diff --git a/CycloBranch/images/icons/search.png b/CycloBranch/images/icons/search.png new file mode 100644 index 0000000..c483b6e Binary files /dev/null and b/CycloBranch/images/icons/search.png differ diff --git a/CycloBranch/images/splash.cdr b/CycloBranch/images/splash.cdr index 567fad9..d15de84 100644 Binary files a/CycloBranch/images/splash.cdr and b/CycloBranch/images/splash.cdr differ diff --git a/CycloBranch/images/splash.png b/CycloBranch/images/splash.png index 7ffd8f8..2e3eae9 100644 Binary files a/CycloBranch/images/splash.png and b/CycloBranch/images/splash.png differ diff --git a/CycloBranch/main.cpp b/CycloBranch/main.cpp index 537a8fb..040d6bc 100644 --- a/CycloBranch/main.cpp +++ b/CycloBranch/main.cpp @@ -18,6 +18,10 @@ int main(int argc, char** argv) { XMLPlatformUtils::Initialize(); + + #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + #endif QApplication app(argc, argv); Q_INIT_RESOURCE(images); @@ -39,7 +43,7 @@ int main(int argc, char** argv) { QSplashScreen splash(pixmap); if(!pixmap.isNull()) { splash.show(); - splash.showMessage(QObject::tr(QString("Please, cite us using any related paper. " + appname + " " + appversion + " is starting ...").toStdString().c_str()), Qt::AlignCenter | Qt::AlignBottom, Qt::black); + splash.showMessage(QObject::tr(QString(appname + " " + appversion + " is starting ...").toStdString().c_str()), Qt::AlignCenter | Qt::AlignBottom, Qt::black); for (int i = 0; i < 50; i++) { if (!splash.isVisible()) { break; diff --git a/CycloBranch/parallel/cFormulaPredictorThread.cpp b/CycloBranch/parallel/cFormulaPredictorThread.cpp new file mode 100644 index 0000000..8c08dce --- /dev/null +++ b/CycloBranch/parallel/cFormulaPredictorThread.cpp @@ -0,0 +1,353 @@ +#include "parallel/cFormulaPredictorThread.h" + + +int cFormulaPredictorThread::generateCompoundsFormulaPredictor(vector& formulas) { + double minimummz = mzvalue - mzvalue * mzerror * 0.000001; + double maximummz = mzvalue + mzvalue * mzerror * 0.000001; + + unsigned long long compoundsgenerated = 0; + unsigned long long compoundsused = 0; + unsigned long long compoundslimit = 5000000; + + cSummaryFormula tmpformula; + int size; + + cBricksDatabase elementsbrickdatabase; + cBrick tmpbrick; + string tmpstr, tmpstr2; + vector valences; + bool validvalences = false; + + vector limitsofelements; + vector countsofelements; + vector massesofelements; + vector namesofelements; + + int numberofbasicbricks = 0; + + double sumofmasses; + double tmpmzdifference; + bool alloutofmz; + + double minadd = 0; + //double maxadd = 0; + + for (int i = 0; i < (int)selectedelements->size(); i++) { + tmpstr = (*selectedelements)[i]; + + if (tmpstr.rfind(':') != string::npos) { + tmpstr = tmpstr.substr(0, tmpstr.rfind(':')); + } + + tmpformula.setFormula(tmpstr, false); + + tmpbrick.clear(); + tmpbrick.setName((*selectedelements)[i]); + tmpbrick.setComposition(to_string(numberofbasicbricks + 1), false); + tmpbrick.setMass(tmpformula.getMass()); + tmpbrick.setSummary(tmpstr); + tmpbrick.createSummaryMap(); + + if ((tmpbrick.getSummaryMap().size() != 1)) { + *errmsg = "Bad input element: " + tmpstr + ". Only single elements can be used (e.g. H, C, O, N, P, S)."; + return -1; + } + else { + auto it = tmpbrick.getSummaryMap().begin(); + if (it->second != 1) { + *errmsg = "Bad input element: " + tmpstr + ". Only single elements can be used (e.g. H, C, O, N, P, S)."; + return -1; + } + } + + elementsbrickdatabase.push_back(tmpbrick); + + numberofbasicbricks++; + } + + elementsbrickdatabase.sortbyMass(); + + int carbonpos = -1; + //bool enablelimitfilter = false; + for (int i = 0; i < elementsbrickdatabase.size(); i++) { + countsofelements.push_back(0); + massesofelements.push_back(elementsbrickdatabase[i].getMass()); + + tmpstr = elementsbrickdatabase[i].getName(); + if (tmpstr.rfind(':') != string::npos) { + tmpstr = tmpstr.substr(tmpstr.rfind(':') + 1); + limitsofelements.push_back(QVariant(tmpstr.c_str()).toInt()); + //enablelimitfilter = true; + } + else { + limitsofelements.push_back(0); + } + + tmpstr = elementsbrickdatabase[i].getSummary(); + namesofelements.push_back(tmpstr); + + if (tmpstr.compare("C") == 0) { + carbonpos = i; + } + + if (tmpstr.compare("H") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("C") == 0) { + valences.push_back(4); + } + + if (tmpstr.compare("O") == 0) { + valences.push_back(2); + } + + if (tmpstr.compare("N") == 0) { + valences.push_back(3); + } + + if (tmpstr.compare("S") == 0) { + valences.push_back(6); + } + + if (tmpstr.compare("P") == 0) { + valences.push_back(5); + } + + if (tmpstr.compare("Li") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("Na") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("K") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("F") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("Cl") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("Br") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("I") == 0) { + valences.push_back(1); + } + + if (tmpstr.compare("Si") == 0) { + valences.push_back(4); + } + } + + if (basicformulacheck && (elementsbrickdatabase.size() > 0) && (elementsbrickdatabase.size() == valences.size())) { + validvalences = true; + } + + vector combarray; + for (int i = 0; i < maximumcombinedelements; i++) { + combarray.push_back(0); + } + + if (selectedions->size() > 0) { + minadd = (*selectedions)[0].massdifference; + //maxadd = (*selectedions)[0].massdifference; + for (int i = 1; i < (int)selectedions->size(); i++) { + if ((*selectedions)[i].massdifference < minadd) { + minadd = (*selectedions)[i].massdifference; + } + //if ((*selectedions)[i].massdifference > maxadd) { + // maxadd = (*selectedions)[i].massdifference; + //} + } + } + + double unchargedmaximummz = charge(uncharge(maximummz, chargevalue), (chargevalue > 0) ? 1 : -1) - minadd; + //double unchargedmaximummz = maximummz - minadd; + + //bool skipcombination; + //while (elementsbrickdatabase.nextCombinationFast(combarray, countsofelements, massesofelements, sumofmasses, numberofbasicbricks, maximumcombinedelements, 0, maximummz)) { + while (elementsbrickdatabase.nextCombinationFastLimited(combarray, countsofelements, limitsofelements, massesofelements, sumofmasses, numberofbasicbricks, maximumcombinedelements, 0, unchargedmaximummz)) { + if (*terminatecomputation) { + formulas.clear(); + return 0; + } + + /*if (enablelimitfilter) { + skipcombination = false; + size = (int)countsofelements.size(); + for (int j = 0; j < size; j++) { + if ((limitsofelements[j] > 0) && (countsofelements[j] > limitsofelements[j])) { + skipcombination = true; + break; + } + } + + if (skipcombination) { + continue; + } + }*/ + + if (validvalences) { + if (!checkSeniorRules(combarray, valences, 1)) { + continue; + } + } + + //sumofmasses = getMassAndCounts(combarray, countsofelements, massesofelements); + + alloutofmz = true; + for (auto& it : *selectedions) { + for (int j = 0; j < abs(chargevalue); j++) { + tmpmzdifference = sumofmasses + it.massdifference; + if (chargevalue > 0) { + tmpmzdifference += j * (H - e); + } + else { + tmpmzdifference -= j * (H - e); + } + if (j > 0) { + tmpmzdifference /= (double)(j + 1); + } + if ((tmpmzdifference >= minimummz) && (tmpmzdifference <= maximummz)) { + alloutofmz = false; + } + } + } + + if (alloutofmz) { + continue; + } + + if (advancedformulacheck) { + if (checkAdvancedFilteringRules(noratiocheck, sumofmasses, countsofelements, namesofelements)) { + continue; + } + } + + compoundsgenerated++; + + tmpstr.clear(); + tmpstr2.clear(); + size = (int)countsofelements.size(); + for (int j = 0; j < size; j++) { + if (countsofelements[j] > 0) { + if (j == carbonpos) { + tmpstr2 = namesofelements[j] + to_string(countsofelements[j]); + } + else { + tmpstr += namesofelements[j] + to_string(countsofelements[j]); + } + } + } + tmpstr = tmpstr2 + tmpstr; + + if (compoundsused <= compoundslimit) { + formulas.push_back(tmpstr); + } + compoundsused++; + } + + //cout << "Number of generated compounds: " << compoundsgenerated << endl; + //cout << "Number of used compounds: " << compoundsused << endl << endl; + + return 0; +} + + +cFormulaPredictorThread::cFormulaPredictorThread() { + chargevalue = 0; + maximumcombinedelements = 0; + basicformulacheck = false; + advancedformulacheck = false; + noratiocheck = false; + mzvalue = 0; + mzerror = 0; + selectedions = 0; + selectedelements = 0; + ionitems = 0; + success = 0; + terminatecomputation = 0; + errmsg = 0; + + // delete thread when run is finished + connect(this, SIGNAL(finished()), this, SLOT(deleteLater())); +} + + +void cFormulaPredictorThread::initialize(int chargevalue, int maximumcombinedelements, bool basicformulacheck, bool advancedformulacheck, bool noratiocheck, double mzvalue, double mzerror, vector& selectedions, vector& selectedelements, vector& ionitems, bool& success, bool& terminatecomputation, string& errmsg) { + this->chargevalue = chargevalue; + this->maximumcombinedelements = maximumcombinedelements; + this->basicformulacheck = basicformulacheck; + this->advancedformulacheck = advancedformulacheck; + this->noratiocheck = noratiocheck; + this->mzvalue = mzvalue; + this->mzerror = mzerror; + this->selectedions = &selectedions; + this->selectedelements = &selectedelements; + this->ionitems = &ionitems; + this->success = &success; + this->terminatecomputation = &terminatecomputation; + this->errmsg = &errmsg; +} + + +void cFormulaPredictorThread::run() { + vector formulas; + cFormulaPredictorRowItem ionitem; + + cSummaryFormula formula; + string proton = "H+"; + + if (generateCompoundsFormulaPredictor(formulas) == 0) { + *success = true; + + for (auto& it : formulas) { + for (auto& it2 : *selectedions) { + for (int i = 0; i < abs(chargevalue); i++) { + formula.setFormula(it); + formula.addFormula(it2.formula); + + for (int j = 0; j < i; j++) { + if (chargevalue > 0) { + formula.addFormula(proton); + } + else { + formula.addFormula(proton, true); + } + } + + ionitem.theoreticalmz = formula.getMass() / (double)(i + 1); + ionitem.mzerror = ppmError(mzvalue, ionitem.theoreticalmz); + ionitem.iontype = fixLabelCharge(it2.name, (chargevalue > 0) ? 1 : -1, i + 1) + " "; + ionitem.iontype += to_string(i + 1); + if (it2.positive) { + ionitem.iontype += "+"; + } + else { + ionitem.iontype += "-"; + } + + ionitem.charge = i + 1; + if (chargevalue < 0) { + ionitem.charge = -ionitem.charge; + } + + ionitem.ionformula = it; + + if (isInPpmMassErrorTolerance(mzvalue, ionitem.theoreticalmz, mzerror)) { + ionitems->push_back(ionitem); + } + } + } + } + } +} + diff --git a/CycloBranch/parallel/cFormulaPredictorThread.h b/CycloBranch/parallel/cFormulaPredictorThread.h new file mode 100644 index 0000000..f83101f --- /dev/null +++ b/CycloBranch/parallel/cFormulaPredictorThread.h @@ -0,0 +1,120 @@ +/** + \file cFormulaPredictorThread.h + \brief The thread which searches molecular formulas corresponding to m/z value. +*/ + + +#ifndef _CFORMULAPREDICTORTHREAD_H +#define _CFORMULAPREDICTORTHREAD_H + +#include +#include "core/utilities.h" +#include "core/cSummaryFormula.h" +#include "core/cBricksDatabase.h" +#include "core/cParameters.h" + + +/** + \brief An auxiliary structure representing a row in the output table. +*/ +struct cFormulaPredictorRowItem { + + /** + \brief Ion formula. + */ + string ionformula; + + + /** + \brief Theoretical m/z. + */ + double theoreticalmz; + + + /** + \brief m/z error [ppm]. + */ + double mzerror; + + + /** + \brief Ion type. + */ + string iontype; + + + /** + \brief Charge. + */ + int charge; + +}; + + +/** + \brief The thread which searches molecular formulas corresponding to m/z value. +*/ +class cFormulaPredictorThread : public QThread { + + Q_OBJECT + +private: + + int chargevalue; + int maximumcombinedelements; + bool basicformulacheck; + bool advancedformulacheck; + bool noratiocheck; + double mzvalue; + double mzerror; + vector* selectedions; + vector* selectedelements; + vector* ionitems; + bool* success; + bool* terminatecomputation; + string* errmsg; + + int generateCompoundsFormulaPredictor(vector& formulas); + + +public: + + + /** + \brief The constructor. + */ + cFormulaPredictorThread(); + + + /** + \brief Initialize the thread. + \param chargevalue charge + \param maximumcombinedelements maximum number of combined chemical elements + \param basicformulacheck basic filtering rules + \param advancedformulacheck advanced filtering rules + \param noratiocheck enable N/O rule + \param mzvalue experimental m/z value + \param mzerror m/z error + \param selectedions input list of selected ions + \param selectedelements input list of selected elements + \param ionitems output list of ions + \param success true if the calculation was successful + \param terminatecomputation reference to a variable determining that the thread must be stopped + \param errmsg an error message + */ + void initialize(int chargevalue, int maximumcombinedelements, bool basicformulacheck, bool advancedformulacheck, bool noratiocheck, double mzvalue, double mzerror, vector& selectedions, vector& selectedelements, vector& ionitems, bool& success, bool& terminatecomputation, string& errmsg); + + +protected: + + + /** + \brief The main method of the thread. + */ + void run(); + +}; + + +#endif + diff --git a/CycloBranch/parallel/cSpectrumAnalyzerThreadMS1.cpp b/CycloBranch/parallel/cSpectrumAnalyzerThreadMS1.cpp new file mode 100644 index 0000000..61fba28 --- /dev/null +++ b/CycloBranch/parallel/cSpectrumAnalyzerThreadMS1.cpp @@ -0,0 +1,72 @@ +#include "parallel/cSpectrumAnalyzerThreadMS1.h" + +#include "gui/cMainThread.h" + + +void cSpectrumAnalyzerThreadMS1::initialize(cMainThread* mainthread, cParameters* parameters, int peaklistseriesvectorid, cTheoreticalSpectrum* poolspectrum, vector< vector >* hintsindex, bool* terminatecomputation) { + this->mainthread = mainthread; + this->parameters = parameters; + this->peaklistseriesvectorid = peaklistseriesvectorid; + this->poolspectrum = poolspectrum; + this->hintsindex = hintsindex; + this->terminatecomputation = terminatecomputation; +} + + +void cSpectrumAnalyzerThreadMS1::run() { + if ((parameters == 0) || (poolspectrum == 0) || (hintsindex == 0)) { + return; + } + + if (peaklistseriesvectorid >= parameters->peaklistseriesvector.size()) { + return; + } + + poolspectrum->setParameters(parameters); + + int peaklistseriessize = parameters->peaklistseriesvector[peaklistseriesvectorid].size(); + + hintsindex->clear(); + hintsindex->resize(poolspectrum->getNumberOfPeaks()); + + vector unmatchedpeaks; + unmatchedpeaks.resize(peaklistseriessize); + + bool lcms = (parameters->peaklistseriesvector[peaklistseriesvectorid].size() > 1) && !((parameters->peaklistfileformats[peaklistseriesvectorid] == mis) || (parameters->peaklistfileformats[peaklistseriesvectorid] == imzML)); + bool rtavailable = (parameters->peaklistseriesvector[peaklistseriesvectorid].size() > 1) && (parameters->peaklistseriesvector[peaklistseriesvectorid][parameters->peaklistseriesvector[peaklistseriesvectorid].size() - 1].getRetentionTime() > 0); + bool skipcomparison; + + for (int i = 0; i < peaklistseriessize; i++) { + if (*terminatecomputation) { + hintsindex->clear(); + return; + } + + skipcomparison = false; + if (lcms && rtavailable) { + if (parameters->minimumrt != 0) { + if (parameters->peaklistseriesvector[peaklistseriesvectorid][i].getRetentionTime() < parameters->minimumrt) { + skipcomparison = true; + } + } + if (parameters->maximumrt != 0) { + if (parameters->peaklistseriesvector[peaklistseriesvectorid][i].getRetentionTime() > parameters->maximumrt) { + skipcomparison = true; + } + } + } + + cTheoreticalSpectrum tstmp; + tstmp.setParameters(parameters); + tstmp.getHintsIndex(i, peaklistseriesvectorid, *poolspectrum, unmatchedpeaks[i], *hintsindex, lcms && rtavailable, skipcomparison); + } + + for (auto& it : *hintsindex) { + sort(it.begin(), it.end()); + } + + if (mainthread) { + mainthread->addToParallelOutputState(1); + } +} + diff --git a/CycloBranch/parallel/cSpectrumAnalyzerThreadMS1.h b/CycloBranch/parallel/cSpectrumAnalyzerThreadMS1.h new file mode 100644 index 0000000..5b47039 --- /dev/null +++ b/CycloBranch/parallel/cSpectrumAnalyzerThreadMS1.h @@ -0,0 +1,63 @@ +/** + \file cSpectrumAnalyzerThreadMS1.h + \brief The thread for an initial check of LC-MS and MSI spectra. +*/ + + +#ifndef _CSPECTRUMANALYZERTHREADMS1_H +#define _CSPECTRUMANALYZERTHREADMS1_H + +#include +#include + +#include "core/cTheoreticalSpectrum.h" + + +class cMainThread; + + +/** + \brief The class representing a thread for an initial check of LC-MS and MSI spectra. +*/ +class cSpectrumAnalyzerThreadMS1 : public QObject, public QRunnable { + + Q_OBJECT + +private: + + cMainThread* mainthread; + cParameters* parameters; + int peaklistseriesvectorid; + cTheoreticalSpectrum* poolspectrum; + vector< vector >* hintsindex; + bool* terminatecomputation; + + +public: + + + /** + \brief Initialize the spectrum analyzer. + \param mainthread pointer to the main thread + \param parameters pointer to program parameters + \param peaklistseriesvectorid id of a peaklistseriesvector + \param poolspectrum input pool of theoretical peaks + \param hintsindex output vector of ids of experimental spectra in which a theoretical peak was found; for every theoretical peak + \param terminatecomputation pointer to a variable determining that the thread must be stopped + */ + void initialize(cMainThread* mainthread, cParameters* parameters, int peaklistseriesvectorid, cTheoreticalSpectrum* poolspectrum, vector< vector >* hintsindex, bool* terminatecomputation); + + +protected: + + + /** + \brief The main method of the thread. + */ + void run(); + +}; + + +#endif + diff --git a/CycloBranch/parallel/cSpectrumComparatorThreadMS1.cpp b/CycloBranch/parallel/cSpectrumComparatorThreadMS1.cpp new file mode 100644 index 0000000..bac0ee8 --- /dev/null +++ b/CycloBranch/parallel/cSpectrumComparatorThreadMS1.cpp @@ -0,0 +1,71 @@ +#include "parallel/cSpectrumComparatorThreadMS1.h" + +#include "core/cTheoreticalSpectrumList.h" +#include "gui/cMainThread.h" + + +void cSpectrumComparatorThreadMS1::initialize(cMainThread* mainthread, cParameters* parameters, int peaklistseriesvectorid, cTheoreticalSpectrum* poolspectrum, vector< vector >* hintsindex, cTheoreticalSpectrumList* theoreticalspectrumlist, vector* unmatchedpeaks, bool* terminatecomputation) { + this->mainthread = mainthread; + this->parameters = parameters; + this->peaklistseriesvectorid = peaklistseriesvectorid; + this->poolspectrum = poolspectrum; + this->hintsindex = hintsindex; + this->theoreticalspectrumlist = theoreticalspectrumlist; + this->unmatchedpeaks = unmatchedpeaks; + this->terminatecomputation = terminatecomputation; +} + + +void cSpectrumComparatorThreadMS1::run() { + if ((parameters == 0) || (poolspectrum == 0) || (hintsindex == 0) || (theoreticalspectrumlist == 0) || (unmatchedpeaks == 0)) { + return; + } + + if (peaklistseriesvectorid >= parameters->peaklistseriesvector.size()) { + return; + } + + poolspectrum->setParameters(parameters); + + int peaklistseriessize = parameters->peaklistseriesvector[peaklistseriesvectorid].size(); + + unmatchedpeaks->clear(); + unmatchedpeaks->resize(peaklistseriessize); + + // to do - theoreticalspectrumlist - reserve + + bool lcms = (parameters->peaklistseriesvector[peaklistseriesvectorid].size() > 1) && !((parameters->peaklistfileformats[peaklistseriesvectorid] == mis) || (parameters->peaklistfileformats[peaklistseriesvectorid] == imzML)); + bool rtavailable = (parameters->peaklistseriesvector[peaklistseriesvectorid].size() > 1) && (parameters->peaklistseriesvector[peaklistseriesvectorid][parameters->peaklistseriesvector[peaklistseriesvectorid].size() - 1].getRetentionTime() > 0); + bool skipcomparison; + + for (int i = 0; i < peaklistseriessize; i++) { + if (*terminatecomputation) { + // to do - clear something ? + return; + } + + skipcomparison = false; + if (lcms && rtavailable) { + if (parameters->minimumrt != 0) { + if (parameters->peaklistseriesvector[peaklistseriesvectorid][i].getRetentionTime() < parameters->minimumrt) { + skipcomparison = true; + } + } + if (parameters->maximumrt != 0) { + if (parameters->peaklistseriesvector[peaklistseriesvectorid][i].getRetentionTime() > parameters->maximumrt) { + skipcomparison = true; + } + } + } + + cTheoreticalSpectrum tstmp; + tstmp.setParameters(parameters); + tstmp.compareMSSpectrum(i, peaklistseriesvectorid, *poolspectrum, (*unmatchedpeaks)[i], *hintsindex, lcms && rtavailable, skipcomparison); + theoreticalspectrumlist->add(peaklistseriesvectorid, tstmp); + } + + if (mainthread) { + mainthread->addToParallelOutputState(1); + } +} + diff --git a/CycloBranch/parallel/cSpectrumComparatorThreadMS1.h b/CycloBranch/parallel/cSpectrumComparatorThreadMS1.h new file mode 100644 index 0000000..b274326 --- /dev/null +++ b/CycloBranch/parallel/cSpectrumComparatorThreadMS1.h @@ -0,0 +1,68 @@ +/** + \file cSpectrumComparatorThreadMS1.h + \brief The thread for comparison of a theoretical spectrum with a peak list (MS1 level). +*/ + + +#ifndef _CSPECTRUMCOMPARATORTHREADMS1_H +#define _CSPECTRUMCOMPARATORTHREADMS1_H + +#include +#include + +#include "core/cTheoreticalSpectrum.h" + + +class cTheoreticalSpectrumList; +class cMainThread; + + +/** + \brief The class representing a thread for comparison of a theoretical spectrum with a peak list (MS1 level). +*/ +class cSpectrumComparatorThreadMS1 : public QObject, public QRunnable { + + Q_OBJECT + +private: + + cMainThread* mainthread; + cParameters* parameters; + int peaklistseriesvectorid; + cTheoreticalSpectrum* poolspectrum; + vector< vector >* hintsindex; + cTheoreticalSpectrumList* theoreticalspectrumlist; + vector* unmatchedpeaks; + bool* terminatecomputation; + + +public: + + + /** + \brief Initialize the spectrum comparator. + \param mainthread pointer to the main thread + \param parameters pointer to program parameters + \param peaklistseriesvectorid id of a peaklistseriesvector + \param poolspectrum input pool of theoretical peaks + \param hintsindex input vector of ids of experimental spectra in which a theoretical peak was found; for every theoretical peak + \param theoreticalspectrumlist output list of matched peaks + \param unmatchedpeaks output list of unmatched peaks + \param terminatecomputation pointer to a variable determining that the thread must be stopped + */ + void initialize(cMainThread* mainthread, cParameters* parameters, int peaklistseriesvectorid, cTheoreticalSpectrum* poolspectrum, vector< vector >* hintsindex, cTheoreticalSpectrumList* theoreticalspectrumlist, vector* unmatchedpeaks, bool* terminatecomputation); + + +protected: + + + /** + \brief The main method of the thread. + */ + void run(); + +}; + + +#endif + diff --git a/CycloBranch/parallel/cSpectrumComparatorThread.cpp b/CycloBranch/parallel/cSpectrumComparatorThreadMS2.cpp similarity index 92% rename from CycloBranch/parallel/cSpectrumComparatorThread.cpp rename to CycloBranch/parallel/cSpectrumComparatorThreadMS2.cpp index c4574b6..da408cf 100644 --- a/CycloBranch/parallel/cSpectrumComparatorThread.cpp +++ b/CycloBranch/parallel/cSpectrumComparatorThreadMS2.cpp @@ -1,4 +1,4 @@ -#include "parallel/cSpectrumComparatorThread.h" +#include "parallel/cSpectrumComparatorThreadMS2.h" #include "core/cTheoreticalSpectrumList.h" @@ -184,7 +184,7 @@ bool compareWeightedRatioDesc(const cTheoreticalSpectrum& a, const cTheoreticalS } -void cSpectrumComparatorThread::initialize(cCandidate& candidate, cPeaksList& peaklist, cBricksDatabase* bricksdatabasewithcombinations, cTheoreticalSpectrumList* theoreticalspectrumlist, cParameters* parameters, regex* rxsequencetag, regex* rxsearchedsequence, double currentworstscore, bool* terminatecomputation) { +void cSpectrumComparatorThreadMS2::initialize(cCandidate& candidate, cPeaksList& peaklist, cBricksDatabase* bricksdatabasewithcombinations, cTheoreticalSpectrumList* theoreticalspectrumlist, cParameters* parameters, regex* rxsequencetag, regex* rxsearchedsequence, double currentworstscore, bool* terminatecomputation) { this->candidate = candidate; this->peaklist = peaklist; this->theoreticalspectrumlist = theoreticalspectrumlist; @@ -197,7 +197,7 @@ void cSpectrumComparatorThread::initialize(cCandidate& candidate, cPeaksList& pe } -void cSpectrumComparatorThread::run() { +void cSpectrumComparatorThreadMS2::run() { cCandidateSet permutations; double score; diff --git a/CycloBranch/parallel/cSpectrumComparatorThread.h b/CycloBranch/parallel/cSpectrumComparatorThreadMS2.h similarity index 91% rename from CycloBranch/parallel/cSpectrumComparatorThread.h rename to CycloBranch/parallel/cSpectrumComparatorThreadMS2.h index 2df8fae..f72913b 100644 --- a/CycloBranch/parallel/cSpectrumComparatorThread.h +++ b/CycloBranch/parallel/cSpectrumComparatorThreadMS2.h @@ -1,11 +1,11 @@ /** - \file cSpectrumComparatorThread.h - \brief The thread for comparison of a theoretical spectrum with a peak list. + \file cSpectrumComparatorThreadMS2.h + \brief The thread for comparison of a theoretical spectrum with a peak list (MS2 level). */ -#ifndef _CSPECTRUMCOMPARATORTHREAD_H -#define _CSPECTRUMCOMPARATORTHREAD_H +#ifndef _CSPECTRUMCOMPARATORTHREADMS2_H +#define _CSPECTRUMCOMPARATORTHREADMS2_H #include #include @@ -79,9 +79,9 @@ bool compareWeightedRatioDesc(const cTheoreticalSpectrum& a, const cTheoreticalS /** - \brief The class representing a thread for comparison of a theoretical spectrum with a peak list. + \brief The class representing a thread for comparison of a theoretical spectrum with a peak list (MS2 level). */ -class cSpectrumComparatorThread : public QObject, public QRunnable { +class cSpectrumComparatorThreadMS2 : public QObject, public QRunnable { Q_OBJECT diff --git a/CycloBranch/parallel/cSpectrumGeneratorThreadMS1.cpp b/CycloBranch/parallel/cSpectrumGeneratorThreadMS1.cpp new file mode 100644 index 0000000..51c339b --- /dev/null +++ b/CycloBranch/parallel/cSpectrumGeneratorThreadMS1.cpp @@ -0,0 +1,36 @@ +#include "parallel/cSpectrumGeneratorThreadMS1.h" + +#include "gui/cMainThread.h" + + +void cSpectrumGeneratorThreadMS1::initialize(cMainThread* mainthread, cParameters* parameters, int sequencestart, int sequencestop, cTheoreticalSpectrum* poolspectrum, bool* terminatecomputation) { + this->mainthread = mainthread; + this->parameters = parameters; + this->sequencestart = sequencestart; + this->sequencestop = sequencestop; + this->poolspectrum = poolspectrum; + this->terminatecomputation = terminatecomputation; +} + + +void cSpectrumGeneratorThreadMS1::run() { + if ((poolspectrum == 0) || (parameters == 0)) { + return; + } + + poolspectrum->setParameters(parameters); + + // to do - use reserve for theoreticalpeaks + + if (parameters->generateisotopepattern) { + poolspectrum->generateFineMSSpectrum(sequencestart, sequencestop, *terminatecomputation); + } + else { + poolspectrum->generateMSSpectrum(sequencestart, sequencestop, *terminatecomputation, true); + } + + if (mainthread) { + mainthread->addToParallelOutputState(1); + } +} + diff --git a/CycloBranch/parallel/cSpectrumGeneratorThreadMS1.h b/CycloBranch/parallel/cSpectrumGeneratorThreadMS1.h new file mode 100644 index 0000000..51d93aa --- /dev/null +++ b/CycloBranch/parallel/cSpectrumGeneratorThreadMS1.h @@ -0,0 +1,63 @@ +/** + \file cSpectrumGeneratorThreadMS1.h + \brief The thread for generating a theoretical spectrum (MS1 level). +*/ + + +#ifndef _CSPECTRUMGENERATORTHREADMS1_H +#define _CSPECTRUMGENERATORTHREADMS1_H + +#include +#include + +#include "core/cTheoreticalSpectrum.h" + + +class cMainThread; + + +/** + \brief The class representing a thread for generating a theoretical spectrum (MS1 level). +*/ +class cSpectrumGeneratorThreadMS1 : public QObject, public QRunnable { + + Q_OBJECT + +private: + + cMainThread* mainthread; + cParameters* parameters; + int sequencestart; + int sequencestop; + cTheoreticalSpectrum* poolspectrum; + bool* terminatecomputation; + + +public: + + + /** + \brief Initialize the spectrum generator. + \param mainthread pointer to the main thread + \param parameters pointer to program parameters + \param sequencestart index of the first item to be processed + \param sequencestop index of the last item to be processed (excluding the last item) + \param poolspectrum output pool of theoretical peaks + \param terminatecomputation pointer to a variable determining that the thread must be stopped + */ + void initialize(cMainThread* mainthread, cParameters* parameters, int sequencestart, int sequencestop, cTheoreticalSpectrum* poolspectrum, bool* terminatecomputation); + + +protected: + + + /** + \brief The main method of the thread. + */ + void run(); + +}; + + +#endif + diff --git a/CycloBranch/readme-macosx-compile.txt b/CycloBranch/readme-macosx-compile.txt index 8860875..0d4f66a 100644 --- a/CycloBranch/readme-macosx-compile.txt +++ b/CycloBranch/readme-macosx-compile.txt @@ -10,6 +10,7 @@ Tested on macOS Sierra (10.12): - install boost 1.64.0 (or higher) using "brew install boost" 2) Execute the following commands in the directory where CycloBranch is unpacked: +- open "images.qrc" in TextEdit and click File->Save - open "CycloBranch-MacOSX.pro" in TextEdit and click File->Save - type "/usr/local/opt/qt/bin/qmake" - type "make"