From 3ebc76210fde30293233bb08bce7f41580b99204 Mon Sep 17 00:00:00 2001 From: Qing <44231502+byemaxx@users.noreply.github.com> Date: Fri, 8 Nov 2024 14:26:40 -0500 Subject: [PATCH] - Change: changed the "Sum normalization" to "Percentages Scaling" in the data preprossing part to avoid the confusion with the normalization method. --- Docs/ChangeLog.md | 6 ++++++ metax/gui/main_gui.py | 2 +- metax/gui/metax_gui/main_window.ui | 14 +++++++------- metax/gui/metax_gui/ui_main_window.py | 16 ++++++++-------- .../analyzer_utils/data_preprocessing.py | 6 +++--- metax/utils/version.py | 2 +- pyproject.toml | 2 +- 7 files changed, 27 insertions(+), 21 deletions(-) diff --git a/Docs/ChangeLog.md b/Docs/ChangeLog.md index 8476811..521a444 100644 --- a/Docs/ChangeLog.md +++ b/Docs/ChangeLog.md @@ -1,3 +1,9 @@ +# Version: 1.118.2 +## Date: 2024-11-8 +### Changes: +- Change: changed the "Sum normalization" to "Percentages Scaling" in the data preprossing part to avoid the confusion with the normalization method. + + # Version: 1.118.1 ## Date: 2024-11-7 ### Changes: diff --git a/metax/gui/main_gui.py b/metax/gui/main_gui.py index e6342ac..cf0a19f 100644 --- a/metax/gui/main_gui.py +++ b/metax/gui/main_gui.py @@ -2674,7 +2674,7 @@ def set_multi_table(self, restore_taxafunc=False, saved_obj=None): "Standard Scaling (Z-Score)": "zscore", "Min-Max Scaling": "minmax", "Pareto Scaling": "pareto", - "Normalization by sum": "sum", + "Percentages Scaling": "percentage", } normalize_method = normalize_dict[normalize_method] transform_method = transform_dict[transform_method] diff --git a/metax/gui/metax_gui/main_window.ui b/metax/gui/metax_gui/main_window.ui index d732f6d..68359a1 100644 --- a/metax/gui/metax_gui/main_window.ui +++ b/metax/gui/metax_gui/main_window.ui @@ -46,7 +46,7 @@ Qt::LeftToRight - 4 + 2 false @@ -246,7 +246,7 @@ 0 0 528 - 591 + 595 @@ -976,7 +976,7 @@ - Normalization by sum + Percentages Scaling @@ -5713,7 +5713,7 @@ 0 0 996 - 160 + 164 @@ -7494,7 +7494,7 @@ 0 0 1016 - 162 + 166 @@ -9315,7 +9315,7 @@ 0 0 1016 - 177 + 179 @@ -10449,7 +10449,7 @@ 0 0 1122 - 23 + 21 diff --git a/metax/gui/metax_gui/ui_main_window.py b/metax/gui/metax_gui/ui_main_window.py index 3147c7c..f4a0cfc 100644 --- a/metax/gui/metax_gui/ui_main_window.py +++ b/metax/gui/metax_gui/ui_main_window.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'c:\Users\max\OneDrive - University of Ottawa\code\TaxaFunc\MetaX\metax\gui\metax_gui\main_window.ui' +# Form implementation generated from reading ui file 'c:\Users\Qing\OneDrive - University of Ottawa\code\TaxaFunc\MetaX\metax\gui\metax_gui\main_window.ui' # # Created by: PyQt5 UI code generator 5.15.9 # @@ -147,7 +147,7 @@ def setupUi(self, metaX_main): self.toolBox_2.setMaximumSize(QtCore.QSize(1677, 16777215)) self.toolBox_2.setObjectName("toolBox_2") self.page_2 = QtWidgets.QWidget() - self.page_2.setGeometry(QtCore.QRect(0, 0, 528, 591)) + self.page_2.setGeometry(QtCore.QRect(0, 0, 528, 595)) self.page_2.setObjectName("page_2") self.gridLayout_27 = QtWidgets.QGridLayout(self.page_2) self.gridLayout_27.setObjectName("gridLayout_27") @@ -2902,7 +2902,7 @@ def setupUi(self, metaX_main): self.scrollArea_3.setWidgetResizable(True) self.scrollArea_3.setObjectName("scrollArea_3") self.scrollAreaWidgetContents_4 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 996, 160)) + self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 996, 164)) self.scrollAreaWidgetContents_4.setObjectName("scrollAreaWidgetContents_4") self.gridLayout_68 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_4) self.gridLayout_68.setObjectName("gridLayout_68") @@ -3848,7 +3848,7 @@ def setupUi(self, metaX_main): self.scrollArea_5.setWidgetResizable(True) self.scrollArea_5.setObjectName("scrollArea_5") self.scrollAreaWidgetContents_6 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_6.setGeometry(QtCore.QRect(0, 0, 1016, 162)) + self.scrollAreaWidgetContents_6.setGeometry(QtCore.QRect(0, 0, 1016, 166)) self.scrollAreaWidgetContents_6.setObjectName("scrollAreaWidgetContents_6") self.gridLayout_57 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_6) self.gridLayout_57.setObjectName("gridLayout_57") @@ -4857,7 +4857,7 @@ def setupUi(self, metaX_main): self.scrollArea_7.setWidgetResizable(True) self.scrollArea_7.setObjectName("scrollArea_7") self.scrollAreaWidgetContents_8 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_8.setGeometry(QtCore.QRect(0, 0, 1016, 177)) + self.scrollAreaWidgetContents_8.setGeometry(QtCore.QRect(0, 0, 1016, 179)) self.scrollAreaWidgetContents_8.setObjectName("scrollAreaWidgetContents_8") self.gridLayout_66 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_8) self.gridLayout_66.setObjectName("gridLayout_66") @@ -5426,7 +5426,7 @@ def setupUi(self, metaX_main): self.statusbar.setObjectName("statusbar") metaX_main.setStatusBar(self.statusbar) self.menuBar = QtWidgets.QMenuBar(metaX_main) - self.menuBar.setGeometry(QtCore.QRect(0, 0, 1122, 23)) + self.menuBar.setGeometry(QtCore.QRect(0, 0, 1122, 21)) self.menuBar.setObjectName("menuBar") self.menuTools = QtWidgets.QMenu(self.menuBar) self.menuTools.setObjectName("menuTools") @@ -5492,7 +5492,7 @@ def setupUi(self, metaX_main): self.retranslateUi(metaX_main) self.stackedWidget.setCurrentIndex(0) - self.tabWidget_TaxaFuncAnalyzer.setCurrentIndex(4) + self.tabWidget_TaxaFuncAnalyzer.setCurrentIndex(2) self.toolBox_2.setCurrentIndex(0) self.tabWidget_4.setCurrentIndex(0) self.tabWidget_3.setCurrentIndex(3) @@ -5639,7 +5639,7 @@ def retranslateUi(self, metaX_main): self.comboBox_set_data_normalization.setItemText(3, _translate("metaX_main", "Min-Max Scaling")) self.comboBox_set_data_normalization.setItemText(4, _translate("metaX_main", "Pareto Scaling")) self.comboBox_set_data_normalization.setItemText(5, _translate("metaX_main", "Mean centering")) - self.comboBox_set_data_normalization.setItemText(6, _translate("metaX_main", "Normalization by sum")) + self.comboBox_set_data_normalization.setItemText(6, _translate("metaX_main", "Percentages Scaling")) self.comboBox_remove_batch_effect.setItemText(0, _translate("metaX_main", "None")) self.label_41.setText(_translate("metaX_main", "Data Normalization")) self.label_43.setText(_translate("metaX_main", "Batch Effect Correction")) diff --git a/metax/taxafunc_analyzer/analyzer_utils/data_preprocessing.py b/metax/taxafunc_analyzer/analyzer_utils/data_preprocessing.py index 210e013..0efc2fc 100644 --- a/metax/taxafunc_analyzer/analyzer_utils/data_preprocessing.py +++ b/metax/taxafunc_analyzer/analyzer_utils/data_preprocessing.py @@ -118,7 +118,7 @@ def trace_shift(x): normalize_operations = { 'None': lambda x: x, 'mean': lambda x: x - x.mean(), - 'sum': lambda x: x / (x.sum() + epsilon), + 'percentage': lambda x: x / (x.sum() + epsilon) * 100, 'minmax': lambda x: (x - x.min()) / (x.max() - x.min()), 'zscore': lambda x: (x - x.mean()) / (x.std() + epsilon), 'pareto': lambda x: (x - x.mean()) / (np.sqrt(x.std() + epsilon)), @@ -143,7 +143,7 @@ def trace_shift(x): print(f'Data normalized by [{normalize_method}]') else: - raise ValueError('normalize_method must be in [None, mean, sum, minmax, zscore, pareto]') + raise ValueError(f'normalize_method must be in {list(normalize_operations.keys())}') # move the data to positive df_mat = df_mat - df_mat.min() @@ -637,7 +637,7 @@ def data_preprocess(self, df: pd.DataFrame, normalize_method: str|None = None, - `None`: No normalization. - `trace_shift`: Trace shift normalization inspired by DirectLFQ. - `mean`: Mean normalization. - - `sum`: Sum normalization. + - `percentage`: Percentage normalization, then *100. - `minmax`: Min-max normalization. - `zscore`: Z-score normalization. - `pareto`: Pareto scaling. diff --git a/metax/utils/version.py b/metax/utils/version.py index b12bc66..d467f5e 100644 --- a/metax/utils/version.py +++ b/metax/utils/version.py @@ -1,2 +1,2 @@ -__version__ = '1.118.1' +__version__ = '1.118.2' API_version = '3' \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5c60907..fd170fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "MetaXTools" -version = "1.118.1" +version = "1.118.2" description = "MetaXTools is a novel tool for linking peptide sequences with taxonomic and functional information in Metaproteomics." readme = "README_PyPi.md" license = { text = "NorthOmics" }