Skip to content

Commit

Permalink
- Change: changed the "Sum normalization" to "Percentages Scaling" in…
Browse files Browse the repository at this point in the history
… the data preprossing part to avoid the confusion with the normalization method.
  • Loading branch information
byemaxx committed Nov 8, 2024
1 parent 9ac1cea commit 3ebc762
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 21 deletions.
6 changes: 6 additions & 0 deletions Docs/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion metax/gui/main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 7 additions & 7 deletions metax/gui/metax_gui/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<enum>Qt::LeftToRight</enum>
</property>
<property name="currentIndex">
<number>4</number>
<number>2</number>
</property>
<property name="documentMode">
<bool>false</bool>
Expand Down Expand Up @@ -246,7 +246,7 @@
<x>0</x>
<y>0</y>
<width>528</width>
<height>591</height>
<height>595</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -976,7 +976,7 @@
</item>
<item>
<property name="text">
<string>Normalization by sum</string>
<string>Percentages Scaling</string>
</property>
</item>
</widget>
Expand Down Expand Up @@ -5713,7 +5713,7 @@
<x>0</x>
<y>0</y>
<width>996</width>
<height>160</height>
<height>164</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_68">
Expand Down Expand Up @@ -7494,7 +7494,7 @@
<x>0</x>
<y>0</y>
<width>1016</width>
<height>162</height>
<height>166</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_57">
Expand Down Expand Up @@ -9315,7 +9315,7 @@
<x>0</x>
<y>0</y>
<width>1016</width>
<height>177</height>
<height>179</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_66">
Expand Down Expand Up @@ -10449,7 +10449,7 @@
<x>0</x>
<y>0</y>
<width>1122</width>
<height>23</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuTools">
Expand Down
16 changes: 8 additions & 8 deletions metax/gui/metax_gui/ui_main_window.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"))
Expand Down
6 changes: 3 additions & 3 deletions metax/taxafunc_analyzer/analyzer_utils/data_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand All @@ -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()
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion metax/utils/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.118.1'
__version__ = '1.118.2'
API_version = '3'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit 3ebc762

Please sign in to comment.