diff --git a/MANIFEST.in b/MANIFEST.in index dc4c575fe1343ac222be57a9d056e0b766d01183..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +0,0 @@ -exclude lifescale/models/ls_run.py lifescale/scripts/run_gui.py \ No newline at end of file diff --git a/README.md b/README.md index 790f66901c4fb10be2aa7dbc48e4712db4409f8d..f649c3c751750690a06c78b5f0563b4f2bcc09a7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # lifescale_utils -Data analysis tools for lifescale with GUI. +Data analysis utility tools for lifescale. # Command line programs: ## ls2csv -The program *ls2csv* reads the content of the xlsm files written by lifescale units, parses the data and writes them to three csv +*ls2csv* is a command line program that reads the content of the xlsm files written by lifescale units, parses the data and writes them to three csv files (where `[run-name]` is the name from the settings sheet): * `Masses_Vibrio_[run-name].csv`: Data series from the sheet AcquisitionIntervals. * `Metadata_[run-name].csv`: Data from the sheet PanelData. @@ -12,7 +12,9 @@ files (where `[run-name]` is the name from the settings sheet): ### Usage: ``` -ls2csv -i [path and nale of xlsm file] -o [outpur directory] [-s] [-nv] +usage: ls2csv [-h] -i INPUT_XLSM -o OUT_DIR [-nv] [-s] [-t] + +Conversion from lifescale xlsm output to csv files options: -h, --help show this help message and exit @@ -30,6 +32,7 @@ options: -t, --sort-masses-by-time Sort data in the Masses CSV file by acquisition time. (default: False) + ``` diff --git a/lifescale/__init__.py b/lifescale/__init__.py index af1d517ca89f1f94b3c97b63573cf5f95052ea4e..24dea2a1e8fb2d43c93cda9c7681b444dbd5a319 100644 --- a/lifescale/__init__.py +++ b/lifescale/__init__.py @@ -17,8 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. Andreas Hellerschmied (heller182@gmx.at) """ -__version__ = '0.0.3' +__version__ = '0.0.6' __author__ = 'Andreas Hellerschmied' -__git_repo__ = 'tba' +__git_repo__ = 'https://gitlab.com/hellerdev/lifescale_utils' __email__ = 'heller182@gmx.at' -__copyright__ = '(c) 2022 Andreas Hellerschmied' +__copyright__ = '(c) 2023 Andreas Hellerschmied' +__pypi_repo__ = 'https://pypi.org/project/lifescale-utils/' diff --git a/lifescale/command_line/command_line.py b/lifescale/command_line/command_line.py index 86eff8c7e93ef09e30808abb4131271f212586ac..561c11572ea8f99670bf17e923a4f60e4839d689 100644 --- a/lifescale/command_line/command_line.py +++ b/lifescale/command_line/command_line.py @@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. """ from lifescale.scripts.ls2csv import ls2csv as ls2csv_main +from lifescale.scripts.run_gui import run_gui as run_gui_main import argparse import os @@ -70,6 +71,18 @@ def ls2csv(): verbose=verbose) +def lsgui(): + """Start lifescale utils gui.""" + parser = argparse.ArgumentParser(prog="lsgui", + description="Starts lifescale utils gui.", + epilog="Start the graphical user interface (gui) of lifescale utils.", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + + args = parser.parse_args() + + return run_gui_main() + + if __name__ == '__main__': """Main function for debugging and testing.""" ls2csv() diff --git a/lifescale/gui/MainWindow.py b/lifescale/gui/MainWindow.py index e1d6bff8ecfb591c724f5d042341995d0d985ac8..66f013826b13566e05ecc65ff4c62de3546d0da7 100644 --- a/lifescale/gui/MainWindow.py +++ b/lifescale/gui/MainWindow.py @@ -1,6 +1,6 @@ # Form implementation generated from reading ui file 'lifescale/gui/MainWindow.ui' # -# Created by: PyQt6 UI code generator 6.2.1 +# Created by: PyQt6 UI code generator 6.4.0 # # WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. @@ -12,150 +12,269 @@ from PyQt6 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.resize(992, 616) + MainWindow.resize(1277, 728) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout.setObjectName("verticalLayout") self.tabWidget_Main = QtWidgets.QTabWidget(self.centralwidget) + self.tabWidget_Main.setTabPosition(QtWidgets.QTabWidget.TabPosition.East) self.tabWidget_Main.setObjectName("tabWidget_Main") - self.tab_peaks = QtWidgets.QWidget() - self.tab_peaks.setObjectName("tab_peaks") - self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab_peaks) + self.tab_LSData = QtWidgets.QWidget() + self.tab_LSData.setObjectName("tab_LSData") + self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_LSData) + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.splitter = QtWidgets.QSplitter(self.tab_LSData) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.splitter.sizePolicy().hasHeightForWidth()) + self.splitter.setSizePolicy(sizePolicy) + self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal) + self.splitter.setChildrenCollapsible(False) + self.splitter.setObjectName("splitter") + self.layoutWidget = QtWidgets.QWidget(self.splitter) + self.layoutWidget.setObjectName("layoutWidget") + self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.layoutWidget) + self.verticalLayout_2.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetDefaultConstraint) + self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") - self.groupBox_data = QtWidgets.QGroupBox(self.tab_peaks) - self.groupBox_data.setObjectName("groupBox_data") - self.formLayout = QtWidgets.QFormLayout(self.groupBox_data) + self.listWidget_Samples = QtWidgets.QListWidget(self.layoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.listWidget_Samples.sizePolicy().hasHeightForWidth()) + self.listWidget_Samples.setSizePolicy(sizePolicy) + self.listWidget_Samples.setMinimumSize(QtCore.QSize(150, 0)) + self.listWidget_Samples.setMaximumSize(QtCore.QSize(16777215, 16777215)) + self.listWidget_Samples.setObjectName("listWidget_Samples") + self.verticalLayout_2.addWidget(self.listWidget_Samples) + self.groupBox_LSDataOptions = QtWidgets.QGroupBox(self.layoutWidget) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_LSDataOptions.sizePolicy().hasHeightForWidth()) + self.groupBox_LSDataOptions.setSizePolicy(sizePolicy) + self.groupBox_LSDataOptions.setMinimumSize(QtCore.QSize(150, 0)) + self.groupBox_LSDataOptions.setMaximumSize(QtCore.QSize(16777215, 16777215)) + self.groupBox_LSDataOptions.setObjectName("groupBox_LSDataOptions") + self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.groupBox_LSDataOptions) + self.verticalLayout_8.setObjectName("verticalLayout_8") + self.pushButton_resetMassLimits = QtWidgets.QPushButton(self.groupBox_LSDataOptions) + self.pushButton_resetMassLimits.setObjectName("pushButton_resetMassLimits") + self.verticalLayout_8.addWidget(self.pushButton_resetMassLimits) + self.checkBox_MassesShowTable = QtWidgets.QCheckBox(self.groupBox_LSDataOptions) + self.checkBox_MassesShowTable.setChecked(True) + self.checkBox_MassesShowTable.setObjectName("checkBox_MassesShowTable") + self.verticalLayout_8.addWidget(self.checkBox_MassesShowTable) + self.verticalLayout_2.addWidget(self.groupBox_LSDataOptions) + self.tabWidget_LSData = QtWidgets.QTabWidget(self.splitter) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(1) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.tabWidget_LSData.sizePolicy().hasHeightForWidth()) + self.tabWidget_LSData.setSizePolicy(sizePolicy) + self.tabWidget_LSData.setObjectName("tabWidget_LSData") + self.tab_LSData_hist = QtWidgets.QWidget() + self.tab_LSData_hist.setObjectName("tab_LSData_hist") + self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.tab_LSData_hist) + self.verticalLayout_9.setObjectName("verticalLayout_9") + self.GraphicsLayoutWidget_SampelHistogram = GraphicsLayoutWidget(self.tab_LSData_hist) + self.GraphicsLayoutWidget_SampelHistogram.setObjectName("GraphicsLayoutWidget_SampelHistogram") + self.verticalLayout_9.addWidget(self.GraphicsLayoutWidget_SampelHistogram) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.groupBoxLSDataSampleStatistics = QtWidgets.QGroupBox(self.tab_LSData_hist) + self.groupBoxLSDataSampleStatistics.setObjectName("groupBoxLSDataSampleStatistics") + self.horizontalLayout = QtWidgets.QHBoxLayout(self.groupBoxLSDataSampleStatistics) + self.horizontalLayout.setObjectName("horizontalLayout") + self.formLayout = QtWidgets.QFormLayout() self.formLayout.setObjectName("formLayout") - self.label_data_rawData = QtWidgets.QLabel(self.groupBox_data) - self.label_data_rawData.setObjectName("label_data_rawData") - self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_data_rawData) - self.horizontalLayout_data_rawData = QtWidgets.QHBoxLayout() - self.horizontalLayout_data_rawData.setObjectName("horizontalLayout_data_rawData") - self.lineEdit_data_rawData = QtWidgets.QLineEdit(self.groupBox_data) - self.lineEdit_data_rawData.setObjectName("lineEdit_data_rawData") - self.horizontalLayout_data_rawData.addWidget(self.lineEdit_data_rawData) - self.pushButton_data_rawData = QtWidgets.QPushButton(self.groupBox_data) - self.pushButton_data_rawData.setObjectName("pushButton_data_rawData") - self.horizontalLayout_data_rawData.addWidget(self.pushButton_data_rawData) - self.formLayout.setLayout(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_data_rawData) - self.label_data_metadataFile = QtWidgets.QLabel(self.groupBox_data) - self.label_data_metadataFile.setObjectName("label_data_metadataFile") - self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_data_metadataFile) - self.horizontalLayout_data_metadataFile = QtWidgets.QHBoxLayout() - self.horizontalLayout_data_metadataFile.setObjectName("horizontalLayout_data_metadataFile") - self.lineEdit_data_metadataFile = QtWidgets.QLineEdit(self.groupBox_data) - self.lineEdit_data_metadataFile.setObjectName("lineEdit_data_metadataFile") - self.horizontalLayout_data_metadataFile.addWidget(self.lineEdit_data_metadataFile) - self.pushButton_data_metadataFile = QtWidgets.QPushButton(self.groupBox_data) - self.pushButton_data_metadataFile.setObjectName("pushButton_data_metadataFile") - self.horizontalLayout_data_metadataFile.addWidget(self.pushButton_data_metadataFile) - self.formLayout.setLayout(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_data_metadataFile) - self.label_data_outputFolder = QtWidgets.QLabel(self.groupBox_data) - self.label_data_outputFolder.setObjectName("label_data_outputFolder") - self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_data_outputFolder) - self.horizontalLayout_data_outputFolder = QtWidgets.QHBoxLayout() - self.horizontalLayout_data_outputFolder.setObjectName("horizontalLayout_data_outputFolder") - self.lineEdit_data_outputFolder = QtWidgets.QLineEdit(self.groupBox_data) - self.lineEdit_data_outputFolder.setObjectName("lineEdit_data_outputFolder") - self.horizontalLayout_data_outputFolder.addWidget(self.lineEdit_data_outputFolder) - self.pushButton_data_outputFolder = QtWidgets.QPushButton(self.groupBox_data) - self.pushButton_data_outputFolder.setObjectName("pushButton_data_outputFolder") - self.horizontalLayout_data_outputFolder.addWidget(self.pushButton_data_outputFolder) - self.formLayout.setLayout(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_data_outputFolder) - self.label_data_selectExperiment = QtWidgets.QLabel(self.groupBox_data) - self.label_data_selectExperiment.setObjectName("label_data_selectExperiment") - self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_data_selectExperiment) - self.comboBox_data_selectExperiment = QtWidgets.QComboBox(self.groupBox_data) - self.comboBox_data_selectExperiment.setObjectName("comboBox_data_selectExperiment") - self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.comboBox_data_selectExperiment) - self.verticalLayout_2.addWidget(self.groupBox_data) - self.groupBox_processingParameters = QtWidgets.QGroupBox(self.tab_peaks) - self.groupBox_processingParameters.setObjectName("groupBox_processingParameters") - self.formLayout_2 = QtWidgets.QFormLayout(self.groupBox_processingParameters) + self.label = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label.setObjectName("label") + self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label) + self.label_SelectedMasse = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_SelectedMasse.setText("") + self.label_SelectedMasse.setObjectName("label_SelectedMasse") + self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_SelectedMasse) + self.label_3 = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_3.setObjectName("label_3") + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_3) + self.label_selectionLimits = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_selectionLimits.setText("") + self.label_selectionLimits.setObjectName("label_selectionLimits") + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_selectionLimits) + self.label_5 = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_5.setObjectName("label_5") + self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_5) + self.label_mean = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_mean.setText("") + self.label_mean.setObjectName("label_mean") + self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_mean) + self.label_7 = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_7.setObjectName("label_7") + self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_7) + self.label_median = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_median.setText("") + self.label_median.setObjectName("label_median") + self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_median) + self.label_9 = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_9.setObjectName("label_9") + self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_9) + self.label_std = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_std.setText("") + self.label_std.setObjectName("label_std") + self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_std) + self.label_11 = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_11.setObjectName("label_11") + self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_11) + self.label_iqr = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_iqr.setText("") + self.label_iqr.setObjectName("label_iqr") + self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_iqr) + self.label_13 = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_13.setObjectName("label_13") + self.formLayout.setWidget(6, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_13) + self.label_rcv = QtWidgets.QLabel(self.groupBoxLSDataSampleStatistics) + self.label_rcv.setText("") + self.label_rcv.setObjectName("label_rcv") + self.formLayout.setWidget(6, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_rcv) + self.horizontalLayout.addLayout(self.formLayout) + self.horizontalLayout_2.addWidget(self.groupBoxLSDataSampleStatistics) + self.groupBox_histOptions = QtWidgets.QGroupBox(self.tab_LSData_hist) + self.groupBox_histOptions.setObjectName("groupBox_histOptions") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox_histOptions) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.formLayout_2 = QtWidgets.QFormLayout() self.formLayout_2.setObjectName("formLayout_2") - self.label_massTransformation = QtWidgets.QLabel(self.groupBox_processingParameters) - self.label_massTransformation.setObjectName("label_massTransformation") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_massTransformation) - self.doubleSpinBox_massTransformation = QtWidgets.QDoubleSpinBox(self.groupBox_processingParameters) - self.doubleSpinBox_massTransformation.setDecimals(6) - self.doubleSpinBox_massTransformation.setObjectName("doubleSpinBox_massTransformation") - self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.doubleSpinBox_massTransformation) - self.label_massCutoff = QtWidgets.QLabel(self.groupBox_processingParameters) - self.label_massCutoff.setObjectName("label_massCutoff") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_massCutoff) - self.doubleSpinBox_massCutoff = QtWidgets.QDoubleSpinBox(self.groupBox_processingParameters) - self.doubleSpinBox_massCutoff.setDecimals(1) - self.doubleSpinBox_massCutoff.setObjectName("doubleSpinBox_massCutoff") - self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.doubleSpinBox_massCutoff) - self.label_peakWidthCutoff = QtWidgets.QLabel(self.groupBox_processingParameters) - self.label_peakWidthCutoff.setObjectName("label_peakWidthCutoff") - self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_peakWidthCutoff) - self.doubleSpinBox_peakWidthCutoff = QtWidgets.QDoubleSpinBox(self.groupBox_processingParameters) - self.doubleSpinBox_peakWidthCutoff.setDecimals(1) - self.doubleSpinBox_peakWidthCutoff.setObjectName("doubleSpinBox_peakWidthCutoff") - self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.doubleSpinBox_peakWidthCutoff) - self.label_peakDistanceCutoff = QtWidgets.QLabel(self.groupBox_processingParameters) - self.label_peakDistanceCutoff.setObjectName("label_peakDistanceCutoff") - self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_peakDistanceCutoff) - self.doubleSpinBox_peakDistanceCutoff = QtWidgets.QDoubleSpinBox(self.groupBox_processingParameters) - self.doubleSpinBox_peakDistanceCutoff.setDecimals(1) - self.doubleSpinBox_peakDistanceCutoff.setObjectName("doubleSpinBox_peakDistanceCutoff") - self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.doubleSpinBox_peakDistanceCutoff) - self.verticalLayout_2.addWidget(self.groupBox_processingParameters) - self.pushButton_run = QtWidgets.QPushButton(self.tab_peaks) - self.pushButton_run.setObjectName("pushButton_run") - self.verticalLayout_2.addWidget(self.pushButton_run) - self.tabWidget_Main.addTab(self.tab_peaks, "") - self.tab_analysis = QtWidgets.QWidget() - self.tab_analysis.setObjectName("tab_analysis") - self.tabWidget_Main.addTab(self.tab_analysis, "") + self.label_2 = QtWidgets.QLabel(self.groupBox_histOptions) + self.label_2.setObjectName("label_2") + self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2) + self.comboBox_histMethod = QtWidgets.QComboBox(self.groupBox_histOptions) + self.comboBox_histMethod.setObjectName("comboBox_histMethod") + self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.comboBox_histMethod) + self.label_numberOfBins = QtWidgets.QLabel(self.groupBox_histOptions) + self.label_numberOfBins.setObjectName("label_numberOfBins") + self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_numberOfBins) + self.spinBox_histBins = QtWidgets.QSpinBox(self.groupBox_histOptions) + self.spinBox_histBins.setMaximum(1000) + self.spinBox_histBins.setStepType(QtWidgets.QAbstractSpinBox.StepType.AdaptiveDecimalStepType) + self.spinBox_histBins.setProperty("value", 100) + self.spinBox_histBins.setObjectName("spinBox_histBins") + self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.spinBox_histBins) + self.verticalLayout_3.addLayout(self.formLayout_2) + self.label_histBinMethodDescription = QtWidgets.QLabel(self.groupBox_histOptions) + self.label_histBinMethodDescription.setText("") + self.label_histBinMethodDescription.setWordWrap(True) + self.label_histBinMethodDescription.setObjectName("label_histBinMethodDescription") + self.verticalLayout_3.addWidget(self.label_histBinMethodDescription) + self.checkBox_plotMedian = QtWidgets.QCheckBox(self.groupBox_histOptions) + self.checkBox_plotMedian.setChecked(False) + self.checkBox_plotMedian.setObjectName("checkBox_plotMedian") + self.verticalLayout_3.addWidget(self.checkBox_plotMedian) + self.checkBox_plotMean = QtWidgets.QCheckBox(self.groupBox_histOptions) + self.checkBox_plotMean.setChecked(False) + self.checkBox_plotMean.setObjectName("checkBox_plotMean") + self.verticalLayout_3.addWidget(self.checkBox_plotMean) + self.horizontalLayout_2.addWidget(self.groupBox_histOptions) + self.verticalLayout_9.addLayout(self.horizontalLayout_2) + self.tabWidget_LSData.addTab(self.tab_LSData_hist, "") + self.tab_Masses = QtWidgets.QWidget() + self.tab_Masses.setObjectName("tab_Masses") + self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.tab_Masses) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.tableView_Masses = QtWidgets.QTableView(self.tab_Masses) + self.tableView_Masses.setEnabled(True) + self.tableView_Masses.setLineWidth(9) + self.tableView_Masses.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) + self.tableView_Masses.setObjectName("tableView_Masses") + self.verticalLayout_5.addWidget(self.tableView_Masses) + self.tabWidget_LSData.addTab(self.tab_Masses, "") + self.verticalLayout_4.addWidget(self.splitter) + self.tabWidget_Main.addTab(self.tab_LSData, "") + self.tab_SampleSummary = QtWidgets.QWidget() + self.tab_SampleSummary.setObjectName("tab_SampleSummary") + self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.tab_SampleSummary) + self.verticalLayout_7.setObjectName("verticalLayout_7") + self.tableView_SampleSummary = QtWidgets.QTableView(self.tab_SampleSummary) + self.tableView_SampleSummary.setObjectName("tableView_SampleSummary") + self.verticalLayout_7.addWidget(self.tableView_SampleSummary) + self.tabWidget_Main.addTab(self.tab_SampleSummary, "") + self.tab_PanelMetadata = QtWidgets.QWidget() + self.tab_PanelMetadata.setObjectName("tab_PanelMetadata") + self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.tab_PanelMetadata) + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.tableView_PanelMetadata = QtWidgets.QTableView(self.tab_PanelMetadata) + self.tableView_PanelMetadata.setObjectName("tableView_PanelMetadata") + self.verticalLayout_6.addWidget(self.tableView_PanelMetadata) + self.tabWidget_Main.addTab(self.tab_PanelMetadata, "") self.verticalLayout.addWidget(self.tabWidget_Main) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 992, 22)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1277, 22)) self.menubar.setObjectName("menubar") - self.menuOptions = QtWidgets.QMenu(self.menubar) - self.menuOptions.setObjectName("menuOptions") + self.menuFile = QtWidgets.QMenu(self.menubar) + self.menuFile.setObjectName("menuFile") + self.menuExport = QtWidgets.QMenu(self.menuFile) + self.menuExport.setObjectName("menuExport") + self.menuHelp = QtWidgets.QMenu(self.menubar) + self.menuHelp.setObjectName("menuHelp") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) - self.actionSave_current_GUI_parameters_json = QtGui.QAction(MainWindow) - self.actionSave_current_GUI_parameters_json.setObjectName("actionSave_current_GUI_parameters_json") - self.actionLoad_GUI_parameters_json = QtGui.QAction(MainWindow) - self.actionLoad_GUI_parameters_json.setObjectName("actionLoad_GUI_parameters_json") - self.actionLoad_default_parameters = QtGui.QAction(MainWindow) - self.actionLoad_default_parameters.setObjectName("actionLoad_default_parameters") - self.menuOptions.addAction(self.actionSave_current_GUI_parameters_json) - self.menuOptions.addAction(self.actionLoad_GUI_parameters_json) - self.menuOptions.addAction(self.actionLoad_default_parameters) - self.menubar.addAction(self.menuOptions.menuAction()) + self.actionLoad_xlsm_file = QtGui.QAction(MainWindow) + self.actionLoad_xlsm_file.setObjectName("actionLoad_xlsm_file") + self.action_About = QtGui.QAction(MainWindow) + self.action_About.setObjectName("action_About") + self.action_csvFiles = QtGui.QAction(MainWindow) + self.action_csvFiles.setObjectName("action_csvFiles") + self.action_Exit = QtGui.QAction(MainWindow) + self.action_Exit.setObjectName("action_Exit") + self.menuExport.addAction(self.action_csvFiles) + self.menuFile.addAction(self.actionLoad_xlsm_file) + self.menuFile.addAction(self.menuExport.menuAction()) + self.menuFile.addSeparator() + self.menuFile.addAction(self.action_Exit) + self.menuHelp.addAction(self.action_About) + self.menubar.addAction(self.menuFile.menuAction()) + self.menubar.addAction(self.menuHelp.menuAction()) self.retranslateUi(MainWindow) self.tabWidget_Main.setCurrentIndex(0) + self.tabWidget_LSData.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "lifescale tools")) - self.groupBox_data.setTitle(_translate("MainWindow", "Data")) - self.label_data_rawData.setText(_translate("MainWindow", "Raw data folder")) - self.pushButton_data_rawData.setText(_translate("MainWindow", "Browse")) - self.label_data_metadataFile.setText(_translate("MainWindow", "Metadata file (optional)")) - self.pushButton_data_metadataFile.setText(_translate("MainWindow", "Browse")) - self.label_data_outputFolder.setText(_translate("MainWindow", "Output folder")) - self.pushButton_data_outputFolder.setText(_translate("MainWindow", "Browse")) - self.label_data_selectExperiment.setText(_translate("MainWindow", "Select Experiment")) - self.groupBox_processingParameters.setTitle(_translate("MainWindow", "Processing parameters")) - self.label_massTransformation.setText(_translate("MainWindow", "Mass transformation [fg/Hz]")) - self.label_massCutoff.setText(_translate("MainWindow", "Mass cutoff [fg]")) - self.label_peakWidthCutoff.setText(_translate("MainWindow", "Peak width cutoff [???]")) - self.label_peakDistanceCutoff.setText(_translate("MainWindow", "Peak distance cutoff [??]")) - self.pushButton_run.setText(_translate("MainWindow", "Run")) - self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_peaks), _translate("MainWindow", "Mass Peaks")) - self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_analysis), _translate("MainWindow", "Analysis")) - self.menuOptions.setTitle(_translate("MainWindow", "Options")) - self.actionSave_current_GUI_parameters_json.setText(_translate("MainWindow", "Save current GUI parameters (json)")) - self.actionLoad_GUI_parameters_json.setText(_translate("MainWindow", "Load GUI parameters (json)")) - self.actionLoad_default_parameters.setText(_translate("MainWindow", "Load default parameters")) + MainWindow.setWindowTitle(_translate("MainWindow", "LifeScale utils")) + self.groupBox_LSDataOptions.setTitle(_translate("MainWindow", "Options")) + self.pushButton_resetMassLimits.setText(_translate("MainWindow", "Reset mass limits")) + self.checkBox_MassesShowTable.setText(_translate("MainWindow", "Show table")) + self.groupBoxLSDataSampleStatistics.setTitle(_translate("MainWindow", "Sample statistics (current selection)")) + self.label.setText(_translate("MainWindow", "Selected masses")) + self.label_3.setText(_translate("MainWindow", "Selection limits")) + self.label_5.setText(_translate("MainWindow", "Mean")) + self.label_7.setText(_translate("MainWindow", "Median")) + self.label_9.setText(_translate("MainWindow", "Std")) + self.label_11.setText(_translate("MainWindow", "IQR")) + self.label_13.setText(_translate("MainWindow", "rCV")) + self.groupBox_histOptions.setTitle(_translate("MainWindow", "Histogram options")) + self.label_2.setText(_translate("MainWindow", "Bin determination method")) + self.label_numberOfBins.setText(_translate("MainWindow", "Number of bins")) + self.checkBox_plotMedian.setText(_translate("MainWindow", "Plot median")) + self.checkBox_plotMean.setText(_translate("MainWindow", "Plot mean")) + self.tabWidget_LSData.setTabText(self.tabWidget_LSData.indexOf(self.tab_LSData_hist), _translate("MainWindow", "Sample histogram and statistics")) + self.tabWidget_LSData.setTabText(self.tabWidget_LSData.indexOf(self.tab_Masses), _translate("MainWindow", "Masses per Sample")) + self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_LSData), _translate("MainWindow", "Masses")) + self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_SampleSummary), _translate("MainWindow", "Sample Summary")) + self.tabWidget_Main.setTabText(self.tabWidget_Main.indexOf(self.tab_PanelMetadata), _translate("MainWindow", "Panel Metadata")) + self.menuFile.setTitle(_translate("MainWindow", "File")) + self.menuExport.setTitle(_translate("MainWindow", "Export")) + self.menuHelp.setTitle(_translate("MainWindow", "Help")) + self.actionLoad_xlsm_file.setText(_translate("MainWindow", "Load xlsm file")) + self.actionLoad_xlsm_file.setToolTip(_translate("MainWindow", "Load xlsm file created by LifeScale")) + self.action_About.setText(_translate("MainWindow", "About")) + self.action_csvFiles.setText(_translate("MainWindow", "CSV files")) + self.action_Exit.setText(_translate("MainWindow", "Exit")) +from pyqtgraph import GraphicsLayoutWidget diff --git a/lifescale/gui/MainWindow.ui b/lifescale/gui/MainWindow.ui index 8b01b72c078c0c7b11c1ad10d6185da8c5a62ca0..3adb2eb1ff3edafed1f22d81969f576d0bae7fb4 100644 --- a/lifescale/gui/MainWindow.ui +++ b/lifescale/gui/MainWindow.ui @@ -6,185 +6,367 @@ <rect> <x>0</x> <y>0</y> - <width>992</width> - <height>616</height> + <width>1277</width> + <height>728</height> </rect> </property> <property name="windowTitle"> - <string>lifescale tools</string> + <string>LifeScale utils</string> </property> <widget class="QWidget" name="centralwidget"> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QTabWidget" name="tabWidget_Main"> + <property name="tabPosition"> + <enum>QTabWidget::East</enum> + </property> <property name="currentIndex"> <number>0</number> </property> - <widget class="QWidget" name="tab_peaks"> + <widget class="QWidget" name="tab_LSData"> <attribute name="title"> - <string>Mass Peaks</string> + <string>Masses</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> + <layout class="QVBoxLayout" name="verticalLayout_4"> <item> - <widget class="QGroupBox" name="groupBox_data"> - <property name="title"> - <string>Data</string> + <widget class="QSplitter" name="splitter"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="childrenCollapsible"> + <bool>false</bool> </property> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label_data_rawData"> - <property name="text"> - <string>Raw data folder</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_data_rawData"> + <widget class="QWidget" name="layoutWidget"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <widget class="QListWidget" name="listWidget_Samples"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_LSDataOptions"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="title"> + <string>Options</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <item> + <widget class="QPushButton" name="pushButton_resetMassLimits"> + <property name="text"> + <string>Reset mass limits</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_MassesShowTable"> + <property name="text"> + <string>Show table</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QTabWidget" name="tabWidget_LSData"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="tab_LSData_hist"> + <attribute name="title"> + <string>Sample histogram and statistics</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_9"> <item> - <widget class="QLineEdit" name="lineEdit_data_rawData"/> + <widget class="GraphicsLayoutWidget" name="GraphicsLayoutWidget_SampelHistogram"/> </item> <item> - <widget class="QPushButton" name="pushButton_data_rawData"> - <property name="text"> - <string>Browse</string> - </property> - </widget> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QGroupBox" name="groupBoxLSDataSampleStatistics"> + <property name="title"> + <string>Sample statistics (current selection)</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Selected masses</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="label_SelectedMasse"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Selection limits</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="label_selectionLimits"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Mean</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="label_mean"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_7"> + <property name="text"> + <string>Median</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLabel" name="label_median"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_9"> + <property name="text"> + <string>Std</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="label_std"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label_11"> + <property name="text"> + <string>IQR</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLabel" name="label_iqr"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label_13"> + <property name="text"> + <string>rCV</string> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QLabel" name="label_rcv"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_histOptions"> + <property name="title"> + <string>Histogram options</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <layout class="QFormLayout" name="formLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Bin determination method</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="comboBox_histMethod"/> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_numberOfBins"> + <property name="text"> + <string>Number of bins</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="spinBox_histBins"> + <property name="maximum"> + <number>1000</number> + </property> + <property name="stepType"> + <enum>QAbstractSpinBox::AdaptiveDecimalStepType</enum> + </property> + <property name="value"> + <number>100</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="label_histBinMethodDescription"> + <property name="text"> + <string/> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_plotMedian"> + <property name="text"> + <string>Plot median</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="checkBox_plotMean"> + <property name="text"> + <string>Plot mean</string> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> </item> </layout> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_data_metadataFile"> - <property name="text"> - <string>Metadata file (optional)</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_data_metadataFile"> + </widget> + <widget class="QWidget" name="tab_Masses"> + <attribute name="title"> + <string>Masses per Sample</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_5"> <item> - <widget class="QLineEdit" name="lineEdit_data_metadataFile"/> - </item> - <item> - <widget class="QPushButton" name="pushButton_data_metadataFile"> - <property name="text"> - <string>Browse</string> + <widget class="QTableView" name="tableView_Masses"> + <property name="enabled"> + <bool>true</bool> </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_data_outputFolder"> - <property name="text"> - <string>Output folder</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_data_outputFolder"> - <item> - <widget class="QLineEdit" name="lineEdit_data_outputFolder"/> - </item> - <item> - <widget class="QPushButton" name="pushButton_data_outputFolder"> - <property name="text"> - <string>Browse</string> + <property name="lineWidth"> + <number>9</number> + </property> + <property name="sizeAdjustPolicy"> + <enum>QAbstractScrollArea::AdjustToContents</enum> </property> </widget> </item> </layout> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_data_selectExperiment"> - <property name="text"> - <string>Select Experiment</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QComboBox" name="comboBox_data_selectExperiment"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_processingParameters"> - <property name="title"> - <string>Processing parameters</string> - </property> - <layout class="QFormLayout" name="formLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="label_massTransformation"> - <property name="text"> - <string>Mass transformation [fg/Hz]</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QDoubleSpinBox" name="doubleSpinBox_massTransformation"> - <property name="decimals"> - <number>6</number> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_massCutoff"> - <property name="text"> - <string>Mass cutoff [fg]</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QDoubleSpinBox" name="doubleSpinBox_massCutoff"> - <property name="decimals"> - <number>1</number> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_peakWidthCutoff"> - <property name="text"> - <string>Peak width cutoff [???]</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QDoubleSpinBox" name="doubleSpinBox_peakWidthCutoff"> - <property name="decimals"> - <number>1</number> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_peakDistanceCutoff"> - <property name="text"> - <string>Peak distance cutoff [??]</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QDoubleSpinBox" name="doubleSpinBox_peakDistanceCutoff"> - <property name="decimals"> - <number>1</number> - </property> - </widget> - </item> - </layout> + </widget> + </widget> </widget> </item> + </layout> + </widget> + <widget class="QWidget" name="tab_SampleSummary"> + <attribute name="title"> + <string>Sample Summary</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_7"> <item> - <widget class="QPushButton" name="pushButton_run"> - <property name="text"> - <string>Run</string> - </property> - </widget> + <widget class="QTableView" name="tableView_SampleSummary"/> </item> </layout> </widget> - <widget class="QWidget" name="tab_analysis"> + <widget class="QWidget" name="tab_PanelMetadata"> <attribute name="title"> - <string>Analysis</string> + <string>Panel Metadata</string> </attribute> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <widget class="QTableView" name="tableView_PanelMetadata"/> + </item> + </layout> </widget> </widget> </item> @@ -195,37 +377,66 @@ <rect> <x>0</x> <y>0</y> - <width>992</width> + <width>1277</width> <height>22</height> </rect> </property> - <widget class="QMenu" name="menuOptions"> + <widget class="QMenu" name="menuFile"> + <property name="title"> + <string>File</string> + </property> + <widget class="QMenu" name="menuExport"> + <property name="title"> + <string>Export</string> + </property> + <addaction name="action_csvFiles"/> + </widget> + <addaction name="actionLoad_xlsm_file"/> + <addaction name="menuExport"/> + <addaction name="separator"/> + <addaction name="action_Exit"/> + </widget> + <widget class="QMenu" name="menuHelp"> <property name="title"> - <string>Options</string> + <string>Help</string> </property> - <addaction name="actionSave_current_GUI_parameters_json"/> - <addaction name="actionLoad_GUI_parameters_json"/> - <addaction name="actionLoad_default_parameters"/> + <addaction name="action_About"/> </widget> - <addaction name="menuOptions"/> + <addaction name="menuFile"/> + <addaction name="menuHelp"/> </widget> <widget class="QStatusBar" name="statusbar"/> - <action name="actionSave_current_GUI_parameters_json"> + <action name="actionLoad_xlsm_file"> + <property name="text"> + <string>Load xlsm file</string> + </property> + <property name="toolTip"> + <string>Load xlsm file created by LifeScale</string> + </property> + </action> + <action name="action_About"> <property name="text"> - <string>Save current GUI parameters (json)</string> + <string>About</string> </property> </action> - <action name="actionLoad_GUI_parameters_json"> + <action name="action_csvFiles"> <property name="text"> - <string>Load GUI parameters (json)</string> + <string>CSV files</string> </property> </action> - <action name="actionLoad_default_parameters"> + <action name="action_Exit"> <property name="text"> - <string>Load default parameters</string> + <string>Exit</string> </property> </action> </widget> + <customwidgets> + <customwidget> + <class>GraphicsLayoutWidget</class> + <extends>QGraphicsView</extends> + <header>pyqtgraph</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/lifescale/gui/__init__.py b/lifescale/gui/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b8ecf4c4880b775e0569d6e408d78df27aa22c5c 100644 --- a/lifescale/gui/__init__.py +++ b/lifescale/gui/__init__.py @@ -0,0 +1,18 @@ +"""LifeScale utils graphical user interface. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + +:Authors: + Andreas Hellerschmied (heller182@gmx.at) +""" \ No newline at end of file diff --git a/lifescale/gui/dialog_about.py b/lifescale/gui/dialog_about.py new file mode 100644 index 0000000000000000000000000000000000000000..80f4d79b293093d4fb26cf60efd407b0955f31ec --- /dev/null +++ b/lifescale/gui/dialog_about.py @@ -0,0 +1,753 @@ +# Form implementation generated from reading ui file 'lifescale/gui/dialog_about.ui' +# +# Created by: PyQt6 UI code generator 6.4.0 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog_about(object): + def setupUi(self, Dialog_about): + Dialog_about.setObjectName("Dialog_about") + Dialog_about.resize(610, 677) + Dialog_about.setMinimumSize(QtCore.QSize(610, 500)) + self.verticalLayout_3 = QtWidgets.QVBoxLayout(Dialog_about) + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.label_2 = QtWidgets.QLabel(Dialog_about) + font = QtGui.QFont() + font.setPointSize(12) + font.setBold(True) + font.setWeight(75) + self.label_2.setFont(font) + self.label_2.setTextFormat(QtCore.Qt.TextFormat.AutoText) + self.label_2.setWordWrap(True) + self.label_2.setObjectName("label_2") + self.verticalLayout_3.addWidget(self.label_2) + self.formLayout = QtWidgets.QFormLayout() + self.formLayout.setObjectName("formLayout") + self.label_8 = QtWidgets.QLabel(Dialog_about) + self.label_8.setObjectName("label_8") + self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_8) + self.label_version = QtWidgets.QLabel(Dialog_about) + self.label_version.setObjectName("label_version") + self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_version) + self.label_6 = QtWidgets.QLabel(Dialog_about) + self.label_6.setObjectName("label_6") + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_6) + self.label_email = QtWidgets.QLabel(Dialog_about) + self.label_email.setObjectName("label_email") + self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_email) + self.label_7 = QtWidgets.QLabel(Dialog_about) + self.label_7.setObjectName("label_7") + self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_7) + self.label_copyright = QtWidgets.QLabel(Dialog_about) + self.label_copyright.setObjectName("label_copyright") + self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_copyright) + self.label_9 = QtWidgets.QLabel(Dialog_about) + self.label_9.setObjectName("label_9") + self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_9) + self.label_git_repo = QtWidgets.QLabel(Dialog_about) + self.label_git_repo.setOpenExternalLinks(True) + self.label_git_repo.setObjectName("label_git_repo") + self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_git_repo) + self.label_5 = QtWidgets.QLabel(Dialog_about) + self.label_5.setObjectName("label_5") + self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_5) + self.label_pypi_repo = QtWidgets.QLabel(Dialog_about) + self.label_pypi_repo.setObjectName("label_pypi_repo") + self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_pypi_repo) + self.label_10 = QtWidgets.QLabel(Dialog_about) + self.label_10.setObjectName("label_10") + self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_10) + self.label_author = QtWidgets.QLabel(Dialog_about) + self.label_author.setObjectName("label_author") + self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.label_author) + self.verticalLayout_3.addLayout(self.formLayout) + spacerItem = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed) + self.verticalLayout_3.addItem(spacerItem) + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.label_4 = QtWidgets.QLabel(Dialog_about) + self.label_4.setWordWrap(True) + self.label_4.setOpenExternalLinks(True) + self.label_4.setObjectName("label_4") + self.horizontalLayout.addWidget(self.label_4) + self.label = QtWidgets.QLabel(Dialog_about) + self.label.setText("") + self.label.setPixmap(QtGui.QPixmap(":/logos/logos/Uni_Logo_2016_SW_230px-wide.jpg")) + self.label.setScaledContents(False) + self.label.setObjectName("label") + self.horizontalLayout.addWidget(self.label) + self.verticalLayout_3.addLayout(self.horizontalLayout) + spacerItem1 = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed) + self.verticalLayout_3.addItem(spacerItem1) + self.groupBox = QtWidgets.QGroupBox(Dialog_about) + self.groupBox.setObjectName("groupBox") + self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.label_3 = QtWidgets.QLabel(self.groupBox) + self.label_3.setOpenExternalLinks(True) + self.label_3.setObjectName("label_3") + self.verticalLayout.addWidget(self.label_3) + self.plainTextEdit = QtWidgets.QPlainTextEdit(self.groupBox) + font = QtGui.QFont() + font.setPointSize(10) + self.plainTextEdit.setFont(font) + self.plainTextEdit.setObjectName("plainTextEdit") + self.verticalLayout.addWidget(self.plainTextEdit) + self.verticalLayout_2.addLayout(self.verticalLayout) + self.verticalLayout_3.addWidget(self.groupBox) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog_about) + self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Close) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout_3.addWidget(self.buttonBox) + + self.retranslateUi(Dialog_about) + self.buttonBox.accepted.connect(Dialog_about.accept) # type: ignore + self.buttonBox.rejected.connect(Dialog_about.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Dialog_about) + + def retranslateUi(self, Dialog_about): + _translate = QtCore.QCoreApplication.translate + Dialog_about.setWindowTitle(_translate("Dialog_about", "About")) + self.label_2.setText(_translate("Dialog_about", "LifeScale utils")) + self.label_8.setText(_translate("Dialog_about", "Version:")) + self.label_version.setText(_translate("Dialog_about", "version")) + self.label_6.setText(_translate("Dialog_about", "Contact:")) + self.label_email.setText(_translate("Dialog_about", "email")) + self.label_7.setText(_translate("Dialog_about", "Copyright:")) + self.label_copyright.setText(_translate("Dialog_about", "copyright")) + self.label_9.setText(_translate("Dialog_about", "Git repository:")) + self.label_git_repo.setText(_translate("Dialog_about", "git_repo")) + self.label_5.setText(_translate("Dialog_about", "pypi.org repository:")) + self.label_pypi_repo.setText(_translate("Dialog_about", "pypi_repo")) + self.label_10.setText(_translate("Dialog_about", "Author:")) + self.label_author.setText(_translate("Dialog_about", "author")) + self.label_4.setText(_translate("Dialog_about", "<html><head/><body><p>LifeScale utils was funded by the <a href=\"https://cmess.univie.ac.at/\"><span style=\" text-decoration: underline; color:#0000ff;\">Centre for Microbiology and Environmental Systems Science (CMESS) of the University of Vienna</span></a>.</p></body></html>")) + self.groupBox.setTitle(_translate("Dialog_about", "License")) + self.label_3.setText(_translate("Dialog_about", "<html><head/><body><p>LifeScale utils is licensed under the <a href=\"https://www.gnu.org/licenses/gpl-3.0.de.html\"><span style=\" text-decoration: underline; color:#0000ff;\">GNU General Public License 3</span></a>.</p></body></html>")) + self.plainTextEdit.setPlainText(_translate("Dialog_about", " GNU GENERAL PUBLIC LICENSE\n" +" Version 3, 29 June 2007\n" +"\n" +" Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n" +" Everyone is permitted to copy and distribute verbatim copies\n" +" of this license document, but changing it is not allowed.\n" +"\n" +" Preamble\n" +"\n" +" The GNU General Public License is a free, copyleft license for\n" +"software and other kinds of works.\n" +"\n" +" The licenses for most software and other practical works are designed\n" +"to take away your freedom to share and change the works. By contrast,\n" +"the GNU General Public License is intended to guarantee your freedom to\n" +"share and change all versions of a program--to make sure it remains free\n" +"software for all its users. We, the Free Software Foundation, use the\n" +"GNU General Public License for most of our software; it applies also to\n" +"any other work released this way by its authors. You can apply it to\n" +"your programs, too.\n" +"\n" +" When we speak of free software, we are referring to freedom, not\n" +"price. Our General Public Licenses are designed to make sure that you\n" +"have the freedom to distribute copies of free software (and charge for\n" +"them if you wish), that you receive source code or can get it if you\n" +"want it, that you can change the software or use pieces of it in new\n" +"free programs, and that you know you can do these things.\n" +"\n" +" To protect your rights, we need to prevent others from denying you\n" +"these rights or asking you to surrender the rights. Therefore, you have\n" +"certain responsibilities if you distribute copies of the software, or if\n" +"you modify it: responsibilities to respect the freedom of others.\n" +"\n" +" For example, if you distribute copies of such a program, whether\n" +"gratis or for a fee, you must pass on to the recipients the same\n" +"freedoms that you received. You must make sure that they, too, receive\n" +"or can get the source code. And you must show them these terms so they\n" +"know their rights.\n" +"\n" +" Developers that use the GNU GPL protect your rights with two steps:\n" +"(1) assert copyright on the software, and (2) offer you this License\n" +"giving you legal permission to copy, distribute and/or modify it.\n" +"\n" +" For the developers\' and authors\' protection, the GPL clearly explains\n" +"that there is no warranty for this free software. For both users\' and\n" +"authors\' sake, the GPL requires that modified versions be marked as\n" +"changed, so that their problems will not be attributed erroneously to\n" +"authors of previous versions.\n" +"\n" +" Some devices are designed to deny users access to install or run\n" +"modified versions of the software inside them, although the manufacturer\n" +"can do so. This is fundamentally incompatible with the aim of\n" +"protecting users\' freedom to change the software. The systematic\n" +"pattern of such abuse occurs in the area of products for individuals to\n" +"use, which is precisely where it is most unacceptable. Therefore, we\n" +"have designed this version of the GPL to prohibit the practice for those\n" +"products. If such problems arise substantially in other domains, we\n" +"stand ready to extend this provision to those domains in future versions\n" +"of the GPL, as needed to protect the freedom of users.\n" +"\n" +" Finally, every program is threatened constantly by software patents.\n" +"States should not allow patents to restrict development and use of\n" +"software on general-purpose computers, but in those that do, we wish to\n" +"avoid the special danger that patents applied to a free program could\n" +"make it effectively proprietary. To prevent this, the GPL assures that\n" +"patents cannot be used to render the program non-free.\n" +"\n" +" The precise terms and conditions for copying, distribution and\n" +"modification follow.\n" +"\n" +" TERMS AND CONDITIONS\n" +"\n" +" 0. Definitions.\n" +"\n" +" \"This License\" refers to version 3 of the GNU General Public License.\n" +"\n" +" \"Copyright\" also means copyright-like laws that apply to other kinds of\n" +"works, such as semiconductor masks.\n" +"\n" +" \"The Program\" refers to any copyrightable work licensed under this\n" +"License. Each licensee is addressed as \"you\". \"Licensees\" and\n" +"\"recipients\" may be individuals or organizations.\n" +"\n" +" To \"modify\" a work means to copy from or adapt all or part of the work\n" +"in a fashion requiring copyright permission, other than the making of an\n" +"exact copy. The resulting work is called a \"modified version\" of the\n" +"earlier work or a work \"based on\" the earlier work.\n" +"\n" +" A \"covered work\" means either the unmodified Program or a work based\n" +"on the Program.\n" +"\n" +" To \"propagate\" a work means to do anything with it that, without\n" +"permission, would make you directly or secondarily liable for\n" +"infringement under applicable copyright law, except executing it on a\n" +"computer or modifying a private copy. Propagation includes copying,\n" +"distribution (with or without modification), making available to the\n" +"public, and in some countries other activities as well.\n" +"\n" +" To \"convey\" a work means any kind of propagation that enables other\n" +"parties to make or receive copies. Mere interaction with a user through\n" +"a computer network, with no transfer of a copy, is not conveying.\n" +"\n" +" An interactive user interface displays \"Appropriate Legal Notices\"\n" +"to the extent that it includes a convenient and prominently visible\n" +"feature that (1) displays an appropriate copyright notice, and (2)\n" +"tells the user that there is no warranty for the work (except to the\n" +"extent that warranties are provided), that licensees may convey the\n" +"work under this License, and how to view a copy of this License. If\n" +"the interface presents a list of user commands or options, such as a\n" +"menu, a prominent item in the list meets this criterion.\n" +"\n" +" 1. Source Code.\n" +"\n" +" The \"source code\" for a work means the preferred form of the work\n" +"for making modifications to it. \"Object code\" means any non-source\n" +"form of a work.\n" +"\n" +" A \"Standard Interface\" means an interface that either is an official\n" +"standard defined by a recognized standards body, or, in the case of\n" +"interfaces specified for a particular programming language, one that\n" +"is widely used among developers working in that language.\n" +"\n" +" The \"System Libraries\" of an executable work include anything, other\n" +"than the work as a whole, that (a) is included in the normal form of\n" +"packaging a Major Component, but which is not part of that Major\n" +"Component, and (b) serves only to enable use of the work with that\n" +"Major Component, or to implement a Standard Interface for which an\n" +"implementation is available to the public in source code form. A\n" +"\"Major Component\", in this context, means a major essential component\n" +"(kernel, window system, and so on) of the specific operating system\n" +"(if any) on which the executable work runs, or a compiler used to\n" +"produce the work, or an object code interpreter used to run it.\n" +"\n" +" The \"Corresponding Source\" for a work in object code form means all\n" +"the source code needed to generate, install, and (for an executable\n" +"work) run the object code and to modify the work, including scripts to\n" +"control those activities. However, it does not include the work\'s\n" +"System Libraries, or general-purpose tools or generally available free\n" +"programs which are used unmodified in performing those activities but\n" +"which are not part of the work. For example, Corresponding Source\n" +"includes interface definition files associated with source files for\n" +"the work, and the source code for shared libraries and dynamically\n" +"linked subprograms that the work is specifically designed to require,\n" +"such as by intimate data communication or control flow between those\n" +"subprograms and other parts of the work.\n" +"\n" +" The Corresponding Source need not include anything that users\n" +"can regenerate automatically from other parts of the Corresponding\n" +"Source.\n" +"\n" +" The Corresponding Source for a work in source code form is that\n" +"same work.\n" +"\n" +" 2. Basic Permissions.\n" +"\n" +" All rights granted under this License are granted for the term of\n" +"copyright on the Program, and are irrevocable provided the stated\n" +"conditions are met. This License explicitly affirms your unlimited\n" +"permission to run the unmodified Program. The output from running a\n" +"covered work is covered by this License only if the output, given its\n" +"content, constitutes a covered work. This License acknowledges your\n" +"rights of fair use or other equivalent, as provided by copyright law.\n" +"\n" +" You may make, run and propagate covered works that you do not\n" +"convey, without conditions so long as your license otherwise remains\n" +"in force. You may convey covered works to others for the sole purpose\n" +"of having them make modifications exclusively for you, or provide you\n" +"with facilities for running those works, provided that you comply with\n" +"the terms of this License in conveying all material for which you do\n" +"not control copyright. Those thus making or running the covered works\n" +"for you must do so exclusively on your behalf, under your direction\n" +"and control, on terms that prohibit them from making any copies of\n" +"your copyrighted material outside their relationship with you.\n" +"\n" +" Conveying under any other circumstances is permitted solely under\n" +"the conditions stated below. Sublicensing is not allowed; section 10\n" +"makes it unnecessary.\n" +"\n" +" 3. Protecting Users\' Legal Rights From Anti-Circumvention Law.\n" +"\n" +" No covered work shall be deemed part of an effective technological\n" +"measure under any applicable law fulfilling obligations under article\n" +"11 of the WIPO copyright treaty adopted on 20 December 1996, or\n" +"similar laws prohibiting or restricting circumvention of such\n" +"measures.\n" +"\n" +" When you convey a covered work, you waive any legal power to forbid\n" +"circumvention of technological measures to the extent such circumvention\n" +"is effected by exercising rights under this License with respect to\n" +"the covered work, and you disclaim any intention to limit operation or\n" +"modification of the work as a means of enforcing, against the work\'s\n" +"users, your or third parties\' legal rights to forbid circumvention of\n" +"technological measures.\n" +"\n" +" 4. Conveying Verbatim Copies.\n" +"\n" +" You may convey verbatim copies of the Program\'s source code as you\n" +"receive it, in any medium, provided that you conspicuously and\n" +"appropriately publish on each copy an appropriate copyright notice;\n" +"keep intact all notices stating that this License and any\n" +"non-permissive terms added in accord with section 7 apply to the code;\n" +"keep intact all notices of the absence of any warranty; and give all\n" +"recipients a copy of this License along with the Program.\n" +"\n" +" You may charge any price or no price for each copy that you convey,\n" +"and you may offer support or warranty protection for a fee.\n" +"\n" +" 5. Conveying Modified Source Versions.\n" +"\n" +" You may convey a work based on the Program, or the modifications to\n" +"produce it from the Program, in the form of source code under the\n" +"terms of section 4, provided that you also meet all of these conditions:\n" +"\n" +" a) The work must carry prominent notices stating that you modified\n" +" it, and giving a relevant date.\n" +"\n" +" b) The work must carry prominent notices stating that it is\n" +" released under this License and any conditions added under section\n" +" 7. This requirement modifies the requirement in section 4 to\n" +" \"keep intact all notices\".\n" +"\n" +" c) You must license the entire work, as a whole, under this\n" +" License to anyone who comes into possession of a copy. This\n" +" License will therefore apply, along with any applicable section 7\n" +" additional terms, to the whole of the work, and all its parts,\n" +" regardless of how they are packaged. This License gives no\n" +" permission to license the work in any other way, but it does not\n" +" invalidate such permission if you have separately received it.\n" +"\n" +" d) If the work has interactive user interfaces, each must display\n" +" Appropriate Legal Notices; however, if the Program has interactive\n" +" interfaces that do not display Appropriate Legal Notices, your\n" +" work need not make them do so.\n" +"\n" +" A compilation of a covered work with other separate and independent\n" +"works, which are not by their nature extensions of the covered work,\n" +"and which are not combined with it such as to form a larger program,\n" +"in or on a volume of a storage or distribution medium, is called an\n" +"\"aggregate\" if the compilation and its resulting copyright are not\n" +"used to limit the access or legal rights of the compilation\'s users\n" +"beyond what the individual works permit. Inclusion of a covered work\n" +"in an aggregate does not cause this License to apply to the other\n" +"parts of the aggregate.\n" +"\n" +" 6. Conveying Non-Source Forms.\n" +"\n" +" You may convey a covered work in object code form under the terms\n" +"of sections 4 and 5, provided that you also convey the\n" +"machine-readable Corresponding Source under the terms of this License,\n" +"in one of these ways:\n" +"\n" +" a) Convey the object code in, or embodied in, a physical product\n" +" (including a physical distribution medium), accompanied by the\n" +" Corresponding Source fixed on a durable physical medium\n" +" customarily used for software interchange.\n" +"\n" +" b) Convey the object code in, or embodied in, a physical product\n" +" (including a physical distribution medium), accompanied by a\n" +" written offer, valid for at least three years and valid for as\n" +" long as you offer spare parts or customer support for that product\n" +" model, to give anyone who possesses the object code either (1) a\n" +" copy of the Corresponding Source for all the software in the\n" +" product that is covered by this License, on a durable physical\n" +" medium customarily used for software interchange, for a price no\n" +" more than your reasonable cost of physically performing this\n" +" conveying of source, or (2) access to copy the\n" +" Corresponding Source from a network server at no charge.\n" +"\n" +" c) Convey individual copies of the object code with a copy of the\n" +" written offer to provide the Corresponding Source. This\n" +" alternative is allowed only occasionally and noncommercially, and\n" +" only if you received the object code with such an offer, in accord\n" +" with subsection 6b.\n" +"\n" +" d) Convey the object code by offering access from a designated\n" +" place (gratis or for a charge), and offer equivalent access to the\n" +" Corresponding Source in the same way through the same place at no\n" +" further charge. You need not require recipients to copy the\n" +" Corresponding Source along with the object code. If the place to\n" +" copy the object code is a network server, the Corresponding Source\n" +" may be on a different server (operated by you or a third party)\n" +" that supports equivalent copying facilities, provided you maintain\n" +" clear directions next to the object code saying where to find the\n" +" Corresponding Source. Regardless of what server hosts the\n" +" Corresponding Source, you remain obligated to ensure that it is\n" +" available for as long as needed to satisfy these requirements.\n" +"\n" +" e) Convey the object code using peer-to-peer transmission, provided\n" +" you inform other peers where the object code and Corresponding\n" +" Source of the work are being offered to the general public at no\n" +" charge under subsection 6d.\n" +"\n" +" A separable portion of the object code, whose source code is excluded\n" +"from the Corresponding Source as a System Library, need not be\n" +"included in conveying the object code work.\n" +"\n" +" A \"User Product\" is either (1) a \"consumer product\", which means any\n" +"tangible personal property which is normally used for personal, family,\n" +"or household purposes, or (2) anything designed or sold for incorporation\n" +"into a dwelling. In determining whether a product is a consumer product,\n" +"doubtful cases shall be resolved in favor of coverage. For a particular\n" +"product received by a particular user, \"normally used\" refers to a\n" +"typical or common use of that class of product, regardless of the status\n" +"of the particular user or of the way in which the particular user\n" +"actually uses, or expects or is expected to use, the product. A product\n" +"is a consumer product regardless of whether the product has substantial\n" +"commercial, industrial or non-consumer uses, unless such uses represent\n" +"the only significant mode of use of the product.\n" +"\n" +" \"Installation Information\" for a User Product means any methods,\n" +"procedures, authorization keys, or other information required to install\n" +"and execute modified versions of a covered work in that User Product from\n" +"a modified version of its Corresponding Source. The information must\n" +"suffice to ensure that the continued functioning of the modified object\n" +"code is in no case prevented or interfered with solely because\n" +"modification has been made.\n" +"\n" +" If you convey an object code work under this section in, or with, or\n" +"specifically for use in, a User Product, and the conveying occurs as\n" +"part of a transaction in which the right of possession and use of the\n" +"User Product is transferred to the recipient in perpetuity or for a\n" +"fixed term (regardless of how the transaction is characterized), the\n" +"Corresponding Source conveyed under this section must be accompanied\n" +"by the Installation Information. But this requirement does not apply\n" +"if neither you nor any third party retains the ability to install\n" +"modified object code on the User Product (for example, the work has\n" +"been installed in ROM).\n" +"\n" +" The requirement to provide Installation Information does not include a\n" +"requirement to continue to provide support service, warranty, or updates\n" +"for a work that has been modified or installed by the recipient, or for\n" +"the User Product in which it has been modified or installed. Access to a\n" +"network may be denied when the modification itself materially and\n" +"adversely affects the operation of the network or violates the rules and\n" +"protocols for communication across the network.\n" +"\n" +" Corresponding Source conveyed, and Installation Information provided,\n" +"in accord with this section must be in a format that is publicly\n" +"documented (and with an implementation available to the public in\n" +"source code form), and must require no special password or key for\n" +"unpacking, reading or copying.\n" +"\n" +" 7. Additional Terms.\n" +"\n" +" \"Additional permissions\" are terms that supplement the terms of this\n" +"License by making exceptions from one or more of its conditions.\n" +"Additional permissions that are applicable to the entire Program shall\n" +"be treated as though they were included in this License, to the extent\n" +"that they are valid under applicable law. If additional permissions\n" +"apply only to part of the Program, that part may be used separately\n" +"under those permissions, but the entire Program remains governed by\n" +"this License without regard to the additional permissions.\n" +"\n" +" When you convey a copy of a covered work, you may at your option\n" +"remove any additional permissions from that copy, or from any part of\n" +"it. (Additional permissions may be written to require their own\n" +"removal in certain cases when you modify the work.) You may place\n" +"additional permissions on material, added by you to a covered work,\n" +"for which you have or can give appropriate copyright permission.\n" +"\n" +" Notwithstanding any other provision of this License, for material you\n" +"add to a covered work, you may (if authorized by the copyright holders of\n" +"that material) supplement the terms of this License with terms:\n" +"\n" +" a) Disclaiming warranty or limiting liability differently from the\n" +" terms of sections 15 and 16 of this License; or\n" +"\n" +" b) Requiring preservation of specified reasonable legal notices or\n" +" author attributions in that material or in the Appropriate Legal\n" +" Notices displayed by works containing it; or\n" +"\n" +" c) Prohibiting misrepresentation of the origin of that material, or\n" +" requiring that modified versions of such material be marked in\n" +" reasonable ways as different from the original version; or\n" +"\n" +" d) Limiting the use for publicity purposes of names of licensors or\n" +" authors of the material; or\n" +"\n" +" e) Declining to grant rights under trademark law for use of some\n" +" trade names, trademarks, or service marks; or\n" +"\n" +" f) Requiring indemnification of licensors and authors of that\n" +" material by anyone who conveys the material (or modified versions of\n" +" it) with contractual assumptions of liability to the recipient, for\n" +" any liability that these contractual assumptions directly impose on\n" +" those licensors and authors.\n" +"\n" +" All other non-permissive additional terms are considered \"further\n" +"restrictions\" within the meaning of section 10. If the Program as you\n" +"received it, or any part of it, contains a notice stating that it is\n" +"governed by this License along with a term that is a further\n" +"restriction, you may remove that term. If a license document contains\n" +"a further restriction but permits relicensing or conveying under this\n" +"License, you may add to a covered work material governed by the terms\n" +"of that license document, provided that the further restriction does\n" +"not survive such relicensing or conveying.\n" +"\n" +" If you add terms to a covered work in accord with this section, you\n" +"must place, in the relevant source files, a statement of the\n" +"additional terms that apply to those files, or a notice indicating\n" +"where to find the applicable terms.\n" +"\n" +" Additional terms, permissive or non-permissive, may be stated in the\n" +"form of a separately written license, or stated as exceptions;\n" +"the above requirements apply either way.\n" +"\n" +" 8. Termination.\n" +"\n" +" You may not propagate or modify a covered work except as expressly\n" +"provided under this License. Any attempt otherwise to propagate or\n" +"modify it is void, and will automatically terminate your rights under\n" +"this License (including any patent licenses granted under the third\n" +"paragraph of section 11).\n" +"\n" +" However, if you cease all violation of this License, then your\n" +"license from a particular copyright holder is reinstated (a)\n" +"provisionally, unless and until the copyright holder explicitly and\n" +"finally terminates your license, and (b) permanently, if the copyright\n" +"holder fails to notify you of the violation by some reasonable means\n" +"prior to 60 days after the cessation.\n" +"\n" +" Moreover, your license from a particular copyright holder is\n" +"reinstated permanently if the copyright holder notifies you of the\n" +"violation by some reasonable means, this is the first time you have\n" +"received notice of violation of this License (for any work) from that\n" +"copyright holder, and you cure the violation prior to 30 days after\n" +"your receipt of the notice.\n" +"\n" +" Termination of your rights under this section does not terminate the\n" +"licenses of parties who have received copies or rights from you under\n" +"this License. If your rights have been terminated and not permanently\n" +"reinstated, you do not qualify to receive new licenses for the same\n" +"material under section 10.\n" +"\n" +" 9. Acceptance Not Required for Having Copies.\n" +"\n" +" You are not required to accept this License in order to receive or\n" +"run a copy of the Program. Ancillary propagation of a covered work\n" +"occurring solely as a consequence of using peer-to-peer transmission\n" +"to receive a copy likewise does not require acceptance. However,\n" +"nothing other than this License grants you permission to propagate or\n" +"modify any covered work. These actions infringe copyright if you do\n" +"not accept this License. Therefore, by modifying or propagating a\n" +"covered work, you indicate your acceptance of this License to do so.\n" +"\n" +" 10. Automatic Licensing of Downstream Recipients.\n" +"\n" +" Each time you convey a covered work, the recipient automatically\n" +"receives a license from the original licensors, to run, modify and\n" +"propagate that work, subject to this License. You are not responsible\n" +"for enforcing compliance by third parties with this License.\n" +"\n" +" An \"entity transaction\" is a transaction transferring control of an\n" +"organization, or substantially all assets of one, or subdividing an\n" +"organization, or merging organizations. If propagation of a covered\n" +"work results from an entity transaction, each party to that\n" +"transaction who receives a copy of the work also receives whatever\n" +"licenses to the work the party\'s predecessor in interest had or could\n" +"give under the previous paragraph, plus a right to possession of the\n" +"Corresponding Source of the work from the predecessor in interest, if\n" +"the predecessor has it or can get it with reasonable efforts.\n" +"\n" +" You may not impose any further restrictions on the exercise of the\n" +"rights granted or affirmed under this License. For example, you may\n" +"not impose a license fee, royalty, or other charge for exercise of\n" +"rights granted under this License, and you may not initiate litigation\n" +"(including a cross-claim or counterclaim in a lawsuit) alleging that\n" +"any patent claim is infringed by making, using, selling, offering for\n" +"sale, or importing the Program or any portion of it.\n" +"\n" +" 11. Patents.\n" +"\n" +" A \"contributor\" is a copyright holder who authorizes use under this\n" +"License of the Program or a work on which the Program is based. The\n" +"work thus licensed is called the contributor\'s \"contributor version\".\n" +"\n" +" A contributor\'s \"essential patent claims\" are all patent claims\n" +"owned or controlled by the contributor, whether already acquired or\n" +"hereafter acquired, that would be infringed by some manner, permitted\n" +"by this License, of making, using, or selling its contributor version,\n" +"but do not include claims that would be infringed only as a\n" +"consequence of further modification of the contributor version. For\n" +"purposes of this definition, \"control\" includes the right to grant\n" +"patent sublicenses in a manner consistent with the requirements of\n" +"this License.\n" +"\n" +" Each contributor grants you a non-exclusive, worldwide, royalty-free\n" +"patent license under the contributor\'s essential patent claims, to\n" +"make, use, sell, offer for sale, import and otherwise run, modify and\n" +"propagate the contents of its contributor version.\n" +"\n" +" In the following three paragraphs, a \"patent license\" is any express\n" +"agreement or commitment, however denominated, not to enforce a patent\n" +"(such as an express permission to practice a patent or covenant not to\n" +"sue for patent infringement). To \"grant\" such a patent license to a\n" +"party means to make such an agreement or commitment not to enforce a\n" +"patent against the party.\n" +"\n" +" If you convey a covered work, knowingly relying on a patent license,\n" +"and the Corresponding Source of the work is not available for anyone\n" +"to copy, free of charge and under the terms of this License, through a\n" +"publicly available network server or other readily accessible means,\n" +"then you must either (1) cause the Corresponding Source to be so\n" +"available, or (2) arrange to deprive yourself of the benefit of the\n" +"patent license for this particular work, or (3) arrange, in a manner\n" +"consistent with the requirements of this License, to extend the patent\n" +"license to downstream recipients. \"Knowingly relying\" means you have\n" +"actual knowledge that, but for the patent license, your conveying the\n" +"covered work in a country, or your recipient\'s use of the covered work\n" +"in a country, would infringe one or more identifiable patents in that\n" +"country that you have reason to believe are valid.\n" +"\n" +" If, pursuant to or in connection with a single transaction or\n" +"arrangement, you convey, or propagate by procuring conveyance of, a\n" +"covered work, and grant a patent license to some of the parties\n" +"receiving the covered work authorizing them to use, propagate, modify\n" +"or convey a specific copy of the covered work, then the patent license\n" +"you grant is automatically extended to all recipients of the covered\n" +"work and works based on it.\n" +"\n" +" A patent license is \"discriminatory\" if it does not include within\n" +"the scope of its coverage, prohibits the exercise of, or is\n" +"conditioned on the non-exercise of one or more of the rights that are\n" +"specifically granted under this License. You may not convey a covered\n" +"work if you are a party to an arrangement with a third party that is\n" +"in the business of distributing software, under which you make payment\n" +"to the third party based on the extent of your activity of conveying\n" +"the work, and under which the third party grants, to any of the\n" +"parties who would receive the covered work from you, a discriminatory\n" +"patent license (a) in connection with copies of the covered work\n" +"conveyed by you (or copies made from those copies), or (b) primarily\n" +"for and in connection with specific products or compilations that\n" +"contain the covered work, unless you entered into that arrangement,\n" +"or that patent license was granted, prior to 28 March 2007.\n" +"\n" +" Nothing in this License shall be construed as excluding or limiting\n" +"any implied license or other defenses to infringement that may\n" +"otherwise be available to you under applicable patent law.\n" +"\n" +" 12. No Surrender of Others\' Freedom.\n" +"\n" +" If conditions are imposed on you (whether by court order, agreement or\n" +"otherwise) that contradict the conditions of this License, they do not\n" +"excuse you from the conditions of this License. If you cannot convey a\n" +"covered work so as to satisfy simultaneously your obligations under this\n" +"License and any other pertinent obligations, then as a consequence you may\n" +"not convey it at all. For example, if you agree to terms that obligate you\n" +"to collect a royalty for further conveying from those to whom you convey\n" +"the Program, the only way you could satisfy both those terms and this\n" +"License would be to refrain entirely from conveying the Program.\n" +"\n" +" 13. Use with the GNU Affero General Public License.\n" +"\n" +" Notwithstanding any other provision of this License, you have\n" +"permission to link or combine any covered work with a work licensed\n" +"under version 3 of the GNU Affero General Public License into a single\n" +"combined work, and to convey the resulting work. The terms of this\n" +"License will continue to apply to the part which is the covered work,\n" +"but the special requirements of the GNU Affero General Public License,\n" +"section 13, concerning interaction through a network will apply to the\n" +"combination as such.\n" +"\n" +" 14. Revised Versions of this License.\n" +"\n" +" The Free Software Foundation may publish revised and/or new versions of\n" +"the GNU General Public License from time to time. Such new versions will\n" +"be similar in spirit to the present version, but may differ in detail to\n" +"address new problems or concerns.\n" +"\n" +" Each version is given a distinguishing version number. If the\n" +"Program specifies that a certain numbered version of the GNU General\n" +"Public License \"or any later version\" applies to it, you have the\n" +"option of following the terms and conditions either of that numbered\n" +"version or of any later version published by the Free Software\n" +"Foundation. If the Program does not specify a version number of the\n" +"GNU General Public License, you may choose any version ever published\n" +"by the Free Software Foundation.\n" +"\n" +" If the Program specifies that a proxy can decide which future\n" +"versions of the GNU General Public License can be used, that proxy\'s\n" +"public statement of acceptance of a version permanently authorizes you\n" +"to choose that version for the Program.\n" +"\n" +" Later license versions may give you additional or different\n" +"permissions. However, no additional obligations are imposed on any\n" +"author or copyright holder as a result of your choosing to follow a\n" +"later version.\n" +"\n" +" 15. Disclaimer of Warranty.\n" +"\n" +" THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\n" +"APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\n" +"HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\n" +"OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\n" +"THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" +"PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\n" +"IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\n" +"ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n" +"\n" +" 16. Limitation of Liability.\n" +"\n" +" IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n" +"WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\n" +"THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\n" +"GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\n" +"USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\n" +"DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\n" +"PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\n" +"EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\n" +"SUCH DAMAGES.\n" +"\n" +" 17. Interpretation of Sections 15 and 16.\n" +"\n" +" If the disclaimer of warranty and limitation of liability provided\n" +"above cannot be given local legal effect according to their terms,\n" +"reviewing courts shall apply local law that most closely approximates\n" +"an absolute waiver of all civil liability in connection with the\n" +"Program, unless a warranty or assumption of liability accompanies a\n" +"copy of the Program in return for a fee.")) diff --git a/lifescale/gui/dialog_about.ui b/lifescale/gui/dialog_about.ui new file mode 100644 index 0000000000000000000000000000000000000000..bd3dcc2e802d91b1da378343dd4709497e08d754 --- /dev/null +++ b/lifescale/gui/dialog_about.ui @@ -0,0 +1,898 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Dialog_about</class> + <widget class="QDialog" name="Dialog_about"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>610</width> + <height>677</height> + </rect> + </property> + <property name="minimumSize"> + <size> + <width>610</width> + <height>500</height> + </size> + </property> + <property name="windowTitle"> + <string>About</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <pointsize>12</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>LifeScale utils</string> + </property> + <property name="textFormat"> + <enum>Qt::AutoText</enum> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>Version:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="label_version"> + <property name="text"> + <string>version</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_6"> + <property name="text"> + <string>Contact:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="label_email"> + <property name="text"> + <string>email</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_7"> + <property name="text"> + <string>Copyright:</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLabel" name="label_copyright"> + <property name="text"> + <string>copyright</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_9"> + <property name="text"> + <string>Git repository:</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLabel" name="label_git_repo"> + <property name="text"> + <string>git_repo</string> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>pypi.org repository:</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLabel" name="label_pypi_repo"> + <property name="text"> + <string>pypi_repo</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_10"> + <property name="text"> + <string>Author:</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="label_author"> + <property name="text"> + <string>author</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string><html><head/><body><p>LifeScale utils was funded by the <a href="https://cmess.univie.ac.at/"><span style=" text-decoration: underline; color:#0000ff;">Centre for Microbiology and Environmental Systems Science (CMESS) of the University of Vienna</span></a>.</p></body></html></string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/logos/logos/Uni_Logo_2016_SW_230px-wide.jpg</pixmap> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>License</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string><html><head/><body><p>LifeScale utils is licensed under the <a href="https://www.gnu.org/licenses/gpl-3.0.de.html"><span style=" text-decoration: underline; color:#0000ff;">GNU General Public License 3</span></a>.</p></body></html></string> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QPlainTextEdit" name="plainTextEdit"> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> + <property name="plainText"> + <string> GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee.</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Close</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources> + <include location="resources.qrc"/> + </resources> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>Dialog_about</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>Dialog_about</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/lifescale/gui/gui_main.py b/lifescale/gui/gui_main.py index 4bfbecadb8f7a91011c94714f3e6c0adcc92de1f..cc2f81d56641db6930cf7ff7cab97527ae8facf4 100644 --- a/lifescale/gui/gui_main.py +++ b/lifescale/gui/gui_main.py @@ -1,8 +1,30 @@ import sys import os -from PyQt6.QtWidgets import QApplication, QMainWindow +from PyQt6.QtWidgets import QApplication, QMainWindow, QMessageBox, QFileDialog, QDialog +from PyQt6.QtCore import pyqtSlot, QDir, Qt +import numpy as np +import pyqtgraph as pg from lifescale.gui.MainWindow import Ui_MainWindow +from lifescale.gui.dialog_about import Ui_Dialog_about +from lifescale.models.ls_data import LSData +from lifescale.gui.panel_metadata_model import PanelMetadataModel +from lifescale.gui.sample_summary_model import SampleSummaryModel +from lifescale.gui.masses_model import MassesModel +from lifescale.gui import resources +from lifescale import __version__, __author__, __git_repo__, __email__, __copyright__, __pypi_repo__ + +# https://numpy.org/doc/stable/reference/generated/numpy.histogram_bin_edges.html#numpy.histogram_bin_edges +NUMPY_HISTOGRAM_BIN_EDGES_OPTIONS = { + 'auto': 'Maximum of the ‘sturges’ and ‘fd’ estimators. Provides good all around performance.', + 'fd': 'Freedman Diaconis Estimator: Robust (resilient to outliers) estimator that takes into account data variability and data size.', + 'doane': 'An improved version of Sturges’ estimator that works better with non-normal datasets.', + 'scott': 'Estimator based on leave-one-out cross-validation estimate of the integrated squared error. Can be regarded as a generalization of Scott’s rule.', + 'rice': 'Estimator does not take variability into account, only data size. Commonly overestimates number of bins required.', + 'sturges': 'R’s default method, only accounts for data size. Only optimal for gaussian data and underestimates number of bins for large non-gaussian datasets.', + 'sqrt': 'Square root (of data size) estimator, used by Excel and other programs for its speed and simplicity.', + 'Num. of bins': 'User defined number of bins (max. 1000).' +} class MainWindow(QMainWindow, Ui_MainWindow): @@ -11,15 +33,450 @@ class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self): """Initializer.""" + # Attributes: + # - GUI objects: + self.sample_list = None + self.glw_sample_histogram = None + self.sample_histogram = None + self.masses_region = None + self.hist_marker_mean_all = None + self.hist_marker_mean_selected = None + self.hist_marker_median_selected = None + self.hist_marker_median_all = None + self.hist = None + # - other objects: + self.ls_data = None + self.settings = { + 'hist_number_of_bins': None, + 'hist_bin_mode': 'auto', + } + # GUI: super().__init__() self.setupUi(self) # Connect signals and slots: + self.action_Exit.triggered.connect(self.exit_application) + self.actionLoad_xlsm_file.triggered.connect(self.on_menu_file_load_xlsm_file) + self.action_About.triggered.connect(self.on_menu_help_about) + self.action_csvFiles.triggered.connect(self.on_action_csvFiles) + self.listWidget_Samples.itemSelectionChanged.connect(self.on_selection_changed_sample_list) + self.checkBox_MassesShowTable.stateChanged.connect(self.on_checkBox_MassesShowTable_stateChanged) + self.comboBox_histMethod.currentIndexChanged.connect(self.on_histogram_bin_method_currentIndexChanged) + self.checkBox_plotMedian.stateChanged.connect(self.on_checkBox_plotMedian_stateChanged) + self.checkBox_plotMean.stateChanged.connect(self.on_checkBox_plotMean_stateChanged) + self.comboBox_histMethod.currentIndexChanged.connect(self.on_selection_changed_sample_list) + self.spinBox_histBins.valueChanged.connect(self.on_selection_changed_sample_list) # Set up GUI items and widgets: + self.status = self.statusBar() + self.set_up_sample_histogram() + self.set_up_sample_list() + self.set_up_hist_method_comboBox() + + # GUI dialogs: + self.dlg_about = DialogAbout() + self.dlg_about.label_version.setText(__version__) + self.dlg_about.label_git_repo.setText(__git_repo__) + self.dlg_about.label_pypi_repo.setText(__pypi_repo__) + self.dlg_about.label_email.setText(__email__) + self.dlg_about.label_copyright.setText(__copyright__) + self.dlg_about.label_author.setText(__author__) # Init models: + self.panel_metadata_model = None + self.sample_summary_model = None + self.masses_model = None + + @pyqtSlot() + def on_action_csvFiles(self): + """Invoked when pressing Export CSV files.""" + if self.ls_data is None: + QMessageBox.warning(self, 'Warning!', 'No data available!') + return + + if (self.ls_data.df_panel_data is None) and (self.ls_data.df_panel_data is None) and (self.ls_data.df_masses is None): + QMessageBox.warning(self, 'Warning!', 'No LifeScale data available!') + return + self.export_csv() + + def export_csv(self): + """Export ls data to csv files.""" + + # Get output directory: + output_dir_name = QFileDialog.getExistingDirectory(self, + caption='Select an output directory', + directory=self.get_work_dir(), + options=QFileDialog.Option.ShowDirsOnly) + # Write files + try: + self.ls_data.export_csv_files(output_dir_name, sort_by_time=False) + except Exception as e: + QMessageBox.critical(self, 'Error!', str(e)) + self.statusBar().showMessage(f'No LS data exportet.') + else: + self.status.showMessage(f'Exported CSV files to: {output_dir_name}') + + @pyqtSlot() + def on_checkBox_plotMedian_stateChanged(self): + """Invoked whenever the state changes.""" + if self.sample_histogram is not None: + if self.masses_model is not None: + self.plot_hist_mean_median_marker(self.masses_model.get_current_sample_id) + + @pyqtSlot() + def on_checkBox_plotMean_stateChanged(self): + """Invoked whenever the state changes.""" + if self.sample_histogram is not None: + if self.masses_model is not None: + self.plot_hist_mean_median_marker(self.masses_model.get_current_sample_id) + + @pyqtSlot() + def on_pushButton_resetMassLimits_pressed(self): + """Invoked whenever the button `pushButton_resetMassLimits` is pressed.""" + self.ls_data.reset_flag_masses(self.masses_model.get_current_sample_id) + self.ls_data.calc_sample_statistics(selection_only=True) + self.plot_masses_histogram(self.masses_model.get_current_sample_id) + self.print_sample_statistics(self.masses_model.get_current_sample_id) + + def set_up_sample_histogram(self): + """Set up `self.GraphicsLayoutWidget_stations_map` widget.""" + self.glw_sample_histogram = self.GraphicsLayoutWidget_SampelHistogram + self.glw_sample_histogram.setBackground('w') # white background color + # Create sub-plots: + self.sample_histogram = self.glw_sample_histogram.addPlot(0, 0, name='sample_histogram') + self.sample_histogram.setLabel(axis='left', text='Number of Samples') + self.sample_histogram.setLabel(axis='bottom', text='Mass') + self.sample_histogram.setTitle('Sample Histogram') + # self.stations_map.addLegend() + self.sample_histogram.setMouseEnabled(y=False) + + def set_up_hist_method_comboBox(self): + """Set up the histogram method combo box.""" + self.comboBox_histMethod.addItems(list(NUMPY_HISTOGRAM_BIN_EDGES_OPTIONS.keys())) + # self.histogram_bin_method_selection(0) # default: i. item in dict + + @pyqtSlot() + def on_histogram_bin_method_currentIndexChanged(self): + """Select bin determination method.""" + self.settings['hist_bin_mode'] = self.comboBox_histMethod.currentText() + self.settings['hist_number_of_bins'] = self.spinBox_histBins.value() + self.label_histBinMethodDescription.setText(NUMPY_HISTOGRAM_BIN_EDGES_OPTIONS[self.settings['hist_bin_mode']]) + if self.settings['hist_bin_mode'] == 'Num. of bins': + self.label_numberOfBins.setEnabled(True) + self.spinBox_histBins.setEnabled(True) + else: + self.label_numberOfBins.setEnabled(False) + self.spinBox_histBins.setEnabled(False) + + def get_hist_bin_method(self): + """Get selected bin method from GUI.""" + bins = self.comboBox_histMethod.currentText() + if bins == 'Num. of bins': + bins = self.spinBox_histBins.value() + return bins + + @pyqtSlot(int) + def on_checkBox_MassesShowTable_stateChanged(self, state): + """Invoked whenever the state of the shoe massed checkbox changes.""" + self.set_model_tableView_Masses_based_on_checkbox_state() + + def set_model_tableView_Masses_based_on_checkbox_state(self): + """Connect/disconnect the model of the masses table view based on checkbox state.""" + if self.checkBox_MassesShowTable.isChecked(): + self.tableView_Masses.setModel(self.masses_model) + else: + self.tableView_Masses.setModel(None) + + @pyqtSlot() + def on_menu_file_load_xlsm_file(self): + """Launch file selection dialog to load data from an xlsm file.""" + + if self.ls_data is not None: + reply = QMessageBox.question(self, + 'Message', + f'Overwrite data from: {self.ls_data.run_name}', + QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No, + QMessageBox.StandardButton.No) + if reply == QMessageBox.StandardButton.No: + return + self.reset_gui() # Clear and reset all items + + xlsm_filename, _ = QFileDialog.getOpenFileName(self, + caption='Select LifeScale data file (xlsm format)', + directory=self.get_work_dir(), + filter="LifeScale data file (*.xlsm)") + + if xlsm_filename: + xlsm_filename = QDir.toNativeSeparators(xlsm_filename) + try: + ls_data = LSData.from_xlsm_file(xlsm_filename) + ls_data.calc_sample_statistics() + except Exception as e: + QMessageBox.critical(self, 'Error!', str(e)) + self.statusBar().showMessage(f"No LS data loaded.") + else: + self.ls_data = ls_data + self.status.showMessage(f'Loaded: {ls_data}') + self.setWindowTitle(self.ls_data.run_name) + self.set_up_panel_metadata_view_model() + self.set_up_sample_summary_view_model() + self.set_up_masses_view_model() + self.update_sample_list() + else: + self.statusBar().showMessage(f"No LS data loaded.") + + def set_up_sample_list(self): + """Set up sample list widget""" + self.sample_list = self.listWidget_Samples + + def print_sample_statistics(self, sample_id): + """Print sample statistics in GUI.""" + sample_data = self.ls_data.df_interval_analysis.loc[self.ls_data.df_interval_analysis['SampleID'] == sample_id] + if len(sample_data) == 0: + raise IndexError(f'No sample dataset found for sample ID = {sample_id}') + + self.label_median.setText( + f'{sample_data["Mass_median"].item():.3f} ({sample_data["Mass_median_keep"].item():.3f})') + self.label_mean.setText(f'{sample_data["MeanMass"].item():.3f} ({sample_data["Mass_mean_keep"].item():.3f})') + self.label_std.setText(f'{sample_data["Mass_std"].item():.3f} ({sample_data["Mass_std_keep"].item():.3f})') + self.label_iqr.setText(f'{sample_data["Mass_iqr"].item():.3f} ({sample_data["Mass_iqr_keep"].item():.3f})') + self.label_rcv.setText( + f'{sample_data["Mass_rCV"].item():.3f} ({sample_data["Mass_rCV_keep"].item():.3f})') + if sample_data["keep_min_mass"].isna().item() and sample_data["keep_max_mass"].isna().item(): + self.label_selectionLimits.clear() + self.label_SelectedMasse.setText('No selection') + else: + self.label_selectionLimits.setText( + f'[{sample_data["keep_min_mass"].item():.3f}, {sample_data["keep_max_mass"].item():.3f}]') + num_selected = sample_data['DetectedParticles_keep'].item() + num_all = sample_data['DetectedParticles'].item() + selected_percent = (num_selected / num_all) * 100 + self.label_SelectedMasse.setText(f'{num_selected:.0f} of {num_all:.0f} ({selected_percent:.3f} %)') + + def update_sample_list(self): + """Update sample list widget and add """ + # TODO: SampleDescription zu jedem Sample hinzufügen, siehe: ls_data.df_panel_data.SampleDescription + self.sample_list.clear() + # self.sample_list.addItems(self.ls_data.get_sample_ids) + self.sample_list.addItems(self.sample_summary_model.get_sample_list_tags) + + @pyqtSlot() + def on_selection_changed_sample_list(self): + """Invoked whenever the item selection changed.""" + items = self.sample_list.selectedItems() + if len(items) == 1: + sample_id = items[0].text().split(':')[0] # Extract sample ID from tag + # TODO: Update gui models, plots, tables and statistics! + self.update_masses_table_view(sample_id) + self.status.showMessage(f'{len(self.masses_model.get_data)} mass(es) in sample {sample_id}.') + self.plot_masses_histogram(sample_id) + self.print_sample_statistics(sample_id) + + else: + print('No or multiple items selected!') + + def plot_masses_histogram(self, sample_id, bins='auto'): + """Create a histogram of masses of a single sample.""" + # ## compute standard histogram + # y, x = np.histogram(vals, bins=np.linspace(-3, 8, 40)) + # + # ## notice that len(x) == len(y)+1 + # ## We are required to use stepMode=True so that PlotCurveItem will interpret this data correctly. + # curve = pg.PlotCurveItem(x, y, stepMode=True, fillLevel=0, brush=(0, 0, 255, 80)) + # plt1.addItem(curve) + # + # Get min and max mass threshold: + tmp_filter = self.ls_data.df_interval_analysis['SampleID'] == sample_id + keep_min_mass = self.ls_data.df_interval_analysis.loc[tmp_filter, 'keep_min_mass'].item() + keep_max_mass = self.ls_data.df_interval_analysis.loc[tmp_filter, 'keep_max_mass'].item() + + # Get bin method: + bins = self.get_hist_bin_method() + + self.sample_histogram.clear() + masses = self.masses_model.get_data['Mass'] + y, x = np.histogram(masses, bins=bins) + self.hist = pg.PlotCurveItem(x, y, stepMode=True, fillLevel=0, brush=(0, 0, 255, 80)) + self.sample_histogram.addItem(self.hist) + + # Get region limits: + if keep_min_mass is None: + x_min = x.min() + else: + x_min = keep_min_mass + if keep_max_mass is None: + x_max = x.max() + else: + x_max = keep_max_mass + + # Linear Reagions: + pen = pg.mkPen(color='r', width=10) + # https://pyqtgraph.readthedocs.io/en/latest/api_reference/graphicsItems/linearregionitem.html + self.masses_region = pg.LinearRegionItem([x_min, x_max], + # bounds=[x.min(), x.max()], # use clipItem instead + swapMode='block', + clipItem=self.hist, + hoverPen=pen) + self.masses_region.setZValue(-10) + self.sample_histogram.addItem(self.masses_region) + self.masses_region.sigRegionChangeFinished.connect(self.on_masses_region_sigRegionChangeFinished) + + # Mean and median marker: + self.plot_hist_mean_median_marker(sample_id) + + def plot_hist_mean_median_marker(self, sample_id: str): + """Plot mean and median marker to the histogram plot.""" + if self.sample_histogram.legend is not None: + self.sample_histogram.legend.clear() + if self.hist_marker_mean_all is not None: + self.hist_marker_mean_all.clear() + if self.hist_marker_mean_selected is not None: + self.hist_marker_mean_selected.clear() + if self.hist_marker_median_all is not None: + self.hist_marker_median_all.clear() + if self.hist_marker_median_selected is not None: + self.hist_marker_median_selected.clear() + + if self.checkBox_plotMean.isChecked() or self.checkBox_plotMedian.isChecked(): + + self.sample_histogram.addLegend() + + tmp_filter = self.ls_data.df_interval_analysis['SampleID'] == sample_id + mean_all = self.ls_data.df_interval_analysis.loc[tmp_filter, 'MeanMass'].item() + mean_keep = self.ls_data.df_interval_analysis.loc[tmp_filter, 'Mass_mean_keep'].item() + median_all = self.ls_data.df_interval_analysis.loc[tmp_filter, 'Mass_median'].item() + median_keep = self.ls_data.df_interval_analysis.loc[tmp_filter, 'Mass_median_keep'].item() + + # y_max = self.sample_histogram.getAxis('left').range[1] + y_max = self.hist.getData()[1].max() + + if self.checkBox_plotMean.isChecked(): + pen = pg.mkPen(color='b', width=1) + self.hist_marker_mean_all = self.sample_histogram.plot([mean_all, mean_all], [0.0, y_max], + name=f'Mean (all)', + pen=pen) + pen = pg.mkPen(color='r', width=1) + self.hist_marker_mean_selected = self.sample_histogram.plot([mean_keep, mean_keep], [0.0, y_max], + name=f'Mean (selected)', + pen=pen) + if self.checkBox_plotMedian.isChecked(): + pen = pg.mkPen(color='b', width=1, style=Qt.PenStyle.DotLine) + self.hist_marker_median_all = self.sample_histogram.plot([median_all, median_all], [0.0, y_max], + name=f'Median (all)', + pen=pen) + pen = pg.mkPen(color='r', width=1, style=Qt.PenStyle.DotLine) + self.hist_marker_median_selected = self.sample_histogram.plot([median_keep, median_keep], [0.0, y_max], + name=f'Median (selected)', + pen=pen) + + @pyqtSlot() + def on_masses_region_sigRegionChangeFinished(self): + """Invoked whenever the masses selection region changed.""" + [min_mass, max_mass] = self.masses_region.getRegion() + print(f'Mass selection changed: min={min_mass:.3f}, max={max_mass:.3f}') + info_string = self.ls_data.flag_masses(min_mass, + max_mass, + sample_id=self.masses_model.get_current_sample_id) # Set flag in ls_data object + self.status.showMessage(info_string) + self.update_masses_table_view(sample_id=self.masses_model.get_current_sample_id) + self.ls_data.calc_sample_statistics(selection_only=True) + self.print_sample_statistics(self.masses_model.get_current_sample_id) + self.plot_hist_mean_median_marker(self.masses_model.get_current_sample_id) + + def reset_gui(self): + """Clean and reset all GUI items, e.g. when loading new data.""" + self.sample_list.clear() + + def set_up_panel_metadata_view_model(self): + """Set up the panel metadata table view model.""" + try: + self.panel_metadata_model = PanelMetadataModel(self.ls_data.df_panel_data) + except AttributeError: + QMessageBox.warning(self, 'Warning!', 'No panel metadata available!') + except Exception as e: + QMessageBox.critical(self, 'Error!', str(e)) + else: + self.tableView_PanelMetadata.setModel(self.panel_metadata_model) + self.tableView_PanelMetadata.resizeColumnsToContents() + + def set_up_sample_summary_view_model(self): + """Set up the sample summary table view model.""" + try: + self.sample_summary_model = SampleSummaryModel(self.ls_data.df_interval_analysis) + except AttributeError: + QMessageBox.warning(self, 'Warning!', 'No sample summary data available!') + except Exception as e: + QMessageBox.critical(self, 'Error!', str(e)) + else: + self.tableView_SampleSummary.setModel(self.sample_summary_model) + self.tableView_SampleSummary.resizeColumnsToContents() + + def update_sample_summary_view_model(self): + """Update the sample summary table view after changing the model.""" + pass + + def set_up_masses_view_model(self): + """Set up the masses table view model.""" + try: + self.masses_model = MassesModel(self.ls_data.df_masses) + except AttributeError: + QMessageBox.warning(self, 'Warning!', 'No masses data available!') + except Exception as e: + QMessageBox.critical(self, 'Error!', str(e)) + else: + self.set_model_tableView_Masses_based_on_checkbox_state() + self.tableView_Masses.resizeColumnsToContents() + # self.masses_model.dataChanged.connect(self.on_masses_model_data_changed) + + def update_masses_table_view(self, sample_id: int): + """Update the masses table view according to the sample selection""" + self.masses_model.update_view_model(sample_id) + self.masses_model.layoutChanged.emit() # Show changes in table view + # Workaround: https://stackoverflow.com/questions/8199747/sizing-to-fit-rows-and-columns-in-a-qtableview-is-very-slow + # self.tableView_Masses.resizeColumnsToContents() # Takes a very long time to execute! + + def closeEvent(self, event): + """Ask the user whether to close the main window or not!""" + reply = QMessageBox.question(self, + 'Message', + "Are you sure to quit?", + QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No, + QMessageBox.StandardButton.No) + if reply == QMessageBox.StandardButton.Yes: + event.accept() + else: + event.ignore() + + @pyqtSlot() + def exit_application(self): + """Exit the application.""" + reply = QMessageBox.question(self, + 'Message', + "Are you sure to quit?", + QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No, + QMessageBox.StandardButton.No) + if reply == QMessageBox.StandardButton.Yes: + sys.exit() + + def get_work_dir(self): + """Returns the current working directory for file dialogs""" + return os.getcwd() + + @pyqtSlot() + def on_menu_help_about(self): + """Launch the about dialog.""" + return_value = self.dlg_about.exec() + + +class DialogAbout(QDialog, Ui_Dialog_about): + """About dialog.""" + + def __init__(self, parent=None): + super().__init__(parent) + + # Run the .setupUi() method to show the GUI + self.setupUi(self) def main(): @@ -32,7 +489,8 @@ def main(): main_window.show() # Run the application's main loop: sys.exit( - app.exec()) # exit or error code of Qt (app.exec_) is passed to sys.exit. Terminates pgm with standard python method + app.exec()) # exit or error code of Qt (app.exec_) is passed to sys.exit. Terminates pgm with standard + # python method if __name__ == "__main__": diff --git a/lifescale/gui/logos/Uni_Logo_2016_SW_230px-wide.jpg b/lifescale/gui/logos/Uni_Logo_2016_SW_230px-wide.jpg new file mode 100644 index 0000000000000000000000000000000000000000..79768fc13e9f9d82281afbc42611db303b68fe61 Binary files /dev/null and b/lifescale/gui/logos/Uni_Logo_2016_SW_230px-wide.jpg differ diff --git a/lifescale/gui/masses_model.py b/lifescale/gui/masses_model.py new file mode 100644 index 0000000000000000000000000000000000000000..9238ea0023ab387558767a3e3a9ae8e12f53c7a2 --- /dev/null +++ b/lifescale/gui/masses_model.py @@ -0,0 +1,160 @@ +"""Masses model class for PyQt's model view architectrue. + +Copyright (C) 2022 Andreas Hellerschmied <heller182@gmx.at> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. +""" + +from PyQt6.QtCore import QAbstractTableModel, Qt +from PyQt6.QtWidgets import QMessageBox +from PyQt6 import QtGui + + +NONE_REPRESENTATION_IN_TABLE_VIEW = '' # Representation of None values in table views in the GUI + + +class MassesModel(QAbstractTableModel): + """Model for the masses table view.""" + + # Number of decimal pla + _DECIMAL_PLACES_PER_FLOAT_COLUMN = { + 'Time': 3, + 'Mass': 3, + 'Volume': 3, + 'TransitTime': 3, + 'PressureDrop': 5, + } + + def __init__(self, df): + QAbstractTableModel.__init__(self) + self._data = None + self._masses = None + self._current_sample_id = None + self.load_data(df) + + def load_data(self, df): + """Load data from pandas dataframe to table model. + + Notes + ----- + The data is assigned by reference, i.e. all changes in `_masses` will propagate to the data origin (`df`). + """ + # self._masses = df.copy(deep=True) + self._masses = df + + def update_view_model(self, sample_id: int): + """Update the `_data` DataFrame that hold the actual data that is displayed.""" + try: + df_masses_slice = self._masses.loc[self._masses['SampleID'] == sample_id] + except KeyError: + self._current_sample_id = None + self._data = None + QMessageBox.critical(self.parent(), 'Error!', f'SampleID "{sample_id}" is not available.') + else: + self._current_sample_id = sample_id + self._data = df_masses_slice + + def rowCount(self, parent=None): + if self._data is not None: + return self._data.shape[0] + else: + return 0 + + def columnCount(self, parent=None): + if self._data is not None: + return self._data.shape[1] + else: + return 0 + + def data(self, index, role=Qt.ItemDataRole.DisplayRole): + if index.isValid(): + + value = self._data.iloc[index.row(), index.column()] + column_name = self.get_colum_names[index.column()] + + if role == Qt.ItemDataRole.DisplayRole: + + # Custom formatter (string is expected as return type): + if value is None: # + return NONE_REPRESENTATION_IN_TABLE_VIEW + elif isinstance(value, float): + if value != value: # True, if value is "NaN" + return NONE_REPRESENTATION_IN_TABLE_VIEW + else: + if column_name in self._DECIMAL_PLACES_PER_FLOAT_COLUMN.keys(): + num_dec_places = self._DECIMAL_PLACES_PER_FLOAT_COLUMN[column_name] + return '{1:.{0}f}'.format(num_dec_places, value) + else: + return str(value) + else: # all other + return str(value) + + if role == Qt.ItemDataRole.TextAlignmentRole: + # value = self._data.iloc[index.row(), index.column()] + if isinstance(value, int) or isinstance(value, float): + # Align right, vertical middle. + return Qt.AlignmentFlag.AlignVCenter + Qt.AlignmentFlag.AlignRight + + if role == Qt.ItemDataRole.BackgroundRole: + if ~self._data.iloc[index.row()].keep: + return QtGui.QColor('red') + + # if role == Qt.CheckStateRole: + # try: + # if column_name == 'is_datum': + # keep_obs_flag = self._data.iloc[index.row(), self._data_column_names.index('is_datum')] + # if keep_obs_flag: + # return Qt.Checked + # else: + # return Qt.Unchecked + # except Exception: + # return None + return None + + def headerData(self, section, orientation, role): + # section is the index of the column/row. + if role == Qt.ItemDataRole.DisplayRole: + if self._data is not None: + if orientation == Qt.Orientation.Horizontal: + # return self._SHOW_COLUMNS_IN_TABLE_DICT[str(self._data.columns[section])] + return str(self._data.columns[section]) + if orientation == Qt.Orientation.Vertical: + return str(self._data.index[section]) + + def flags(self, index): + """Enable editing of table items.""" + flags = super(self.__class__, self).flags(index) + flags |= Qt.ItemFlag.ItemIsSelectable + flags |= Qt.ItemFlag.ItemIsEnabled + flags |= Qt.ItemFlag.ItemIsDragEnabled + flags |= Qt.ItemFlag.ItemIsDropEnabled + return flags + + @property + def get_data(self): + return self._data + + @property + def get_colum_names(self): + """Return a list with all columns.""" + if self._data is not None: + return self._data.columns.to_list() + else: + return None + + @property + def get_current_sample_id(self): + """Return the current sample ID.""" + return self._current_sample_id + diff --git a/lifescale/gui/panel_metadata_model.py b/lifescale/gui/panel_metadata_model.py new file mode 100644 index 0000000000000000000000000000000000000000..4b4a40f9cc37342f609be4bc89368dbb69f9b01a --- /dev/null +++ b/lifescale/gui/panel_metadata_model.py @@ -0,0 +1,127 @@ +"""Panel data model class for PyQt's model view architectrue. + +Copyright (C) 2022 Andreas Hellerschmied <heller182@gmx.at> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. +""" + +from PyQt6.QtCore import QAbstractTableModel, Qt + + +NONE_REPRESENTATION_IN_TABLE_VIEW = '' # Representation of None values in table views in the GUI + + +class PanelMetadataModel(QAbstractTableModel): + """Model for the panel metadata table view.""" + + # Number of decimal pla + _DECIMAL_PLACES_PER_FLOAT_COLUMN = { + 'long_deg': 3, + } + + def __init__(self, df_panel_data): + QAbstractTableModel.__init__(self) + self._data = None + self.load_df_panel_data(df_panel_data) + + def load_df_panel_data(self, df_panel_data): + """Load data from pandas dataframe to table model.""" + self._data = df_panel_data.copy(deep=True) + + def rowCount(self, parent=None): + return self._data.shape[0] + + def columnCount(self, parent=None): + return self._data.shape[1] + + def data(self, index, role=Qt.ItemDataRole.DisplayRole): + if index.isValid(): + + value = self._data.iloc[index.row(), index.column()] + column_name = self.get_colum_names[index.column()] + + if role == Qt.ItemDataRole.DisplayRole: + + # Custom formatter (string is expected as return type): + if value is None: # + return NONE_REPRESENTATION_IN_TABLE_VIEW + elif isinstance(value, float): + if value != value: # True, if value is "NaN" + return NONE_REPRESENTATION_IN_TABLE_VIEW + else: + if column_name in self._DECIMAL_PLACES_PER_FLOAT_COLUMN.keys(): + num_dec_places = self._DECIMAL_PLACES_PER_FLOAT_COLUMN[column_name] + return '{1:.{0}f}'.format(num_dec_places, value) + else: + return str(value) + else: # all other + return str(value) + + if role == Qt.ItemDataRole.TextAlignmentRole: + # value = self._data.iloc[index.row(), index.column()] + if isinstance(value, int) or isinstance(value, float): + # Align right, vertical middle. + return Qt.AlignmentFlag.AlignVCenter + Qt.AlignmentFlag.AlignRight + + # if role == Qt.BackgroundRole: + # if column_name == 'is_datum': + # if value: + # return QtGui.QColor('red') + # + # is_observed_flag = self._data.iloc[index.row(), 7] # is_observed + # if is_observed_flag: + # return QtGui.QColor('cyan') + + # if role == Qt.CheckStateRole: + # try: + # if column_name == 'is_datum': + # keep_obs_flag = self._data.iloc[index.row(), self._data_column_names.index('is_datum')] + # if keep_obs_flag: + # return Qt.Checked + # else: + # return Qt.Unchecked + # except Exception: + # return None + return None + + def headerData(self, section, orientation, role): + # section is the index of the column/row. + if role == Qt.ItemDataRole.DisplayRole: + if self._data is not None: + if orientation == Qt.Orientation.Horizontal: + # return self._SHOW_COLUMNS_IN_TABLE_DICT[str(self._data.columns[section])] + return str(self._data.columns[section]) + if orientation == Qt.Orientation.Vertical: + return str(self._data.index[section]) + + def flags(self, index): + """Enable editing of table items.""" + flags = super(self.__class__, self).flags(index) + flags |= Qt.ItemFlag.ItemIsSelectable + flags |= Qt.ItemFlag.ItemIsEnabled + flags |= Qt.ItemFlag.ItemIsDragEnabled + flags |= Qt.ItemFlag.ItemIsDropEnabled + return flags + + @property + def get_data(self): + return self._data + + @property + def get_colum_names(self): + """Return a list with all columns.""" + if self._data is not None: + return self._data.columns.to_list() + else: + return None diff --git a/lifescale/gui/resources.py b/lifescale/gui/resources.py new file mode 100644 index 0000000000000000000000000000000000000000..a44d85619d48720c4143b0cd4f92523bb2330093 --- /dev/null +++ b/lifescale/gui/resources.py @@ -0,0 +1,819 @@ +# Resource object code (Python 3) +# Created by: object code +# Created by: The Resource Compiler for Qt version 5.15.3 +# WARNING! All changes made in this file will be lost! + +from PyQt6 import QtCore + +qt_resource_data = b"\ +\x00\x000\x87\ +\xff\ +\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\ +\x01\x00\x00\xff\xe1\x0a\x0cExif\x00\x00II*\ +\x00\x08\x00\x00\x00\x0b\x00\x0b\x00\x02\x00\x0e\x00\x00\x00\x92\ +\x00\x00\x00\x00\x01\x09\x00\x01\x00\x00\x00\xe6\x00\x00\x00\x01\ +\x01\x09\x00\x01\x00\x00\x00s\x00\x00\x00\x12\x01\x09\x00\x01\ +\x00\x00\x00\x01\x00\x00\x00\x1a\x01\x05\x00\x01\x00\x00\x00\xa0\ +\x00\x00\x00\x1b\x01\x05\x00\x01\x00\x00\x00\xa8\x00\x00\x00(\ +\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\x00 \ +\x00\x00\x00\xb0\x00\x00\x002\x01\x02\x00\x14\x00\x00\x00\xd0\ +\x00\x00\x00\x13\x02\x09\x00\x01\x00\x00\x00\x01\x00\x00\x00i\ +\x87\x04\x00\x01\x00\x00\x00\xe4\x00\x00\x002\x01\x00\x00g\ +Thumb 3.12.0\x00\xc0\xc6-\ +\x00\x10'\x00\x00\xc0\xc6-\x00\x10'\x00\x00Ado\ +be Photoshop CS6\ + (Macintosh)\x00201\ +6:02:09 09:54:09\ +\x00\x06\x00\x00\x90\x07\x00\x04\x00\x00\x000221\x01\ +\x91\x07\x00\x04\x00\x00\x00\x01\x02\x03\x00\x00\xa0\x07\x00\x04\ +\x00\x00\x000100\x01\xa0\x03\x00\x01\x00\x00\x00\x01\ +\x00\x00\x00\x02\xa0\x09\x00\x01\x00\x00\x00\xe6\x00\x00\x00\x03\ +\xa0\x09\x00\x01\x00\x00\x00s\x00\x00\x00\x00\x00\x00\x00\x06\ +\x00\x03\x01\x03\x00\x01\x00\x00\x00\x06\x00\x00\x00\x1a\x01\x09\ +\x00\x01\x00\x00\x00H\x00\x00\x00\x1b\x01\x09\x00\x01\x00\x00\ +\x00H\x00\x00\x00(\x01\x09\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00\x01\x02\x04\x00\x01\x00\x00\x00\x80\x01\x00\x00\x02\x02\x04\ +\x00\x01\x00\x00\x00\x83\x08\x00\x00\x00\x00\x00\x00\xff\xd8\xff\ +\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\ +\x00\xff\xdb\x00C\x00\x05\x03\x04\x04\x04\x03\x05\x04\x04\x04\ +\x05\x05\x05\x06\x07\x0c\x08\x07\x07\x07\x07\x0f\x0b\x0b\x09\x0c\ +\x11\x0f\x12\x12\x11\x0f\x11\x11\x13\x16\x1c\x17\x13\x14\x1a\x15\ +\x11\x11\x18!\x18\x1a\x1d\x1d\x1f\x1f\x1f\x13\x17\x22$\x22\ +\x1e$\x1c\x1e\x1f\x1e\xff\xdb\x00C\x01\x05\x05\x05\x07\x06\ +\x07\x0e\x08\x08\x0e\x1e\x14\x11\x14\x1e\x1e\x1e\x1e\x1e\x1e\x1e\ +\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\ +\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\ +\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\xff\xc0\x00\x11\x08\ +\x00@\x00\x80\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xc4\ +\x00\x1c\x00\x01\x00\x01\x05\x01\x01\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x06\x03\x04\x05\x07\x08\x01\x02\xff\xc4\x001\ +\x10\x00\x02\x01\x04\x02\x01\x03\x02\x05\x04\x01\x05\x00\x00\x00\ +\x00\x01\x02\x03\x04\x05\x06\x11\x00\x12!\x07\x131\x22A\ +\x14\x15\x162Q\x08#3a$BRbq\x81\xff\ +\xc4\x00\x14\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xc4\x00\x14\x11\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xda\x00\x0c\x03\ +\x01\x00\x02\x11\x03\x11\x00?\x00\xec\xbe8\xe3\x80\xe3\x8d\ +\xf1\xc0q\xc7\x1c\x07\x1cq\xc0q\xc7\x1c\x07\x1cq\xc0\ +q\xc7\x1c\x07\x1cq\xc0r\x19\xea\x0ei\xf9#\x1be\ +\xacA-\xd1\xa22\x133\xea8\x17\xec[\xeeI\xfe\ +\x07\x85\x1bf!F\xcc\xc9\x88U$\x9d\x01\xf3\xce{\ +\x8e\xa9\xeb\xeeu\xf7\xaa\xc8\x9eI^9\xabc\x8aq\ + \x8aiB\xee\x15*\xdfK(,\x8b\xd9?p\x8c\ +/\xf2\x08_I\x92\xc7r\xacZj\x8f\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 +MpCehiHzreSzNTcz\ +kc9d\x22?> <x:xmpme\ +ta xmlns:x=\x22adob\ +e:ns:meta/\x22 x:xm\ +ptk=\x22XMP Core 4.\ +4.0-Exiv2\x22> <rdf\ +:RDF xmlns:rdf=\x22\ +http://www.w3.or\ +g/1999/02/22-rdf\ +-syntax-ns#\x22> <r\ +df:Description r\ +df:about=\x22\x22 xmln\ +s:dc=\x22http://pur\ +l.org/dc/element\ +s/1.1/\x22 xmlns:ph\ +otoshop=\x22http://\ +ns.adobe.com/pho\ +toshop/1.0/\x22 xml\ +ns:xmp=\x22http://n\ +s.adobe.com/xap/\ +1.0/\x22 xmlns:xmpM\ +M=\x22http://ns.ado\ +be.com/xap/1.0/m\ +m/\x22 xmlns:stRef=\ +\x22http://ns.adobe\ +.com/xap/1.0/sTy\ +pe/ResourceRef#\x22\ + xmlns:stEvt=\x22ht\ +tp://ns.adobe.co\ +m/xap/1.0/sType/\ +ResourceEvent#\x22 \ +dc:format=\x22image\ +/jpeg\x22 photoshop\ +:ColorMode=\x223\x22 p\ +hotoshop:ICCProf\ +ile=\x22sRGB IEC619\ +66-2.1\x22 xmp:Crea\ +teDate=\x222016-02-\ +01T12:15:26+01:0\ +0\x22 xmp:CreatorTo\ +ol=\x22Adobe Photos\ +hop CS6 (Macinto\ +sh)\x22 xmp:Metadat\ +aDate=\x222016-02-0\ +9T09:54:09+01:00\ +\x22 xmp:ModifyDate\ +=\x222016-02-09T09:\ +54:09+01:00\x22 xmp\ +MM:DocumentID=\x22x\ +mp.did:058011740\ +7206811822ADBEF1\ +B4D268D\x22 xmpMM:I\ +nstanceID=\x22xmp.i\ +id:0880117407206\ +811822ADBEF1B4D2\ +68D\x22 xmpMM:Origi\ +nalDocumentID=\x22x\ +mp.did:058011740\ +7206811822ADBEF1\ +B4D268D\x22> <xmpMM\ +:DerivedFrom stR\ +ef:documentID=\x22x\ +mp.did:058011740\ +7206811822ADBEF1\ +B4D268D\x22 stRef:i\ +nstanceID=\x22xmp.i\ +id:0780117407206\ +811822ADBEF1B4D2\ +68D\x22 stRef:origi\ +nalDocumentID=\x22x\ +mp.did:058011740\ +7206811822ADBEF1\ +B4D268D\x22/> <xmpM\ +M:History> <rdf:\ +Seq> <rdf:li stE\ +vt:action=\x22creat\ +ed\x22 stEvt:instan\ +ceID=\x22xmp.iid:05\ +8011740720681182\ +2ADBEF1B4D268D\x22 \ +stEvt:softwareAg\ +ent=\x22Adobe Photo\ +shop CS6 (Macint\ +osh)\x22 stEvt:when\ +=\x222016-02-01T12:\ +15:26+01:00\x22/> <\ +rdf:li stEvt:act\ +ion=\x22converted\x22 \ +stEvt:parameters\ +=\x22from applicati\ +on/vnd.adobe.pho\ +toshop to image/\ +tiff\x22/> <rdf:li \ +stEvt:action=\x22sa\ +ved\x22 stEvt:chang\ +ed=\x22/\x22 stEvt:ins\ +tanceID=\x22xmp.iid\ +:068011740720681\ +1822ADBEF1B4D268\ +D\x22 stEvt:softwar\ +eAgent=\x22Adobe Ph\ +otoshop CS6 (Mac\ +intosh)\x22 stEvt:w\ +hen=\x222016-02-09T\ +09:54:02+01:00\x22/\ +> <rdf:li stEvt:\ +action=\x22saved\x22 s\ +tEvt:changed=\x22/\x22\ + stEvt:instanceI\ +D=\x22xmp.iid:07801\ +17407206811822AD\ +BEF1B4D268D\x22 stE\ +vt:softwareAgent\ +=\x22Adobe Photosho\ +p CS6 (Macintosh\ +)\x22 stEvt:when=\x222\ +016-02-09T09:54:\ +09+01:00\x22/> <rdf\ +:li stEvt:action\ +=\x22converted\x22 stE\ +vt:parameters=\x22f\ +rom image/tiff t\ +o image/jpeg\x22/> \ +<rdf:li stEvt:ac\ +tion=\x22derived\x22 s\ +tEvt:parameters=\ +\x22converted from \ +image/tiff to im\ +age/jpeg\x22/> <rdf\ +:li stEvt:action\ +=\x22saved\x22 stEvt:c\ +hanged=\x22/\x22 stEvt\ +:instanceID=\x22xmp\ +.iid:08801174072\ +06811822ADBEF1B4\ +D268D\x22 stEvt:sof\ +twareAgent=\x22Adob\ +e Photoshop CS6 \ +(Macintosh)\x22 stE\ +vt:when=\x222016-02\ +-09T09:54:09+01:\ +00\x22/> </rdf:Seq>\ + </xmpMM:History\ +> </rdf:Descript\ +ion> </rdf:RDF> \ +</x:xmpmeta> \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + <?x\ +packet end=\x22w\x22?>\ +\xff\xdb\x00C\x00\x05\x03\x04\x04\x04\x03\x05\x04\x04\x04\x05\ +\x05\x05\x06\x07\x0c\x08\x07\x07\x07\x07\x0f\x0b\x0b\x09\x0c\x11\ +\x0f\x12\x12\x11\x0f\x11\x11\x13\x16\x1c\x17\x13\x14\x1a\x15\x11\ +\x11\x18!\x18\x1a\x1d\x1d\x1f\x1f\x1f\x13\x17\x22$\x22\x1e\ +$\x1c\x1e\x1f\x1e\xff\xdb\x00C\x01\x05\x05\x05\x07\x06\x07\ +\x0e\x08\x08\x0e\x1e\x14\x11\x14\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\ +\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\ +\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\ +\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\xff\xc0\x00\x11\x08\x00\ +s\x00\xe6\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\ +\x1c\x00\x01\x00\x02\x03\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x06\x07\x04\x05\x08\x03\x02\x01\xff\xc4\x00A\x10\ +\x00\x01\x03\x03\x03\x02\x04\x02\x06\x06\x07\x09\x00\x00\x00\x00\ +\x01\x02\x03\x04\x00\x05\x11\x06\x07\x12\x13!\x08\x221A\ +\x14Q\x15#2aq\x81\x09\x163B\x91\xb1\x174\ +8Rbrt&5CSv\x83\xa1\xa2\xc1\xff\xc4\ +\x00\x14\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\xff\xc4\x00\x14\x11\x01\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xda\x00\x0c\x03\x01\ +\x00\x02\x11\x03\x11\x00?\x00\xec\xbaR\x94\x0aR\x94\x0a\ +R\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\ +\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\x94\ +\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aTZ\xe7\ +\xb8Z2\xdf1P\x9d\xbf\xc5~Z\x0e\x17\x1a\x18T\ +\xa7\x90~\xf44\x14\xa1\xf9\x8a\xf0wrt\x9b *\ +K\xf7X\xa8\xff\x00\x99*\xc95\x94\x01\xf3*[@\ +\x01\xf9\xd0L)Z\xeb\x0d\xf6\xcb~\x8aeY.\xd0\ +nL$\x80\xa7\x22\xc8K\xa9I\xf9\x1e$\xe0\xfd\xc6\ +\xb64\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\ +\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0aR\x94\ +\x0aR\x94\x0aR\x86\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1b\x08Ci\x1e\x81)\ +\x1d\x80\xfc+\x22\x94\x0aR\x94\x0aR\x94\x0aR\x94\x0a\ +`|\x85)@\xa5)@\xa5)@\xa5)@\xa5)\ +@\xa5)@\xa5)@\xa5)@\xa5)@\xa5)@\ +\xa5)@\xa5)@\xa5)@\xa5)@\xa5)@\xa5\ +)@\xa5)@\xa5)@\xa5)@\xa5)@\xa5)\ +@\xa5)@\xa5)@\xa5)@\xa5)@\xa5)@\ +\xa5)@\xa5)@\xa5)@\xa5)@\xa5)@\xa5\ +)@\xa5)@\xa5)@\xa5)@\xa5)@\xa5)\ +@\xa5)A\xff\xd9\ +" + +qt_resource_name = b"\ +\x00\x05\ +\x00s^c\ +\x00l\ +\x00o\x00g\x00o\x00s\ +\x00\x1f\ +\x04\x0e\xd5\xc7\ +\x00U\ +\x00n\x00i\x00_\x00L\x00o\x00g\x00o\x00_\x002\x000\x001\x006\x00_\x00S\x00W\x00_\ +\x002\x003\x000\x00p\x00x\x00-\x00w\x00i\x00d\x00e\x00.\x00j\x00p\x00g\ +" + +qt_resource_struct = b"\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x01\x87\xa8d!\x9f\ +" + +def qInitResources(): + QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) + +def qCleanupResources(): + QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) + +qInitResources() diff --git a/lifescale/gui/resources.qrc b/lifescale/gui/resources.qrc new file mode 100644 index 0000000000000000000000000000000000000000..f458679ddc2c7f82f59e8d37ab3ddd556c8c99a4 --- /dev/null +++ b/lifescale/gui/resources.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="logos"> + <file>logos/Uni_Logo_2016_SW_230px-wide.jpg</file> + </qresource> +</RCC> diff --git a/lifescale/gui/sample_summary_model.py b/lifescale/gui/sample_summary_model.py new file mode 100644 index 0000000000000000000000000000000000000000..3742367812798012b67ee3ce18b2870bfdd512cf --- /dev/null +++ b/lifescale/gui/sample_summary_model.py @@ -0,0 +1,173 @@ +"""Sample model class for PyQt's model view architectrue. + +Copyright (C) 2022 Andreas Hellerschmied <heller182@gmx.at> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. +""" + +from PyQt6.QtCore import QAbstractTableModel, Qt +from PyQt6 import QtGui + + +NONE_REPRESENTATION_IN_TABLE_VIEW = '' # Representation of None values in table views in the GUI + + +class SampleSummaryModel(QAbstractTableModel): + """Model for the panel metadata table view.""" + + # Number of decimal pla + _DECIMAL_PLACES_PER_FLOAT_COLUMN = { + 'Concentration': 1, + 'StartTime': 3, + 'EndTime': 3, + 'MeanMass': 3, + 'MassContent': 5, + 'MeasuredVolume': 3, + 'MeasuredVolume': 3, + 'ResonantFrequency': 3, + 'Mass_median': 3, + 'Mass_std': 3, + 'Mass_q25': 3, + 'Mass_q75': 3, + 'Mass_iqr': 3, + 'keep_max_mass': 3, + 'keep_min_mass': 3, + 'DetectedParticles_keep': 0, + 'Mass_mean_keep': 3, + 'Mass_median_keep': 3, + 'Mass_std_keep': 3, + 'Mass_q25_keep': 3, + 'Mass_q75_keep': 3, + 'Mass_iqr_keep': 3, + 'Mass_rCV_keep': 3, + 'Mass_rCV': 3, + } + + def __init__(self, df): + QAbstractTableModel.__init__(self) + self._data = None + self.load_data(df) + + def load_data(self, df): + """Load data from pandas dataframe to table model.""" + self._data = df + + def rowCount(self, parent=None): + return self._data.shape[0] + + def columnCount(self, parent=None): + return self._data.shape[1] + + def data(self, index, role=Qt.ItemDataRole.DisplayRole): + if index.isValid(): + + value = self._data.iloc[index.row(), index.column()] + column_name = self.get_colum_names[index.column()] + + if role == Qt.ItemDataRole.DisplayRole: + + # Custom formatter (string is expected as return type): + if value is None: # + return NONE_REPRESENTATION_IN_TABLE_VIEW + elif isinstance(value, float): + if value != value: # True, if value is "NaN" + return NONE_REPRESENTATION_IN_TABLE_VIEW + else: + if column_name in self._DECIMAL_PLACES_PER_FLOAT_COLUMN.keys(): + num_dec_places = self._DECIMAL_PLACES_PER_FLOAT_COLUMN[column_name] + return '{1:.{0}f}'.format(num_dec_places, value) + else: + return str(value) + else: # all other + return str(value) + + if role == Qt.ItemDataRole.TextAlignmentRole: + # value = self._data.iloc[index.row(), index.column()] + if isinstance(value, int) or isinstance(value, float): + # Align right, vertical middle. + return Qt.AlignmentFlag.AlignVCenter + Qt.AlignmentFlag.AlignRight + + if role == Qt.ItemDataRole.BackgroundRole: + if (self._data.iloc[index.row()].keep_max_mass is not None) or (self._data.iloc[index.row()].keep_min_mass is not None): + return QtGui.QColor('green') + + # if role == Qt.BackgroundRole: + # if column_name == 'is_datum': + # if value: + # return QtGui.QColor('red') + # + # is_observed_flag = self._data.iloc[index.row(), 7] # is_observed + # if is_observed_flag: + # return QtGui.QColor('cyan') + + # if role == Qt.CheckStateRole: + # try: + # if column_name == 'is_datum': + # keep_obs_flag = self._data.iloc[index.row(), self._data_column_names.index('is_datum')] + # if keep_obs_flag: + # return Qt.Checked + # else: + # return Qt.Unchecked + # except Exception: + # return None + return None + + def headerData(self, section, orientation, role): + # section is the index of the column/row. + if role == Qt.ItemDataRole.DisplayRole: + if self._data is not None: + if orientation == Qt.Orientation.Horizontal: + # return self._SHOW_COLUMNS_IN_TABLE_DICT[str(self._data.columns[section])] + return str(self._data.columns[section]) + if orientation == Qt.Orientation.Vertical: + return str(self._data.index[section]) + + def flags(self, index): + """Enable editing of table items.""" + flags = super(self.__class__, self).flags(index) + flags |= Qt.ItemFlag.ItemIsSelectable + flags |= Qt.ItemFlag.ItemIsEnabled + flags |= Qt.ItemFlag.ItemIsDragEnabled + flags |= Qt.ItemFlag.ItemIsDropEnabled + return flags + + @property + def get_data(self): + return self._data + + @property + def get_colum_names(self): + """Return a list with all columns.""" + if self._data is not None: + return self._data.columns.to_list() + else: + return None + + @property + def get_sample_ids(self): + """Return a list with all sample IDs.""" + if self._data is not None: + return self._data['SampleID'].to_list() + else: + return None + + @property + def get_sample_list_tags(self): + """Return a list of sample tags with sample IDs and number of detected particles.""" + if self._data is not None: + return (self._data['SampleID'].astype(str) + ': ' + self._data['DetectedParticles'].astype(str)).to_list() + else: + return None + + diff --git a/lifescale/models/ls_data.py b/lifescale/models/ls_data.py index f60d18a735a5d31732a21cbc93f02f156ec09537..be9e00e1f0d74e1d567c0bc9368ba7a69deddf2f 100644 --- a/lifescale/models/ls_data.py +++ b/lifescale/models/ls_data.py @@ -192,8 +192,12 @@ class LSData: raise AssertionError( f'The combination if the values in the columns "Id" and "IntervalNumber" in IntervalAnalysis is not ' f'unique!') + df_interval_analysis['SampleID'] = df_interval_analysis['Well'] + '-' + df_interval_analysis[ + 'IntervalNumber'].astype(str) + df_interval_analysis['keep_min_mass'] = None # Masses threshold + df_interval_analysis['keep_max_mass'] = None # Masses threshold - # Settings: + # Settings: if verbose: print(f' - Parse Settings') settings_dict = {} @@ -388,6 +392,8 @@ class LSData: columns=df_masses_columns) df_masses['Id'] = df_masses['Id'].astype(int) df_masses['IntervalNumber'] = df_masses['IntervalNumber'].astype(int) + df_masses['SampleID'] = df_masses['Well'] + '-' + df_masses['IntervalNumber'].astype(str) + df_masses['keep'] = True # Sensor: # sensor_dict = {} @@ -450,7 +456,6 @@ class LSData: self.df_panel_data.to_csv(filename, index=False) # Write Masses: - filename = os.path.join(output_filepath, f'Masses_{filename_ending}') if verbose: print(f'Write Masses to: {filename}') @@ -467,27 +472,50 @@ class LSData: print(f'Write IntervalAnalysis to: {filename}') self.df_interval_analysis.to_csv(filename, index=False) - # TODO: Output format (number of digits) - # TODO: Select columns for output (settable as parameter + default settings for each csv file) - - def calc_sample_statistics(self, verbose=True): + def calc_sample_statistics(self, verbose=True, selection_only=False): """Calculate statistical values for each sample and add it to the self.df_interval_analysis.""" - if verbose: + if verbose & selection_only: + print('Calculate sample statistics (selection only).') + elif verbose: print('Calculate sample statistics.') for idx, row in self.df_interval_analysis.iterrows(): - tmp_filter = (self.df_masses['Id'] == row.Id) & (self.df_masses['IntervalNumber'] == row.IntervalNumber) + # For all masses in a sample: + if not selection_only: + tmp_filter = (self.df_masses['Id'] == row.Id) & (self.df_masses['IntervalNumber'] == row.IntervalNumber) + tmp_filter_1 = (self.df_interval_analysis['Id'] == row.Id) & \ + (self.df_interval_analysis['IntervalNumber'] == row.IntervalNumber) + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_median'] = self.df_masses.loc[tmp_filter, 'Mass'].median() + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_std'] = self.df_masses.loc[tmp_filter, 'Mass'].std() + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q25'] = \ + self.df_masses.loc[tmp_filter, 'Mass'].quantile(0.25) + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q75'] = \ + self.df_masses.loc[tmp_filter, 'Mass'].quantile(0.75) + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_iqr'] = \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q75'] - \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q25'] + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_rCV'] = \ + 74.1 * self.df_interval_analysis.loc[tmp_filter_1, 'Mass_iqr'] / \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_median'] + + # For selected items only (flag `keep` = True): + tmp_filter = (self.df_masses['Id'] == row.Id) & (self.df_masses['IntervalNumber'] == row.IntervalNumber) & (self.df_masses['keep']) tmp_filter_1 = (self.df_interval_analysis['Id'] == row.Id) & \ (self.df_interval_analysis['IntervalNumber'] == row.IntervalNumber) - self.df_interval_analysis.loc[tmp_filter_1, 'Mass_median'] = self.df_masses.loc[tmp_filter, 'Mass'].median() - self.df_interval_analysis.loc[tmp_filter_1, 'Mass_std'] = self.df_masses.loc[tmp_filter, 'Mass'].std() - self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q25'] = \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_median_keep'] = self.df_masses.loc[tmp_filter, 'Mass'].median() + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_mean_keep'] = self.df_masses.loc[tmp_filter, 'Mass'].mean() + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_std_keep'] = self.df_masses.loc[tmp_filter, 'Mass'].std() + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q25_keep'] = \ self.df_masses.loc[tmp_filter, 'Mass'].quantile(0.25) - self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q75'] = \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q75_keep'] = \ self.df_masses.loc[tmp_filter, 'Mass'].quantile(0.75) - self.df_interval_analysis.loc[tmp_filter_1, 'Mass_iqr'] = \ - self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q75'] - \ - self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q25'] + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_iqr_keep'] = \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q75_keep'] - \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_q25_keep'] + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_rCV_keep'] = \ + 74.1 * self.df_interval_analysis.loc[tmp_filter_1, 'Mass_iqr_keep'] / \ + self.df_interval_analysis.loc[tmp_filter_1, 'Mass_median_keep'] + self.df_interval_analysis.loc[tmp_filter_1, 'DetectedParticles_keep'] = len(self.df_masses.loc[tmp_filter, 'Mass']) @property def get_number_of_observations(self): @@ -513,6 +541,14 @@ class LSData: else: return 0 + @property + def get_sample_ids(self): + """Return list of IDs of all samples.""" + if self.df_interval_analysis is not None: + return self.df_interval_analysis['SampleID'].to_list() + else: + return [] + def __str__(self): if self.run_name is not None: return f'Run "{self.run_name}" with {self.get_number_of_observations} observations in ' \ @@ -520,6 +556,29 @@ class LSData: else: return f'Not data available yet.' + def flag_masses(self, min_mass: float, max_mass: float, sample_id: str, verbose=True): + """Set the `keep` flag in the masses dataframe according to the data limits (min, max) and sample ID.""" + tmp_filter = self.df_masses['SampleID'] == sample_id + self.df_masses.loc[tmp_filter, 'keep'] = (self.df_masses.loc[tmp_filter, 'Mass'] < max_mass) & (self.df_masses.loc[tmp_filter, 'Mass'] > min_mass) + info_string = f'Sample {sample_id}: {len(self.df_masses.loc[~self.df_masses["keep"] & tmp_filter])} out of {len(self.df_masses.loc[tmp_filter])} masses deselected. {len(self.df_masses.loc[self.df_masses["keep"] & tmp_filter])} remaining.' + + # set thresholds in sample dataframe: + tmp_filter = self.df_interval_analysis['SampleID'] == sample_id + self.df_interval_analysis.loc[tmp_filter, 'keep_max_mass'] = max_mass + self.df_interval_analysis.loc[tmp_filter, 'keep_min_mass'] = min_mass + + if verbose: + print(info_string) + return info_string + + def reset_flag_masses(self, sample_id: str, verbose=True): + """Reset alls keep flags in the sample with the ID `sample_id`.""" + print(sample_id) + tmp_filter = self.df_masses['SampleID'] == sample_id + self.df_masses.loc[tmp_filter, 'keep'] = True + tmp_filter = self.df_interval_analysis['SampleID'] == sample_id + self.df_interval_analysis.loc[tmp_filter, 'keep_min_mass'] = None + self.df_interval_analysis.loc[tmp_filter, 'keep_max_mass'] = None def remove_space_from_column_names(df): """Removes white space from column names of input dataframe.""" diff --git a/lifescale/models/ls_run.py b/lifescale/models/ls_run.py deleted file mode 100644 index a90fbe35cdc8241531aee01d12d230388a25db0f..0000000000000000000000000000000000000000 --- a/lifescale/models/ls_run.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Modelling a LifeScale run - -Copyright (C) 2022 Andreas Hellerschmied <heller182@gmx.at> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. -""" - -import datetime as dt -import pytz -import numpy as np -import pickle -import os -import sys - -import pandas as pd - -# from gravtools.models.lsm import LSM - - -class LSRun: - """LifeScale run object. - - A LS run contains: - - - - run name and description - - input data - - settings - - Attributes - ---------- - run_name : str - Name of the lsm run. - output_directory : str - Path to output directory (all output files are stored there). - pgm_version : str - Version of the program. - """ - - def __init__(self, - campaign_name, - output_directory, - surveys=None, # Always use non-mutable default arguments! - stations=None, # Always use non-mutable default arguments! - lsm_runs=None, # Always use non-mutable default arguments! - ref_delta_t_dt=None # Reference time for drift determination - ): - """ - Parameters - """ \ No newline at end of file diff --git a/makefile b/makefile index 50604b59aac78b45ba9a97620a3214e50df003c5..315bbd86b2cac8925ea4f9c078e8b8e124086671 100644 --- a/makefile +++ b/makefile @@ -12,6 +12,12 @@ init: # Convert *.ui files from Qt Designer to Python files: py_gui: pyuic6 -o lifescale/gui/MainWindow.py lifescale/gui/MainWindow.ui + pyuic6 -o lifescale/gui/dialog_about.py lifescale/gui/dialog_about.ui + +# Convert QT resources to a python file using rcc of PySide2: +# - PyQt >= 6.3.1 is required! +py_gui_resources: + rcc -g python lifescale/gui/resources.qrc | sed '0,/PySide2/s//PyQt6/' > lifescale/gui/resources.py # Package test (install in current virtual environment, editable install with pip) test_pack: diff --git a/setup.cfg b/setup.cfg index 5cb308073936bf00b7166d0d1f735ff6878304e2..e0e2aa28c63cd07fd4fac85ed37ace55ec64166c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,13 +23,16 @@ install_requires = numpy pandas openpyxl + PyQt6 + pyqtgraph [options.entry_points] console_scripts = ls2csv = lifescale.command_line.command_line:ls2csv + lsgui = lifescale.command_line.command_line:lsgui -[options.packages.find] -exclude = - lifescale.gui* - lifescale.scripts.run_gui.py - lifescale.models.ls_run.py +# [options.packages.find] +# exclude = +# lifescale.gui* +# lifescale.scripts.run_gui.py +# lifescale.models.ls_run.py