├── src ├── maven │ ├── icon.png │ ├── mzroll.rc │ ├── mzroll.ico │ ├── images │ │ ├── R.png │ │ ├── PDF.png │ │ ├── bad.png │ │ ├── bug.png │ │ ├── flip.png │ │ ├── good.png │ │ ├── hide.png │ │ ├── icon.icns │ │ ├── icon.png │ │ ├── last.png │ │ ├── link.png │ │ ├── next.png │ │ ├── note.png │ │ ├── qqq.png │ │ ├── tic.png │ │ ├── train.png │ │ ├── adducts.png │ │ ├── cluster.png │ │ ├── copyCSV.png │ │ ├── copyPNG.png │ │ ├── delete.png │ │ ├── export.png │ │ ├── filenew.png │ │ ├── filter.png │ │ ├── gallery.png │ │ ├── heatmap.png │ │ ├── isotope.png │ │ ├── markbad.png │ │ ├── padlock.png │ │ ├── pathway.png │ │ ├── refresh.png │ │ ├── samples.png │ │ ├── spectra.png │ │ ├── splash.png │ │ ├── zoomin.png │ │ ├── zoomout.png │ │ ├── autofocus.png │ │ ├── black_star.png │ │ ├── blue_star.png │ │ ├── bookmark.png │ │ ├── colorfill.png │ │ ├── compound.png │ │ ├── contrast.png │ │ ├── covariants.png │ │ ├── dbsearch.png │ │ ├── exportcsv.png │ │ ├── exportpdf.png │ │ ├── exportpng.png │ │ ├── exportxml.png │ │ ├── fileopen.png │ │ ├── fileprint.png │ │ ├── filesave.png │ │ ├── flowerplot.png │ │ ├── free_range.png │ │ ├── green_star.png │ │ ├── markgood.png │ │ ├── maven_2_img.ai │ │ ├── molecule.png │ │ ├── peakgroup.png │ │ ├── pink_star.png │ │ ├── resetzoom.png │ │ ├── resetzoom2.png │ │ ├── settings.png │ │ ├── textcenter.png │ │ ├── zoomInEdge.png │ │ ├── zoomInNode.png │ │ ├── zoomInText.png │ │ ├── black_circle.png │ │ ├── blue_circle.png │ │ ├── findcompound.png │ │ ├── green_circle.png │ │ ├── icon_filter.png │ │ ├── maven_2_img.png │ │ ├── negative_ion.png │ │ ├── orange_star.png │ │ ├── pink_circle.png │ │ ├── positive_ion.png │ │ ├── scatterplot.png │ │ ├── spreadsheet.png │ │ ├── unknown_ion.png │ │ ├── yellow_star.png │ │ ├── zoomOutEdge.png │ │ ├── zoomOutNode.png │ │ ├── zoomOutText.png │ │ ├── averageSpectra.png │ │ ├── blue_triangle.png │ │ ├── daffodil_circle.png │ │ ├── daffodil_star.png │ │ ├── dotted_gaussian.png │ │ ├── featuredetect.png │ │ ├── filled_gaussian.png │ │ ├── gaussian_groups.png │ │ ├── green_triangle.png │ │ ├── integrateArea.png │ │ ├── isotope_legend.png │ │ ├── librarymanager.png │ │ ├── metadata_upload.png │ │ ├── orange_circle.png │ │ ├── plain_gaussian.png │ │ ├── showbookmarks.png │ │ ├── spectra_search.png │ │ ├── spectra_with_2.png │ │ ├── spectra_with_3.png │ │ ├── bar_plot_samples.png │ │ ├── daffodil_triangle.png │ │ ├── metadata_download.png │ │ ├── compound_reassigned.png │ │ ├── icon_filter_selected.png │ │ └── autofocus.svg │ ├── get_version.sh │ ├── maven.desktop │ ├── traindialog.cpp │ ├── clusterdialog.cpp │ ├── alignmentdialog.cpp │ ├── searchparamsdialog.cpp │ ├── isotopesexportsettings.cpp │ ├── alignmentdialog.h │ ├── traindialog.h │ ├── clusterdialog.h │ ├── searchparamsdialog.h │ ├── isotopeexportsettingsdialog.h │ ├── alignmentdialog2.h │ ├── msmsscoringsettings.h │ ├── samplebarplotwidget.h │ ├── msmsscoringsettings.cpp │ ├── isotopelegendwidget.h │ ├── editpeakgroupingdialog.h │ ├── alignmentdialog2.cpp │ ├── setrumsdbdialog.h │ ├── configurediffisotopesearch.h │ ├── classifierNeuralNet.h │ ├── forms │ │ ├── covariantswidget.ui │ │ ├── adductwidget.ui │ │ ├── searchparamsdialog.ui │ │ ├── selectadductsdialog.ui │ │ ├── rconsolewidget.ui │ │ ├── isotopesexportsettings.ui │ │ ├── filtertagsdialog.ui │ │ ├── isotopeswidget.ui │ │ ├── librarydialog.ui │ │ ├── clusterdialog.ui │ │ ├── setrumsDBdialog.ui │ │ └── editpeakgroupdialog.ui │ ├── selectadductsdialog.h │ ├── mzfileio.h │ ├── numeric_treewidgetitem.h │ ├── heatmap.h │ ├── history.cpp │ ├── directinfusiondialog.h │ ├── boxplot.h │ ├── librarydialog.h │ ├── filtertagsdialog.h │ ├── calibratedialog.h │ ├── suggest.h │ ├── spectramatching.h │ ├── masscalcgui.h │ ├── scatterplot.h │ ├── comparesamplesdialog.h │ ├── csvreports.h │ ├── globals.h │ ├── rconsolewidget.h │ ├── gallerywidget.h │ ├── plot_axes.h │ ├── background_directinfusion_update.h │ ├── gitversion.pri │ ├── tinyplot.h │ ├── samplebarplotwidget.cpp │ ├── settingsform.h │ ├── isotopelegendwidget.cpp │ ├── barplot.h │ ├── isotopeswidget.h │ ├── line.h │ ├── history.h │ ├── spectralhit.h │ ├── stable.h │ ├── setrumsdbdialog.cpp │ ├── peakdetectiondialog.h │ ├── test.cpp │ ├── note.h │ ├── isotopeplot.h │ ├── point.h │ ├── classifier.cpp │ ├── highlighter.h │ ├── line.cpp │ ├── projectdockwidget.h │ ├── configurediffisotopesearch.cpp │ ├── treedockwidget.h │ ├── plot_axes.cpp │ ├── ligandwidget.h │ └── database.h ├── maven_tests │ ├── testsecprocessor │ │ ├── testsecprocessor.cpp │ │ └── testsecprocessor.pro │ ├── testsimpleparsimony │ │ ├── testsimpleparsimony.h │ │ ├── testsimpleparsimony.pro │ │ └── testsimpleparsimony.cpp │ ├── maven_tests.pro │ ├── testqstring │ │ ├── testqstring.pro │ │ └── testqstring.cpp │ ├── testqstring2 │ │ ├── testqstring2.pro │ │ └── testqstring2.cpp │ ├── testrtalignment │ │ └── testrtalignment.pro │ └── testmzkitchenprocessor │ │ └── testmzkitchenprocessor.pro ├── pulleics │ └── pulleics.pro ├── isotopeprocessor │ └── isotopeprocessor.pro ├── peakdetector │ ├── peakdetector_resource.rc │ ├── strnatcmp.h │ └── peakdetector.pro └── proteinfragmentfinder │ └── proteinfragmentfinder.pro ├── .gitmodules ├── .bzrignore ├── ci └── travis │ ├── before_install_osx.sh │ └── before_install_linux.sh ├── README.md ├── COPYING ├── peakdetector_pipeline └── README.md ├── .gitignore ├── make_dist_osx.sh ├── CHANGELOG.md ├── make_dist_linux.sh ├── .travis.yml.bak └── make_dist_win32.sh /src/maven/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/icon.png -------------------------------------------------------------------------------- /src/maven/mzroll.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "mzroll.ico" 2 | -------------------------------------------------------------------------------- /src/maven/mzroll.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/mzroll.ico -------------------------------------------------------------------------------- /src/maven/images/R.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/R.png -------------------------------------------------------------------------------- /src/maven/images/PDF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/PDF.png -------------------------------------------------------------------------------- /src/maven/images/bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/bad.png -------------------------------------------------------------------------------- /src/maven/images/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/bug.png -------------------------------------------------------------------------------- /src/maven/images/flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/flip.png -------------------------------------------------------------------------------- /src/maven/images/good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/good.png -------------------------------------------------------------------------------- /src/maven/images/hide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/hide.png -------------------------------------------------------------------------------- /src/maven/images/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/icon.icns -------------------------------------------------------------------------------- /src/maven/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/icon.png -------------------------------------------------------------------------------- /src/maven/images/last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/last.png -------------------------------------------------------------------------------- /src/maven/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/link.png -------------------------------------------------------------------------------- /src/maven/images/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/next.png -------------------------------------------------------------------------------- /src/maven/images/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/note.png -------------------------------------------------------------------------------- /src/maven/images/qqq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/qqq.png -------------------------------------------------------------------------------- /src/maven/images/tic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/tic.png -------------------------------------------------------------------------------- /src/maven/images/train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/train.png -------------------------------------------------------------------------------- /src/maven/images/adducts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/adducts.png -------------------------------------------------------------------------------- /src/maven/images/cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/cluster.png -------------------------------------------------------------------------------- /src/maven/images/copyCSV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/copyCSV.png -------------------------------------------------------------------------------- /src/maven/images/copyPNG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/copyPNG.png -------------------------------------------------------------------------------- /src/maven/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/delete.png -------------------------------------------------------------------------------- /src/maven/images/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/export.png -------------------------------------------------------------------------------- /src/maven/images/filenew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/filenew.png -------------------------------------------------------------------------------- /src/maven/images/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/filter.png -------------------------------------------------------------------------------- /src/maven/images/gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/gallery.png -------------------------------------------------------------------------------- /src/maven/images/heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/heatmap.png -------------------------------------------------------------------------------- /src/maven/images/isotope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/isotope.png -------------------------------------------------------------------------------- /src/maven/images/markbad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/markbad.png -------------------------------------------------------------------------------- /src/maven/images/padlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/padlock.png -------------------------------------------------------------------------------- /src/maven/images/pathway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/pathway.png -------------------------------------------------------------------------------- /src/maven/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/refresh.png -------------------------------------------------------------------------------- /src/maven/images/samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/samples.png -------------------------------------------------------------------------------- /src/maven/images/spectra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/spectra.png -------------------------------------------------------------------------------- /src/maven/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/splash.png -------------------------------------------------------------------------------- /src/maven/images/zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomin.png -------------------------------------------------------------------------------- /src/maven/images/zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomout.png -------------------------------------------------------------------------------- /src/maven/images/autofocus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/autofocus.png -------------------------------------------------------------------------------- /src/maven/images/black_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/black_star.png -------------------------------------------------------------------------------- /src/maven/images/blue_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/blue_star.png -------------------------------------------------------------------------------- /src/maven/images/bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/bookmark.png -------------------------------------------------------------------------------- /src/maven/images/colorfill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/colorfill.png -------------------------------------------------------------------------------- /src/maven/images/compound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/compound.png -------------------------------------------------------------------------------- /src/maven/images/contrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/contrast.png -------------------------------------------------------------------------------- /src/maven/images/covariants.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/covariants.png -------------------------------------------------------------------------------- /src/maven/images/dbsearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/dbsearch.png -------------------------------------------------------------------------------- /src/maven/images/exportcsv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/exportcsv.png -------------------------------------------------------------------------------- /src/maven/images/exportpdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/exportpdf.png -------------------------------------------------------------------------------- /src/maven/images/exportpng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/exportpng.png -------------------------------------------------------------------------------- /src/maven/images/exportxml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/exportxml.png -------------------------------------------------------------------------------- /src/maven/images/fileopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/fileopen.png -------------------------------------------------------------------------------- /src/maven/images/fileprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/fileprint.png -------------------------------------------------------------------------------- /src/maven/images/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/filesave.png -------------------------------------------------------------------------------- /src/maven/images/flowerplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/flowerplot.png -------------------------------------------------------------------------------- /src/maven/images/free_range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/free_range.png -------------------------------------------------------------------------------- /src/maven/images/green_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/green_star.png -------------------------------------------------------------------------------- /src/maven/images/markgood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/markgood.png -------------------------------------------------------------------------------- /src/maven/images/maven_2_img.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/maven_2_img.ai -------------------------------------------------------------------------------- /src/maven/images/molecule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/molecule.png -------------------------------------------------------------------------------- /src/maven/images/peakgroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/peakgroup.png -------------------------------------------------------------------------------- /src/maven/images/pink_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/pink_star.png -------------------------------------------------------------------------------- /src/maven/images/resetzoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/resetzoom.png -------------------------------------------------------------------------------- /src/maven/images/resetzoom2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/resetzoom2.png -------------------------------------------------------------------------------- /src/maven/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/settings.png -------------------------------------------------------------------------------- /src/maven/images/textcenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/textcenter.png -------------------------------------------------------------------------------- /src/maven/images/zoomInEdge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomInEdge.png -------------------------------------------------------------------------------- /src/maven/images/zoomInNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomInNode.png -------------------------------------------------------------------------------- /src/maven/images/zoomInText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomInText.png -------------------------------------------------------------------------------- /src/maven/get_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export GIT_VERSION=$(git describe --tags --always) 3 | echo $GIT_VERSION 4 | -------------------------------------------------------------------------------- /src/maven/images/black_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/black_circle.png -------------------------------------------------------------------------------- /src/maven/images/blue_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/blue_circle.png -------------------------------------------------------------------------------- /src/maven/images/findcompound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/findcompound.png -------------------------------------------------------------------------------- /src/maven/images/green_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/green_circle.png -------------------------------------------------------------------------------- /src/maven/images/icon_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/icon_filter.png -------------------------------------------------------------------------------- /src/maven/images/maven_2_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/maven_2_img.png -------------------------------------------------------------------------------- /src/maven/images/negative_ion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/negative_ion.png -------------------------------------------------------------------------------- /src/maven/images/orange_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/orange_star.png -------------------------------------------------------------------------------- /src/maven/images/pink_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/pink_circle.png -------------------------------------------------------------------------------- /src/maven/images/positive_ion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/positive_ion.png -------------------------------------------------------------------------------- /src/maven/images/scatterplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/scatterplot.png -------------------------------------------------------------------------------- /src/maven/images/spreadsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/spreadsheet.png -------------------------------------------------------------------------------- /src/maven/images/unknown_ion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/unknown_ion.png -------------------------------------------------------------------------------- /src/maven/images/yellow_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/yellow_star.png -------------------------------------------------------------------------------- /src/maven/images/zoomOutEdge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomOutEdge.png -------------------------------------------------------------------------------- /src/maven/images/zoomOutNode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomOutNode.png -------------------------------------------------------------------------------- /src/maven/images/zoomOutText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/zoomOutText.png -------------------------------------------------------------------------------- /src/maven/images/averageSpectra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/averageSpectra.png -------------------------------------------------------------------------------- /src/maven/images/blue_triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/blue_triangle.png -------------------------------------------------------------------------------- /src/maven/images/daffodil_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/daffodil_circle.png -------------------------------------------------------------------------------- /src/maven/images/daffodil_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/daffodil_star.png -------------------------------------------------------------------------------- /src/maven/images/dotted_gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/dotted_gaussian.png -------------------------------------------------------------------------------- /src/maven/images/featuredetect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/featuredetect.png -------------------------------------------------------------------------------- /src/maven/images/filled_gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/filled_gaussian.png -------------------------------------------------------------------------------- /src/maven/images/gaussian_groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/gaussian_groups.png -------------------------------------------------------------------------------- /src/maven/images/green_triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/green_triangle.png -------------------------------------------------------------------------------- /src/maven/images/integrateArea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/integrateArea.png -------------------------------------------------------------------------------- /src/maven/images/isotope_legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/isotope_legend.png -------------------------------------------------------------------------------- /src/maven/images/librarymanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/librarymanager.png -------------------------------------------------------------------------------- /src/maven/images/metadata_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/metadata_upload.png -------------------------------------------------------------------------------- /src/maven/images/orange_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/orange_circle.png -------------------------------------------------------------------------------- /src/maven/images/plain_gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/plain_gaussian.png -------------------------------------------------------------------------------- /src/maven/images/showbookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/showbookmarks.png -------------------------------------------------------------------------------- /src/maven/images/spectra_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/spectra_search.png -------------------------------------------------------------------------------- /src/maven/images/spectra_with_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/spectra_with_2.png -------------------------------------------------------------------------------- /src/maven/images/spectra_with_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/spectra_with_3.png -------------------------------------------------------------------------------- /src/maven/images/bar_plot_samples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/bar_plot_samples.png -------------------------------------------------------------------------------- /src/maven/images/daffodil_triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/daffodil_triangle.png -------------------------------------------------------------------------------- /src/maven/images/metadata_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/metadata_download.png -------------------------------------------------------------------------------- /src/maven/images/compound_reassigned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/compound_reassigned.png -------------------------------------------------------------------------------- /src/maven/images/icon_filter_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugenemel/maven/HEAD/src/maven/images/icon_filter_selected.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/maven_core"] 2 | path = src/maven_core 3 | url = https://github.com/eugenemel/maven_core.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /.bzrignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | libcdfread/tmp 3 | libmzorbi/tmp 4 | libneural/tmp 5 | mzroll/tmp 6 | mzWatcher/tmp 7 | peakdetector/tmp 8 | pugixml/src/tmp 9 | build 10 | -------------------------------------------------------------------------------- /src/maven/maven.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Maven 4 | Comment=Metabolomics Data and Pathway Browser 5 | Exec=Maven 6 | Icon=icon 7 | Categories=Science; 8 | -------------------------------------------------------------------------------- /src/maven/traindialog.cpp: -------------------------------------------------------------------------------- 1 | #include "traindialog.h" 2 | 3 | TrainDialog::TrainDialog(QWidget *parent) : 4 | QDialog(parent) { 5 | setupUi(this); 6 | setModal(false); 7 | } 8 | -------------------------------------------------------------------------------- /src/maven_tests/testsecprocessor/testsecprocessor.cpp: -------------------------------------------------------------------------------- 1 | #include "secprocessor.h" 2 | 3 | int main(int argc, char* argv[]) { 4 | //TODO 5 | cout << "Test Passed" << endl; 6 | } 7 | -------------------------------------------------------------------------------- /src/maven/clusterdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "clusterdialog.h" 2 | 3 | ClusterDialog::ClusterDialog(QWidget *parent) : 4 | QDialog(parent) { 5 | setupUi(this); 6 | setModal(false); 7 | } 8 | -------------------------------------------------------------------------------- /src/maven/alignmentdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "alignmentdialog.h" 2 | 3 | AlignmentDialog::AlignmentDialog(QWidget *parent) : QDialog(parent) { 4 | setupUi(this); 5 | setModal(true); 6 | } 7 | -------------------------------------------------------------------------------- /src/maven/searchparamsdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "searchparamsdialog.h" 2 | 3 | SearchParamsDialog::SearchParamsDialog(QWidget *parent) : 4 | QDialog(parent) { 5 | setupUi(this); 6 | setModal(false); 7 | } 8 | -------------------------------------------------------------------------------- /src/maven/isotopesexportsettings.cpp: -------------------------------------------------------------------------------- 1 | #include "isotopeexportsettingsdialog.h" 2 | 3 | IsotopeExportSettingsDialog::IsotopeExportSettingsDialog(QWidget *parent) : 4 | QDialog(parent) { 5 | setupUi(this); 6 | setModal(true); 7 | } 8 | -------------------------------------------------------------------------------- /src/maven_tests/testsimpleparsimony/testsimpleparsimony.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class TestSimpleParsimony: public QObject 4 | { 5 | Q_OBJECT 6 | private slots: 7 | void simpleParsimonyReduce(); 8 | void simpleParsimonyReduce_data(); 9 | }; 10 | -------------------------------------------------------------------------------- /src/maven_tests/maven_tests.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += ordered qt thread 3 | SUBDIRS += \ 4 | testqstring \ 5 | testqstring2 \ 6 | testsimpleparsimony \ 7 | testsecprocessor \ 8 | testmzkitchenprocessor \ 9 | testrtalignment 10 | -------------------------------------------------------------------------------- /src/maven_tests/testqstring/testqstring.pro: -------------------------------------------------------------------------------- 1 | # Generated by following instructions here 2 | # See https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html 3 | 4 | QT += testlib 5 | TEMPLATE = app 6 | TARGET = testqstring 7 | INCLUDEPATH += . 8 | DEFINES += QT_DEPRECATED_WARNINGS 9 | 10 | SOURCES += testqstring.cpp 11 | -------------------------------------------------------------------------------- /src/maven/alignmentdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ALIGNDIALOG_H 2 | #define ALIGNDIALOG_H 3 | 4 | #include "stable.h" 5 | #include "ui_alignmentdialog.h" 6 | 7 | class AlignmentDialog : public QDialog, public Ui_AlignmentDialog { 8 | Q_OBJECT 9 | 10 | public: 11 | AlignmentDialog(QWidget *parent); 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/maven_tests/testqstring2/testqstring2.pro: -------------------------------------------------------------------------------- 1 | # Generated by following instructions here 2 | # See https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html 3 | 4 | QT += testlib 5 | TEMPLATE = app 6 | TARGET = testqstring2 7 | INCLUDEPATH += . 8 | DEFINES += QT_DEPRECATED_WARNINGS 9 | 10 | # Input 11 | SOURCES += testqstring2.cpp 12 | 13 | -------------------------------------------------------------------------------- /src/maven/traindialog.h: -------------------------------------------------------------------------------- 1 | #ifndef TRAINDIALOG_H 2 | #define TRAINDIALOG_H 3 | 4 | #include "stable.h" 5 | #include "ui_trainingdialog.h" 6 | #include "tabledockwidget.h" 7 | 8 | class TableDockWidget; 9 | 10 | class TrainDialog : public QDialog, public Ui_TrainingDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | TrainDialog(QWidget *parent); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/maven/clusterdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef CLUSTERDIALOG_H 2 | #define CLUSTERDIALOG_H 3 | 4 | #include "stable.h" 5 | #include "ui_clusterdialog.h" 6 | #include "tabledockwidget.h" 7 | 8 | class TableDockWidget; 9 | 10 | class ClusterDialog : public QDialog, public Ui_ClusterDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | ClusterDialog(QWidget *parent); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/maven/searchparamsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SEARCHPARAMSDIALOG_H 2 | #define SEARCHPARAMSDIALOG_H 3 | 4 | #include "ui_searchparamsdialog.h" 5 | 6 | class TableDockWidget; 7 | 8 | class SearchParamsDialog : public QDialog, public Ui_SearchParamsDialog{ 9 | 10 | Q_OBJECT 11 | 12 | public: 13 | SearchParamsDialog(QWidget *parent); 14 | }; 15 | 16 | #endif // SEARCHPARAMSDIALOG_H 17 | -------------------------------------------------------------------------------- /src/maven/isotopeexportsettingsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ISOTOPEEXPORTSETTINGSDIALOG_H 2 | #define ISOTOPEEXPORTSETTINGSDIALOG_H 3 | 4 | #include "stable.h" 5 | #include "ui_isotopesexportsettings.h" 6 | 7 | class IsotopeExportSettingsDialog : public QDialog, public Ui_Dialog { 8 | 9 | Q_OBJECT 10 | 11 | public: 12 | IsotopeExportSettingsDialog(QWidget *parent); 13 | }; 14 | 15 | #endif // ISOTOPEEXPORTSETTINGSDIALOG_H 16 | -------------------------------------------------------------------------------- /src/maven/alignmentdialog2.h: -------------------------------------------------------------------------------- 1 | #ifndef ALIGNDIALOG2_H 2 | #define ALIGNDIALOG2_H 3 | 4 | #include "stable.h" 5 | #include "ui_alignmentdialog2.h" 6 | 7 | class AlignmentDialog2 : public QDialog, public Ui_AlignmentDialog2 { 8 | Q_OBJECT 9 | 10 | public: 11 | AlignmentDialog2(QWidget *parent); 12 | 13 | public slots: 14 | void loadRtFile(); 15 | void bringIntoView(); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/maven/msmsscoringsettings.h: -------------------------------------------------------------------------------- 1 | #ifndef MSMSSCORINGSETTINGS_H 2 | #define MSMSSCORINGSETTINGS_H 3 | 4 | #include "stable.h" 5 | #include "ui_msmsscoringsettings.h" 6 | 7 | class MSMSScoringSettingsDialog : public QDialog, public Ui_MSMSScoringSettingsDialog 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | MSMSScoringSettingsDialog(QWidget *parent); 13 | 14 | public slots: 15 | void setLipidClassAdductFile(); 16 | void bringIntoView(); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ci/travis/before_install_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #echo "Maven debugging: try doing nothing for mac os x" 4 | 5 | brew update 6 | which cmake 7 | echo $PATH 8 | brew pin cmake 9 | brew install qt@5 10 | brew link qt5 --force 11 | 12 | ENVFILE=qt-5.env 13 | echo Create $ENVFILE 14 | cat << EOF > $ENVFILE 15 | 16 | export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" 17 | export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib" 18 | export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include" 19 | export PKG_CONFIG_PATH="/opt/homebrew/opt/pkgconfig/" 20 | EOF -------------------------------------------------------------------------------- /src/maven/samplebarplotwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef SAMPLEBARPLOTWIDGET_H 2 | #define SAMPLEBARPLOTWIDGET_H 3 | 4 | #include "stable.h" 5 | #include "mainwindow.h" 6 | #include "barplot.h" 7 | 8 | class SampleBarPlotWidget : public QGraphicsView { 9 | 10 | Q_OBJECT 11 | 12 | public: 13 | SampleBarPlotWidget(MainWindow *mw); 14 | ~SampleBarPlotWidget(); 15 | 16 | public slots: 17 | void setPeakGroup(PeakGroup *peakGroup); 18 | void refresh(); 19 | 20 | private: 21 | QGraphicsScene *_scene; 22 | MainWindow *_mw; 23 | BarPlot *_barPlot; 24 | 25 | }; 26 | 27 | #endif // SAMPLEBARPLOTWIDGET_H 28 | -------------------------------------------------------------------------------- /src/pulleics/pulleics.pro: -------------------------------------------------------------------------------- 1 | # codebase paths 2 | CORE = ../maven_core 3 | NATSORT = . 4 | MAVEN = ../maven/ 5 | 6 | include($$CORE/libmaven.pri) 7 | 8 | TEMPLATE = app 9 | TARGET = pulleics 10 | DESTDIR = $$MAVEN/bin/ 11 | CONFIG -= network gui opengl 12 | CONFIG += sql qt std++14 13 | 14 | QT += sql gui 15 | QT -= network opengl std++14 16 | 17 | INCLUDEPATH += $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src $$CORE/libneural $$CORE/MSToolkit/include $$CORE $$NATSORT 18 | 19 | LDFLAGS += $$OUTPUT_DIR/lib 20 | 21 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 22 | 23 | contains (DEFINES,CDFPARSER) { 24 | LIBS += -lcdfread -lnetcdf 25 | } 26 | 27 | SOURCES= pulleics.cpp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Maven GUI: Metabolomics Analysis and Visualization Engine 3 | 4 | Build Status (AppVeyor): [![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/eugenemel/maven?branch=master&svg=true&retina=true)](https://ci.appveyor.com/project/eugenemel/maven) 5 | 6 | As of 20241105, linux builds have been retired, and both mac os and windows executable are now produced by Appveyor. 7 | 8 | ## Download latest release 9 | 10 | [Maven Releases](https://github.com/eugenemel/maven/releases) 11 | 12 | [Maven Core](https://github.com/eugenemel/maven_core) 13 | 14 | ## Materials 15 | 16 | [Manuscript](https://www.mdpi.com/2218-1989/12/8/684/htm) 17 | 18 | [Tutorial Video](https://www.youtube.com/watch?v=QUSX0GJ6Gsk) 19 | -------------------------------------------------------------------------------- /src/maven/msmsscoringsettings.cpp: -------------------------------------------------------------------------------- 1 | #include "msmsscoringsettings.h" 2 | 3 | MSMSScoringSettingsDialog::MSMSScoringSettingsDialog(QWidget *parent) : 4 | QDialog(parent) { 5 | setupUi(this); 6 | setModal(false); 7 | } 8 | 9 | void MSMSScoringSettingsDialog::setLipidClassAdductFile(){ 10 | 11 | const QString name = QFileDialog::getOpenFileName(this, 12 | "Select Lipid Class/Adduct Parameters ", ".",tr("Comma-Separated Values (*.csv)")); 13 | 14 | this->classAdductFileName->setText(name); 15 | } 16 | 17 | void MSMSScoringSettingsDialog::bringIntoView(){ 18 | if (isVisible()){ 19 | show(); 20 | raise(); 21 | activateWindow(); 22 | } else { 23 | show(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/maven_tests/testsimpleparsimony/testsimpleparsimony.pro: -------------------------------------------------------------------------------- 1 | # Generated by following instructions here 2 | # See https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html 3 | 4 | # codebase paths 5 | CORE = ../../../../maven_core 6 | NATSORT = ../../peakdetector/ 7 | MAVEN = ../../maven 8 | 9 | include($$CORE/libmaven.pri) 10 | 11 | QT += testlib 12 | TEMPLATE = app 13 | TARGET = testsimpleparsimony 14 | INCLUDEPATH += . $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src $$CORE/libneural $$CORE/MSToolkit/include $$CORE $$NATSORT 15 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 16 | 17 | DEFINES += QT_DEPRECATED_WARNINGS 18 | 19 | HEADERS += testsimpleparsimony.h 20 | SOURCES += testsimpleparsimony.cpp 21 | -------------------------------------------------------------------------------- /src/maven/isotopelegendwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef ISOTOPELEGENDWIDGET_H 2 | #define ISOTOPELEGENDWIDGET_H 3 | 4 | #include "stable.h" 5 | #include "mainwindow.h" 6 | #include "isotopeplot.h" 7 | 8 | class IsotopeLegendWidget : public QGraphicsView { 9 | 10 | Q_OBJECT 11 | 12 | public: 13 | IsotopeLegendWidget(MainWindow *mw); 14 | ~IsotopeLegendWidget(); 15 | inline IsotopePlot* getIsotopePlot(){return _isotopePlot;} 16 | 17 | public slots: 18 | void setPeakGroup(PeakGroup *peakGroup); 19 | void refresh(); 20 | 21 | private: 22 | QGraphicsScene *_scene; 23 | MainWindow *_mw; 24 | IsotopePlot *_isotopePlot; 25 | 26 | 27 | 28 | }; 29 | 30 | #endif // ISOTOPELEGENDWIDGET_H 31 | -------------------------------------------------------------------------------- /src/maven_tests/testqstring/testqstring.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class TestQString: public QObject 4 | { 5 | Q_OBJECT 6 | private slots: 7 | void toUpper(); 8 | void toUpper_data(); 9 | }; 10 | 11 | 12 | void TestQString::toUpper() 13 | { 14 | QFETCH(QString, string); 15 | QFETCH(QString, result); 16 | 17 | QCOMPARE(string.toUpper(), result); 18 | } 19 | 20 | void TestQString::toUpper_data() 21 | { 22 | QTest::addColumn("string"); 23 | QTest::addColumn("result"); 24 | 25 | QTest::newRow("all lower") << "hello" << "HELLO"; 26 | QTest::newRow("mixed") << "Hello" << "HELLO"; 27 | QTest::newRow("all upper") << "HELLO" << "HELLO"; 28 | } 29 | 30 | QTEST_MAIN(TestQString) 31 | #include "testqstring.moc" 32 | -------------------------------------------------------------------------------- /src/maven_tests/testqstring2/testqstring2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class TestQString2: public QObject 4 | { 5 | Q_OBJECT 6 | private slots: 7 | void toUpper(); 8 | void toUpper_data(); 9 | }; 10 | 11 | 12 | void TestQString2::toUpper() 13 | { 14 | QFETCH(QString, string); 15 | QFETCH(QString, result); 16 | 17 | QCOMPARE(string.toUpper(), result); 18 | } 19 | 20 | void TestQString2::toUpper_data() 21 | { 22 | QTest::addColumn("string"); 23 | QTest::addColumn("result"); 24 | 25 | QTest::newRow("all lower") << "hello" << "HELLO"; 26 | QTest::newRow("mixed") << "Hello" << "HELLO"; 27 | QTest::newRow("all upper") << "HELLO" << "HELLO"; 28 | } 29 | 30 | QTEST_MAIN(TestQString2) 31 | #include "testqstring2.moc" 32 | -------------------------------------------------------------------------------- /src/maven/editpeakgroupingdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef EDITPEAKGROUPINGDIALOG_H 2 | #define EDITPEAKGROUPINGDIALOG_H 3 | 4 | #include "ui_editpeakgroupdialog.h" 5 | #include "stable.h" 6 | #include "mainwindow.h" 7 | 8 | extern Database DB; 9 | 10 | class EditPeakGroupDialog : public QDialog, public Ui_editPeakGroupDialog { 11 | 12 | Q_OBJECT 13 | 14 | MainWindow *_mainwindow = nullptr; 15 | 16 | public: 17 | EditPeakGroupDialog(QWidget *parent, MainWindow *mainwindow); 18 | ~EditPeakGroupDialog(); 19 | 20 | public slots: 21 | void show(); 22 | void onAnchorClicked(const QUrl &link); 23 | void setPeakGroup(PeakGroup *peakGroup); 24 | void updateAdductComboBox(); 25 | void updateAdductText(); 26 | }; 27 | 28 | #endif // EDITPEAKGROUPINGDIALOG_H 29 | -------------------------------------------------------------------------------- /src/maven/alignmentdialog2.cpp: -------------------------------------------------------------------------------- 1 | #include "alignmentdialog2.h" 2 | 3 | AlignmentDialog2::AlignmentDialog2(QWidget *parent) : QDialog(parent) { 4 | setupUi(this); 5 | setModal(false); 6 | 7 | connect(this->btnSelectFile, SIGNAL(clicked(bool)), SLOT(loadRtFile())); 8 | } 9 | 10 | void AlignmentDialog2::loadRtFile() { 11 | 12 | const QString name = QFileDialog::getOpenFileName( 13 | this, "Select .rt File", ".",tr("Model File (*.rt)")); 14 | 15 | if (QFile::exists(name)) { 16 | this->txtSelectFile->setText(name); 17 | } 18 | } 19 | 20 | void AlignmentDialog2::bringIntoView(){ 21 | if (isVisible()){ 22 | show(); 23 | raise(); 24 | activateWindow(); 25 | } else { 26 | show(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | MAVEN - Metabolomic Analysis and Visualization Engine 2 | 3 | Authors: Eugene Melamud 4 | Copyright 2010 Eugene Melamud / Princeton University 5 | Copyright 2016 Eugene Melamud / Calico Labs LLC. 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | -------------------------------------------------------------------------------- /src/maven/setrumsdbdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SETRUMSDBDIALOG_H 2 | #define SETRUMSDBDIALOG_H 3 | 4 | #include "stable.h" 5 | #include "database.h" 6 | #include "ui_setrumsDBdialog.h" 7 | #include "mainwindow.h" 8 | 9 | class MainWindow; 10 | extern Database DB; 11 | 12 | class SetRumsDBDialog : public QDialog, public Ui_setrumsDBDialog { 13 | 14 | Q_OBJECT 15 | 16 | public: 17 | SetRumsDBDialog(QWidget *parent); 18 | bool isCancelled(); 19 | 20 | public slots: 21 | void setRumsDBDatabaseName(); 22 | void useNoRumsDBDatabaseName(); 23 | void cancelLoading(); 24 | void updateComboBox(); 25 | void setAttemptToLoadDBFlag(); 26 | void setLoadPGCompoundMatchesFlag(); 27 | 28 | private: 29 | MainWindow* mainWindow; 30 | bool _isCancelled = true; 31 | }; 32 | 33 | #endif // SETRUMSDBDIALOG_H 34 | -------------------------------------------------------------------------------- /ci/travis/before_install_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Issue 723: Do nothing" 4 | 5 | # brew update 6 | # brew install qt5 7 | # brew link qt5 --force 8 | # 9 | # ENVFILE=qt-5.env 10 | # echo Create $ENVFILE 11 | # cat << EOF > $ENVFILE 12 | 13 | # Clone QTCI to assist with scripted install of QT 14 | # echo Cloning qtci repository 15 | # git clone https://github.com/benlau/qtci.git 16 | # export PATH="$PATH:$PWD/qtci/bin:$PWD/qtci/recipes" 17 | # 18 | # echo Downloading Qt 19 | # INSTALLER=qt-opensource-linux-x64-5.8.0.run 20 | # ENVFILE=qt-5.8.0.env 21 | # wget -c https://download.qt.io/archive/qt/5.8/5.8.0/qt-opensource-linux-x64-5.8.0.run 22 | # echo Installing Qt 23 | # QT_CI_PACKAGES="qt.58.gcc_64" extract-qt-installer $PWD/$INSTALLER $PWD/Qt 24 | # 25 | # echo Create $ENVFILE 26 | # cat << EOF > $ENVFILE 27 | # export PATH=$PWD/Qt/5.8/gcc_64/bin:$PATH 28 | # EOF 29 | 30 | -------------------------------------------------------------------------------- /src/maven/configurediffisotopesearch.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIGUREDIFFISOTOPESEARCH_H 2 | #define CONFIGUREDIFFISOTOPESEARCH_H 3 | 4 | #include "stable.h" 5 | #include "ui_configurediffisotopesearch.h" 6 | 7 | class ConfigureDiffIsotopeSearch : public QDialog, public Ui_ConfigureDiffIsotopeSearch 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | ConfigureDiffIsotopeSearch(QWidget *parent); 13 | vector getUnlabeledSamples(vector loadedSamples); 14 | vector getLabeledSamples(vector loadedSamples); 15 | 16 | public slots: 17 | void populateSamples(vector loadedSamples); 18 | void resetSamples(vector loadedSamples); 19 | void bringIntoView(); 20 | 21 | private: 22 | bool isSampleInListWidget(mzSample* sample, QListWidget *widget); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/isotopeprocessor/isotopeprocessor.pro: -------------------------------------------------------------------------------- 1 | # codebase paths 2 | CORE = ../maven_core 3 | NATSORT = . 4 | MAVEN = ../maven/ 5 | 6 | include($$CORE/libmaven.pri) 7 | 8 | TEMPLATE = app 9 | TARGET = isotopeprocessor 10 | DESTDIR = $$MAVEN/bin/ 11 | CONFIG -= network gui opengl 12 | CONFIG += sql qt std++14 13 | 14 | QT += sql gui 15 | QT -= network opengl std++14 16 | 17 | INCLUDEPATH += $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src $$CORE/libneural $$CORE/MSToolkit/include $$CORE $$NATSORT 18 | 19 | LDFLAGS += $$OUTPUT_DIR/lib 20 | 21 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 22 | 23 | contains (DEFINES,CDFPARSER) { 24 | LIBS += -lcdfread -lnetcdf 25 | } 26 | 27 | SOURCES= isotopeprocessor.cpp $$MAVEN/projectDB.cpp $$MAVEN/database.cpp $$MAVEN/classifier.cpp $$MAVEN/classifierNeuralNet.cpp 28 | HEADERS= $$MAVEN/projectDB.h $$MAVEN/database.h $$MAVEN/classifierNeuralNet.h 29 | -------------------------------------------------------------------------------- /src/maven/classifierNeuralNet.h: -------------------------------------------------------------------------------- 1 | #ifndef CLASSIFER_NEURALNET 2 | #define CLASSIFER_NEURALNET 3 | 4 | #include "mzSample.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | using namespace std; 14 | 15 | class ClassifierNeuralNet: public Classifier 16 | { 17 | public: 18 | ClassifierNeuralNet(); 19 | ~ClassifierNeuralNet(); 20 | void classify(PeakGroup* grp); 21 | void train(vector& groups); 22 | void refineModel(PeakGroup* grp); 23 | void saveModel(string filename); 24 | void loadModel(string filename); 25 | void loadDefaultModel(); 26 | bool hasModel(); 27 | 28 | vector getFeatures(Peak& p); 29 | 30 | //neural net specific features 31 | nnwork* brain; 32 | int hidden_layer; 33 | int num_outputs; 34 | float trainingSize; 35 | string defaultModel; 36 | 37 | }; 38 | #endif 39 | -------------------------------------------------------------------------------- /src/maven/forms/covariantswidget.ui: -------------------------------------------------------------------------------- 1 | 2 | CovariantsWidget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 562 9 | 490 10 | 11 | 12 | 13 | 14 | 524287 15 | 524287 16 | 17 | 18 | 19 | QDockWidget::AllDockWidgetFeatures 20 | 21 | 22 | Covariants 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/maven_tests/testsecprocessor/testsecprocessor.pro: -------------------------------------------------------------------------------- 1 | # Generated by following instructions here 2 | # See https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html 3 | 4 | # codebase paths 5 | CORE = ../../../../maven_core 6 | NATSORT = ../../peakdetector/ 7 | MAVEN = ../../maven 8 | 9 | include($$CORE/libmaven.pri) 10 | 11 | QT += core 12 | QT += sql gui 13 | QT -= network opengl std++14 14 | 15 | TEMPLATE = app 16 | TARGET = testsecprocessor 17 | 18 | INCLUDEPATH += \ 19 | . $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src \ 20 | $$CORE/libneural\ 21 | $$CORE/MSToolkit/include\ 22 | $$CORE \ 23 | $$NATSORT \ 24 | /usr/local/opt/llvm/lib/clang/13.0.1/include/ 25 | 26 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 27 | 28 | CONFIG += sdk_no_version_check 29 | CONFIG -= network gui opengl 30 | CONFIG += sql qt std++14 31 | 32 | DEFINES += QT_DEPRECATED_WARNINGS 33 | 34 | SOURCES += testsecprocessor.cpp 35 | -------------------------------------------------------------------------------- /peakdetector_pipeline/README.md: -------------------------------------------------------------------------------- 1 | # How to use peakdetector in a custom pipeline 2 | 3 | `peakdetector` is a command line program based on the `maven_core` library for performing peak picking, grouping, and spectral library searches. The program is published in the [releases](https://github.com/eugenemel/maven/releases) section of this repository alongside the MAVEN GUI. 4 | 5 | It is designed to be incorporated into data science pipelines written in `R` or `Python`. 6 | 7 | The examples below are designed to work in `R`, but something similar could be developed for `Python` as well. The key step is the command line that is generated, which should be executed via a system call. 8 | 9 | # Windows 10 | 11 | [peakdetector-in-pipeline-example-windows.Rmd](https://github.com/eugenemel/maven/blob/master/peakdetector_pipeline/peakdetector-in-pipeline-example-windows.Rmd) 12 | 13 | # Mac OS 14 | [peakdetector-in-pipeline-example-mac-osx.Rmd](https://github.com/eugenemel/maven/blob/master/peakdetector_pipeline/peakdetector-in-pipeline-example-mac-osx.Rmd) -------------------------------------------------------------------------------- /src/maven/selectadductsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SELECTADDUCTSDIALOG_H 2 | #define SELECTADDUCTSDIALOG_H 3 | 4 | #include "ui_selectadductsdialog.h" 5 | #include "stable.h" 6 | #include "mainwindow.h" 7 | 8 | class MainWindow; 9 | 10 | class SelectAdductsDialog : public QDialog, public Ui_selectAdductsDialog { 11 | 12 | Q_OBJECT 13 | 14 | public: 15 | SelectAdductsDialog(QWidget* parent, MainWindow* w, QSettings *settings); 16 | ~SelectAdductsDialog(); 17 | 18 | public slots: 19 | void show(); 20 | void selectAll(); 21 | void deselectAll(); 22 | void updateSelectedAdducts(); 23 | void updateGUI(); 24 | 25 | private: 26 | QSettings *settings; 27 | MainWindow *mainwindow; 28 | map checkBoxAdduct = {}; 29 | 30 | }; 31 | 32 | class AdductsCheckBoxWidgetItem : public QTableWidgetItem { 33 | public: 34 | bool operator < (const QTableWidgetItem &other) const { 35 | return (other.checkState() < checkState()); 36 | } 37 | }; 38 | #endif // SELECTADDUCTSDIALOG_H 39 | -------------------------------------------------------------------------------- /src/maven/mzfileio.h: -------------------------------------------------------------------------------- 1 | #ifndef MZFILEIO_H 2 | #define MZFILEIO_H 3 | #include "globals.h" 4 | #include "mainwindow.h" 5 | 6 | class mzFileIO : public QThread 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | mzFileIO(QWidget*); 12 | void setFileList(QStringList& flist) { filelist = flist; } 13 | void loadSamples(QStringList& flist); 14 | mzSample* loadSample(QString filename); 15 | mzSample* parseMzData(QString fileName); 16 | void setMainWindow(MainWindow*); 17 | int loadPepXML(QString filename); 18 | static QString shortSampleName(QString filename); 19 | bool checkSampleAlreadyLoaded(QString filename); 20 | QStringList getEmptyFiles(); 21 | signals: 22 | void updateProgressBar(QString,int,int); 23 | 24 | protected: 25 | void run(void); 26 | void fileImport(void); 27 | 28 | private: 29 | QStringList filelist; 30 | QStringList emptyFiles; 31 | MainWindow* _mainwindow; 32 | bool _stopped; 33 | 34 | 35 | }; 36 | 37 | #endif // MZFILEIO_H 38 | -------------------------------------------------------------------------------- /src/maven/numeric_treewidgetitem.h: -------------------------------------------------------------------------------- 1 | #ifndef NUMERIC_ITEM_H 2 | #define NUMERIC_ITEM_H 3 | 4 | #include "stable.h" 5 | #include 6 | #include 7 | #include 8 | 9 | class NumericTreeWidgetItem : public QTreeWidgetItem 10 | { 11 | 12 | public: 13 | NumericTreeWidgetItem(QTreeWidgetItem *parent) : QTreeWidgetItem(parent){} 14 | NumericTreeWidgetItem(QTreeWidgetItem *parent, int type = Type):QTreeWidgetItem(parent,type){} 15 | 16 | NumericTreeWidgetItem(QTreeWidget *tree, int type = Type):QTreeWidgetItem(tree,type){} 17 | NumericTreeWidgetItem(QTreeWidget *tree): QTreeWidgetItem(tree){} 18 | NumericTreeWidgetItem(QTreeWidget *tree, const QStringList & strings) : QTreeWidgetItem (tree,strings){} 19 | 20 | 21 | bool operator< ( const QTreeWidgetItem & other ) const 22 | { 23 | int sortCol = treeWidget()->sortColumn(); 24 | bool isFloat; 25 | float a = text(sortCol).toFloat(&isFloat); 26 | 27 | if (isFloat) { 28 | return a < other.text(sortCol).toFloat(); 29 | } else { 30 | return text(sortCol) < other.text(sortCol); 31 | } 32 | } 33 | 34 | 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/maven/heatmap.h: -------------------------------------------------------------------------------- 1 | #ifndef HEATMAPWIDGET_H 2 | #define HEATMAPWIDGET_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | #include "tabledockwidget.h" 8 | #include "statistics.h" 9 | 10 | 11 | 12 | class HeatMap : public QGraphicsView 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | HeatMap(MainWindow* mw); 18 | ~HeatMap(); 19 | 20 | public slots: 21 | void setTable(TableDockWidget* t); 22 | void replot(); 23 | void updateColors(); 24 | 25 | private: 26 | QColor getColor(float cellValue, float minValue, float maxValue); 27 | MainWindow* mainwindow; 28 | TableDockWidget* _table; 29 | 30 | MatrixXf heatmap; 31 | float _heatMax; 32 | float _heatMin; 33 | float _colorramp; 34 | int _sampleSpacer; 35 | int _rowSpacer; 36 | float _boxW; 37 | float _boxH; 38 | 39 | 40 | protected: 41 | void drawMap(); 42 | void resizeEvent ( QResizeEvent *event ); 43 | void wheelEvent(QWheelEvent *event); 44 | void mousePressEvent(QMouseEvent *event); 45 | void keyPressEvent(QKeyEvent *event); 46 | 47 | }; 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /src/maven/history.cpp: -------------------------------------------------------------------------------- 1 | #include "history.h" 2 | using namespace std; 3 | 4 | 5 | History::History() { 6 | _pos = 0; 7 | } 8 | 9 | void History::addToHistory(const mzSlice slice) { 10 | 11 | if ( size() == 0 ) { 12 | history.push_back(slice); 13 | return; 14 | } 15 | 16 | if (_pos < history.size() && _pos >= 0 ) { 17 | if ( history[_pos].mzmin == slice.mzmin && history[_pos].mzmax == slice.mzmax && 18 | history[_pos].rtmin == slice.rtmin && history[_pos].rtmax == slice.rtmax ) { 19 | return; 20 | } 21 | } 22 | 23 | //cerr << "addToHistory() " << slice.mzmin << " " << slice.mzmax << endl; 24 | history.push_back(slice); 25 | if (history.size() > 10 ) history.pop_front(); //keep history to some reasonable number 26 | _pos = history.size()-1; 27 | 28 | } 29 | 30 | mzSlice History::next() { 31 | if (size() == 0) return mzSlice(0,0,0,0); 32 | if (_pos + 1 < history.size() ) _pos++; 33 | return history[_pos]; 34 | } 35 | 36 | mzSlice History::last() { 37 | if (size() == 0) return mzSlice(0,0,0,0); 38 | if (_pos-1 > 0 ) _pos--; 39 | return history[_pos]; 40 | } 41 | -------------------------------------------------------------------------------- /src/maven/forms/adductwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | AdductWidget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 562 9 | 490 10 | 11 | 12 | 13 | 14 | 16777215 15 | 16777215 16 | 17 | 18 | 19 | QDockWidget::AllDockWidgetFeatures 20 | 21 | 22 | Adducts 23 | 24 | 25 | 26 | 27 | 0 28 | 22 29 | 562 30 | 468 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/maven/directinfusiondialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DIRECTINFUSIONDIALOG_H 2 | #define DIRECTINFUSIONDIALOG_H 3 | 4 | #include "ui_directinfusiondialog.h" 5 | #include "stable.h" 6 | #include "mainwindow.h" 7 | #include "background_directinfusion_update.h" 8 | 9 | class MainWindow; 10 | class BackgroundDirectInfusionUpdate; 11 | extern Database DB; 12 | 13 | class DirectInfusionDialog : public QDialog, public Ui_directInfusionDialog { 14 | 15 | Q_OBJECT 16 | 17 | public: 18 | DirectInfusionDialog(QWidget* parent); 19 | ~DirectInfusionDialog(); 20 | void setSettings(QSettings* settings) { this->settings = settings;} 21 | void setMainWindow(MainWindow* w) { this->mainwindow = w;} 22 | 23 | public slots: 24 | void analyze(); 25 | void setProgressBar(QString text, int progress, int totalSteps); 26 | void show(); 27 | void updateSpectralCompositionDescription(); 28 | 29 | private: 30 | QSettings *settings = nullptr; 31 | MainWindow *mainwindow = nullptr; 32 | BackgroundDirectInfusionUpdate *directInfusionUpdate = nullptr; 33 | }; 34 | 35 | #endif //DIRECTINFUSIONDIALOG_H 36 | -------------------------------------------------------------------------------- /src/maven_tests/testrtalignment/testrtalignment.pro: -------------------------------------------------------------------------------- 1 | # Generated by following instructions here 2 | # See https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html 3 | 4 | # codebase paths 5 | CORE = ../../../../maven_core 6 | NATSORT = ../../peakdetector/ 7 | MAVEN = ../../maven 8 | 9 | include($$CORE/libmaven.pri) 10 | 11 | QT += core 12 | QT += sql gui 13 | QT -= network opengl std++14 14 | 15 | TEMPLATE = app 16 | TARGET = testrtalignment 17 | 18 | INCLUDEPATH += \ 19 | . $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src \ 20 | $$CORE/libneural\ 21 | $$CORE/MSToolkit/include\ 22 | $$CORE \ 23 | $$NATSORT \ 24 | /usr/local/opt/llvm/lib/clang/13.0.1/include/ 25 | 26 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 27 | 28 | CONFIG += sdk_no_version_check 29 | CONFIG -= network gui opengl 30 | CONFIG += sql qt std++14 31 | 32 | DEFINES += QT_DEPRECATED_WARNINGS 33 | 34 | HEADERS += $$MAVEN/database.h \ 35 | $$MAVEN/projectDB.h 36 | 37 | SOURCES += testrtalignment.cpp \ 38 | $$MAVEN/database.cpp \ 39 | $$MAVEN/projectDB.cpp 40 | -------------------------------------------------------------------------------- /src/maven/boxplot.h: -------------------------------------------------------------------------------- 1 | #ifndef BOXPLOT_H 2 | #define BOXPLOT_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | 8 | 9 | class MainWindow; 10 | class PeakGroup; 11 | class QGraphicsItem; 12 | class QGraphicsScene; 13 | 14 | class BoxPlot : public QObject, public QGraphicsItem 15 | { 16 | Q_OBJECT 17 | 18 | #if QT_VERSION >= 0x040600 19 | Q_INTERFACES( QGraphicsItem ) 20 | #endif 21 | 22 | static PeakGroup::QType qtype; 23 | 24 | public: 25 | BoxPlot(QGraphicsItem *parent, QGraphicsScene *scene); 26 | ~BoxPlot(); 27 | void setPeakGroup(PeakGroup *group); 28 | QRectF boundingRect() const; 29 | void setMainWindow(MainWindow* mw) { _mw = mw; } 30 | void switchQValue(); 31 | void clear(); 32 | 33 | protected: 34 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 35 | void mousePressEvent (QGraphicsSceneMouseEvent*) { switchQValue(); update(); } 36 | 37 | private: 38 | QVector _labels; 39 | QVector _colors; 40 | QVector _yvalues; 41 | int _width; 42 | int _height; 43 | float _barwidth; 44 | 45 | MainWindow* _mw; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/maven/librarydialog.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBRARYDIALOG_H 2 | #define LIBRARYDIALOG_H 3 | 4 | #include 5 | #include "database.h" 6 | #include "mainwindow.h" 7 | #include "ui_librarydialog.h" 8 | 9 | class MainWindow; 10 | extern Database DB; 11 | 12 | class LibraryMangerDialog : public QDialog , public Ui_librarydialog { 13 | Q_OBJECT 14 | 15 | public: 16 | LibraryMangerDialog(QWidget *parent); 17 | void setMainWindow(MainWindow* w) { this->mainwindow = w; } 18 | 19 | protected: 20 | void closeEvent(QCloseEvent *event); 21 | 22 | signals: 23 | void loadLibrarySignal(QString); 24 | void unloadLibrarySignal(QString); 25 | void afterUnloadedLibrarySignal(QString); 26 | 27 | public slots: 28 | void show(); 29 | void loadCompoundsFile(); 30 | void loadCompoundsFile(QString filename); 31 | void reloadMethodsFolder(); 32 | 33 | private slots: 34 | void deleteLibrary(); 35 | void loadLibrary(); 36 | void unloadLibrary(); 37 | void unloadAllLibraries(); 38 | void showPeakDetectionDialog(); 39 | 40 | private: 41 | void updateLibraryStats(); 42 | MainWindow *mainwindow; 43 | 44 | }; 45 | 46 | #endif // LIBRARYDIALOG_H 47 | -------------------------------------------------------------------------------- /src/maven_tests/testmzkitchenprocessor/testmzkitchenprocessor.pro: -------------------------------------------------------------------------------- 1 | # Generated by following instructions here 2 | # See https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html 3 | 4 | # codebase paths 5 | CORE = ../../../../maven_core 6 | NATSORT = ../../peakdetector/ 7 | MAVEN = ../../maven 8 | 9 | include($$CORE/libmaven.pri) 10 | 11 | QT += core 12 | QT += sql gui 13 | QT -= network opengl std++14 14 | 15 | TEMPLATE = app 16 | TARGET = testmzkitchenprocessor 17 | 18 | INCLUDEPATH += \ 19 | . $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src \ 20 | $$CORE/libneural\ 21 | $$CORE/MSToolkit/include\ 22 | $$CORE \ 23 | $$NATSORT \ 24 | /usr/local/opt/llvm/lib/clang/13.0.1/include/ 25 | 26 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 27 | 28 | CONFIG += sdk_no_version_check 29 | CONFIG -= network gui opengl 30 | CONFIG += sql qt std++14 31 | 32 | DEFINES += QT_DEPRECATED_WARNINGS 33 | 34 | HEADERS += $$MAVEN/database.h \ 35 | $$MAVEN/projectDB.h 36 | 37 | SOURCES += testmzkitchenprocessor.cpp \ 38 | $$MAVEN/database.cpp \ 39 | $$MAVEN/projectDB.cpp 40 | -------------------------------------------------------------------------------- /src/peakdetector/peakdetector_resource.rc: -------------------------------------------------------------------------------- 1 | // Minimal valid Windows resource file for peakdetector.exe 2 | // It provides version information to satisfy windres.exe 3 | 4 | #include 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,0,0,0 8 | PRODUCTVERSION 1,0,0,0 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS 0x1L 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "040904b0" // Language (US English), Charset (Unicode) 22 | BEGIN 23 | VALUE "CompanyName", "No Company" 24 | VALUE "FileDescription", "Peak Detector Command-Line Tool" 25 | VALUE "FileVersion", "1.0.0.0" 26 | VALUE "InternalName", "peakdetector.exe" 27 | VALUE "LegalCopyright", "Copyright (C) No Company 2024" 28 | VALUE "OriginalFilename", "peakdetector.exe" 29 | VALUE "ProductName", "peakdetector" 30 | VALUE "ProductVersion", "1.0.0" 31 | END 32 | END 33 | BLOCK "VarFileInfo" 34 | BEGIN 35 | VALUE "Translation", 0x409, 1200 // US English, Unicode 36 | END 37 | END -------------------------------------------------------------------------------- /src/maven/filtertagsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERTAGSDIALOG_H 2 | #define FILTERTAGSDIALOG_H 3 | 4 | #include "ui_filtertagsdialog.h" 5 | #include "stable.h" 6 | #include "database.h" 7 | #include "mzSample.h" 8 | 9 | extern Database DB; 10 | 11 | struct TagFilterState; 12 | 13 | class FilterTagsDialog : public QDialog, public Ui_filterTagsDialog { 14 | 15 | Q_OBJECT 16 | 17 | public: 18 | FilterTagsDialog(QWidget *parent); 19 | TagFilterState getFilterState(); 20 | 21 | signals: 22 | void updateFilter(); 23 | 24 | public slots: 25 | void selectAll(); 26 | void deselectAll(); 27 | void processNewFilter(); 28 | void clearFilter(); 29 | 30 | private: 31 | map checkBoxTag = {}; 32 | 33 | QTableWidgetItem *noTags = nullptr; 34 | QTableWidgetItem *goodTag = nullptr; 35 | QTableWidgetItem *badTag = nullptr; 36 | QTableWidgetItem *reAssignedCompoundTag = nullptr; 37 | }; 38 | 39 | struct TagFilterState { 40 | bool isAllPass = true; 41 | bool isNoTagsPass = true; 42 | vector passingLabels; 43 | 44 | bool isPeakGroupPasses(PeakGroup *g); 45 | }; 46 | 47 | #endif // FILTERTAGSDIALOG_H 48 | -------------------------------------------------------------------------------- /src/maven/calibratedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef CALIBRATEDIALOG_H 2 | #define CALIBRATEDIALOG_H 3 | 4 | #include "stable.h" 5 | #include "ui_calibrateform.h" 6 | #include "database.h" 7 | #include "mainwindow.h" 8 | 9 | class MainWindow; 10 | class BackgroundPeakUpdate; 11 | extern Database DB; 12 | 13 | 14 | class CalibrateDialog : public QDialog, public Ui_CalibrateDialog { 15 | Q_OBJECT 16 | 17 | public: 18 | CalibrateDialog(QWidget *parent); 19 | 20 | public slots: 21 | void show(); 22 | void runCalibration(); 23 | void undoCalibration(); 24 | void doCorrection(); 25 | void addPeakGroup(PeakGroup* grp,bool); 26 | 27 | private: 28 | MainWindow* mw; 29 | BackgroundPeakUpdate* workerThread; 30 | vectorallgroups; 31 | bool evaluateFit(vectorobs, vectorexp, vector coef); 32 | void applyFit(mzSample* sample, vector coef); 33 | void reverseFit(mzSample* sample); 34 | vector leastSqrFit(vector &x, vector &y); 35 | 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/maven/suggest.h: -------------------------------------------------------------------------------- 1 | #ifndef SUGGEST_H 2 | #define SUGGEST_H 3 | 4 | #include "globals.h" 5 | #include "stable.h" 6 | #include "numeric_treewidgetitem.h" 7 | 8 | class QLineEdit; 9 | class QTimer; 10 | class QTreeWidget; 11 | extern Database DB; 12 | 13 | 14 | class SuggestPopup : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | SuggestPopup(QLineEdit *parent = 0); 20 | ~SuggestPopup(); 21 | bool eventFilter(QObject *obj, QEvent *ev); 22 | 23 | void addToHistory(QString,int); 24 | QMap getHistory(); 25 | 26 | public slots: 27 | void doSearch(QString needle); 28 | void doneCompletion(); 29 | void preventSuggest(); 30 | void addToHistory(); 31 | void addToHistory(QString); 32 | void setDatabase(QString db); 33 | 34 | signals: 35 | void compoundSelected(Compound*); 36 | 37 | private: 38 | QLineEdit *editor; 39 | QTreeWidget *popup; 40 | QTimer *timer; 41 | 42 | QString _currentDatabase; 43 | QMap searchHistory; 44 | 45 | 46 | void doSearchCompounds(QString needle, int maxHitCount, QString dbLimit); 47 | void doSearchHistory(QString needle); 48 | 49 | QHash scores; 50 | QHash compound_matches; 51 | 52 | 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/maven_tests/testsimpleparsimony/testsimpleparsimony.cpp: -------------------------------------------------------------------------------- 1 | #include "testsimpleparsimony.h" 2 | #include "mzUtils.h" 3 | 4 | using namespace std; 5 | 6 | void TestSimpleParsimony::simpleParsimonyReduce() 7 | { 8 | QFETCH(vector>, input); 9 | QFETCH(vector>, output); 10 | 11 | auto x = mzUtils::simpleParsimonyReducer(input); 12 | cout << "mzUtils::simpleParsimonyReducer(): "; 13 | 14 | for (unsigned int i = 0; i < x.size(); i++) { 15 | auto x1 = x[i]; 16 | if (i>0) cout << ", "; 17 | cout << "{"; 18 | for (unsigned int j = 0; j < x1.size(); j++) { 19 | if (j>0) { 20 | cout << ", "; 21 | } 22 | cout << x1[j]; 23 | } 24 | cout << "}"; 25 | } 26 | cout << endl; 27 | 28 | QCOMPARE(input.size()-2, output.size()); 29 | } 30 | 31 | void TestSimpleParsimony::simpleParsimonyReduce_data() 32 | { 33 | 34 | QTest::addColumn>>("input"); 35 | QTest::addColumn>>("output"); 36 | 37 | QTest::newRow("Merge Perfect Overlaps") 38 | << vector>{{1,2}, {1,2,3}, {4, 5}, {4, 5, 6}, {7, 8}, {7, 9}, {7, 10}} 39 | << vector>{{7, 8}, {7, 9}, {7, 10}, {1,2,3}, {4, 5, 6}}; 40 | } 41 | 42 | QTEST_MAIN(TestSimpleParsimony) 43 | #include "testsimpleparsimony.moc" 44 | -------------------------------------------------------------------------------- /src/maven/spectramatching.h: -------------------------------------------------------------------------------- 1 | #ifndef SPECTAMATCHING_FORM_H 2 | #define SPECTAMATCHING_FORM_H 3 | 4 | #include "spectralhit.h" 5 | #include "ui_spectramatching.h" 6 | #include "mainwindow.h" 7 | #include "numeric_treewidgetitem.h" 8 | #include "Fragment.h" 9 | 10 | class MainWindow; 11 | 12 | class SpectraMatching : public QDialog, public Ui_SpectraMatchingForm 13 | { 14 | Q_OBJECT 15 | public: 16 | SpectraMatching(MainWindow *w); 17 | 18 | public slots: 19 | void getFormValues(); 20 | void findMatches(); 21 | void showScan(); 22 | void doSearch(); 23 | void exportMatches(); 24 | double scoreScan(Scan* scan); 25 | double matchPattern(Scan* scan); 26 | 27 | 28 | private: 29 | MainWindow *mainwindow; 30 | int _msScanType; 31 | double _precursorMz; 32 | float _precursorPPM; 33 | float _productPPM; 34 | QVector _mzsList; 35 | QVector _intensityList; 36 | QVector _intensityMinErr; 37 | QVector _intensityMaxErr; 38 | 39 | bool bound_checking_pattern; 40 | StatisticsVectorallscores; 41 | 42 | QList matches; 43 | void addHit(double score, float precursormz, QString samplename, int matchCount, Scan* scan, QVector&mzs, QVector&ints); //add hit to matches 44 | 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/maven/masscalcgui.h: -------------------------------------------------------------------------------- 1 | #ifndef MASSCALCGUI_H 2 | #define MASSCALCGUI_H 3 | 4 | #include "stable.h" 5 | #include "mainwindow.h" 6 | #include "ui_masscalcwidget.h" 7 | #include "mzMassCalculator.h" 8 | 9 | class QAction; 10 | class QTextEdit; 11 | class MainWindow; 12 | class MassCalculator; 13 | class Database; 14 | 15 | extern Database DB; 16 | 17 | class MassCalcWidget: public QDockWidget, public Ui_MassCalcWidget { 18 | Q_OBJECT 19 | 20 | public: 21 | MassCalcWidget(MainWindow* mw); 22 | ~MassCalcWidget(); 23 | 24 | protected: 25 | 26 | 27 | public slots: 28 | void setPeakGroup(PeakGroup* grp); 29 | void setFragmentationScan(Scan* scan); 30 | void setFragment(Fragment *fragment); 31 | void setMass(float mz); 32 | void setCharge(float charge); 33 | void setPPM(float ppm); 34 | void compute(); 35 | void updateDatabaseList(); 36 | 37 | private slots: 38 | void showInfo(); 39 | void getMatches(); 40 | void showTable(); 41 | void showTablerumsDBMatches(PeakGroup* grp); 42 | void showTableCheckRumsDB(); 43 | 44 | private: 45 | MainWindow* _mw; 46 | MassCalculator mcalc; 47 | std::vector matches; 48 | 49 | double _mz; 50 | double _charge; 51 | double _ppm; 52 | 53 | void pubChemLink(QString formula); 54 | void keggLink(QString formula); 55 | 56 | bool isInRumsDBMode = false; 57 | 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/maven/scatterplot.h: -------------------------------------------------------------------------------- 1 | #ifndef SCATTERPLOT_H 2 | #define SCATTERPLOT_H 3 | 4 | #include "plotdock.h" 5 | #include "comparesamplesdialog.h" 6 | 7 | class CompareSamplesDialog; 8 | class MainWindow; 9 | 10 | class ScatterPlot: public PlotDockWidget { 11 | Q_OBJECT 12 | 13 | enum plotTypeEnum { scatter=0, flower=1, mzrt=2 }; 14 | 15 | public: 16 | ScatterPlot(QWidget* w); 17 | ~ScatterPlot(); 18 | void showSimilar(PeakGroup* g); 19 | void setTable(TableDockWidget* t); 20 | 21 | public slots: 22 | void contrastGroups(); 23 | void showSelectedGroups(QPointF a, QPointF b); 24 | void setPlotTypeScatter() { plotType=scatter; draw(); } 25 | void setPlotTypeFlower() { plotType=flower; draw(); } 26 | void setPlotTypeMzRt() { plotType=mzrt; draw(); } 27 | void showSimilarOnClick(bool t) { showSimilarFlag=t; } 28 | 29 | 30 | 31 | protected: 32 | void draw(); 33 | void drawScatter(StatisticsVectorvecB,StatisticsVectorvecY, vectorgroups); 34 | void drawFlower(vectorgroups); 35 | void drawMzRt(QListgroups); 36 | void setupToolBar(); 37 | 38 | private: 39 | QAction* showSimilarOptions; 40 | bool showSimilarFlag; 41 | TableDockWidget* _table; 42 | CompareSamplesDialog* compareSamplesDialog; 43 | 44 | plotTypeEnum plotType; 45 | 46 | }; 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /src/maven/comparesamplesdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPARESAMPLESDIALOG_H 2 | #define COMPARESAMPLESDIALOG_H 3 | #include "ui_comparesamplesdialog.h" 4 | #include "mainwindow.h" 5 | 6 | 7 | class MainWindow; 8 | class TableDockWidget; 9 | 10 | 11 | class CompareSamplesDialog : public QDialog, public Ui_CompareSamplesDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | CompareSamplesDialog(QWidget *parent); 17 | ~CompareSamplesDialog(); 18 | void setTableWidget(TableDockWidget* w); 19 | 20 | public slots: 21 | void compareSamples(); 22 | void resetSamples(); 23 | void compareSets(); 24 | void cancel(); 25 | void updateSampleList(); 26 | void setQuantitationType(PeakGroup::QType x) { _qtype=x; } 27 | vector getSampleSet1() { return getSampleSet(filelist1); } 28 | vector getSampleSet2() { return getSampleSet(filelist2); } 29 | 30 | protected slots: 31 | void showEvent(QShowEvent*); 32 | 33 | signals: 34 | void setProgressBar(QString,int,int); 35 | 36 | private: 37 | PeakGroup::QType _qtype; 38 | TableDockWidget* table; 39 | QSet samples; 40 | vector getSampleSet(QListWidget* set); 41 | void shuffle(StatisticsVector& groupA, StatisticsVector& groupB ); 42 | StatisticsVector rand_scores; 43 | StatisticsVector real_scores; 44 | }; 45 | ; 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/maven/csvreports.h: -------------------------------------------------------------------------------- 1 | #ifndef CSVREPORT_H 2 | #define CSVREPORT_H 3 | 4 | #include "stable.h" 5 | #include "mzUtils.h" 6 | #include "mzSample.h" 7 | #include "tabledockwidget.h" 8 | 9 | using namespace std; 10 | using namespace mzUtils; 11 | 12 | class mzSample; 13 | class EIC; 14 | class PeakGroup; 15 | class mzLink; 16 | 17 | class CSVReports { 18 | 19 | public: 20 | CSVReports(){}; 21 | CSVReports(vector& insamples); 22 | ~CSVReports(); 23 | 24 | void openGroupReport(string filename); 25 | void openPeakReport(string filename); 26 | void openMzLinkReport(string filename); 27 | 28 | void addGroup(PeakGroup* group, bool isAddChildren=true); 29 | void writeIsotopeTableMzLink(mzLink* link); 30 | 31 | void closeFiles(); 32 | void setSamples(vector& insamples) { samples = insamples; } 33 | void setUserQuantType(PeakGroup::QType t) { qtype=t; } 34 | void setTabDelimited() { SEP="\t"; } 35 | void setCommaDelimited() { SEP=","; } 36 | 37 | 38 | private: 39 | void writeGroupInfo(PeakGroup* group, bool isAddChildren=true); 40 | void writePeakInfo(PeakGroup* group, bool isAddChildren=true); 41 | string doubleQuoteString(std::string& in); 42 | 43 | int groupId; //sequential group numbering 44 | string SEP; 45 | 46 | vectorsamples; 47 | ofstream groupReport; 48 | ofstream peakReport; 49 | ofstream mzLinkReport; 50 | PeakGroup::QType qtype; 51 | 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/maven/globals.h: -------------------------------------------------------------------------------- 1 | #ifndef GLOBAL_H 2 | #define GLOBAL_H 3 | 4 | //c++ 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | //local 12 | #include "mzUtils.h" 13 | #include "mzSample.h" 14 | #include "parallelMassSlicer.h" 15 | #include "database.h" 16 | #include "classifierNeuralNet.h" 17 | #include "directinfusionprocessor.h" 18 | 19 | //non gui qt classes 20 | #include 21 | 22 | const QString rsrcPath = ":/images"; 23 | const QString PROGRAMNAME = "MAVEN"; 24 | const int darkModeBackgroundColor = 30; // QColor(ARGB 1, 0.117647, 0.117647, 0.117647) red == blue == green == 30 25 | 26 | static const double Pi = 3.14159265358979323846264338327950288419717; 27 | 28 | Q_DECLARE_METATYPE(mzSample*) 29 | Q_DECLARE_METATYPE(Peak*) 30 | Q_DECLARE_METATYPE(Compound*) 31 | Q_DECLARE_METATYPE(Adduct*) 32 | Q_DECLARE_METATYPE(Scan*) 33 | Q_DECLARE_METATYPE(PeakGroup*) 34 | Q_DECLARE_METATYPE(mzSlice*) 35 | Q_DECLARE_METATYPE(mzSlice) 36 | Q_DECLARE_METATYPE(DirectInfusionGroupAnnotation*) 37 | Q_DECLARE_METATYPE(SRMTransition*) 38 | Q_DECLARE_METATYPE(SRMTransition) 39 | Q_DECLARE_METATYPE(PeakAndGroup) 40 | 41 | enum itemType { 42 | SampleType=4999, 43 | PeakGroupType, 44 | CompoundType, 45 | ScanType, 46 | EICType, 47 | PeakType, 48 | mzSliceType, 49 | mzLinkType, 50 | AdductType, 51 | ScanVectorType, 52 | SRMTransitionType, 53 | PeandAndGroupType 54 | }; 55 | 56 | extern Database DB; 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/maven/rconsolewidget.h: -------------------------------------------------------------------------------- 1 | #ifndef RCONSOLEWIDGET_H 2 | #define RCONSOLEWIDGET_H 3 | 4 | #include "globals.h" 5 | #include "stable.h" 6 | #include "highlighter.h" 7 | #include "ui_rconsolewidget.h" 8 | #include "mainwindow.h" 9 | 10 | 11 | 12 | class RconsoleWidget : public QDockWidget, public Ui_RconsoleWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | RconsoleWidget(QWidget *parent = 0); 18 | ~RconsoleWidget(); 19 | 20 | public slots: 21 | void openFile(); 22 | void saveFile(); 23 | void runAnalysis(); 24 | void newFile(); 25 | void readProcessOutput(int); 26 | void setPeakGroups(QListgrouplist) { groups=grouplist; updateStatus();} 27 | void stopProcess() { if(process->pid()) process->terminate(); } 28 | void linkTable(TableDockWidget* table) { _linkedTable=table; } 29 | void enableScriptSave() { btnSave->setEnabled(true); } 30 | void readStdOut(); 31 | void setStatusLabel(QString l) { statusLabel->setText(l); } 32 | void readStdErr(); 33 | void updateStatus(); 34 | void loadScript(QString filename); 35 | 36 | 37 | private: 38 | void setupEditor(); 39 | void exportGroupsToTable(); 40 | 41 | Highlighter *highlighter; 42 | MainWindow* _mainwindow; 43 | QSettings* _settings; 44 | TableDockWidget* _linkedTable; 45 | QString userScriptFile; 46 | 47 | QProcess *process; 48 | QString processScriptFile; 49 | QString processErrorFile; 50 | QString processOutFile; 51 | QString groupsTableFile; 52 | 53 | QList groups; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/peakdetector/strnatcmp.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-file-style: "k&r" -*- 2 | 3 | strnatcmp.c -- Perform 'natural order' comparisons of strings in C. 4 | Copyright (C) 2000, 2004 by Martin Pool 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | 23 | 24 | /* CUSTOMIZATION SECTION 25 | * 26 | * You can change this typedef, but must then also change the inline 27 | * functions in strnatcmp.c */ 28 | typedef char nat_char; 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | int strnatcmp(nat_char const *a, nat_char const *b); 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | int strnatcasecmp(nat_char const *a, nat_char const *b); 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .qmake.stash 2 | src/maven/.qtc_clangd/ 3 | Makefile 4 | src/maven/tmp 5 | src/maven/appdir 6 | mzWatcher/tmp 7 | bin/ 8 | *.moc 9 | .vim* 10 | *.sw* 11 | moc_* 12 | *.o 13 | *.gch 14 | *.user 15 | qrc_* 16 | dump 17 | *.msp 18 | .DS_Store 19 | maven.pro 20 | maven.pro.user.4.9-pre1 21 | src/build-maven_core-Desktop_Qt_5_12_5_clang_64bit-Debug/ 22 | src/build-maven-Desktop_Qt_5_12_5_clang_64bit-Debug/ 23 | src/build-build-Desktop_Qt_5_15_14_for_macOS_Universal-Debug/ 24 | src/build-maven-Desktop_Qt_5_15_14_for_macOS_Universal-Debug/ 25 | src/build-maven-Qt_6_5_2_for_macOS-Debug/ 26 | src/build-peakdetector-Desktop_Qt_5_15_14_for_macOS_Universal-Debug/ 27 | src/build-isotopeprocessor-Desktop_Qt_5_15_14_for_macOS_Universal-Debug/ 28 | src/build-isotopeprocessor-llvm_Desktop_Qt_5_15_2_for_macOS_Universal-Debug/ 29 | src/build-pulleics-Desktop_Qt_5_15_14_for_macOS_Universal-Debug/ 30 | src/build-maven-Desktop_Qt_5_15_14_clang_64bit-Debug/ 31 | src/build-peakdetector-llvm_Desktop_Qt_5_15_14_for_macOS_Universal-Debug/ 32 | src/maven/build/ 33 | src/peakdetector/peakdetector.pro.user 34 | src/peakdetector/tmp 35 | src/peakdetector/Makefile 36 | src/peakdetector/.DS_Store 37 | src/peakdetector/build/ 38 | src/isotopeprocessor/build/ 39 | src/pulleics/build/ 40 | 41 | # tests 42 | src/maven_tests/testqstring/testqstring.app/ 43 | src/maven_tests/testqstring2/testqstring2.app/ 44 | src/maven_tests/testsimpleparsimony/testsimpleparsimony.app/ 45 | src/maven_tests/testsecprocessor/testsecprocessor.app/ 46 | src/maven_tests/testmzkitchenprocessor/testmzkitchenprocessor.app/ 47 | Src/maven_tests/testrtalignment/testrtalignment.app/ 48 | 49 | peakdetector_pipeline/.DS_Store -------------------------------------------------------------------------------- /src/maven/gallerywidget.h: -------------------------------------------------------------------------------- 1 | #ifndef GALLERYWIDGET_H 2 | #define GALLERYWIDGET_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | #include "tabledockwidget.h" 8 | #include "statistics.h" 9 | #include "tinyplot.h" 10 | 11 | class TinyPlot; 12 | 13 | class GalleryWidget : public QGraphicsView 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | GalleryWidget(MainWindow* mw); 19 | ~GalleryWidget(); 20 | 21 | public slots: 22 | void replot(); 23 | void clear() { scene()->clear(); plotitems.clear(); } 24 | void addEicPlots(std::vector& groups); 25 | void addEicPlots(std::vector&compounds); 26 | void addEicPlots(std::vector&slices); 27 | void addEicPlots(std::vector&links); 28 | void addIdividualEicPlots(std::vector& eics,PeakGroup* grp); 29 | void fileGallery(const QString& dir); 30 | void exportPDF(); 31 | 32 | private: 33 | MainWindow* mainwindow; 34 | QList plotitems; 35 | int _rowSpacer; 36 | int _colSpacer; 37 | int _boxW; 38 | int _boxH; 39 | TinyPlot* addEicPlot(std::vector& eics); 40 | TinyPlot* addEicPlot(mzSlice& slice); 41 | bool recursionCheck; 42 | 43 | 44 | protected: 45 | void drawMap(); 46 | void resizeEvent ( QResizeEvent *event ); 47 | void wheelEvent(QWheelEvent *event); 48 | void mousePressEvent(QMouseEvent *event); 49 | void keyPressEvent(QKeyEvent *event); 50 | void contextMenuEvent(QContextMenuEvent * event); 51 | 52 | }; 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /src/proteinfragmentfinder/proteinfragmentfinder.pro: -------------------------------------------------------------------------------- 1 | # codebase paths 2 | CORE = ../maven_core 3 | NATSORT = . 4 | MAVEN = ../maven/ 5 | 6 | include($$CORE/libmaven.pri) 7 | 8 | TEMPLATE = app 9 | TARGET = proteinfragmentfinder 10 | DESTDIR = $$MAVEN/bin/ 11 | CONFIG -= network gui opengl 12 | CONFIG += sql qt std++14 13 | 14 | QT += sql gui 15 | QT -= network opengl std++14 16 | 17 | INCLUDEPATH += $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src $$CORE/libneural $$CORE/MSToolkit/include $$CORE $$NATSORT 18 | 19 | LDFLAGS += $$OUTPUT_DIR/lib 20 | 21 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 22 | 23 | contains (DEFINES,CDFPARSER) { 24 | LIBS += -lcdfread -lnetcdf 25 | } 26 | 27 | #BUILD OPENMP PARALLEL VERSION 28 | 29 | mac { 30 | exists(/usr/local/opt/llvm) { 31 | message("mac os x: llvm found. Will build parallel.") 32 | 33 | #compiler and linker need to be clang-omp++ 34 | QMAKE_CXX=/usr/local/opt/llvm/bin/clang++ 35 | QMAKE_LINK=/usr/local/opt/llvm/bin/clang++ 36 | 37 | LIBS += -L/usr/local/opt/llvm/lib/ 38 | INCLUDEPATH += /usr/local/opt/llvm/include/ 39 | 40 | CONFIG += parallel 41 | } 42 | } 43 | 44 | unix { 45 | !mac { 46 | CONFIG += parallel 47 | } 48 | } 49 | 50 | win32 { 51 | 52 | } 53 | 54 | parallel { 55 | message("Building OpenMP isotopeprocessor parallel") 56 | 57 | QMAKE_CXXFLAGS += -DOMP_PARALLEL -fopenmp -I/usr/local/opt/libomp/include/ 58 | QMAKE_LFLAGS += -fopenmp 59 | LIBS += -fopenmp 60 | } 61 | 62 | SOURCES=proteinfragmentfinder.cpp 63 | -------------------------------------------------------------------------------- /src/maven/plot_axes.h: -------------------------------------------------------------------------------- 1 | #ifndef PLOT_AXES_H 2 | #define PLOT_AXES_H 3 | 4 | #include "stable.h" 5 | #include "mainwindow.h" 6 | 7 | class Axes : public QGraphicsItem 8 | { 9 | public: 10 | Axes(QGraphicsItem* parent):QGraphicsItem(parent){} 11 | Axes( int type, float min, float max, int nticks, MainWindow *mainwindow); 12 | QRectF boundingRect() const; 13 | void setRange(double a, double b) { min=a; max=b; } 14 | double getMin() {return min;} 15 | double getMax() {return max;} 16 | void setLabel(QString t) { label = t; } 17 | void setTitle(QString t) { title = t; } 18 | void setNumTicks(int x) { nticks = x; } 19 | void preferedNumTicks(int x) {nticksPref = x; } 20 | void forceNumTicks(bool t) { force_nticks = t; } 21 | bool numTicksForced() { return force_nticks; } 22 | void useIntLabels(bool t) {intLabels = t;} 23 | void setMargin(int m) { margin=m; } 24 | void setOffset(int o ) { offset=o; } 25 | void showTicLines(bool f) { tickLinesFlag=f; } 26 | 27 | void setRenderScale(float f){ renderScale = f;} 28 | void setRenderOffset(float f){ renderOffset = f;} 29 | void setVerticalOffset(int i){ verticalOffset = i;} 30 | 31 | protected: 32 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 33 | 34 | private: 35 | MainWindow *mainwindow = nullptr; 36 | int type; 37 | float min; 38 | float max; 39 | int nticks; 40 | int nticksPref; 41 | int margin; 42 | int offset; 43 | bool force_nticks; 44 | bool intLabels; 45 | bool tickLinesFlag; 46 | QString label; 47 | QString title; 48 | 49 | float renderScale = 1; 50 | float renderOffset= 0; 51 | int verticalOffset = 0; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/maven/background_directinfusion_update.h: -------------------------------------------------------------------------------- 1 | #ifndef BACKGROUND_DIRECTINFUSION_UPDATE_H 2 | #define BACKGROUND_DIRECTINFUSION_UPDATE_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | #include "database.h" 8 | 9 | #include "directinfusionprocessor.h" 10 | 11 | class MainWindow; 12 | class Database; 13 | class TableDockWidget; 14 | 15 | class BackgroundDirectInfusionUpdate : public QThread { 16 | 17 | Q_OBJECT 18 | 19 | public: 20 | BackgroundDirectInfusionUpdate(QWidget*); 21 | ~BackgroundDirectInfusionUpdate(); 22 | 23 | /** 24 | * @brief params 25 | * sets all to defaults. 26 | */ 27 | shared_ptr params = shared_ptr(new DirectInfusionSearchParameters); 28 | 29 | /** 30 | * @brief compoundDatabaseString 31 | * search database used. by default, set to "ALL", though this should probably be changed 32 | * to avoid incorporating "summarized" compounds from other searches (see Issue 238) 33 | */ 34 | string compoundDatabaseString; 35 | 36 | private: 37 | vector samples; 38 | vector compounds; 39 | vector adducts; 40 | 41 | public: 42 | void setCompounds(vector set) {compounds=set; } 43 | void setSamples(vector& set) {samples=set; } 44 | void setAdducts(vector& set) {adducts=set;} 45 | 46 | protected: 47 | void run(void); 48 | 49 | signals: 50 | void updateProgressBar(QString, int, int); 51 | void newDirectInfusionAnnotation(DirectInfusionGroupAnnotation*, int); 52 | void newMs3Annotation(Ms3Annotation*, int); 53 | void closeDialog(); 54 | 55 | }; 56 | 57 | #endif // BACKGROUND_DIRECTINFUSION_UPDATE_H 58 | -------------------------------------------------------------------------------- /src/maven/gitversion.pri: -------------------------------------------------------------------------------- 1 | # Original author: Dmitriy Kubyshkin 2 | # https://www.everythingfrontend.com/posts/app-version-from-git-tag-in-qt-qml.html 3 | 4 | # If there is no version tag in git this one will be used 5 | VERSION = 0.1.0 6 | 7 | # Need to discard STDERR so get path to NULL device 8 | win32 { 9 | NULL_DEVICE = NUL # Windows doesn't have /dev/null but has NUL 10 | } else { 11 | NULL_DEVICE = /dev/null 12 | } 13 | 14 | # Get version from environment variable (available to downstream scripts too) 15 | GIT_VERSION = $$(GIT_VERSION) 16 | isEmpty(GIT_VERSION) { 17 | # Trying to get version from git tag / revision 18 | GIT_VERSION = $$system(get_version.sh 2> $$NULL_DEVICE) 19 | } 20 | 21 | # Turns describe output like 0.1.5-42-g652c397 into "0.1.5.42.652c397" 22 | GIT_VERSION ~= s/-/"." 23 | GIT_VERSION ~= s/g/"" 24 | 25 | # Now we are ready to pass parsed version to Qt 26 | VERSION = $$GIT_VERSION 27 | win32 { # On windows version can only be numerical so remove commit hash 28 | VERSION ~= s/\.\d+\.[a-f0-9]{6,}// 29 | } 30 | 31 | # Adding C preprocessor #DEFINE so we can use it in C++ code 32 | # also here we want full version on every system so using GIT_VERSION 33 | DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\" 34 | 35 | 36 | # By default Qt only uses major and minor version for Info.plist on Mac. 37 | # This will rewrite Info.plist with full version 38 | # TODO Improve plist file (poor metadata) 39 | # This currently doesn't appear in our plist file 40 | #macx { 41 | # INFO_PLIST_PATH = $$shell_quote($${OUT_PWD}/$${INSTALL_ROOT}/$${target.path}/$${TARGET}.app/Contents/Info.plist) 42 | # QMAKE_POST_LINK += /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $${VERSION}\" $${INFO_PLIST_PATH} 43 | #} 44 | -------------------------------------------------------------------------------- /src/maven/tinyplot.h: -------------------------------------------------------------------------------- 1 | #ifndef TINYPLOT_H 2 | #define TINYPLOT_H 3 | 4 | #include "stable.h" 5 | #include "mainwindow.h" 6 | 7 | class TinyPlot: public QObject, public QGraphicsItem { 8 | Q_OBJECT 9 | 10 | #if QT_VERSION >= 0x040600 11 | Q_INTERFACES( QGraphicsItem ) 12 | #endif 13 | 14 | public: 15 | TinyPlot(QGraphicsItem *parent = nullptr, QGraphicsScene *scene = nullptr, MainWindow *mw = nullptr); 16 | void addData(QVector&v); 17 | void addData(std::vector&v); 18 | void addData(EIC* eic); 19 | void addData(EIC* eic, float rtmin, float rtmax); 20 | void addDataColor(QColor c); 21 | void clearData() { data.clear(); _minYValue=_maxYValue=_minXValue=_maxXValue=0; } 22 | void setCurrentXCoord(float x) { _currentXCoord=x; } 23 | float getCurrentXCoord() { return _currentXCoord; } 24 | void setWidth(int w) { _width=w; } 25 | void setHeight(int h) { _height=h; } 26 | void setTitle(QString title) { _title=title; } 27 | void addPoint(float x, float y) { points << QPointF(x,y); } 28 | 29 | protected: 30 | QRectF boundingRect() const; 31 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 32 | // void hoverEnterEvent( QGraphicsSceneHoverEvent * event); 33 | // void hoverLeaveEvent( QGraphicsSceneHoverEvent * event); 34 | // void mouseDoubleClickEvent (QGraphicsSceneMouseEvent * event); 35 | // void mouseMoveEvent (QGraphicsSceneMouseEvent*); 36 | 37 | private: 38 | QPointF mapToPlot(float x, float y); 39 | float predictYValue(float x); 40 | QString _title; 41 | 42 | int _width; 43 | int _height; 44 | 45 | float _minXValue, _minYValue, _maxXValue, _maxYValue; 46 | float _currentXCoord; 47 | QVector< QVector >data; 48 | QVector colors; 49 | QVector points; 50 | 51 | int rt_axis_offset = 20; 52 | 53 | MainWindow *mw; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/maven/samplebarplotwidget.cpp: -------------------------------------------------------------------------------- 1 | #include "samplebarplotwidget.h" 2 | 3 | SampleBarPlotWidget::SampleBarPlotWidget(MainWindow *mw){ 4 | 5 | _scene = new QGraphicsScene(this); 6 | setScene(_scene); 7 | 8 | setAlignment(Qt::AlignTop|Qt::AlignLeft); 9 | 10 | this->_mw = mw; 11 | _barPlot = new BarPlot(nullptr, scene(), _mw); 12 | 13 | setDragMode(NoDrag); 14 | scene()->addItem(_barPlot); 15 | } 16 | 17 | SampleBarPlotWidget::~SampleBarPlotWidget(){ 18 | 19 | if (_barPlot){ 20 | delete(_barPlot); 21 | } 22 | 23 | if (_scene) { 24 | delete(_scene); 25 | } 26 | } 27 | 28 | void SampleBarPlotWidget::setPeakGroup(PeakGroup *peakGroup){ 29 | qDebug() << "SampleBarPlotWidget::setPeakGroup() group=" << peakGroup; 30 | 31 | if (peakGroup->compound) { 32 | qDebug() << "SampleBarPlotWidget::setPeakGroup() compound=" << peakGroup->compound->name.c_str(); 33 | } 34 | 35 | if(!peakGroup) return; 36 | 37 | _barPlot->setPeakGroup(peakGroup); 38 | _barPlot->update(); 39 | 40 | //Needed to coerce scroll bars to scroll to correct size 41 | int pixelBuffer = 20; 42 | 43 | repaint(); 44 | 45 | QRectF sceneRect(0, 0, _barPlot->_latestWidth+pixelBuffer, _barPlot->_latestHeight+pixelBuffer); 46 | 47 | // qDebug() << "sampleBarPlotWidget::setPeakGroup(): Scene Rect: w=" << sceneRect.width() << " h=" << sceneRect.height() << endl; 48 | 49 | setSceneRect(sceneRect); 50 | updateSceneRect(sceneRect); 51 | scene()->update(sceneRect); 52 | 53 | this->verticalScrollBar()->setSliderPosition(0); 54 | this->horizontalScrollBar()->setSliderPosition(0); 55 | 56 | refresh(); 57 | qDebug() << "SampleBarPlotWidget::setPeakGroup() group=" << peakGroup << "completed"; 58 | } 59 | 60 | void SampleBarPlotWidget::refresh() { 61 | repaint(); 62 | scene()->update(); 63 | } 64 | -------------------------------------------------------------------------------- /src/maven/settingsform.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_FORM_H 2 | #define SETTINGS_FORM_H 3 | 4 | #include "ui_settingsform.h" 5 | #include "mainwindow.h" 6 | 7 | class MainWindow; 8 | 9 | 10 | class SettingsForm : public QDialog, public Ui_SettingsForm 11 | { 12 | Q_OBJECT 13 | public: 14 | SettingsForm(QSettings* s, MainWindow *w); 15 | protected: 16 | void closeEvent (QCloseEvent* e) { getFormValues(); QDialog::closeEvent(e);} 17 | void keyPressEvent (QKeyEvent* e) { QDialog::keyPressEvent(e); getFormValues(); } 18 | void mouseReleaseEvent(QMouseEvent* e) {QDialog::mouseReleaseEvent(e); getFormValues(); } 19 | 20 | public slots: 21 | void setFormValues(); 22 | void getFormValues(); 23 | void recomputeEIC(); 24 | void replotEIC(); 25 | void recomputeIsotopes(); 26 | void replotMS1Spectrum(); 27 | void replotMS2Spectrum(); 28 | void replotMS3Spectrum(); 29 | void recomputeConsensusSpectrum(); 30 | void selectFolder(QString key); 31 | void selectFile(QString key); 32 | void bringIntoView(); 33 | 34 | inline void showInstrumentationTab() { tabWidget->setCurrentIndex(0); } 35 | inline void showFileImportTab() { tabWidget->setCurrentIndex(1); } 36 | inline void showPeakDetectionTab() { tabWidget->setCurrentIndex(2); } 37 | inline void setIsotopeDetectionTab() { tabWidget->setCurrentIndex(3); } 38 | 39 | inline void selectMethodsFolder() { selectFolder("methodsFolder"); } 40 | void updateClassifierFile(); 41 | 42 | 43 | 44 | private: 45 | QSettings *settings; 46 | MainWindow *mainwindow; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/maven/forms/searchparamsdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SearchParamsDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 598 10 | 345 11 | 12 | 13 | 14 | Cluster PeakGroups 15 | 16 | 17 | 18 | 19 | 20 | Search Parameters 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 0 29 | 0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Search Results 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 0 46 | 0 47 | 48 | 49 | 50 | 51 | 0 52 | 0 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/maven/isotopelegendwidget.cpp: -------------------------------------------------------------------------------- 1 | #include "isotopelegendwidget.h" 2 | 3 | IsotopeLegendWidget::IsotopeLegendWidget(MainWindow *mw){ 4 | 5 | _scene = new QGraphicsScene(this); 6 | setScene(_scene); 7 | 8 | setAlignment(Qt::AlignTop|Qt::AlignLeft); 9 | 10 | this->_mw = mw; 11 | _isotopePlot = new IsotopePlot(nullptr, scene(), _mw); 12 | 13 | setDragMode(NoDrag); 14 | scene()->addItem(_isotopePlot); 15 | } 16 | 17 | IsotopeLegendWidget::~IsotopeLegendWidget(){ 18 | 19 | if (_isotopePlot){ 20 | delete(_isotopePlot); 21 | } 22 | 23 | if (_scene) { 24 | delete(_scene); 25 | } 26 | } 27 | 28 | void IsotopeLegendWidget::setPeakGroup(PeakGroup *peakGroup){ 29 | 30 | qDebug() << "IsotopeLegendWidget::setPeakGroup() group=" << peakGroup; 31 | 32 | if(!peakGroup) return; 33 | 34 | //width is based on the dockwidget width - initialization 35 | _isotopePlot->setWidth(100); 36 | 37 | _isotopePlot->setPeakGroup(peakGroup); 38 | _isotopePlot->update(); 39 | 40 | //Needed to coerce scroll bars to scroll to correct size 41 | int pixelBuffer = 20; 42 | 43 | repaint(); 44 | 45 | QRectF sceneRect(0, 0, _isotopePlot->boundingRect().width()+pixelBuffer, _isotopePlot->boundingRect().height()+pixelBuffer); 46 | 47 | // qDebug() << "IsotopeLegendWidget::setPeakGroup(): Scene Rect: w=" << sceneRect.width() << " h=" << sceneRect.height() << endl; 48 | 49 | setSceneRect(sceneRect); 50 | updateSceneRect(sceneRect); 51 | scene()->update(sceneRect); 52 | 53 | this->verticalScrollBar()->setSliderPosition(0); 54 | this->horizontalScrollBar()->setSliderPosition(0); 55 | 56 | refresh(); 57 | qDebug() << "IsotopeLegendWidget::setPeakGroup() group=" << peakGroup << "completed"; 58 | } 59 | 60 | void IsotopeLegendWidget::refresh() { 61 | repaint(); 62 | scene()->update(); 63 | } 64 | -------------------------------------------------------------------------------- /src/maven/barplot.h: -------------------------------------------------------------------------------- 1 | #ifndef BARPLOT_H 2 | #define BARPLOT_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | 8 | 9 | class MainWindow; 10 | class PeakGroup; 11 | class QGraphicsItem; 12 | class QGraphicsScene; 13 | 14 | class BarPlot : public QObject, public QGraphicsItem 15 | { 16 | Q_OBJECT 17 | 18 | #if QT_VERSION >= 0x040600 19 | Q_INTERFACES( QGraphicsItem ) 20 | #endif 21 | 22 | static PeakGroup::QType qtype; 23 | 24 | public: 25 | BarPlot(QGraphicsItem *parent, QGraphicsScene *scene); 26 | BarPlot(QGraphicsItem *parent, QGraphicsScene *scene, MainWindow *mainWindow); 27 | ~BarPlot(); 28 | void setPeakGroup(PeakGroup *group); 29 | QRectF boundingRect() const; 30 | void setMainWindow(MainWindow* mw) { _mw = mw; } 31 | void switchQValue(); 32 | void clear(); 33 | void showSampleNames(bool flag) { _showSampleNames=flag; } 34 | void showIntensityText(bool flag) { _showIntensityText=flag; } 35 | void showQValueType(bool flag) { _showQValueType=flag; } 36 | 37 | bool isOnEicWidget = true; 38 | int _latestWidth = 1; 39 | int _latestHeight = 1; 40 | 41 | protected: 42 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 43 | void mousePressEvent (QGraphicsSceneMouseEvent*) { if (!isOnEicWidget) return; switchQValue(); update(); } 44 | void wheelEvent ( QGraphicsSceneWheelEvent * event ); 45 | 46 | private: 47 | pair getNumTypeAndNumPrec(float maxYvalue); 48 | QVector _labels; 49 | QVector _colors; 50 | QVector _yvalues; 51 | int _width; 52 | int _height; 53 | float _barwidth; 54 | 55 | bool _showSampleNames; 56 | bool _showIntensityText; 57 | bool _showQValueType; 58 | 59 | MainWindow* _mw; 60 | float _yValuesMean = 0.0f; 61 | float _yValuesCoV = 0.0f; 62 | int _titleSpacer = 10; 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/maven/isotopeswidget.h: -------------------------------------------------------------------------------- 1 | #ifndef ISOTOPEWIDGETGUI_H 2 | #define ISOTOPEWIDGETGUI_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | #include "background_peaks_update.h" 8 | #include "ui_isotopeswidget.h" 9 | #include "numeric_treewidgetitem.h" 10 | 11 | 12 | class QAction; 13 | class QMenu; 14 | class QTextEdit; 15 | class MainWindow; 16 | class BackgroundPeakUpdate; 17 | 18 | extern Database DB; 19 | 20 | using namespace std; 21 | 22 | class IsotopeWidget: public QDockWidget, public Ui_isotopesWidget { 23 | Q_OBJECT 24 | 25 | public: 26 | IsotopeWidget(MainWindow*); 27 | ~IsotopeWidget(); 28 | 29 | public slots: 30 | void setFormula(QString f); 31 | void updateAdduct(); 32 | void userChangedFormula(QString f); 33 | void computeIsotopes(string f); 34 | void setPeakGroup(PeakGroup* group); 35 | void setCompound(Compound* compound); 36 | void unloadCompound(QString db); 37 | void setClipboard(); 38 | void setClipboard(PeakGroup* group); 39 | void setClipboard(QList& groups); 40 | void updateSampleComboBox(); 41 | void rebuildTableCurrentGroup(); 42 | 43 | private slots: 44 | void showInfo(); 45 | void showTable(); 46 | QString groupTextEport(PeakGroup* group); 47 | void exportTableToSpreadsheet(); 48 | 49 | private: 50 | string _formula; 51 | 52 | vector links; 53 | MainWindow* _mw; 54 | 55 | Scan* _scan; 56 | PeakGroup* _group; 57 | Compound* _compound; 58 | Adduct* _adduct; 59 | 60 | MassCalculator mcalc; 61 | Compound* tempCompound; 62 | map> cachedIsotopes{}; 63 | 64 | QString groupIsotopeMatrixExport(PeakGroup* group, bool includeSampleHeader); 65 | Adduct* getCurrentAdduct(); 66 | mzSample* getCurrentSample(); 67 | 68 | //Issue 693 69 | void rebuildTableFromPeakGroup(PeakGroup* group); 70 | 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/maven/line.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef LINE_H 3 | #define LINE_H 4 | 5 | #include "stable.h" 6 | #include "mzSample.h" 7 | #include "mainwindow.h" 8 | 9 | class EIC; 10 | class MainWindow; 11 | 12 | class EicLine : public QGraphicsItem 13 | { 14 | public: 15 | EicLine(QGraphicsItem* parent, QGraphicsScene *scene, MainWindow* mainwindow=nullptr); 16 | void addPoint(float x, float y) { _line << QPointF(x,y+_verticalOffset); } 17 | void addPoint(QPointF p) { _line << QPointF(p.x(), p.y()+_verticalOffset); } 18 | void setColor(QColor &c) { _color = c; } 19 | void setPen(QPen &p) { _pen = p; } 20 | void setBrush(QBrush &b) { _brush = b; } 21 | void fixEnds(); 22 | void setEIC(EIC* e) { _eic = e; } 23 | EIC* getEIC() { return _eic; } 24 | bool isHighlighed() { return _highlighted; } 25 | void setHighlighted(bool value) { _highlighted=value; } 26 | void setFillPath(bool value) { _fillPath=value; } 27 | QPainterPath shape() const; 28 | void setClosePath(bool value ) {_closePath=value;} 29 | void setMainWindow(MainWindow* mainwindow){_mainwindow=mainwindow;} 30 | void setEmphasizePoints(bool value) {_emphasizePoints = value;} 31 | bool isEmphasizePoints(){return _emphasizePoints;} 32 | void setVerticalOffset(int verticalOffset){_verticalOffset=verticalOffset;} 33 | 34 | protected: 35 | QRectF boundingRect() const; 36 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 37 | void hoverEnterEvent (QGraphicsSceneHoverEvent*event ); 38 | void hoverLeaveEvent (QGraphicsSceneHoverEvent*event ); 39 | 40 | 41 | private: 42 | bool _highlighted; 43 | EIC* _eic; 44 | QPolygonF _line; 45 | QColor _color; 46 | QPen _pen; 47 | QBrush _brush; 48 | bool _endsFixed; 49 | bool _closePath; 50 | bool _fillPath; 51 | bool _emphasizePoints; 52 | MainWindow* _mainwindow; 53 | int _verticalOffset = 0; 54 | 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/maven/history.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2008 by melamud,,, * 3 | * emelamud@princeton.edu * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef HISTORY_H 23 | #define HISTORY_H 24 | 25 | #include "stable.h" 26 | #include "mzSample.h" 27 | 28 | 29 | using namespace std; 30 | 31 | class History: public QObject { 32 | Q_OBJECT 33 | 34 | public: 35 | History(); 36 | int size() { return history.size(); } 37 | mzSlice next(); 38 | mzSlice last(); 39 | 40 | public slots: 41 | void addToHistory(const mzSlice slice); 42 | 43 | private: 44 | int _pos; 45 | QList history; 46 | 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/maven/spectralhit.h: -------------------------------------------------------------------------------- 1 | #ifndef SPECTRALHIT 2 | #define SPECTRALHIT 3 | 4 | #include "mzSample.h" 5 | #include 6 | #include 7 | #include 8 | 9 | class SpectralHit { 10 | 11 | public: 12 | double score; 13 | Scan* scan; 14 | QString sampleName; 15 | QVectormzList; 16 | QVectorintensityList; 17 | QVector fragLabelList; 18 | float productPPM; 19 | int matchCount; 20 | float precursorMz; 21 | float xcorr; 22 | float mvh; 23 | int rank; 24 | bool decoy; 25 | int charge; 26 | int massdiff; 27 | int scannum; 28 | QString compoundId; 29 | QString fragmentId; 30 | QString originalCompoundId; 31 | 32 | 33 | SpectralHit() { 34 | scan = nullptr; 35 | precursorMz=0; 36 | matchCount=0; 37 | productPPM=0; 38 | score=0; 39 | xcorr=0; 40 | massdiff=0; 41 | mvh=0; 42 | rank=0; 43 | decoy=false; 44 | charge=0; 45 | } 46 | 47 | double getMaxIntensity() { 48 | double maxIntensity=0; 49 | foreach(double x, intensityList) if(x>maxIntensity) maxIntensity=x; 50 | return maxIntensity; 51 | } 52 | 53 | double getMinMz() { 54 | if (mzList.empty()) return 0.0; 55 | double min = mzList.first(); 56 | foreach(double x, mzList) if(xmax) max=x; 64 | return max; 65 | } 66 | 67 | static bool compScan(SpectralHit* a, SpectralHit* b ) { return a->scan < b->scan; } 68 | static bool compPrecursorMz(SpectralHit* a, SpectralHit* b) { return a->precursorMz < b->precursorMz; } 69 | static bool compScore(SpectralHit* a, SpectralHit* b ) { return a->score > b->score; } 70 | static bool compMVH(SpectralHit* a, SpectralHit* b ) { return a->mvh > b->mvh; } 71 | 72 | }; 73 | //Q_DECLARE_METATYPE(SpectralHit*); 74 | #endif 75 | -------------------------------------------------------------------------------- /src/maven/stable.h: -------------------------------------------------------------------------------- 1 | #ifndef STABLE_H 2 | #define STABLE_H 3 | 4 | //QT gui headers 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | #include 56 | #include 57 | 58 | //std c++ 59 | //#include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | 74 | 75 | //mass spec file handling 76 | #include "mzSample.h" 77 | #include "mzUtils.h" 78 | #include "mzMassCalculator.h" 79 | #include "mzFit.h" 80 | 81 | //Linear Algebra 82 | #include 83 | #include 84 | #include 85 | //#include 86 | 87 | // import most common Eigen types 88 | //USING_PART_OF_NAMESPACE_EIGEN 89 | using namespace Eigen; 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /src/maven/setrumsdbdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "setrumsdbdialog.h" 2 | 3 | SetRumsDBDialog::SetRumsDBDialog(QWidget *parent) : QDialog(parent) { 4 | setupUi(this); 5 | setModal(true); 6 | _isCancelled = true; 7 | 8 | updateComboBox(); 9 | 10 | mainWindow = static_cast(parent); 11 | 12 | 13 | QString selectedDB = mainWindow->ligandWidget->getDatabaseName(); 14 | cmbLoadedLibraries->setCurrentIndex(cmbLoadedLibraries->findText(selectedDB)); 15 | 16 | connect(btnUseSelected, SIGNAL(clicked()), this, SLOT(setRumsDBDatabaseName())); 17 | connect(btnNoLibrary, SIGNAL(clicked()), this, SLOT(useNoRumsDBDatabaseName())); 18 | connect(btnCancel, SIGNAL(clicked()), this, SLOT(cancelLoading())); 19 | connect(btnSelectLibrary, SIGNAL(clicked()), mainWindow->libraryDialog, SLOT(show())); 20 | connect(chkmzrollDBLoadLibs, SIGNAL(clicked()), this, SLOT(setAttemptToLoadDBFlag())); 21 | connect(chkmzrollDBLoadPGCompounds, SIGNAL(clicked()), this, SLOT(setLoadPGCompoundMatchesFlag())); 22 | 23 | btnUseSelected->setFocus(); 24 | 25 | QDialog::show(); 26 | } 27 | 28 | void SetRumsDBDialog::updateComboBox() { 29 | cmbLoadedLibraries->clear(); 30 | QStringList dbnames = DB.getLoadedDatabaseNames(); 31 | for (QString db : dbnames) { 32 | cmbLoadedLibraries->addItem(db); 33 | } 34 | } 35 | 36 | void SetRumsDBDialog::setRumsDBDatabaseName() { 37 | _isCancelled = false; 38 | if (!cmbLoadedLibraries->currentText().isEmpty()) { 39 | mainWindow->rumsDBDatabaseName = cmbLoadedLibraries->currentText(); 40 | close(); 41 | } 42 | } 43 | 44 | void SetRumsDBDialog::useNoRumsDBDatabaseName() { 45 | _isCancelled = false; 46 | mainWindow->rumsDBDatabaseName = QString(""); 47 | close(); 48 | } 49 | 50 | void SetRumsDBDialog::cancelLoading() { 51 | _isCancelled = true; 52 | close(); 53 | } 54 | 55 | bool SetRumsDBDialog::isCancelled(){ 56 | return _isCancelled; 57 | } 58 | 59 | void SetRumsDBDialog::setAttemptToLoadDBFlag(){ 60 | mainWindow->isAttemptToLoadDB = chkmzrollDBLoadLibs->checkState() != Qt::Unchecked; 61 | } 62 | 63 | void SetRumsDBDialog::setLoadPGCompoundMatchesFlag(){ 64 | mainWindow->isLoadPGCompoundMatches = chkmzrollDBLoadPGCompounds->checkState() != Qt::Unchecked; 65 | } 66 | -------------------------------------------------------------------------------- /src/maven/peakdetectiondialog.h: -------------------------------------------------------------------------------- 1 | #ifndef PEAKDETECTIONDIALOG_H 2 | #define PEAKDETECTIONDIALOG_H 3 | 4 | #include "ui_peakdetectiondialog.h" 5 | #include "stable.h" 6 | #include "database.h" 7 | #include "mainwindow.h" 8 | #include "msmsscoringsettings.h" 9 | #include "configurediffisotopesearch.h" 10 | 11 | class MainWindow; 12 | class TableDockWidget; 13 | class BackgroundPeakUpdate; 14 | class MSMSScoringSettingsDialog; 15 | 16 | extern Database DB; 17 | 18 | 19 | class PeakDetectionDialog : public QDialog, public Ui_PeakDetectionDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | enum FeatureDetectionType { PeaksSearch=0, LibrarySearch, QQQ }; 25 | PeakDetectionDialog(QWidget *parent); 26 | ~PeakDetectionDialog(); 27 | void setSettings(QSettings* settings) { this->settings = settings; setUIValuesFromSettings();} 28 | void setMainWindow(MainWindow* w); 29 | 30 | public slots: 31 | void findPeaks(); 32 | void loadModel(); 33 | void setOutputDir(); 34 | void setProgressBar(QString text, int progress, int totalSteps); 35 | void runBackgroupJob(QString func); 36 | void showInfo(QString text); 37 | void cancel(); 38 | void show(); 39 | void setFeatureDetection(FeatureDetectionType type); 40 | void updateLibraryList(); 41 | void showLibraryDialog(); 42 | void resetDiffIsotopeSampleList(); 43 | void populateDiffIsotopeSampleList(); 44 | 45 | private: 46 | void setUIValuesFromSettings(); 47 | QSettings *settings; 48 | MainWindow *mainwindow; 49 | BackgroundPeakUpdate* peakupdater; 50 | FeatureDetectionType _featureDetectionType; 51 | 52 | shared_ptr getPeaksSearchParameters(); 53 | shared_ptr getLipidSearchParameters(); 54 | shared_ptr getMzkitchenMetaboliteSearchParameters(); 55 | shared_ptr getPeakPickingAndGroupingParameters(); 56 | 57 | MSMSScoringSettingsDialog *scoringSettingsDialog; 58 | ConfigureDiffIsotopeSearch *configureDiffIsotopeSearch; 59 | void displayCompoundOptions(bool isDisplayCompoundOptions); 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /make_dist_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | #Set Script Name variable 5 | SCRIPT=`basename ${BASH_SOURCE[0]}` 6 | 7 | #Set fonts for Help. 8 | NORM=`tput sgr0` 9 | BOLD=`tput bold` 10 | REV=`tput smso` 11 | 12 | #Help function 13 | function HELP { 14 | echo -e \\n"${REV}Basic usage:${NORM} ${BOLD}$SCRIPT Maven.app${NORM}"\\n 15 | echo -e "${REV}-h${NORM} --Displays this help message. No further functions are performed."\\n 16 | echo -e "Example: ${BOLD}$SCRIPT \"${apppath}\"${NORM}"\\n 17 | exit 1 18 | } 19 | 20 | #Check the number of arguments. If none are passed, print help and exit. 21 | NUMARGS=$# 22 | if [ $NUMARGS -eq 0 ]; then 23 | HELP 24 | fi 25 | 26 | # A POSIX variable 27 | OPTIND=1 # Reset in case getopts has been used previously in the shell. 28 | 29 | # Initialize our own variables: 30 | 31 | while getopts "h?f:" opt; do 32 | case "$opt" in 33 | h|\?) 34 | show_help 35 | exit 0 36 | ;; 37 | esac 38 | done 39 | 40 | shift $((OPTIND-1)) #This tells getopts to move on to the next argument. 41 | 42 | GIT_VERSION=$(src/maven/get_version.sh) 43 | 44 | apppath=$1 45 | basepath="${apppath%.app}" 46 | appfn="${apppath##*/}" 47 | distpath="dist" 48 | basefn="${appfn%.app}" 49 | dmgfn="${basefn}_${GIT_VERSION}-Mac.dmg" 50 | 51 | # Issue 737: avoid clearing out old paths 52 | # rm -rf "${distpath}" 53 | # mkdir -p "${distpath}" 54 | if [ ! -d ${distpath} ]; then 55 | mkdir -p "${distpath}" 56 | fi 57 | 58 | echo "Copying resources to ${apppath}" 59 | mkdir -p "${apppath}/Contents/Resources/methods" 60 | cp src/maven_core/bin/methods/* "${apppath}/Contents/Resources/methods" 61 | mkdir -p "${apppath}/Contents/Resources/scripts" 62 | cp src/maven_core/bin/scripts/* "${apppath}/Contents/Resources/scripts" 63 | # TODO Should pathways be in the repo? 64 | # mkdir "${apppath}/Contents/Resources/pathways" 65 | # cp bin/pathways/* "${apppath}/Contents/Resources/pathways" 66 | # TODO Should these be in the repo? 67 | # cp bin/*.csv "${apppath}/Contents/Resources" 68 | # cp bin/*.model "${apppath}/Contents/Resources" 69 | 70 | echo "Running macdeployqt" 71 | macdeployqt "${apppath}" 72 | # TODO This doesn't appear to get built, is that correct or are we missing something? 73 | # macdeployqt "bin/peakdetector.app" -dmg 74 | 75 | echo "Making DMG" 76 | hdiutil create "${distpath}/${dmgfn}" -srcfolder "${apppath}" -ov 77 | -------------------------------------------------------------------------------- /src/maven/test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | long nchoosek(int n, int k) { 8 | int n_k = n - k; 9 | if (k < n_k) { k = n_k; n_k = n - k; } 10 | int nchsk = 1; 11 | for ( int i = 1; i <= n_k; i++) { nchsk *= (++k); nchsk /= i; } 12 | return nchsk; 13 | } 14 | 15 | int naturalAbundanceCorrection(int nC, vector& M) { 16 | //inputs 17 | int n = nC; //number of carbonms 18 | int nr_13C=n-1; //number of labeled carbons 19 | 20 | //uncorrected values 21 | vectorC(n,0); // output vector with corrected values 22 | 23 | for(int k=0; k < nr_13C-1; k++ ) { 24 | double contamination=0; 25 | 26 | for(int i=0; iM(n+1,0); 45 | M[0]=0.187158; 46 | M[1]=1.24898e-2; 47 | M[2]=3.47407e-4; 48 | M[3]=2.06750e-5; 49 | M[4]=1.15276e-3; 50 | M[5]=4.56475e-2; 51 | M[6]=0.753184; 52 | 53 | //uncorrected values 54 | vectorC(n,0); // output vector with corrected values 55 | 56 | for(int k=0; k < nr_13C-1; k++ ) { 57 | double contamination=0; 58 | double labeledcontamination=0; 59 | 60 | for(int i=0; iM(n+1,0); 82 | M[0]=0.8757; M[1]=1.16878e-1; M[2]=7.14977e-3; M[3]=2.65074e-4; 83 | M[4]=6.63355e-6; M[5]=1.18049e-7; 84 | 85 | 86 | //labeledNutrient(); 87 | naturalAbundanceCorrection(n,M); 88 | 89 | } 90 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## [8.0.3][] 8 | ### Added 9 | - Implimentation of multivariate hypergeometic scoring for ms2 spectra @eugenemel 10 | - Maven can now read compressed mzML and mzXML samples with 32bit and 64bit encoding 11 | - Saving and loading of segmented alignments from mzrollDB @eugenemel 12 | - Loading and simulation search of multiple fragmentation libraries @eugenemel 13 | - Adjusted plot widgets to use bigger fonts @eugenemel 14 | - Implemented new scatter plot, m/z by rt of detected peakgroups 15 | 16 | ### Changed 17 | 18 | ### Deprecated 19 | 20 | ### Removed 21 | 22 | ### Fixed 23 | - Fixed bug in hypergeometic scoring that caused NaN in output 24 | - Fixed bug that caused crashes on deletion of bookmarks 25 | - Fixed repeated widget update calls for peakgroup display from bookmarks 26 | - Fixed / suppressed many compiler warning 27 | 28 | ## [8.0.2][] 29 | ### Added 30 | - Maven calcuates and displays purity of ms2 specta 31 | - Extract precursor isolation window from mzXML records 32 | 33 | ### Changed 34 | 35 | ### Deprecated 36 | 37 | ### Removed 38 | 39 | ### Fixed 40 | 41 | ## [8.0.1][] 42 | ### Added 43 | - Detect dual 13C/2H labeled isotopes @lparsons 44 | 45 | ### Changed 46 | 47 | ### Deprecated 48 | 49 | ### Removed 50 | 51 | ### Fixed 52 | - Fixed isotopes widget to display only those isotopes that correspond the 53 | isotopes selected in the application preferences (i.e. if C13 is not 54 | selected in preferences, then no C13 isotopes will be displayed). @lparsons 55 | 56 | ### Security 57 | 58 | 59 | ## [8.0.0][] - 2017-08-28 60 | ### Added 61 | - Build process automated using Travis and Appveyor @lparsons 62 | - Tagged release versions pushed to GitHub Releases @lparsons 63 | - TODO: Many other changes @eugenemel 64 | 65 | ### Changed 66 | 67 | ### Deprecated 68 | 69 | ### Removed 70 | 71 | ### Fixed 72 | 73 | ### Security 74 | 75 | 76 | ## [20161028][] - 2016-10-28 77 | - TODO - Document changes 78 | 79 | [8.0.1]: https://github.com/eugenemel/maven/compare/8.0.0...8.0.1 80 | [8.0.0]: https://github.com/eugenemel/maven/compare/20161028...8.0.0 81 | [20161028]: https://github.com/eugenemel/maven/compare/92cf1d16dfc7d9f6bf4394890a06c3ecbed2ba1a...20161028 82 | -------------------------------------------------------------------------------- /src/maven/note.h: -------------------------------------------------------------------------------- 1 | #ifndef NOTE_H 2 | #define NOTE_H 3 | 4 | #include "globals.h" 5 | #include "stable.h" 6 | 7 | 8 | class Note : public QObject, public QGraphicsItem { 9 | Q_OBJECT 10 | #if QT_VERSION >= 0x040600 11 | Q_INTERFACES( QGraphicsItem ) 12 | #endif 13 | 14 | public: 15 | 16 | enum Orientation{DownRight = 0, UpRight = 1, UpLeft = 2, DownLeft = 3}; 17 | 18 | Note(const QString &text, QGraphicsItem *parent = 0, QGraphicsScene *scene = 0); 19 | 20 | void setEditable(bool f) { editable=f; } 21 | void setZValue(int x); 22 | void setBackgroundBrush(QBrush b); 23 | void setPlainText(const QString & text ); 24 | void setHtml(const QString & text); 25 | QString toPlainText() { if(_label) return _label->toPlainText(); return QString(); } 26 | void setPos(float sceneX, float sceneY); 27 | QRectF boundingRect() const; 28 | 29 | void setExpanded(bool f) { expanded=f; } 30 | void setUrl(QString url) { _link=url; } 31 | enum Style { NumberOnly=0, ShortText=1, FullText=2, showNoteIcon=3 }; 32 | void setStyle(Style s) { _style = s; } 33 | void setTimeoutTime(int time) { _timeOutTime=time; } 34 | 35 | 36 | int noteid; 37 | double mzmin; 38 | double mzmax; 39 | double rt; 40 | double intensity; 41 | 42 | Orientation labelOrientation = Orientation::DownRight; 43 | 44 | public slots: 45 | void linkClicked(); 46 | 47 | signals: 48 | void itemChanged(Note*); 49 | void linkActivated(const QString& link); 50 | void clicked(); 51 | 52 | protected: 53 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 54 | void hoverEnterEvent( QGraphicsSceneHoverEvent * event); 55 | void hoverLeaveEvent( QGraphicsSceneHoverEvent * event); 56 | void mousePressEvent(QGraphicsSceneMouseEvent *event); 57 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); 58 | void mouseDoubleClickEvent (QGraphicsSceneMouseEvent * event); 59 | void mouseMoveEvent (QGraphicsSceneMouseEvent*); 60 | void timerEvent(QTimerEvent *event); 61 | QPainterPath shape() const; 62 | 63 | private: 64 | void setupGraphicOptions(); 65 | bool hovered; 66 | bool editable; 67 | bool expanded; 68 | 69 | void showBoundBox(); 70 | 71 | QString _link; 72 | 73 | Style _style; 74 | QGraphicsTextItem* _label; 75 | QGraphicsPathItem* _labelBox; 76 | QPainterPath _shape; 77 | 78 | int _elepsedTime; 79 | int _timerId; 80 | int _timeOutTime; 81 | 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/maven/forms/selectadductsdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | selectAdductsDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 745 10 | 476 11 | 12 | 13 | 14 | Select Active Adducts 15 | 16 | 17 | 18 | 19 | 20 | 5 21 | 22 | 23 | true 24 | 25 | 26 | 27 | enabled 28 | 29 | 30 | 31 | 32 | Name 33 | 34 | 35 | 36 | 37 | nmol 38 | 39 | 40 | 41 | 42 | mass 43 | 44 | 45 | 46 | 47 | z 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | List of active adducts is not updated until 'Update' button pushed. 56 | 57 | 58 | 59 | 60 | 61 | 62 | Select All 63 | 64 | 65 | 66 | 67 | 68 | 69 | Deselect All 70 | 71 | 72 | 73 | 74 | 75 | 76 | Update 77 | 78 | 79 | 80 | 81 | 82 | 83 | Cancel 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/maven/isotopeplot.h: -------------------------------------------------------------------------------- 1 | #ifndef ISOTOPEPLOT_H 2 | #define ISOTOPEPLOT_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | 8 | class MainWindow; 9 | class PeakGroup; 10 | class QGraphicsItem; 11 | class QGraphicsScene; 12 | 13 | class IsotopeBar : public QObject, public QGraphicsRectItem 14 | { 15 | Q_OBJECT 16 | #if QT_VERSION >= 0x040600 17 | Q_INTERFACES( QGraphicsItem ) 18 | #endif 19 | 20 | public: 21 | IsotopeBar(QGraphicsItem *parent) : QGraphicsRectItem(parent){ 22 | setFlag(ItemIsSelectable); 23 | setFlag(ItemIsFocusable); 24 | setAcceptHoverEvents(true); 25 | } 26 | 27 | QRectF boundingRect() const { 28 | return QGraphicsRectItem::boundingRect(); 29 | } 30 | 31 | signals: 32 | void groupSelected(PeakGroup* g); 33 | void groupUpdated(PeakGroup* g); 34 | void showInfo(QString,int xpos=0, int ypos=0); 35 | void showMiniEICPlot(PeakGroup*g); 36 | void peakSelected(Peak*); 37 | 38 | protected: 39 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { 40 | QGraphicsRectItem::paint(painter,option,widget); 41 | } 42 | 43 | void hoverEnterEvent (QGraphicsSceneHoverEvent*event); 44 | // void mouseDoubleClickEvent (QGraphicsSceneMouseEvent*event); 45 | void mousePressEvent (QGraphicsSceneMouseEvent*event); 46 | void keyPressEvent(QKeyEvent *e); 47 | }; 48 | 49 | 50 | class IsotopePlot : public QObject, public QGraphicsItem 51 | { 52 | Q_OBJECT 53 | 54 | #if QT_VERSION >= 0x040600 55 | Q_INTERFACES( QGraphicsItem ) 56 | #endif 57 | 58 | public: 59 | IsotopePlot(QGraphicsItem *parent, QGraphicsScene *scene); 60 | IsotopePlot(QGraphicsItem *parent, QGraphicsScene *scene, MainWindow *mainWindow); 61 | ~IsotopePlot(); 62 | 63 | void setPeakGroup(PeakGroup* group); 64 | void setMainWindow(MainWindow* mw); 65 | QRectF boundingRect() const; 66 | void clear(); 67 | void showBars(); 68 | inline void setIsInLegendWidget(bool isInLegendWidget){_isInLegendWidget = isInLegendWidget;} 69 | inline void setWidth(float width){_width = width;} 70 | 71 | protected: 72 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); 73 | void contextMenuEvent(QGraphicsSceneContextMenuEvent* event); 74 | 75 | private: 76 | 77 | float _width; 78 | float _height; 79 | float _barheight; 80 | bool _isInLegendWidget = false; 81 | 82 | QGraphicsTextItem* _parameters; 83 | 84 | vector _samples; 85 | MainWindow* _mw; 86 | 87 | PeakGroup* _group; 88 | vector _isotopes; 89 | 90 | void computeParameters(); 91 | void clearBars(); 92 | }; 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /src/peakdetector/peakdetector.pro: -------------------------------------------------------------------------------- 1 | # codebase paths 2 | CORE = ../maven_core 3 | NATSORT = . 4 | MAVEN = ../maven/ 5 | 6 | include($$CORE/libmaven.pri) 7 | 8 | TEMPLATE = app 9 | TARGET = peakdetector 10 | DESTDIR = $$MAVEN/bin/ 11 | CONFIG -= network gui opengl 12 | CONFIG += sql qt std++14 13 | 14 | INSTALLS += target 15 | linux:INSTALLS += desktop 16 | target.path = $${INSTALL_PREFIX}/bin 17 | desktop.path = $${INSTALL_PREFIX}/share/applications 18 | 19 | QT += sql gui 20 | QT -= network opengl std++14 21 | 22 | INCLUDEPATH += $$CORE/pugixml/src/ $$CORE/libmaven $$CORE/pugixml/src $$CORE/libneural $$CORE/MSToolkit/include $$CORE $$NATSORT 23 | 24 | LDFLAGS += $$OUTPUT_DIR/lib 25 | 26 | LIBS += -L. -L$$CORE/build/lib -lmaven -lpugixml -lneural -lmstoolkitlite -lz 27 | 28 | contains (DEFINES,CDFPARSER) { 29 | LIBS += -lcdfread -lnetcdf 30 | } 31 | 32 | #add version information during compilation 33 | VERSION = $$system("git describe --tags --always") 34 | 35 | DEFINES += MAVEN_VERSION=\\\"$$VERSION\\\" 36 | DEFINES += "PLATFORM=\"$$QMAKE_HOST.os\"" 37 | 38 | message("Peakdetector Version is:") 39 | message($$VERSION) 40 | 41 | #BUILD OPENMP PARALLEL VERSION 42 | 43 | mac { 44 | exists(/usr/local/opt/llvm) { 45 | message("mac os x: llvm found. Will build parallel.") 46 | 47 | #compiler and linker need to be clang-omp++ 48 | QMAKE_CXX=/usr/local/opt/llvm/bin/clang++ 49 | QMAKE_LINK=/usr/local/opt/llvm/bin/clang++ 50 | LIBS += -L/usr/local/opt/llvm/lib/ 51 | 52 | INCLUDEPATH += /usr/local/opt/llvm/include/ 53 | INCLUDEPATH += /usr/local/opt/llvm/lib/include/ 54 | 55 | # Qt Creator may need this as an explicitly added header for a custom compiler 56 | # INCLUDEPATH += /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include 57 | 58 | # Change this as needed for version of llvm 59 | # INCLUDEPATH += /usr/local/opt/llvm/lib/clang/19/include/ 60 | 61 | CONFIG += parallel 62 | } 63 | } 64 | 65 | unix { 66 | !mac { 67 | CONFIG += parallel 68 | } 69 | } 70 | 71 | win32 { 72 | CONFIG -= parallel 73 | CONFIG += console 74 | RC_FILE = peakdetector_resource.rc 75 | } 76 | 77 | parallel { 78 | message("Building OpenMP peakdetector_parallel") 79 | 80 | QMAKE_CXXFLAGS += -DOMP_PARALLEL -fopenmp -I/usr/local/opt/libomp/include/ 81 | QMAKE_LFLAGS += -fopenmp 82 | LIBS += -fopenmp 83 | } 84 | 85 | SOURCES= peakdetector.cpp options.cpp $$MAVEN/classifier.cpp $$MAVEN/classifierNeuralNet.cpp $$MAVEN/projectDB.cpp $$MAVEN/database.cpp $$NATSORT/strnatcmp.c 86 | HEADERS= $$MAVEN/classifierNeuralNet.h options.h $$MAVEN/projectDB.h $$MAVEN/database.h $$NATSORT/strnatcmp.h 87 | -------------------------------------------------------------------------------- /make_dist_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | #Set Script Name variable 5 | SCRIPT=`basename ${BASH_SOURCE[0]}` 6 | 7 | #Set fonts for Help. 8 | NORM=`tput sgr0` 9 | BOLD=`tput bold` 10 | REV=`tput smso` 11 | 12 | #Help function 13 | function HELP { 14 | echo -e \\n"${REV}Basic usage:${NORM} ${BOLD}$SCRIPT file.exe${NORM}"\\n 15 | echo -e "${REV}-h${NORM} --Displays this help message. No further functions are performed."\\n 16 | echo -e "Example: ${BOLD}$SCRIPT \"appdir/bin/Maven_Linux\"${NORM}"\\n 17 | exit 1 18 | } 19 | 20 | #Check the number of arguments. If none are passed, print help and exit. 21 | NUMARGS=$# 22 | if [ $NUMARGS -eq 0 ]; then 23 | HELP 24 | fi 25 | 26 | # A POSIX variable 27 | OPTIND=1 # Reset in case getopts has been used previously in the shell. 28 | 29 | # Initialize our own variables: 30 | 31 | while getopts "h?f:" opt; do 32 | case "$opt" in 33 | h|\?) 34 | show_help 35 | exit 0 36 | ;; 37 | esac 38 | done 39 | 40 | shift $((OPTIND-1)) #This tells getopts to move on to the next argument. 41 | 42 | GIT_VERSION=$(src/maven/get_version.sh) 43 | 44 | binpath=$1 45 | 46 | echo "binpath: "${binpath} 47 | 48 | bindir=${binpath%/*} 49 | binfn="${binpath##*/}" 50 | distpath="dist" 51 | appimagefn="${binfn%.exe}_${GIT_VERSION}-Linux.AppImage" 52 | 53 | # TODO Resources must be copied to appdir prior to packaging 54 | # See: RedTimer example at https://github.com/probonopd/linuxdeployqt/wiki 55 | #echo "Copying resources to ${apppath}" 56 | #mkdir -p "${apppath}/Contents/Resources/methods" 57 | #cp src/maven_core/bin/methods/* "${apppath}/Contents/Resources/methods" 58 | # TODO Should pathways be in the repo? 59 | # mkdir "${apppath}/Contents/Resources/pathways" 60 | # cp bin/pathways/* "${apppath}/Contents/Resources/pathways" 61 | #mkdir -p "${apppath}/Contents/Resources/scripts" 62 | #cp src/maven_core/bin/scripts/* "${apppath}/Contents/Resources/scripts" 63 | 64 | # Download linuxdeployqt 65 | echo "Downloading linuxdeployqt" 66 | wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" 67 | chmod a+x linuxdeployqt*.AppImage 68 | unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH 69 | 70 | echo "Running linuxdeployqt" 71 | ./linuxdeployqt*.AppImage "${binpath}" -bundle-non-qt-libs -verbose=1 72 | ./linuxdeployqt*.AppImage "${binpath}" -appimage -verbose=1 73 | # find "${bindir}" -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq 74 | #- curl --upload-file ./APPNAME*.AppImage https://transfer.sh/APPNAME-git.$(git rev-parse --short HEAD)-x86_64.AppImage 75 | ls -la "${binpath}" 76 | 77 | echo "Copying AppImage to ${distpath}" 78 | mkdir -p "${distpath}" 79 | ls -la 80 | cp -v "Maven-"*".AppImage" "${distpath}/${appimagefn}" 81 | ls -la "${distpath}" 82 | 83 | -------------------------------------------------------------------------------- /src/maven/point.h: -------------------------------------------------------------------------------- 1 | #ifndef EICPOINT_H 2 | #define EICPOINT_H 3 | 4 | #include "stable.h" 5 | #include "globals.h" 6 | #include "mainwindow.h" 7 | #include "note.h" 8 | 9 | class Peak; 10 | class PeakGroup; 11 | class MainWindow; 12 | class SpectraWidget; 13 | 14 | class EicPoint : public QObject, public QGraphicsItem { 15 | Q_OBJECT 16 | Q_INTERFACES( QGraphicsItem ) 17 | 18 | public: 19 | enum POINTSHAPE { CIRCLE, SQUARE, TRIANGLE_UP, TRIANGLE_DOWN }; 20 | EicPoint(QObject *parent = nullptr); 21 | EicPoint(float x, float y, Peak* peak, MainWindow* mw); 22 | void setColor(QColor &c) { _color = c; _pen.setColor(c); _brush.setColor(c); } 23 | void setPen(QPen &p) { _pen = p; } 24 | void setBrush(QBrush &b) { _brush = b; } 25 | void setPeakGroup(PeakGroup* g) { _group = g; } 26 | void setPeak(Peak* p) { _peak=p; } 27 | void setScan(Scan* x) { _scan=x; } 28 | Peak* getPeak() { return _peak; } 29 | PeakGroup* getPeakGroup() { return _group; } 30 | void setPointShape(POINTSHAPE shape) { pointShape=shape; } 31 | void forceFillColor(bool flag) { _forceFill = flag; } 32 | void setSize(float size) { _cSize=size; } 33 | void setVerticalOffset(int verticalOffset){_verticalOffset = verticalOffset;} 34 | 35 | enum {Type = UserType + 1}; 36 | 37 | int type() const override {return Type;} 38 | 39 | protected: 40 | QRectF boundingRect() const override; 41 | void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) override; 42 | void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) override; 43 | void mousePressEvent( QGraphicsSceneMouseEvent * event) override; 44 | void mouseDoubleClickEvent (QGraphicsSceneMouseEvent* event) override; 45 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; 46 | void contextMenuEvent ( QGraphicsSceneContextMenuEvent* event ) override; 47 | void keyPressEvent(QKeyEvent *event) override; 48 | 49 | private: 50 | float _x; 51 | float _y; 52 | Scan* _scan; 53 | Peak* _peak; 54 | PeakGroup* _group; 55 | MainWindow* _mw; 56 | QColor _color; 57 | QPen _pen; 58 | QBrush _brush; 59 | POINTSHAPE pointShape; 60 | bool _forceFill; 61 | float _cSize; 62 | QRectF _boundingRect; 63 | int _verticalOffset = 0; 64 | 65 | private slots: 66 | void bookmark(); 67 | void linkCompound(); 68 | void setClipboardToGroup(); 69 | void setClipboardToIsotopes(); 70 | 71 | signals: 72 | void peakSelected(Peak*); 73 | void peakSelectedNoShiftModifier(Peak*); 74 | void peakGroupSelected(PeakGroup*); 75 | void spectaFocused(Peak*); 76 | void peakGroupFocus(PeakGroup*); 77 | void scanSelected(Scan*); 78 | void groupClicked(PeakGroup*); 79 | void peakAndGroup(PeakAndGroup); 80 | 81 | 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/maven/forms/rconsolewidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | RconsoleWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 679 10 | 532 11 | 12 | 13 | 14 | R Script Editor 15 | 16 | 17 | 18 | 19 | 20 | 21 | Status: 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 0 32 | 33 | 34 | 35 | Output 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Error Log 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | false 59 | 60 | 61 | Save Script 62 | 63 | 64 | 65 | 66 | 67 | 68 | File: 69 | 70 | 71 | 72 | 73 | 74 | 75 | Run 76 | 77 | 78 | 79 | 80 | 81 | 82 | Load Script 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /.travis.yml.bak: -------------------------------------------------------------------------------- 1 | matrix: 2 | include: 3 | # badge code from README: 4 | # Travis: [![Build Status](https://app.travis-ci.com/eugenemel/maven.svg?branch=master)](https://app.travis-ci.com/eugenemel/maven) 5 | # Issue 762: linux build retired, mac os build now implemented in AppVeyor 6 | # - os: linux 7 | # dist: bionic 8 | # sudo: required 9 | # - os: osx 10 | # osx_image: xcode14.2 11 | addons: 12 | apt: 13 | sources: 14 | - sourceline: ppa:beineri/opt-qt-5.12.6-bionic 15 | packages: 16 | - qt512-meta-minimal 17 | - mesa-common-dev 18 | - libgl1-mesa-dev 19 | - libsqlite3-dev 20 | - libmysqlclient-dev 21 | - libssl-dev 22 | - desktop-file-utils 23 | before_install: 24 | - "./ci/travis/before_install_${TRAVIS_OS_NAME}.sh" 25 | install: 26 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 27 | sudo apt-get install -qq qt5-default qtbase5-dev qt5-qmake libqt5printsupport5; 28 | fi 29 | script: 30 | # - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source qt-5.env; fi 31 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source qt-5.env; fi 32 | - qmake -r build.pro 33 | - make -j12 34 | - make INSTALL_ROOT=appdir install 35 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then desktop-file-validate src/maven/appdir/share/applications/maven.desktop; fi 36 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./make_dist_linux.sh "src/maven/appdir/bin/Maven"; fi 37 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./make_dist_osx.sh "src/maven/appdir/bin/Maven.app"; fi 38 | 39 | # Issue 737: try to locate peakdetector executable 40 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 41 | find . -name 'peakdetector.app'; 42 | fi 43 | 44 | # Issue 737: Add peakdetector executable 45 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./make_dist_linux.sh "src/peakdetector/appdir/bin/peakdetector"; fi 46 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./make_dist_osx.sh "src/peakdetector/appdir/bin/peakdetector.app"; fi 47 | 48 | - ls -la dist/ 49 | deploy: 50 | provider: releases 51 | api_key: 52 | secure: "LFbeN64MAuMJ4fku6p9LeQIAE3NsW0hfHnH7tzQmvak2L8Eka+neVeu/HMqayhMK7PvUUq5Rg02EqJ/2NJyjjTBESpf0U9jFHZ9cWTVOtzWhFkzKdCFaBqRDczcRmZ+iIXnCBdrygdcKBtxOa+G3dw0GSmi6AgLCeKALs0F2+u2WNrpb8u32qgqZSQpDUmjUx1Dx97EUBSsdeqBEIzLd7AlE7OfU7tA5+90pyhoIutjGw7Xx/mn56aGfgQ9sPsbrk7NdNiPeMxnch9heie45jPJT4FQM7qDQ4lF3HZaKe3N1wheQeaTW4eC5evc86PBDq03z7RuKmviYOzxu9ofO9d0BF49zokjPXPbKnMH3PTTEamcNvDVBSS6GkF3Q5nwfizIiBss8PHg+KJDd3O//Ql+xnF2hfajNxV3L9mxXXxHttdLnhMF3xY3y4oZh65GJynjpEK8MhfX7sGDdB0aSl09LbhHW44enAIOvsWUObeGCfw4L/dHn5GuzVscbuS5LfV6TxnWzHHmb2IeRxjOAKpxivxwFeZl0rJL3NHnBOXgbXJn+Tiw4Y4T+V6IhHL44ImwxKgG8aXZ/ALYiznrio2IwDK4xZw6Us57T5u9gmW8/0Ym5sy8Pkl6w8yN8RXGjZCvoWsdrYale2Sq4GHAcma+PPis7pXnLA4azg2BAaVc=" 53 | file_glob: true 54 | file: 55 | - dist/Maven*.AppImage 56 | - dist/Maven*.dmg 57 | - dist/peakdetector* 58 | - dist/peakdetector*.dmg 59 | skip_cleanup: true 60 | on: 61 | repo: eugenemel/maven 62 | branch: master 63 | tags: true 64 | -------------------------------------------------------------------------------- /src/maven/forms/isotopesexportsettings.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 377 10 | 162 11 | 12 | 13 | 14 | Isotopes Export Settings 15 | 16 | 17 | 18 | 19 | 20 | Isotopic Abundance Format 21 | 22 | 23 | 24 | 25 | 26 | Absolute Abundance 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | Fractional Abundance 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Perform Natural Isotopic Abundance Correction 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | 55 | 56 | Qt::Horizontal 57 | 58 | 59 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | boxBtn 69 | accepted() 70 | Dialog 71 | accept() 72 | 73 | 74 | 248 75 | 254 76 | 77 | 78 | 157 79 | 274 80 | 81 | 82 | 83 | 84 | boxBtn 85 | rejected() 86 | Dialog 87 | reject() 88 | 89 | 90 | 316 91 | 260 92 | 93 | 94 | 286 95 | 274 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/maven/classifier.cpp: -------------------------------------------------------------------------------- 1 | #include "mzSample.h" 2 | #include 3 | 4 | Classifier::Classifier() {} 5 | Classifier::~Classifier() {} 6 | 7 | 8 | vector Classifier::removeRedundacy(vector&peaks) { 9 | 10 | vector nrPeaks; 11 | if(peaks.size()>0) nrPeaks.push_back(peaks[0]); 12 | 13 | for(unsigned int i=1; iA = getFeatures(*p1); 16 | 17 | bool unique=true; 18 | for(unsigned int j=0; j B = getFeatures(*p2); 21 | 22 | float rss=0; 23 | for(int k=0; k < num_features;k++) rss +=POW2(A[k]-B[k]); 24 | rss /= num_features; 25 | if (rss < 0.02) { unique=false; break; } 26 | } 27 | 28 | if (unique) nrPeaks.push_back(p1); 29 | } 30 | cerr << "removeRedundacy() " << nrPeaks.size() << " " << peaks.size() << endl; 31 | return nrPeaks; 32 | } 33 | 34 | void Classifier::saveFeatures(vector& groups, string filename) { 35 | ofstream fout(filename.c_str()); 36 | 37 | //print out header 38 | if ( features_names.size() > 0 ) { 39 | fout << "class,groupId,quality,"; 40 | for(int i=0; i < num_features;i++ ) { fout << features_names[i]; if(i+1peaks.size(); j++ ) { 48 | vector features = getFeatures(grp->peaks[j]); 49 | fout << grp->peaks[j].label << ","; 50 | fout << grp->groupId << ","; 51 | fout << grp->peaks[j].quality << ","; 52 | for(int i=0; i < num_features;i++ ) { fout << features[i]; if(i+1 < num_features) fout << ","; } 53 | fout << endl; 54 | } 55 | } 56 | fout.close(); 57 | } 58 | 59 | 60 | void Classifier::classify(vector& groups) { 61 | for(unsigned int i=0; i < groups.size(); i++ ) { PeakGroup* grp = groups[i]; classify(grp); } 62 | } 63 | 64 | void Classifier::printLabelDistribution() { 65 | mapcounts; 66 | map::iterator itr; 67 | 68 | for (unsigned int i=0; i < labels.size(); i++ ) counts[labels[i]]++; 69 | cerr << "refineModel FEATURES=" << labels.size() << endl; 70 | for (itr = counts.begin(); itr != counts.end(); itr++ ) { 71 | cerr << "\t\t label=" << (*itr).first << " count=" << (*itr).second << endl; 72 | } 73 | 74 | cerr << "\tfeature\t\tClass=b\t\tClass=g" << endl; 75 | for(unsigned int jj=0; jj < num_features; jj++ ) { 76 | StatisticsVectordistG; 77 | StatisticsVectordistB; 78 | for(unsigned int ii=0; ii < labels.size(); ii++ ) { 79 | if ( labels[ii]== 'g' ) distG.push_back(FEATURES[ii][jj]); 80 | else if (labels[ii]== 'b' ) distB.push_back(FEATURES[ii][jj]); 81 | } 82 | cerr << setprecision(3) << features_names[jj] << "\t\t" << distB.mean() << "+/-" << distB.stddev() 83 | << "\t\t" << distG.mean() << "+/-" << distG.stddev() << endl; 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/maven/forms/filtertagsdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | filterTagsDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 895 10 | 441 11 | 12 | 13 | 14 | Set Peak Group Tag Filter 15 | 16 | 17 | 18 | 19 | 20 | Apply Filter 21 | 22 | 23 | 24 | 25 | 26 | 27 | 6 28 | 29 | 30 | true 31 | 32 | 33 | 34 | visible 35 | 36 | 37 | 38 | 39 | tag name 40 | 41 | 42 | 43 | 44 | label 45 | 46 | 47 | 48 | 49 | hotkey 50 | 51 | 52 | 53 | 54 | icon 55 | 56 | 57 | 58 | 59 | description 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Deselect All 68 | 69 | 70 | 71 | 72 | 73 | 74 | Select All 75 | 76 | 77 | 78 | 79 | 80 | 81 | Cancel 82 | 83 | 84 | 85 | 86 | 87 | 88 | Clear Filter 89 | 90 | 91 | 92 | 93 | 94 | 95 | Peak Groups are not filtered until 'Apply Filter' or 'Clear Filter' button is pushed. 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/maven/highlighter.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 | ** All rights reserved. 5 | ** Contact: Nokia Corporation (qt-info@nokia.com) 6 | ** 7 | ** This file is part of the examples of the Qt Toolkit. 8 | ** 9 | ** $QT_BEGIN_LICENSE:BSD$ 10 | ** You may use this file under the terms of the BSD license as follows: 11 | ** 12 | ** "Redistribution and use in source and binary forms, with or without 13 | ** modification, are permitted provided that the following conditions are 14 | ** met: 15 | ** * Redistributions of source code must retain the above copyright 16 | ** notice, this list of conditions and the following disclaimer. 17 | ** * Redistributions in binary form must reproduce the above copyright 18 | ** notice, this list of conditions and the following disclaimer in 19 | ** the documentation and/or other materials provided with the 20 | ** distribution. 21 | ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor 22 | ** the names of its contributors may be used to endorse or promote 23 | ** products derived from this software without specific prior written 24 | ** permission. 25 | ** 26 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #ifndef HIGHLIGHTER_H 42 | #define HIGHLIGHTER_H 43 | 44 | #include 45 | 46 | #include 47 | #include 48 | 49 | QT_BEGIN_NAMESPACE 50 | class QTextDocument; 51 | QT_END_NAMESPACE 52 | 53 | //! [0] 54 | class Highlighter : public QSyntaxHighlighter 55 | { 56 | Q_OBJECT 57 | 58 | public: 59 | Highlighter(QTextDocument *parent = 0); 60 | 61 | protected: 62 | void highlightBlock(const QString &text); 63 | 64 | private: 65 | struct HighlightingRule 66 | { 67 | QRegExp pattern; 68 | QTextCharFormat format; 69 | }; 70 | QVector highlightingRules; 71 | 72 | QRegExp commentStartExpression; 73 | QRegExp commentEndExpression; 74 | 75 | QTextCharFormat constantFormat; 76 | QTextCharFormat keywordFormat; 77 | QTextCharFormat classFormat; 78 | QTextCharFormat singleLineCommentFormat; 79 | QTextCharFormat multiLineCommentFormat; 80 | QTextCharFormat quotationFormat; 81 | QTextCharFormat functionFormat; 82 | }; 83 | //! [0] 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /src/maven/forms/isotopeswidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | isotopesWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 554 10 | 412 11 | 12 | 13 | 14 | 15 | 524287 16 | 524287 17 | 18 | 19 | 20 | Isotopes 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 0 29 | 0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Sample: 38 | 39 | 40 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Adduct: 51 | 52 | 53 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 54 | 55 | 56 | 57 | 58 | 59 | 60 | export 61 | 62 | 63 | 64 | 65 | 66 | 67 | Formula: 68 | 69 | 70 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 1 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 0 88 | 0 89 | 90 | 91 | 92 | 93 | Select Sample 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/maven/line.cpp: -------------------------------------------------------------------------------- 1 | #include "line.h" 2 | 3 | EicLine::EicLine(QGraphicsItem* parent, QGraphicsScene *scene, MainWindow* mainwindow): QGraphicsItem(parent) 4 | { 5 | setHighlighted(false); 6 | setAcceptHoverEvents(false); 7 | 8 | _endsFixed=false; 9 | _fillPath=false; 10 | _closePath=true; 11 | _eic=nullptr; 12 | 13 | //Issue 374 14 | _emphasizePoints = false; 15 | 16 | if(scene) scene->addItem(this); 17 | 18 | _mainwindow = mainwindow; 19 | } 20 | 21 | QRectF EicLine::boundingRect() const 22 | { 23 | 24 | return(_line.boundingRect()); 25 | } 26 | void EicLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) 27 | { 28 | // qDebug() << "EicLine::paint()" << _line.isClosed() << " " << _line.size(); 29 | 30 | //creates closed path from end point, to base, and from base up to start point 31 | if (_closePath == true && _endsFixed == false) fixEnds(); 32 | painter->setPen(_pen); 33 | painter->setBrush(_brush); 34 | 35 | if (isHighlighed()) { 36 | QPen pen = _pen; 37 | pen.setWidth( pen.width() + 2 ) ; 38 | painter->setPen(pen); 39 | } 40 | 41 | //Issue 374: User intuition is to always show polygon 42 | painter->drawPolygon(_line); 43 | 44 | // if (_fillPath) painter->drawPolygon(_line); 45 | // //else painter->drawPolyline(_line); 46 | // else painter->drawLines(_line); 47 | 48 | if (_emphasizePoints) { 49 | 50 | if (_mainwindow) { 51 | painter->setPen(QPen(_mainwindow->getBackgroundAdjustedBlack(_mainwindow->spectraWidget))); 52 | painter->setBrush(QBrush(_mainwindow->getBackgroundAdjustedBlack(_mainwindow->spectraWidget))); 53 | } else { 54 | painter->setPen(QPen(Qt::black)); 55 | painter->setBrush(QBrush(Qt::black)); 56 | } 57 | 58 | int paintDiameter = 5; 59 | 60 | //blackPen.setWidth(blackPen.width() + 5) ; 61 | 62 | for (auto& point : _line) { 63 | painter->drawEllipse(static_cast(point.x()-paintDiameter/2), 64 | static_cast(point.y()-paintDiameter/2), 65 | paintDiameter, 66 | paintDiameter); 67 | } 68 | } 69 | 70 | } 71 | 72 | QPainterPath EicLine::shape() const 73 | { 74 | QPainterPath path; 75 | path.addPolygon(_line); 76 | return path; 77 | } 78 | 79 | void EicLine::hoverEnterEvent (QGraphicsSceneHoverEvent*event ) { 80 | qDebug() << "EicLine:: HoverEntered.."; 81 | QGraphicsItem::hoverEnterEvent(event); 82 | setHighlighted(true); 83 | setZValue(zValue()+1); 84 | scene()->update(); 85 | } 86 | 87 | 88 | void EicLine::hoverLeaveEvent ( QGraphicsSceneHoverEvent*) { 89 | setHighlighted(false); 90 | setZValue(zValue()-1); 91 | scene()->update(); 92 | } 93 | 94 | 95 | void EicLine::fixEnds() { 96 | 97 | if(_line.size() < 1) return; 98 | if (! scene()) return; 99 | QPointF p1 = _line[0]; 100 | QPointF p2 = _line[_line.size()-1]; 101 | QPointF a(p2.x(),scene()->height()+_verticalOffset); 102 | QPointF b(p1.x(),scene()->height()+_verticalOffset); 103 | _line.append(a); 104 | _line.append(b); 105 | _line.append(p1); 106 | _endsFixed=true; 107 | } 108 | -------------------------------------------------------------------------------- /make_dist_win32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo "Starting maven_dist_win32.sh." 5 | 6 | #Set Script Name variable 7 | SCRIPT=`basename ${BASH_SOURCE[0]}` 8 | 9 | #Set fonts for Help. 10 | NORM=`tput sgr0` 11 | BOLD=`tput bold` 12 | REV=`tput smso` 13 | 14 | #Help function 15 | function HELP { 16 | echo -e \\n"${REV}Basic usage:${NORM} ${BOLD}$SCRIPT file.exe${NORM}"\\n 17 | echo -e "${REV}-h${NORM} --Displays this help message. No further functions are performed."\\n 18 | echo -e "Example: ${BOLD}$SCRIPT \"appdir/bin/Maven.exe\"${NORM}"\\n 19 | exit 1 20 | } 21 | 22 | #Check the number of arguments. If none are passed, print help and exit. 23 | NUMARGS=$# 24 | if [ $NUMARGS -eq 0 ]; then 25 | HELP 26 | fi 27 | 28 | # A POSIX variable 29 | OPTIND=1 # Reset in case getopts has been used previously in the shell. 30 | 31 | # Initialize our own variables: 32 | 33 | while getopts "h?f:" opt; do 34 | case "$opt" in 35 | h|\?) 36 | show_help 37 | exit 0 38 | ;; 39 | esac 40 | done 41 | 42 | shift $((OPTIND-1)) #This tells getopts to move on to the next argument. 43 | 44 | echo "Attempting to determine version..." 45 | GIT_VERSION=$(src/maven/get_version.sh) 46 | echo "Version: "${GIT_VERSION} 47 | 48 | exepath=$1 49 | exefn="${exepath##*/}" 50 | distpath="dist/${exefn%.exe}-Windows" 51 | zipfn="${exefn%.exe}_${GIT_VERSION}-Windows.zip" 52 | 53 | # Issue 737: avoid clearing out old paths 54 | # rm -rf "${distpath}" 55 | # mkdir -p "${distpath}" 56 | if [ ! -d ${distpath} ]; then 57 | mkdir -p "${distpath}" 58 | fi 59 | 60 | # Issue 794: 61 | # windeployqt copies all qt dependencies into the artifact bundle. 62 | # However, non-qt dependencies are necessary, such as zlib. 63 | # ldd copies all direct dependencies of the executable. 64 | # sqlite3 somehow slips through the cracks: windeployqt correctly copies qsqlite3.dll, 65 | # but misses the fact that qsqlite3.dll is only a symbolic link to libsqlite3-0.dll. 66 | # ldd sees that libsqlite3-0.dll is not a direct dependency of the exectuable, so skips over 67 | # this library. 68 | # The simplest solution is just to manually copy over libsqlite3-0.dll 69 | 70 | # [1] windeployqt: handles direct QT dependencies 71 | echo "Preparing to run windeployqt.exe..." 72 | windeployqt.exe "${exepath}" --dir "${distpath}" 73 | echo "Successfully executed windeployqt.exe" 74 | 75 | # [2] Ask the executable about non-qt dependencies, and copy them 76 | # Issue 794: Explicitly avoid qt libs and plugins, letting windeployqt handle those. 77 | for f in $(ldd "${exepath}" | awk '{print $3}' | grep 'mingw64' | grep -v 'Qt5' | grep -v 'plugins'); do 78 | b=${f##*/} 79 | cp -v "${f}" "${distpath}/${b}" 80 | done 81 | 82 | # [3] manually copy sqlite3, which is skipped over by both windeployqt and ldd. 83 | echo "Manually copying libsqlite3-0.dll" 84 | cp -v /c/msys64/mingw64/bin/libsqlite3-0.dll "${distpath}/" 85 | 86 | mkdir -p "${distpath}/methods" 87 | cp -v src/maven_core/bin/methods/* "${distpath}/methods" 88 | # mkdir -p "${distpath}/pathways" 89 | # cp -v bin/pathways/* "${distpath}/pathways" 90 | mkdir -p "${distpath}/scripts" 91 | cp -v src/maven_core/bin/scripts/* "${distpath}/scripts" 92 | cp -v "${exepath}" "${distpath}/" 93 | 94 | rm -rf "dist/${zipfn}" 95 | (cd "${distpath}" && 7z a -tzip "../${zipfn}" *) 96 | 97 | echo "make_dist_win32: All Processes Succcessfully Completed!" 98 | -------------------------------------------------------------------------------- /src/maven/projectdockwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef PROJECTDOCKWIDGET_H 2 | #define PROJECTDOCKWIDGET_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | #include "projectDB.h" 8 | #include "mzfileio.h" 9 | 10 | class mzFileIO; 11 | 12 | class ProjectDockWidget : public QDockWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit ProjectDockWidget(QMainWindow *parent = 0); 17 | QColor getSampleColor(mzSample* sample); 18 | QIcon getSampleIcon(mzSample* sample); 19 | ProjectDB* currentProject; 20 | 21 | public slots: 22 | void showInfo(); 23 | void setInfo(vector&samples); 24 | void changeSampleOrder(); 25 | void updateSampleList(); 26 | void loadProject(); 27 | void saveProject(); 28 | void saveProjectAs(); 29 | void closeProject(); 30 | void loadAllPeakTables(); 31 | void loadProjectSQLITE(QString filename); 32 | void saveProjectSQLITE(QString filename); 33 | 34 | void loadProjectXML(QString filename); 35 | void saveProjectXML(QString filename, TableDockWidget* peakTable = 0); 36 | void allSamplesVisible(); 37 | void allSamplesInvisible(); 38 | void toggleSelectedSamples(); 39 | void toggleSamplesVisibility(QTreeWidgetItem *item, bool isVisible); 40 | void toggleSelectedSampleVisibility(QTreeWidgetItem *item); 41 | 42 | void refreshSamplesListInOtherWidgets(); 43 | 44 | protected slots: 45 | void keyPressEvent( QKeyEvent *e ); 46 | void contextMenuEvent ( QContextMenuEvent * event ); 47 | 48 | private slots: 49 | void showSample(QTreeWidgetItem* item, int col); 50 | void showSampleInfo(QTreeWidgetItem* item, int col); 51 | void changeSampleColor(QTreeWidgetItem* item, int col); 52 | void changeNormalizationConstant(QTreeWidgetItem* item, int col); 53 | void changeSampleSet(QTreeWidgetItem* item, int col); 54 | void selectSample(QTreeWidgetItem* item, int col); 55 | void changeColors(); 56 | void setSampleColor(QTreeWidgetItem* item, QColor color); 57 | void unloadSample(); 58 | void unloadAllSamples(); 59 | void filterTreeItems(QString filterString); 60 | void getSampleInfoSQLITE(); 61 | void warnUserEmptySampleFiles(); 62 | void importSampleMetadata(); 63 | void exportSampleMetadata(); 64 | void computeGroupStatistics(PeakGroup& peakGroup); 65 | 66 | private: 67 | QTreeWidgetItem* getParentFolder(QString filename); 68 | QMap parentMap; 69 | MainWindow* _mainwindow; 70 | QTreeWidget* _treeWidget; 71 | 72 | QString lastOpennedProject; 73 | QString lastSavedProject; 74 | QColor lastUsedSampleColor; 75 | 76 | mzFileIO* fileLoader; 77 | 78 | }; 79 | 80 | class SampleTreeWidget : public QTreeWidget{ 81 | Q_OBJECT 82 | 83 | public: 84 | SampleTreeWidget(QWidget *parent = nullptr) : QTreeWidget(parent){ 85 | setDragEnabled(true); 86 | setDragDropMode(QAbstractItemView::InternalMove); 87 | } 88 | 89 | protected: 90 | void dropEvent(QDropEvent *event) { 91 | QTreeWidget::dropEvent(event); 92 | emit(sampleTreeWidgetDropEvent()); 93 | } 94 | 95 | signals: 96 | void sampleTreeWidgetDropEvent(); 97 | }; 98 | 99 | #endif // PROJECTDOCKWIDGET_H 100 | -------------------------------------------------------------------------------- /src/maven/forms/librarydialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | librarydialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 466 10 | 348 11 | 12 | 13 | 14 | Library Manager 15 | 16 | 17 | false 18 | 19 | 20 | false 21 | 22 | 23 | 24 | 25 | 26 | Load 27 | 28 | 29 | 30 | 31 | 32 | 33 | Unload 34 | 35 | 36 | 37 | 38 | 39 | 40 | QAbstractItemView::MultiSelection 41 | 42 | 43 | true 44 | 45 | 46 | true 47 | 48 | 49 | 50 | Library 51 | 52 | 53 | 54 | 55 | #Records 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | Reload All 64 | 65 | 66 | 67 | 68 | 69 | 70 | Unload All 71 | 72 | 73 | 74 | 75 | 76 | 77 | Import New Library 78 | 79 | 80 | 81 | 82 | 83 | 84 | Delete Library 85 | 86 | 87 | 88 | 89 | 90 | 91 | Search 92 | 93 | 94 | 95 | 96 | 97 | 98 | Library Manager - Manage Existing and New Databases / Spectra 99 | 100 | 101 | 102 | 103 | 104 | 105 | Close 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/maven/configurediffisotopesearch.cpp: -------------------------------------------------------------------------------- 1 | #include "configurediffisotopesearch.h" 2 | #include "globals.h" 3 | 4 | ConfigureDiffIsotopeSearch::ConfigureDiffIsotopeSearch(QWidget *parent) : 5 | QDialog(parent) { 6 | setupUi(this); 7 | setModal(false); 8 | } 9 | 10 | void ConfigureDiffIsotopeSearch::bringIntoView(){ 11 | if (isVisible()){ 12 | show(); 13 | raise(); 14 | activateWindow(); 15 | } else { 16 | show(); 17 | } 18 | } 19 | 20 | void ConfigureDiffIsotopeSearch::resetSamples(vector loadedSamples) { 21 | this->listAvailableSamples->clear(); 22 | this->listLabeledSamples->clear(); 23 | this->listUnlabeledSamples->clear(); 24 | 25 | this->populateSamples(loadedSamples); 26 | } 27 | 28 | /** 29 | * @brief ConfigureDiffIsotopeSearch::populateSamples 30 | * @param loadedSamples 31 | * 32 | * Note that everything is done with sample names, because attaching the samples themselves to the items 33 | * would require subclassing QListWidgetItem. 34 | * Instead, cross-reference the sample names to the list of samples stored in the main window. 35 | */ 36 | void ConfigureDiffIsotopeSearch::populateSamples(vector loadedSamples){ 37 | 38 | bool isSampleProcessed = false; 39 | 40 | for (mzSample* sample : loadedSamples) { 41 | 42 | //should never happen, but guard against possible NPE 43 | if (!sample) continue; 44 | 45 | //check unlabeled samples 46 | isSampleProcessed = this->isSampleInListWidget(sample, this->listUnlabeledSamples); 47 | if (isSampleProcessed) continue; 48 | 49 | //check labeled samples 50 | isSampleProcessed = this->isSampleInListWidget(sample, this->listLabeledSamples); 51 | if (isSampleProcessed) continue; 52 | 53 | //check unassigned samples 54 | isSampleProcessed = this->isSampleInListWidget(sample, this->listAvailableSamples); 55 | if (isSampleProcessed) continue; 56 | 57 | //Add sample item to list of unassigned samples 58 | QListWidgetItem *item = new QListWidgetItem(sample->sampleName.c_str()); 59 | this->listAvailableSamples->addItem(item); 60 | } 61 | } 62 | 63 | bool ConfigureDiffIsotopeSearch::isSampleInListWidget(mzSample* sample, QListWidget *widget){ 64 | if (!sample) return (false); 65 | 66 | bool isSampleInListWidget = false; 67 | 68 | for (unsigned int i = 0; i < widget->count(); i++) { 69 | 70 | QListWidgetItem *item = widget->item(i); 71 | string itemSampleName = item->text().toStdString(); 72 | 73 | if (itemSampleName == sample->sampleName) { 74 | isSampleInListWidget = true; 75 | break; 76 | } 77 | } 78 | 79 | return isSampleInListWidget; 80 | } 81 | 82 | vector ConfigureDiffIsotopeSearch::getUnlabeledSamples(vector loadedSamples) { 83 | vector unlabeledSamples{}; 84 | 85 | for (mzSample * sample : loadedSamples) { 86 | if (this->isSampleInListWidget(sample, this->listUnlabeledSamples)) { 87 | unlabeledSamples.push_back(sample); 88 | } 89 | } 90 | 91 | return unlabeledSamples; 92 | } 93 | 94 | vector ConfigureDiffIsotopeSearch::getLabeledSamples(vector loadedSamples) { 95 | vector labeledSamples{}; 96 | 97 | for (mzSample * sample : loadedSamples) { 98 | if (this->isSampleInListWidget(sample, this->listLabeledSamples)) { 99 | labeledSamples.push_back(sample); 100 | } 101 | } 102 | 103 | return labeledSamples; 104 | } 105 | -------------------------------------------------------------------------------- /src/maven/treedockwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TREEDOCKWIDGET_H 2 | #define TREEDOCKWIDGET_H 3 | 4 | #include "stable.h" 5 | #include "mzSample.h" 6 | #include "mainwindow.h" 7 | 8 | class MainWindow; 9 | 10 | //Issue 583 11 | class TreeDockWidgetMs1FilterOptions { 12 | public: 13 | 14 | bool isLimitScans = false; 15 | unsigned long numScansLimit; 16 | 17 | QString txtNameFilter; 18 | 19 | float minRt; 20 | float maxRt; 21 | }; 22 | 23 | using namespace std; 24 | 25 | class TreeDockWidget: public QDockWidget { 26 | Q_OBJECT 27 | 28 | public: 29 | QWidget *dockWidgetContents; 30 | QHBoxLayout *horizontalLayout; 31 | QTreeWidget *treeWidget; 32 | 33 | TreeDockWidget(MainWindow*, QString title, int numColms); 34 | 35 | //this->treeWidget will contain items only of this type 36 | inline void setExclusiveItemType(int exclusiveItemType){this->exclusiveItemType = exclusiveItemType;} 37 | 38 | TreeDockWidgetMs1FilterOptions getTreeDockWidgetMs1FilterOptions(); 39 | 40 | public slots: 41 | //void showInfo(PeakGroup* group); 42 | QTreeWidgetItem* addItem(QTreeWidgetItem* parentItem, string key, float value, int type); 43 | QTreeWidgetItem* addItem(QTreeWidgetItem* parentItem, string key, string value, int type); 44 | 45 | 46 | void showInfo(bool isUpdateMassCalcGUI=false); 47 | void showInfoAndUpdateMassCalcGUI(); 48 | 49 | void setInfo(Peak* peak); 50 | void setInfo(PeakGroup* group); 51 | void setInfo(Compound* c); 52 | void setInfo(vector&compounds); 53 | void setInfo(double ms1PrecMz, double ms2PrecMz); 54 | void setInfo(vector& srmTransitions); 55 | void setInfo(set& srmIds); 56 | 57 | void setInfo(vector& peakLinks, 58 | float peakRootRt, 59 | QString peakRootNote, 60 | vector& groupLinks, 61 | float groupRootRt, 62 | QString groupRootNote); 63 | 64 | void setupScanListHeader(); 65 | void setupConsensusScanListHeader(); 66 | void setupMs1ScanHeader(); 67 | void setupMs3ScanHeader(); 68 | void setupSRMTransitionListHeader(); 69 | 70 | void addScanItem(Scan* scan); 71 | void addMs1ScanItem(Scan *scan); 72 | void addMs3ScanItem(Scan *scan); 73 | void addMs2ScanVectorItem(vector scans); 74 | 75 | void addMs1TitleBar(); 76 | void addMs3TitleBar(); 77 | void ms3SearchFromSpinBoxes(); 78 | 79 | void clearTree(); 80 | void filterTree(QString needle); 81 | void copyToClipbard(); 82 | 83 | bool hasPeakGroup(PeakGroup* group); 84 | 85 | void selectMs2Scans(Peak *peak); 86 | void selectMs2Scans(PeakGroup *group); 87 | void selectMs2Scans(Scan *scan); 88 | 89 | protected slots: 90 | void keyPressEvent(QKeyEvent *e ); 91 | void contextMenuEvent ( QContextMenuEvent *e ); 92 | 93 | private slots: 94 | QTreeWidgetItem* addPeakGroup(PeakGroup* group, QTreeWidgetItem* parent); 95 | QTreeWidgetItem* addPeak(Peak* peak, QTreeWidgetItem* parent); 96 | QTreeWidgetItem* addCompound(Compound* c, QTreeWidgetItem* parent); 97 | QTreeWidgetItem* addSlice(mzSlice* s,QTreeWidgetItem* parent); 98 | QTreeWidgetItem* addLink(mzLink* s, QTreeWidgetItem* parent); 99 | 100 | void unlinkGroup(); 101 | 102 | private: 103 | void itemToClipboard(QTreeWidgetItem* item, QString& clipboardtext); 104 | int exclusiveItemType = -1; //this->treeWidget should only contain items of this type. If -1, any type. 105 | 106 | MainWindow* _mw = nullptr; 107 | QDoubleSpinBox *ms1PrecMzSpn = nullptr; 108 | QDoubleSpinBox *ms2PrecMzSpn = nullptr; 109 | 110 | QDoubleSpinBox *spnRtMin = nullptr; 111 | QDoubleSpinBox *spnRtMax = nullptr; 112 | QSpinBox *spnLimit = nullptr; 113 | QCheckBox *chkLimitScans = nullptr; 114 | QPushButton *btnFilterMs1Scans = nullptr; 115 | QLineEdit *txtSampleFilter = nullptr; 116 | 117 | }; 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /src/maven/images/autofocus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 34 | 35 | 53 | 55 | 56 | 58 | image/svg+xml 59 | 61 | 62 | 63 | 64 | 65 | 69 | 81 | 89 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/maven/plot_axes.cpp: -------------------------------------------------------------------------------- 1 | #include "plot_axes.h" 2 | 3 | Axes::Axes( int type, float min, float max, int nticks, MainWindow *mainwindow) { 4 | this->type = type; 5 | this->min = min; 6 | this->max = max; 7 | this->nticks = nticks; 8 | this->mainwindow = mainwindow; 9 | this->offset=0; 10 | this->margin=0; 11 | this->tickLinesFlag=false; 12 | } 13 | 14 | QRectF Axes::boundingRect() const 15 | { 16 | 17 | int textmargin=50; 18 | if (!scene())return QRectF(0,0,0,0); 19 | 20 | if(type == 0 ) { 21 | return(QRectF(0,scene()->height()-textmargin,scene()->width(),scene()->height()-textmargin)); 22 | } else { 23 | return(QRectF(0,0,+textmargin,scene()->height()+textmargin)); 24 | } 25 | } 26 | 27 | void Axes::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) 28 | { 29 | QPen pen(Qt::darkGray, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); 30 | painter->setPen(pen); 31 | 32 | //Issue 730: retrieve this from settings 33 | double fontsize = mainwindow->getSettings()->value("spnAxesTextSize", 12).toDouble(); 34 | 35 | QFont font("Helvetica",fontsize); 36 | font.setBold(true); 37 | painter->setFont(font); 38 | 39 | if (nticks == 0 ) nticks = 2; 40 | int x0 = margin; 41 | int x1 = scene()->width()-margin; 42 | 43 | int Y0=scene()->height()-offset; 44 | int X0=margin+offset; 45 | 46 | float range = (max-min); 47 | float expbase = pow(10,floor( log(range/nticks)/log(10) ) ); 48 | float b; 49 | for(int i=0; i<10; i+=1) { b=i*expbase; if (b>range/nticks) break; } 50 | 51 | float ticks = range/b; 52 | float ix = (x1-x0)/ticks; 53 | 54 | int lastTickTextHeight = 20; 55 | int y0 = rint((scene()->height()-margin) * (1.0f - renderOffset)); 56 | int y1 = margin+lastTickTextHeight+offset+verticalOffset; 57 | 58 | float yRange = y1-y0; 59 | float iy = yRange/nticks; //independent variable, use slope to find corresponding intensities 60 | 61 | float intensityCoordMin = (min/renderScale) * (1 - (y0/(scene()->height())) - renderOffset); 62 | float intensityCoordMax = (max/renderScale) * (1 - (y1/(scene()->height())) - renderOffset); 63 | 64 | // //(x1, y1) = (y0, intensityCoordMin) and (x2, y2) = (y1, intensityCoordMax) 65 | float m = (intensityCoordMax-intensityCoordMin)/(y1-y0); 66 | float y_intercept = min - m * y0; 67 | 68 | ticks = nticks; 69 | 70 | if ( b <= 0 ) return; 71 | 72 | if ( type == 0) { //X axes 73 | painter->drawLine(x0,Y0,x1,Y0); 74 | for (int i=0; i <= ticks; i++ ){ 75 | 76 | float xCoord = x0+ix*i; 77 | 78 | if (xCoord > x1) continue; 79 | 80 | painter->drawLine(static_cast(xCoord),Y0-5,static_cast(xCoord),Y0+5); 81 | painter->drawText(static_cast(xCoord),Y0+12,QString::number(min+b*i,'f',2)); 82 | } 83 | } else if ( type == 1 ) { //Y axes 84 | 85 | painter->drawLine(X0,y0,X0,y1); 86 | 87 | for (int i=0; i <= ticks; i++ ) { 88 | painter->drawLine(X0-5,y0+iy*i,X0+5,y0+iy*i); 89 | } 90 | 91 | for (int i=0; i <= ticks; i++ ) { 92 | 93 | int axisCoord = y0+iy*i; 94 | 95 | float val = m*axisCoord + y_intercept; 96 | 97 | QString value; 98 | 99 | if ( max < 10000 ) { 100 | value = QString::number(val,'f',1); 101 | } else { 102 | value = QString::number(val,'g',2); 103 | } 104 | 105 | painter->drawText(X0+2,axisCoord,value); 106 | 107 | // qDebug() << "TEXT=" << value << " scene()->height()=" << scene()->height() << " m=" << m << " b=" << y_intercept << " intensityCoordMax=" << intensityCoordMax 108 | // << " @ y0=" << y0 <<", Y0=" << Y0 << "y1= " << y1 << "y()" << y() << ", margin=" << margin << ", i=" << i << ", iy=" << iy 109 | // << ", iy*i=" << iy*i << ", y0+iy*i=" << y0+iy*i; 110 | } 111 | 112 | if(tickLinesFlag) { 113 | //horizontal tick lines 114 | QPen pen(Qt::gray, 0.1,Qt::DotLine); 115 | painter->setPen(pen); 116 | for (int i=0; i <= ticks; i++ ) painter->drawLine(X0-5,y0+iy*i,x1,y0+iy*i); 117 | } 118 | } 119 | //painter->drawText(posX-10,posY-3,QString( eics[i]->sampleName.c_str() )); 120 | } 121 | 122 | -------------------------------------------------------------------------------- /src/maven/forms/clusterdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ClusterDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 398 10 | 246 11 | 12 | 13 | 14 | Cluster PeakGroups 15 | 16 | 17 | 18 | 19 | 20 | Cluster 21 | 22 | 23 | 24 | 25 | 26 | 27 | Peak Group Clustering 28 | 29 | 30 | 31 | 32 | 33 | Group - Group Max Rt Difference 34 | 35 | 36 | 37 | 38 | 39 | 40 | -1.000000000000000 41 | 42 | 43 | 1.000000000000000 44 | 45 | 46 | 0.100000000000000 47 | 48 | 49 | 0.800000000000000 50 | 51 | 52 | 53 | 54 | 55 | 56 | min 57 | 58 | 59 | 1000.000000000000000 60 | 61 | 62 | 0.100000000000000 63 | 64 | 65 | 0.500000000000000 66 | 67 | 68 | 69 | 70 | 71 | 72 | Sample Intensity Correlation 73 | 74 | 75 | 76 | 77 | 78 | 79 | Peak Shape Correlation 80 | 81 | 82 | 83 | 84 | 85 | 86 | -1.000000000000000 87 | 88 | 89 | 1.000000000000000 90 | 91 | 92 | 0.100000000000000 93 | 94 | 95 | 0.600000000000000 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | Clear Clusters 106 | 107 | 108 | 109 | 110 | 111 | 112 | Peak Group Display 113 | 114 | 115 | 116 | 117 | 20 118 | 30 119 | 331 120 | 20 121 | 122 | 123 | 124 | All peak groups are displayed at same level 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /src/maven/forms/setrumsDBdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | setrumsDBDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 771 10 | 285 11 | 12 | 13 | 14 | mzrollDB Loading Options 15 | 16 | 17 | 18 | 19 | 20 | compound loading options 21 | 22 | 23 | 24 | 25 | 26 | Automatically load full spectral libraries referenced in mzrollDB file 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | Automatically load compounds that match to peak groups in mzrollDB file 37 | 38 | 39 | true 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | mzkitchen options 50 | 51 | 52 | false 53 | 54 | 55 | false 56 | 57 | 58 | 59 | 60 | 61 | 62 | 0 63 | 0 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | clamDB / rumsDB library: 72 | 73 | 74 | 75 | 76 | 77 | 78 | If the library was not generated by mzkitchen, the association will not work 79 | 80 | 81 | If this mzrollDB was generated by mzkitchen, select the msp library file generated by that mzkitchen run. 82 | 83 | 84 | 85 | 86 | 87 | 88 | Launch Library Dialog 89 | 90 | 91 | 92 | 93 | 94 | 95 | Add clamDB / rumsDB library: 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | Use Selected Library 106 | 107 | 108 | 109 | 110 | 111 | 112 | Proceed without library 113 | 114 | 115 | 116 | 117 | 118 | 119 | Cancel 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /src/maven/ligandwidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2008 by melamud,,, * 3 | * emelamud@princeton.edu * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef LIGANDWIDGET_H 23 | #define LIGANDWIDGET_H 24 | 25 | #include "globals.h" 26 | #include "stable.h" 27 | #include "mainwindow.h" 28 | #include "numeric_treewidgetitem.h" 29 | #include 30 | #include 31 | 32 | class QAction; 33 | class QMenu; 34 | class QTextEdit; 35 | class MainWindow; 36 | class Database; 37 | 38 | 39 | using namespace std; 40 | 41 | extern Database DB; 42 | 43 | class LigandWidget; 44 | 45 | class LigandWidgetTreeBuilder : public QThread { 46 | Q_OBJECT 47 | 48 | public: 49 | LigandWidgetTreeBuilder(LigandWidget* ligandWidget){ 50 | this->ligandWidget = ligandWidget; 51 | } 52 | ~LigandWidgetTreeBuilder(){ 53 | wait(); 54 | } 55 | 56 | protected: 57 | void run(void); 58 | 59 | public: 60 | LigandWidget *ligandWidget; 61 | 62 | signals: 63 | void updateProgress(int, QString); 64 | void sendCompoundToTree(Compound*); 65 | void toggleEnabling(bool); 66 | void completed(); 67 | }; 68 | 69 | static const QString SELECT_DB = QString("-- Select Database --"); 70 | static const QString INITIAL_PRG_MSG = QString("Select a database from the drop-down menu."); 71 | 72 | class LigandWidget: public QDockWidget { 73 | Q_OBJECT 74 | 75 | public: 76 | LigandWidget(MainWindow* parent); 77 | 78 | void updateDatabaseList(); 79 | QString getDatabaseName(); 80 | void clear() { treeWidget->clear(); } 81 | void showNext(); 82 | void showLast(); 83 | void setDatabaseAltered(QString dbame,bool altered); 84 | void setupHeader(); 85 | 86 | public slots: 87 | void setCompoundFocus(Compound* c); 88 | void setDatabase(QString dbname); 89 | void showGallery(); 90 | void rebuildCompoundTree(); //relies on filterString 91 | void saveCompoundList(); 92 | void updateTable() { showTable(); } 93 | void updateCurrentItemData(); 94 | void updateProgressGUI(int, QString); 95 | void addCompound(Compound *c); 96 | void toggleEnabling(bool); 97 | void unloadLibrary(QString); 98 | 99 | signals: 100 | void urlChanged(QString url); 101 | void compoundFocused(Compound* c); 102 | void databaseChanged(QString dbname); 103 | 104 | private slots: 105 | void showLigand(); 106 | void showTable(); 107 | void databaseChanged(int index); 108 | 109 | public: 110 | 111 | vector visibleCompounds; //each compound is one row in the tree widget. 112 | 113 | QString filterString; 114 | QTreeWidget *treeWidget; 115 | QComboBox *databaseSelect; 116 | 117 | private: 118 | 119 | QPushButton *btnSubmit; 120 | QLineEdit* filterEditor; 121 | LigandWidgetTreeBuilder *ligandWidgetTreeBuilder = nullptr; 122 | 123 | QToolButton *galleryButton; 124 | QToolButton *saveButton; 125 | QToolButton *loadButton; 126 | QPoint dragStartPosition; 127 | 128 | QLabel *filteringProgressBarLbl; 129 | QProgressBar *filteringProgressBar; 130 | 131 | QHashalteredDatabases; 132 | 133 | MainWindow* _mw; 134 | QTreeWidgetItem* addItem(QTreeWidgetItem* parentItem, string key , float value); 135 | QTreeWidgetItem* addItem(QTreeWidgetItem* parentItem, string key , string value); 136 | 137 | }; 138 | 139 | #endif 140 | -------------------------------------------------------------------------------- /src/maven/forms/editpeakgroupdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | editPeakGroupDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 827 10 | 613 11 | 12 | 13 | 14 | Edit Peak Group ID 15 | 16 | 17 | 18 | 19 | 20 | Edit Peak Group ID 21 | 22 | 23 | 24 | 25 | 26 | Cancel 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Adduct: 37 | 38 | 39 | 40 | 41 | 42 | 43 | RT: 44 | 45 | 46 | 47 | 48 | 49 | 50 | Select New Adduct 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | m/z: 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 0 81 | 0 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | Suggestions 90 | 91 | 92 | 93 | 94 | 95 | 96 | New Peak Group ID 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 0 105 | 0 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | Compound: 114 | 115 | 116 | 117 | 118 | 119 | 120 | Update Peak Group 121 | 122 | 123 | 124 | 125 | 126 | 127 | Previous Peak Group ID 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /src/maven/database.h: -------------------------------------------------------------------------------- 1 | #ifndef DATABASE_H 2 | #define DATABASE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "mzSample.h" 16 | #include "mzUtils.h" 17 | #include "mzMassCalculator.h" 18 | 19 | class PeakGroupTag; 20 | 21 | class Database { 22 | 23 | public: 24 | Database() { 25 | //empty constructor 26 | } 27 | 28 | Database(QString filename) { 29 | connect(filename); 30 | reloadAll(); 31 | } 32 | //~Database() { closeAll(); } 33 | 34 | QSqlDatabase& getLigandDB() { return ligandDB; } 35 | void reloadAll(); //loads all tables 36 | void closeAll(); 37 | bool connect(QString filename); 38 | bool disconnect(); 39 | 40 | vector loadAdducts(string filename); 41 | vector defaultAdducts(); 42 | 43 | void loadMethodsFolder(QString methodsFolder); 44 | int loadCompoundsFile(QString filename); 45 | static vector loadCompoundCSVFile(QString fileName, bool debug=false); 46 | static vector loadNISTLibrary(QString fileName); 47 | 48 | void loadCompoundsSQL(QString databaseName,QSqlDatabase& dbConnection); 49 | void saveCompoundsSQL(vector &compoundSet, QSqlDatabase& dbConnection, bool isRespectCIDs=true); 50 | void deleteCompoundsSQL(QString dbName, QSqlDatabase& dbConnection); 51 | void deleteAllCompoundsSQL(QSqlDatabase& dbConnection); 52 | void unloadCompounds(QString databaseName); 53 | void unloadAllCompounds(); 54 | 55 | multimap keywordSearch(string needle); 56 | vector getCompoundReactions(string compound_id); 57 | 58 | void addCompound(Compound*c); 59 | void loadReactions(string modelName); 60 | 61 | vector getCompoundsSubset(string database); 62 | map getCompoundsSubsetMap(string dbName); 63 | 64 | QStringList getDatabaseNames(); 65 | QStringList getLoadedDatabaseNames() { return loadedDatabase.keys(); } 66 | int getLoadedDatabaseCount(QString databaseName){return loadedDatabase[databaseName];} 67 | map getChromotographyMethods(); 68 | QStringList getAdductNames(QString dbName); 69 | 70 | Compound* findSpeciesById(string id, string db, bool attemptToLoadDB=true); 71 | Compound* findSpeciesByPrecursor(float precursorMz, float productMz,int polarity,double amuQ1, double amuQ3); 72 | set findSpeciesByMass(float mz, float ppm); 73 | vector findSpeciesByName(string name, string dbname, bool attemptToLoadDB=true); 74 | Compound* findSpeciesByNameAndAdduct(string name, string adduct, string dbname); 75 | 76 | vector findMatchingCompounds(float mz, float ppm, float charge); 77 | vector findMatchingCompoundsSLOW(float mz, float ppm, float charge); 78 | 79 | Adduct* findAdductByName(string id); 80 | 81 | void loadRetentionTimes(QString method); 82 | void saveRetentionTime(Compound* c, float rt, QString method); 83 | 84 | void saveValidation(Peak* p); 85 | 86 | void loadPeakGroupTags(string filename); 87 | 88 | vector adductsDB; 89 | vector fragmentsDB; 90 | vector compoundsDB; 91 | std::map peakGroupTags; 92 | 93 | vector getSupplementalPeakGroupTags(); 94 | 95 | vector availableAdducts{}; //based on file, not activated 96 | 97 | static void setDefaultSampleColors( 98 | vector& samples, 99 | bool skipColoredSamples=true, 100 | bool setBlanksToRed=true); 101 | 102 | private: 103 | QSqlDatabase ligandDB; 104 | QMap compoundIdMap; 105 | QMap loadedDatabase; 106 | }; 107 | 108 | class PeakGroupTag { 109 | 110 | public: 111 | string tagName; 112 | char label; 113 | char hotkey; 114 | QIcon icon; 115 | string description; 116 | unsigned int displayOrder; 117 | 118 | PeakGroupTag(string tagName, char label, char hotKeyChar, unsigned int displayOrder, string iconName, string description) { 119 | this->tagName = tagName; 120 | this->label = label; 121 | this->hotkey = hotKeyChar; 122 | this->displayOrder = displayOrder; 123 | QString iconPath(":/images/"); 124 | iconPath.append(iconName.c_str()); 125 | this->icon = QIcon(iconPath); 126 | this->description = description; 127 | } 128 | }; 129 | 130 | #endif 131 | 132 | --------------------------------------------------------------------------------