Skip to content

Commit

Permalink
- New: Added an option in 'Help' menu to open the online Tutorial page.
Browse files Browse the repository at this point in the history
- Change: Co-expression Network plot: Use the corelation value as the weight of the edge, and improve the layout of the plot.
- Fix: Fixed the bug of when plot the Taxa-Functions Network, the shape setting was not work withotu focus list.
  • Loading branch information
byemaxx committed Jun 16, 2024
1 parent 7d738de commit 1e16935
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 33 deletions.
7 changes: 7 additions & 0 deletions Docs/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Version: 1.107.2
## Date: 2024-06-16
### Changes:
- New: Added an option in 'Help' menu to open the online Tutorial page.
- Change: Co-expression Network plot: Use the corelation value as the weight of the edge, and improve the layout of the plot.
- Fix: Fixed the bug of when plot the Taxa-Functions Network, the shape setting was not work withotu focus list.

# Version: 1.107.1
## Date: 2024-06-16
### Changes:
Expand Down
Binary file modified Docs/MetaX_Cookbook.assets/settings_page2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/MetaX_Cookbook.assets/tf_link_net_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ MetaX also features <u>statistical modules</u> and <u>plotting tools</u> for ana
## Taxa-Functions Linkage
Linking Taxa and Functions in different levels of the hierarchy, and different functional categories. e.g., **Species-KO**, **Genus-CAZy**, **Phylum-EC**, etc.

![OTF](./Docs/MetaX_Cookbook.assets/tf_link_net.png)
- ![OTF](./Docs/MetaX_Cookbook.assets/tf_link_net.png)



e.g. The **KEGG Pathways** linked to ***Roseburia hominis***

- ![tf_link_net_2](./Docs/MetaX_Cookbook.assets/tf_link_net_2.png)



## Download
### `Desktop Version(Recommended)`:
Expand Down
16 changes: 14 additions & 2 deletions utils/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def __init__(self, MainWindow):
self.tf_link_net_params_dict = {'taxa_shape': 'circle', 'func_shape': 'rect',
'taxa_color': '#374E55','taxa_focus_color': '#6A6599',
'func_color': '#DF8F44', 'func_focus_color': '#B24745',
'line_opacity': 0.5, 'line_width': 2, 'line_curve': 0.1,
'line_color': '#9aa7b1', 'repulsion': 500
'line_opacity': 0.5, 'line_width': 2, 'line_curve': 0,
'line_color': '#9aa7b1', 'repulsion': 500, 'font_weight': 'bold'
}


Expand All @@ -182,12 +182,14 @@ def __init__(self, MainWindow):
self.actionAny_Table_Mode.setIcon(qta.icon('mdi.table'))
self.actionCheck_Update.setIcon(qta.icon('mdi.update'))
self.actionSettings.setIcon(qta.icon('mdi.cog'))
self.actionTutorial.setIcon(qta.icon('mdi6.book-open-page-variant-outline'))
# set menu bar click event
self.actionTaxaFuncAnalyzer.triggered.connect(self.swith_stack_page_analyzer)
self.actionPeptide_to_TaxaFunc.triggered.connect(self.swith_stack_page_pep2taxafunc)
self.actionDatabase_Builder.triggered.connect(self.swith_stack_page_dbuilder)
self.actionDatabase_Update.triggered.connect(self.swith_stack_page_db_update)
self.actionAbout.triggered.connect(self.show_about)
self.actionTutorial.triggered.connect(self.open_tutorial)
self.actionRestore_Last_TaxaFunc.triggered.connect(lambda: self.run_restore_taxafunnc_obj_from_file(last=True))
self.actionRestore_From.triggered.connect(self.run_restore_taxafunnc_obj_from_file)
self.actionSave_As.triggered.connect(lambda:self.save_metax_obj_to_file(save_path=None, no_message=False))
Expand Down Expand Up @@ -1381,7 +1383,15 @@ def check_update(self, show_message=False, manual_check_trigger=True):
updater = Updater(MetaXGUI=self, version=__version__, splash=splash, show_message=show_message, branch=self.update_branch)
updater.check_update(show_message=show_message)

def open_tutorial(self):
# use default browser to open the tutorial link
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtCore import QUrl

url = QUrl("https://byemaxx.github.io/MetaX/")
QDesktopServices.openUrl(url)


def show_about(self):

dialog = QDialog(self.MainWindow)
Expand All @@ -1406,6 +1416,7 @@ def show_about(self):
<h3>Aditional Information</h3>
<p>For more information, please visit:</p>
<p>GitHub: <a href='https://github.com/byemaxx/MetaX'>The MetaX Project</a></p>
<p>Tutorial: <a href='https://byemaxx.github.io/MetaX/' >MetaX Tutorial</a></p>
<p>iMeta: <a href='https://wiki.imetalab.ca/'>iMetaWiki Page</a></p>
'''

Expand Down Expand Up @@ -4836,6 +4847,7 @@ def plot_co_expr_network(self):
show_labels=show_labels,
rename_taxa=rename_taxa,
font_size=font_size,
**self.tf_link_net_params_dict
).plot_co_expression_network(df_type= df_type, corr_method=corr_method,
corr_threshold=corr_threshold, sample_list=sample_list, width=width, height=height, focus_list=focus_list, plot_list_only=plot_list_only)
self.save_and_show_js_plot(pic, 'co-expression network')
Expand Down
10 changes: 8 additions & 2 deletions utils/MetaX_GUI/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7382,8 +7382,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>981</width>
<height>332</height>
<width>313</width>
<height>41</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -8038,6 +8038,7 @@
</property>
<addaction name="actionAbout"/>
<addaction name="actionCheck_Update"/>
<addaction name="actionTutorial"/>
</widget>
<widget class="QMenu" name="menuOthers">
<property name="title">
Expand Down Expand Up @@ -8126,6 +8127,11 @@
<string>Settings</string>
</property>
</action>
<action name="actionTutorial">
<property name="text">
<string>Tutorial</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>comboBox_taxa_level_to_stast</tabstop>
Expand Down
39 changes: 35 additions & 4 deletions utils/MetaX_GUI/Setting.ui
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>748</width>
<height>367</height>
<width>246</width>
<height>37</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -113,7 +113,7 @@
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
<double>0.000000000000000</double>
</property>
</widget>
</item>
Expand Down Expand Up @@ -335,7 +335,7 @@
<item row="2" column="5">
<widget class="QSpinBox" name="spinBox_tf_link_net_repulsion">
<property name="maximum">
<number>10000</number>
<number>100000</number>
</property>
<property name="singleStep">
<number>10</number>
Expand All @@ -345,6 +345,37 @@
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Font Weight</string>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QComboBox" name="comboBox_tf_link_net_font_weight">
<item>
<property name="text">
<string>bold</string>
</property>
</item>
<item>
<property name="text">
<string>normal</string>
</property>
</item>
<item>
<property name="text">
<string>bolder</string>
</property>
</item>
<item>
<property name="text">
<string>lighter</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="0" column="3">
Expand Down
5 changes: 3 additions & 2 deletions utils/MetaX_GUI/Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, parent=None, update_branch="main", auto_check_update=True):
self.ui.doubleSpinBox_tf_link_net_line_curve.valueChanged.connect(self.handle_tf_link_network_changed)
self.ui.lineEdit_tf_link_net_line_color.textChanged.connect(self.handle_tf_link_network_changed)
self.ui.spinBox_tf_link_net_repulsion.valueChanged.connect(self.handle_tf_link_network_changed)

self.ui.comboBox_tf_link_net_font_weight.currentTextChanged.connect(self.handle_tf_link_network_changed)

def init_ui(self, update_mode, auto_check_update):
if update_mode == "main":
Expand Down Expand Up @@ -88,7 +88,8 @@ def handle_tf_link_network_changed(self):
"line_curve": self.ui.doubleSpinBox_tf_link_net_line_curve.value(),
"line_color": self.ui.lineEdit_tf_link_net_line_color.text(),

'repulsion': self.ui.spinBox_tf_link_net_repulsion.value()
'repulsion': self.ui.spinBox_tf_link_net_repulsion.value(),
'font_weight': self.ui.comboBox_tf_link_net_font_weight.currentText()

}
self.tf_link_net_params_dict_changed.emit(network_params_dict)
Expand Down
6 changes: 5 additions & 1 deletion utils/MetaX_GUI/Ui_MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3884,7 +3884,7 @@ def setupUi(self, metaX_main):
self.toolBox_metalab_res_anno = QtWidgets.QToolBox(self.tab_18)
self.toolBox_metalab_res_anno.setObjectName("toolBox_metalab_res_anno")
self.page_3 = QtWidgets.QWidget()
self.page_3.setGeometry(QtCore.QRect(0, 0, 981, 332))
self.page_3.setGeometry(QtCore.QRect(0, 0, 313, 41))
self.page_3.setObjectName("page_3")
self.gridLayout_45 = QtWidgets.QGridLayout(self.page_3)
self.gridLayout_45.setObjectName("gridLayout_45")
Expand Down Expand Up @@ -4243,12 +4243,15 @@ def setupUi(self, metaX_main):
self.actionAny_Table_Mode.setObjectName("actionAny_Table_Mode")
self.actionSettings = QtWidgets.QAction(metaX_main)
self.actionSettings.setObjectName("actionSettings")
self.actionTutorial = QtWidgets.QAction(metaX_main)
self.actionTutorial.setObjectName("actionTutorial")
self.menuTools.addAction(self.actionTaxaFuncAnalyzer)
self.menuTools.addAction(self.actionPeptide_to_TaxaFunc)
self.menuTools.addAction(self.actionDatabase_Builder)
self.menuTools.addAction(self.actionDatabase_Update)
self.menuHelp.addAction(self.actionAbout)
self.menuHelp.addAction(self.actionCheck_Update)
self.menuHelp.addAction(self.actionTutorial)
self.menuOthers.addAction(self.actionRestore_Last_TaxaFunc)
self.menuOthers.addAction(self.actionRestore_From)
self.menuOthers.addAction(self.actionSave_As)
Expand Down Expand Up @@ -4963,3 +4966,4 @@ def retranslateUi(self, metaX_main):
self.actionRestore_From.setText(_translate("metaX_main", "Restore From.."))
self.actionAny_Table_Mode.setText(_translate("metaX_main", "Any Table Mode"))
self.actionSettings.setText(_translate("metaX_main", "Settings"))
self.actionTutorial.setText(_translate("metaX_main", "Tutorial"))
21 changes: 18 additions & 3 deletions utils/MetaX_GUI/Ui_Setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setupUi(self, Settings):
self.toolBox = QtWidgets.QToolBox(Settings)
self.toolBox.setObjectName("toolBox")
self.page = QtWidgets.QWidget()
self.page.setGeometry(QtCore.QRect(0, 0, 748, 367))
self.page.setGeometry(QtCore.QRect(0, 0, 246, 37))
self.page.setObjectName("page")
self.gridLayout_3 = QtWidgets.QGridLayout(self.page)
self.gridLayout_3.setObjectName("gridLayout_3")
Expand Down Expand Up @@ -59,7 +59,7 @@ def setupUi(self, Settings):
self.doubleSpinBox_tf_link_net_line_curve.setDecimals(1)
self.doubleSpinBox_tf_link_net_line_curve.setMaximum(1.0)
self.doubleSpinBox_tf_link_net_line_curve.setSingleStep(0.1)
self.doubleSpinBox_tf_link_net_line_curve.setProperty("value", 0.1)
self.doubleSpinBox_tf_link_net_line_curve.setProperty("value", 0.0)
self.doubleSpinBox_tf_link_net_line_curve.setObjectName("doubleSpinBox_tf_link_net_line_curve")
self.gridLayout_6.addWidget(self.doubleSpinBox_tf_link_net_line_curve, 2, 3, 1, 1)
self.comboBox_tf_link_net_taxa_sahpe = QtWidgets.QComboBox(self.page_2)
Expand Down Expand Up @@ -142,11 +142,21 @@ def setupUi(self, Settings):
self.label_15.setObjectName("label_15")
self.gridLayout_6.addWidget(self.label_15, 2, 4, 1, 1)
self.spinBox_tf_link_net_repulsion = QtWidgets.QSpinBox(self.page_2)
self.spinBox_tf_link_net_repulsion.setMaximum(10000)
self.spinBox_tf_link_net_repulsion.setMaximum(100000)
self.spinBox_tf_link_net_repulsion.setSingleStep(10)
self.spinBox_tf_link_net_repulsion.setProperty("value", 500)
self.spinBox_tf_link_net_repulsion.setObjectName("spinBox_tf_link_net_repulsion")
self.gridLayout_6.addWidget(self.spinBox_tf_link_net_repulsion, 2, 5, 1, 1)
self.label_16 = QtWidgets.QLabel(self.page_2)
self.label_16.setObjectName("label_16")
self.gridLayout_6.addWidget(self.label_16, 3, 4, 1, 1)
self.comboBox_tf_link_net_font_weight = QtWidgets.QComboBox(self.page_2)
self.comboBox_tf_link_net_font_weight.setObjectName("comboBox_tf_link_net_font_weight")
self.comboBox_tf_link_net_font_weight.addItem("")
self.comboBox_tf_link_net_font_weight.addItem("")
self.comboBox_tf_link_net_font_weight.addItem("")
self.comboBox_tf_link_net_font_weight.addItem("")
self.gridLayout_6.addWidget(self.comboBox_tf_link_net_font_weight, 3, 5, 1, 1)
self.gridLayout_4.addLayout(self.gridLayout_6, 2, 3, 1, 1)
self.gridLayout_8 = QtWidgets.QGridLayout()
self.gridLayout_8.setObjectName("gridLayout_8")
Expand Down Expand Up @@ -238,6 +248,11 @@ def retranslateUi(self, Settings):
self.label_14.setText(_translate("Settings", "Line Curve"))
self.lineEdit_tf_link_net_line_color.setText(_translate("Settings", "#9aa7b1"))
self.label_15.setText(_translate("Settings", "Repulsion"))
self.label_16.setText(_translate("Settings", "Font Weight"))
self.comboBox_tf_link_net_font_weight.setItemText(0, _translate("Settings", "bold"))
self.comboBox_tf_link_net_font_weight.setItemText(1, _translate("Settings", "normal"))
self.comboBox_tf_link_net_font_weight.setItemText(2, _translate("Settings", "bolder"))
self.comboBox_tf_link_net_font_weight.setItemText(3, _translate("Settings", "lighter"))
self.label_2.setText(_translate("Settings", "Linkage Method"))
self.comboBox_heatmap_linkage_method.setCurrentText(_translate("Settings", "average"))
self.comboBox_heatmap_linkage_method.setItemText(0, _translate("Settings", "average"))
Expand Down
Loading

0 comments on commit 1e16935

Please sign in to comment.