From e715dec523354d6547d95cc9c647931ddea08239 Mon Sep 17 00:00:00 2001 From: Qing Date: Tue, 20 Aug 2024 17:53:20 -0400 Subject: [PATCH] - Fix: Fixed the bug of sum protein by anti-razor method. - Change: Changed the default color of the heatmap plot to make the color more clear. --- Docs/ChangeLog.md | 7 +++++ metax/gui/metax_gui/main_window.ui | 28 +++++++++---------- metax/gui/metax_gui/ui_main_window.py | 24 ++++++++-------- .../analyzer_utils/sum_protein_intensity.py | 3 +- metax/taxafunc_ploter/heatmap_plot.py | 22 +++++++-------- metax/utils/version.py | 2 +- pyproject.toml | 2 +- 7 files changed, 48 insertions(+), 40 deletions(-) diff --git a/Docs/ChangeLog.md b/Docs/ChangeLog.md index c078e15..d1f9234 100644 --- a/Docs/ChangeLog.md +++ b/Docs/ChangeLog.md @@ -1,3 +1,10 @@ +# Version: 1.110.1 +## Date: 2024-08-20 +### Changes: +- Fix: Fixed the bug of sum protein by anti-razor method. +- Change: Changed the default color of the heatmap plot to make the color more clear. + + # Version: 1.110.0 ## Date: 2024-08-12 ### Changes: diff --git a/metax/gui/metax_gui/main_window.ui b/metax/gui/metax_gui/main_window.ui index b586e1c..89ef6c9 100644 --- a/metax/gui/metax_gui/main_window.ui +++ b/metax/gui/metax_gui/main_window.ui @@ -46,7 +46,7 @@ Qt::LeftToRight - 3 + 6 false @@ -2803,22 +2803,22 @@ - row + None - col + row - all + col - None + all @@ -3674,7 +3674,7 @@ 0 0 - 1020 + 929 126 @@ -5542,8 +5542,8 @@ 0 0 - 996 - 140 + 535 + 94 @@ -8171,8 +8171,8 @@ 0 0 - 775 - 102 + 1016 + 185 @@ -8550,22 +8550,22 @@ - row + None - column + row - all + column - None + all diff --git a/metax/gui/metax_gui/ui_main_window.py b/metax/gui/metax_gui/ui_main_window.py index e4c1333..99c7cef 100644 --- a/metax/gui/metax_gui/ui_main_window.py +++ b/metax/gui/metax_gui/ui_main_window.py @@ -1919,7 +1919,7 @@ def setupUi(self, metaX_main): self.scrollArea_cross_heatmap_settings.setWidgetResizable(True) self.scrollArea_cross_heatmap_settings.setObjectName("scrollArea_cross_heatmap_settings") self.scrollAreaWidgetContents_3 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 1020, 126)) + self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 929, 126)) self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3") self.gridLayout_38 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_3) self.gridLayout_38.setObjectName("gridLayout_38") @@ -2844,7 +2844,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, 140)) + self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 535, 94)) self.scrollAreaWidgetContents_4.setObjectName("scrollAreaWidgetContents_4") self.gridLayout_68 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_4) self.gridLayout_68.setObjectName("gridLayout_68") @@ -4261,7 +4261,7 @@ def setupUi(self, metaX_main): self.scrollArea_6.setWidgetResizable(True) self.scrollArea_6.setObjectName("scrollArea_6") self.scrollAreaWidgetContents_7 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_7.setGeometry(QtCore.QRect(0, 0, 775, 102)) + self.scrollAreaWidgetContents_7.setGeometry(QtCore.QRect(0, 0, 1016, 185)) self.scrollAreaWidgetContents_7.setObjectName("scrollAreaWidgetContents_7") self.gridLayout_69 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_7) self.gridLayout_69.setObjectName("gridLayout_69") @@ -5336,7 +5336,7 @@ def setupUi(self, metaX_main): self.retranslateUi(metaX_main) self.stackedWidget.setCurrentIndex(0) - self.tabWidget_TaxaFuncAnalyzer.setCurrentIndex(3) + self.tabWidget_TaxaFuncAnalyzer.setCurrentIndex(6) self.toolBox_2.setCurrentIndex(0) self.tabWidget_4.setCurrentIndex(1) self.tabWidget_3.setCurrentIndex(3) @@ -5615,10 +5615,10 @@ def retranslateUi(self, metaX_main): self.label_185.setText(_translate("metaX_main", "Bar")) self.label_186.setText(_translate("metaX_main", "Sankey")) self.label_31.setText(_translate("metaX_main", "Scale")) - self.comboBox_basic_hetatmap_scale.setItemText(0, _translate("metaX_main", "row")) - self.comboBox_basic_hetatmap_scale.setItemText(1, _translate("metaX_main", "col")) - self.comboBox_basic_hetatmap_scale.setItemText(2, _translate("metaX_main", "all")) - self.comboBox_basic_hetatmap_scale.setItemText(3, _translate("metaX_main", "None")) + self.comboBox_basic_hetatmap_scale.setItemText(0, _translate("metaX_main", "None")) + self.comboBox_basic_hetatmap_scale.setItemText(1, _translate("metaX_main", "row")) + self.comboBox_basic_hetatmap_scale.setItemText(2, _translate("metaX_main", "col")) + self.comboBox_basic_hetatmap_scale.setItemText(3, _translate("metaX_main", "all")) self.label_13.setText(_translate("metaX_main", "Theme")) self.checkBox_basic_hetatmap_row_cluster.setText(_translate("metaX_main", "Row Cluster")) self.label_183.setText(_translate("metaX_main", "General")) @@ -5952,10 +5952,10 @@ def retranslateUi(self, metaX_main): self.checkBox_tflink_bar_show_legend.setText(_translate("metaX_main", "Show Legend")) self.checkBox_tflink_hetatmap_row_cluster.setText(_translate("metaX_main", "Row Cluster")) self.label_23.setText(_translate("metaX_main", "Scale")) - self.comboBox_tflink_hetatmap_scale.setItemText(0, _translate("metaX_main", "row")) - self.comboBox_tflink_hetatmap_scale.setItemText(1, _translate("metaX_main", "column")) - self.comboBox_tflink_hetatmap_scale.setItemText(2, _translate("metaX_main", "all")) - self.comboBox_tflink_hetatmap_scale.setItemText(3, _translate("metaX_main", "None")) + self.comboBox_tflink_hetatmap_scale.setItemText(0, _translate("metaX_main", "None")) + self.comboBox_tflink_hetatmap_scale.setItemText(1, _translate("metaX_main", "row")) + self.comboBox_tflink_hetatmap_scale.setItemText(2, _translate("metaX_main", "column")) + self.comboBox_tflink_hetatmap_scale.setItemText(3, _translate("metaX_main", "all")) self.label_61.setText(_translate("metaX_main", "Theme")) self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_8), _translate("metaX_main", "Taxa-Func Link")) self.radioButton_network_bysample.setText(_translate("metaX_main", "Sample")) diff --git a/metax/taxafunc_analyzer/analyzer_utils/sum_protein_intensity.py b/metax/taxafunc_analyzer/analyzer_utils/sum_protein_intensity.py index 8995e84..793b482 100644 --- a/metax/taxafunc_analyzer/analyzer_utils/sum_protein_intensity.py +++ b/metax/taxafunc_analyzer/analyzer_utils/sum_protein_intensity.py @@ -317,7 +317,8 @@ def _sum_protein_rank(self, sample_name:str, by_sample=False): def _sum_protein_anti_razor(self, sample_name:str): print(f'Creating protein intensity dict for [{sample_name}]', end='\r') df = self.df.loc[:,[ self.tfa.protein_col_name, sample_name]] - + self.share_intensity = True + for row in df.itertuples(): proteins = row[1].split(';') intensity = row[2] diff --git a/metax/taxafunc_ploter/heatmap_plot.py b/metax/taxafunc_ploter/heatmap_plot.py index 4c422d4..7754caf 100644 --- a/metax/taxafunc_ploter/heatmap_plot.py +++ b/metax/taxafunc_ploter/heatmap_plot.py @@ -101,8 +101,8 @@ def plot_top_taxa_func_heatmap_of_test_res(self, df, top_number:int|str= 100, sns_params = { 'center': 0 if data_include_negative_and_positive else None, "cmap": cmap, - "linewidths": 0.5, - "linecolor": 'gray', + "linewidths": 0.01, + "linecolor": (0 ,0 ,0 ,0.1), "dendrogram_ratio": (0.1, 0.2), "figsize": fig_size if return_type == 'fig' else None, "col_cluster": col_cluster, @@ -255,8 +255,8 @@ def plot_basic_heatmap_of_test_res(self, df, top_number:int = 100, value_type:st sns_params = { "center": 0 if data_include_negative_and_positive else None, "cmap": cmap, - "linewidths": 0.5, - "linecolor": 'gray', + "linewidths": 0.01, + "linecolor": (0 ,0 ,0 ,0.01), "figsize": fig_size if return_type == 'fig' else None, "cbar_kws": {"label": "Intensity", "shrink": 0.5}, "col_cluster": col_cluster, @@ -341,7 +341,7 @@ def plot_basic_heatmap(self, df, title = 'Heatmap',fig_size:tuple|None = None, mat = self.rename_taxa(mat) if cmap is None: - cmap = 'Spectral_r' + cmap = 'YlOrRd' if fig_size is None: fig_size = (30,30) @@ -357,11 +357,11 @@ def plot_basic_heatmap(self, df, title = 'Heatmap',fig_size:tuple|None = None, sns_params = { - "center": 0, + # "center": 0, "cmap": cmap, "figsize": fig_size, "linewidths": 0.01, - "linecolor": (0 / 255, 0 / 255, 0 / 255, 0.01), + "linecolor": (0 ,0 ,0 ,0.01), "dendrogram_ratio": (0.1, 0.2), "cbar_kws": {"label": "Intensity", "shrink": 0.5}, "col_cluster": col_cluster, @@ -504,8 +504,8 @@ def plot_heatmap_of_all_condition_res(self, df, pvalue:float = 0.05,scale:str|N "cmap": cmap, "figsize": fig_size, "norm": norm, - "linewidths": 0.01, - "linecolor": (0 / 255, 0 / 255, 0 / 255, 0.01), + "linewidths": 0.01, + "linecolor": (0 ,0 ,0 ,0.01), "dendrogram_ratio": (0.1, 0.2), "col_cluster": col_cluster, "row_cluster": row_cluster, @@ -638,8 +638,8 @@ def plot_heatmap_of_dunnett_test_res(self, df, pvalue:float = 0.05,scale:str|No "cmap": cmap, "figsize": fig_size, "norm": norm, - "linewidths": 0.01, - "linecolor": (0 / 255, 0 / 255, 0 / 255, 0.01), + "linewidths": 0.01, + "linecolor": (0 ,0 ,0 ,0.01), "dendrogram_ratio": (0.1, 0.2), "cbar_kws": {"label": "t-statistic", "shrink": 0.5}, "col_cluster": col_cluster, diff --git a/metax/utils/version.py b/metax/utils/version.py index f7a9d51..6c5bbab 100644 --- a/metax/utils/version.py +++ b/metax/utils/version.py @@ -1,2 +1,2 @@ -__version__ = '1.110.0' +__version__ = '1.110.1' API_version = '2' \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 774eb4f..9bc7681 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "MetaXTools" -version = "1.110.0" +version = "1.110.1" description = "MetaXTools is a novel tool for linking peptide sequences with taxonomic and functional information in Metaproteomics." readme = "README_PyPi.md" license = { text = "NorthOmics" }