Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
byemaxx committed Dec 3, 2024
2 parents a79ab32 + 807ddb0 commit 14936b5
Show file tree
Hide file tree
Showing 23 changed files with 1,170 additions and 1,044 deletions.
10 changes: 10 additions & 0 deletions Docs/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Version: 1.119.5
## Date: 2024-12-3
### Changes:
- Fix: add top error when in co-expression part and trends part.

# Version: 1.119.4
## Date: 2024-12-3
### Changes:
- New: added an option to plot violin plot to replace the box plot in the basic plot part.

# Version: 1.119.3
## Date: 2024-12-3
### Changes:
Expand Down
Binary file modified Docs/MetaX_Cookbook.assets/basic_stats_heatmap.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 modified Docs/MetaX_Cookbook.assets/basic_stats_heatmap_seeting.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 modified Docs/MetaX_Cookbook.assets/basic_stats_pca.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 modified Docs/MetaX_Cookbook.assets/co_network_page.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 modified Docs/MetaX_Cookbook.assets/dev_menu.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 modified Docs/MetaX_Cookbook.assets/group_control_test.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 modified Docs/MetaX_Cookbook.assets/group_in_condition.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 modified Docs/MetaX_Cookbook.assets/pca_setting.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 modified Docs/MetaX_Cookbook.assets/settings.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 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 modified Docs/MetaX_Cookbook.assets/sub_meta.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 modified Docs/MetaX_Cookbook.assets/t_test.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 modified Docs/MetaX_Cookbook.assets/taxa_func_link_page.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 modified Docs/MetaX_Cookbook.assets/taxa_func_link_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 modified Docs/MetaX_Cookbook.assets/trends_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 7 additions & 14 deletions Docs/MetaX_Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a

- Select **Sub Meta** to plot with two meta

- <img src="MetaX_Cookbook.assets/sub_meta.png" alt="sub_meta" />
- <img src="MetaX_Cookbook.assets/sub_meta.png" >

- Change settings in the **PLOT PARAMETER** tab

Expand All @@ -269,11 +269,11 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a

**e.g. :** Select PBS, BAS and others groups **only in** <u>Individual</u> <u>V1</u>

- <img src="MetaX_Cookbook.assets/group_in_condition.png" alt="group_in_condition" />
- <img src="MetaX_Cookbook.assets/group_in_condition.png">

- Select **specific Samples** to Analysis

- <img src="./MetaX_Cookbook.assets/pca_setting.png" alt="image-20230728113359732" />
- <img src="./MetaX_Cookbook.assets/pca_setting.png" >


Expand Down Expand Up @@ -309,7 +309,7 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a

### Heatmap and Bar Plot

<img src="./MetaX_Cookbook.assets/basic_stats_heatmap.png" alt="basic_stats_heatmap" />
<img src="./MetaX_Cookbook.assets/basic_stats_heatmap.png" >

- **Select items(Taxa, Function, Taxa-Func and Peptide ) to plot:**
- Add **All Taxa**, or select one we are interested in.
Expand Down Expand Up @@ -340,17 +340,10 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a
- **Rename Samples**: Add group info to each sample name
- **Rename Taxa**: Only keep the last taxonomic level to reduce to name
- **Plot Mean**: calculate the mean of each group before plotting

- **Sub Meta:** select a second meta, then combine two meta by mean for Heatmap and 3D bar plot
- **<u>For Heatmap</u>**
- **Theme**: The theme of the heatmap
- **scale**: Scale method of the heatmap
- **Show All Labels:** if show all labels in the heatmap
- **<u>For Bar</u>**
- **Bar Ldg**: Show the legend when plotting Bar
- **Bar %:** Transfer each col to percent when plotting Bar
- <img src="./MetaX_Cookbook.assets/basic_stats_heatmap_seeting.png" alt="basic_stats_heatmap_seeting" />

- <img src="./MetaX_Cookbook.assets/basic_stats_heatmap_seeting.png" >

- Plot all color maps to view by right click <u>**Theme**</u>
- ![right_click_theme](MetaX_Cookbook.assets/right_click_theme.png)
- <img src="MetaX_Cookbook.assets/all_cmap.png" alt="all_cmap">
Expand Down
28 changes: 13 additions & 15 deletions metax/gui/main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self, MainWindow):
icon_path = os.path.join(os.path.dirname(__file__), "./MetaX_GUI/resources/logo.png")

self.MainWindow.setWindowIcon(QIcon(icon_path))
self.MainWindow.resize(1440, 900)
self.MainWindow.resize(1200, 800)
self.MainWindow.setWindowTitle("MetaX v" + __version__)

self.logger = LoggerManager()
Expand Down Expand Up @@ -402,7 +402,7 @@ def __init__(self, MainWindow):
self.comboBox_co_expr_group_sample.currentIndexChanged.connect(lambda:self.change_event_comboBox_group_or_sample('co_expr_group'))
self.comboBox_trends_group_sample.currentIndexChanged.connect(lambda:self.change_event_comboBox_group_or_sample('trends_group'))
self.comboBox_tflink_group_sample.currentIndexChanged.connect(lambda:self.change_event_comboBox_group_or_sample('tflink_group'))
self.comboBox_radioButton_network_group_sample.currentIndexChanged.connect(lambda:self.change_event_comboBox_group_or_sample('tfnet_group'))
self.comboBox_network_group_sample.currentIndexChanged.connect(lambda:self.change_event_comboBox_group_or_sample('tfnet_group'))

### Peptide Qeruy
self.pushButton_basic_peptide_query.clicked.connect(self.peptide_query)
Expand Down Expand Up @@ -690,7 +690,7 @@ def change_event_comboBox_group_or_sample(self, position):
'tflink_group': {"current_text": 'comboBox_tflink_group_sample',
"group_layout": ['horizontalLayout_78', 'gridLayout_tflink_group'],
"sample_layout": ['gridLayout_tflink_sample']},
'tfnet_group': {"current_text": 'comboBox_radioButton_network_group_sample',
'tfnet_group': {"current_text": 'comboBox_network_group_sample',
"group_layout": ['horizontalLayout_55', 'gridLayout_network_group'],
"sample_layout": ['gridLayout_network_sample']},
}
Expand Down Expand Up @@ -3640,7 +3640,7 @@ def add_co_expr_top_list(self):
top_num = self.spinBox_co_expr_top_num.value()
filtered = self.checkBox_co_expr_top_filtered.isChecked()
# get sample list
if self.radioButton_co_expr_bygroup.isChecked(): # select by group
if self.comboBox_co_expr_group_sample.currentText() == 'Group':
group_list = self.comboBox_co_expr_group.getCheckedItems()
in_condition = (
[self.comboBox_co_expression_condition_meta.currentText(), self.comboBox_co_expression_condition_group.getCheckedItems()]
Expand Down Expand Up @@ -3968,7 +3968,6 @@ def add_trends_top_list(self):
)

# get sample list
# if self.radioButton_trends_group.isChecked(): # select by group
if self.comboBox_trends_group_sample.currentText() == 'Group':
sample_list = self.get_sample_list_for_group_list_in_condition(group_list, condition=in_condition)

Expand Down Expand Up @@ -4002,7 +4001,7 @@ def plot_trends_cluster(self):


# get sample list and check if the sample list at least has 2 groups
if self.radioButton_trends_group.isChecked():
if self.comboBox_trends_group_sample.currentText() == 'Group':
condition = [self.comboBox_trends_condition_meta.currentText(),
self.comboBox_trends_condition_group.getCheckedItems()]\
if self.checkBox_trends_in_condition.isChecked() else None
Expand Down Expand Up @@ -4121,14 +4120,14 @@ def plot_trends_interactive_line(self):

dft = self.get_table_by_df_type(df_type=table_name, replace_if_two_index = True)
# get sample list
if self.radioButton_trends_group.isChecked():
if self.comboBox_trends_group_sample.currentText() == 'Group':
group_list = self.comboBox_trends_group.getCheckedItems()
group_list = group_list if group_list != [] else sorted(set(self.tfa.group_list))
sample_list = self.get_sample_list_for_group_list_in_condition(group_list, condition=condition)
if sample_list is None:
return None

else: # self.radioButton_trends_sample.isChecked()
else: # select by sample
sample_list = self.comboBox_trends_sample.getCheckedItems()
if sample_list == []:
sample_list = self.tfa.sample_list
Expand Down Expand Up @@ -4447,7 +4446,6 @@ def get_title_by_table_name(self, table_name):
title_name = get_title_by_table_name(self, table_name)

# get sample list when plot by group
# if self.radioButton_basic_pca_group.isChecked():
if self.comboBox_basic_pca_group_sample.currentText() == 'Group':
condition = [self.comboBox_basic_condition_meta.currentText(),
self.comboBox_basic_condition_group.getCheckedItems()] \
Expand Down Expand Up @@ -4499,10 +4497,13 @@ def get_title_by_table_name(self, table_name):

elif method == 'box':
plot_samples = self.checkBox_box_plot_samples.isChecked()
violinplot = self.checkBox_box_violinplot.isChecked()
log_scale = self.checkBox_box_log_scale.isChecked()
BasicPlot(self.tfa).plot_box_sns(df=df, title_name=title_name, show_fliers=show_fliers,
width=width, height=height, font_size=font_size, theme=theme,
rename_sample = rename_sample, plot_samples = plot_samples,
legend_col_num=legend_col_num, sub_meta = sub_meta)
legend_col_num=legend_col_num, sub_meta = sub_meta,
violinplot=violinplot, log_scale=log_scale)

elif method == 'corr':
cluster = self.checkBox_corr_cluster.isChecked()
Expand Down Expand Up @@ -5337,7 +5338,6 @@ def plot_co_expr(self, plot_type = 'network'):
else:
sample_list = slected_list
# print(f'Plot with selected samples:{sample_list}')
# elif self.radioButton_co_expr_bygroup.isChecked():
elif self.comboBox_co_expr_group_sample.currentText() == 'Group':
condition = [self.comboBox_co_expression_condition_meta.currentText(),
self.comboBox_co_expression_condition_group.getCheckedItems()] \
Expand Down Expand Up @@ -5520,8 +5520,7 @@ def add_tfnet_top_list(self):
df_type = self.comboBox_tfnet_table.currentText()
filtered = self.checkBox_tfnet_top_filtered.isChecked()

# if self.radioButton_network_bysample.isChecked(): # by sample
if self.comboBox_radioButton_network_group_sample.currentText() == 'Sample':
if self.comboBox_network_group_sample.currentText() == 'Sample':
slected_list = self.comboBox_network_sample.getCheckedItems()
if slected_list:
sample_list = slected_list
Expand Down Expand Up @@ -5610,7 +5609,7 @@ def plot_network(self):
rename_taxa = self.checkBox_tf_link_net_rename_taxa.isChecked()
font_size = self.spinBox_network_font_size.value()

if self.radioButton_network_bysample.isChecked(): # by sample
if self.comboBox_network_group_sample.currentText() == 'Sample':
slected_list = self.comboBox_network_sample.getCheckedItems()
if slected_list:
sample_list = slected_list
Expand Down Expand Up @@ -5656,7 +5655,6 @@ def plot_network(self):

def get_sample_list_tflink(self):
# get sample list
# if self.radioButton_tflink_group.isChecked(): # by group
if self.comboBox_tflink_group_sample.currentText() == 'Group':
in_condition = (
[self.comboBox_tflink_condition_meta.currentText(), self.comboBox_tflink_condition_group.getCheckedItems()]
Expand Down
Loading

0 comments on commit 14936b5

Please sign in to comment.