Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
byemaxx committed Aug 26, 2024
2 parents efb80e3 + 5dfc08b commit 99ce6ce
Show file tree
Hide file tree
Showing 16 changed files with 6,028 additions and 5,569 deletions.
40 changes: 40 additions & 0 deletions Docs/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# Version: 1.111.6
## Date: 2024-08-21
### Changes:
- Fix: Fixed the bug of extrcting the peptides of taxa, funcs or taxa-funcs, when split the function items.


# Version: 1.111.5
## Date: 2024-08-21
### Changes:
- Change: Optimized the x-axis and y-axis labels of the heatmap plot to make the labels more clear.

# Version: 1.111.4
## Date: 2024-08-21
### Changes:
- New: Added rotation option for the x-axis and y-axis of the heatmap plot.

# Version: 1.111.3
## Date: 2024-08-21
### Changes:
- New: Added protein_id as a function to the OTF table, only keep the first protein_id as the function.

# Version: 1.111.2
## Date: 2024-08-21
### Changes:
- Fix: Fixed the bug when restore the object, the seetings was not restored completely.


# Version: 1.111.1
## Date: 2024-08-21
### Changes:
- Fix: Fixed the bug of spliting the function items, the redundant items were not sumed.



# Version: 1.111.0
## Date: 2024-08-20
### Changes:
- New: Added a option to split the items contain multiple functions to multiple items when set OTF table.


# Version: 1.110.1
## Date: 2024-08-20
### Changes:
Expand Down
2 changes: 1 addition & 1 deletion Docs/MetaX_Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is the guidebook for the MetaX **GUI Version**. If you are using the CLI to

# Overview

**[MetaX](https://github.com/byemaxx/MetaX)** is a novel tool for linking peptide sequences with taxonomic and functional information in **Metaproteomics**. We introduce the ***Operational Taxa-Functions (OTF)*** concept to explore microbial roles and interactions ("**who is doing what and how**") within ecosystems.
**[MetaX](https://github.com/byemaxx/MetaX)** is a novel tool for linking peptide sequences with taxonomic and functional information in **Metaproteomics**. We introduce the ***Operational Taxon-Function (OTF)*** concept to explore microbial roles and interactions ("**who is doing what and how**") within ecosystems.

MetaX also features <u>statistical modules</u> and <u>plotting tools</u> for analyzing peptides, taxa, functions, proteins, and taxon-function contributions across groups.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MetaX

**MetaX** is a novel tool for linking peptide sequences with taxonomic and functional information in **Metaproteomics**. We introduce the ***Operational Taxa-Functions (OTF)*** concept to explore microbial roles and interactions ("**who is doing what and how**") within ecosystems.
**MetaX** is a novel tool for linking peptide sequences with taxonomic and functional information in **Metaproteomics**. We introduce the ***Operational Taxon-Function (OTF)*** concept to explore microbial roles and interactions ("**who is doing what and how**") within ecosystems.

MetaX also features <u>statistical modules</u> and <u>plotting tools</u> for analyzing peptides, taxa, functions, proteins, and taxon-function contributions across groups.

Expand Down
10,002 changes: 5,001 additions & 5,001 deletions metax/data/example_data/Example_OTF.tsv

Large diffs are not rendered by default.

60 changes: 39 additions & 21 deletions metax/gui/main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,13 @@ def __init__(self, MainWindow):
# ploting parameters
# set the default theme mode
self.html_theme = 'white'

self.heatmap_params_dict = {'linkage_method': 'average', 'distance_metric': 'euclidean'}

self.heatmap_params_dict = {
"linkage_method": "average",
"distance_metric": "euclidean",
"x_labels_rotation": 90,
"y_labels_rotation": 0,
}

self.tf_link_net_params_dict = {'taxa_shape': 'circle', 'func_shape': 'rect',
'taxa_color': '#374E55','taxa_focus_color': '#6A6599',
Expand Down Expand Up @@ -1175,6 +1180,12 @@ def save_set_multi_table_settings(self):

elif isinstance(widget, QtWidgets.QSpinBox):
self.settings.setValue(f"{settings_key}/value", widget.value())

elif isinstance(widget, QtWidgets.QCheckBox):
self.settings.setValue(f"{settings_key}/isChecked", widget.isChecked())

elif isinstance(widget, QtWidgets.QLineEdit):
self.settings.setValue(f"{settings_key}/text", widget.text())


def export_log_file(self):
Expand Down Expand Up @@ -1251,6 +1262,17 @@ def restore_settings_after_load_taxafunc_obj(self):
elif isinstance(widget, QtWidgets.QSpinBox):
value = self.settings.value(f"{settings_key}/value", 0, type=int)
widget.setValue(value)
elif isinstance(widget, QtWidgets.QCheckBox):
checked = self.settings.value(f"{settings_key}/isChecked", False, type=bool)
widget.setChecked(checked)
if widget.objectName() == 'checkBox_set_taxa_func_split_func':
enable_list = [self.lineEdit_set_taxa_func_split_func_sep, self.checkBox_set_taxa_func_split_func_share_intensity]
for w in enable_list:
w.setEnabled(checked)

elif isinstance(widget, QtWidgets.QLineEdit):
text = self.settings.value(f"{settings_key}/text", "", type=str)
widget.setText(text)


# enable button after multi table is set
Expand Down Expand Up @@ -2452,6 +2474,10 @@ def set_multi_table(self, restore_taxafunc=False, saved_obj=None):
func_threshold = self.doubleSpinBox_func_threshold.value()
func_threshold = round(func_threshold, 3)

split_func = self.checkBox_set_taxa_func_split_func.isChecked()
split_func_params: dict = {'split_by': self.lineEdit_set_taxa_func_split_func_sep.text(),
'share_intensity': self.checkBox_set_taxa_func_split_func_share_intensity.isChecked()}

peptide_num_threshold = {
'taxa': self.spinBox_peptide_num_threshold_taxa.value(),
'func': self.spinBox_peptide_num_threshold_func.value(),
Expand Down Expand Up @@ -2602,7 +2628,8 @@ def set_multi_table(self, restore_taxafunc=False, saved_obj=None):
'processing_after_sum': processing_after_sum,
'peptide_num_threshold': peptide_num_threshold,
'sum_protein': sum_protein, 'sum_protein_params': sum_protein_params,
'keep_unknow_func': False}
'keep_unknow_func': False,
'split_func': split_func, 'split_func_params': split_func_params}

def callback_after_set_multi_tables(result, success):
if success:
Expand Down Expand Up @@ -3452,28 +3479,19 @@ def plot_basic_list(self, plot_type='heatmap'):
df = self.tfa.peptide_df.copy()

else:
peptides_list = []

if table_name == 'Taxa':
df = self.tfa.clean_df.loc[self.tfa.clean_df['Taxon'].isin(self.basic_heatmap_list)]
df.index = df[self.tfa.peptide_col_name]
for i in self.basic_heatmap_list:
peptides_list.extend(self.tfa.peptides_linked_dict['taxa'][i])

elif table_name == 'Functions':
df = self.tfa.clean_df.loc[self.tfa.clean_df[self.tfa.func_name].isin(self.basic_heatmap_list)]
df.index = df[self.tfa.peptide_col_name]
for i in self.basic_heatmap_list:
peptides_list.extend(self.tfa.peptides_linked_dict['func'][i])

elif table_name == 'Taxa-Functions':
df_list = []
for i in self.basic_heatmap_list:
taxon, func = i.split(' <')
func = func[:-1]
dft = self.tfa.clean_df.loc[(self.tfa.clean_df['Taxon'] == taxon) & (self.tfa.clean_df[self.tfa.func_name] == func)]
df_list.append(dft)

if df_list:
df_all = pd.concat(df_list)
df_all.index = df_all[self.tfa.peptide_col_name]
df = df_all
else:
raise ValueError('No valid taxa-function belongs to the selected taxa-function!')
peptides_list.extend(self.tfa.peptides_linked_dict['taxa_func'][i])

elif table_name == 'Proteins':
QMessageBox.warning(self.MainWindow, 'Warning',
Expand All @@ -3484,9 +3502,9 @@ def plot_basic_list(self, plot_type='heatmap'):
return

else: # Peptide
df = self.tfa.peptide_df.copy()
df = df.loc[self.basic_heatmap_list]
peptides_list = self.basic_heatmap_list

df = self.tfa.peptide_df.loc[peptides_list]
df = df[sample_list]

else:
Expand Down
Loading

0 comments on commit 99ce6ce

Please sign in to comment.