Skip to content

Commit

Permalink
- Fix: when plot non-interactive bar at the basic plot part, the sub …
Browse files Browse the repository at this point in the history
…meta was not work.
  • Loading branch information
byemaxx committed Dec 10, 2024
1 parent 3c9c366 commit 168bae0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Docs/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version: 1.119.11
## Date: 2024-12-10
### Changes:
- Fix: when plot non-interactive bar at the basic plot part, the sub meta was not work.

# Version: 1.119.10
## Date: 2024-12-9
### Changes:
Expand Down
3 changes: 2 additions & 1 deletion metax/gui/main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3839,11 +3839,12 @@ def plot_basic_list(self, plot_type='heatmap'):

self.save_and_show_js_plot(pic, title)
else:
plt_theme = self.comboBox_basic_theme.currentText()
ax = BarPlot(self.tfa, theme=self.html_theme).plot_intensity_bar_sns(df = df, width=width, height=height, # noqa: F841
title= '', rename_taxa=rename_taxa,
show_legend=show_legend, font_size=font_size,
rename_sample=rename_sample, plot_mean = plot_mean,
plot_percent = plot_percent, sub_meta = sub_meta)
plot_percent = plot_percent, sub_meta = sub_meta, plt_theme = plt_theme)

elif plot_type == 'get_table':
self.show_message('Getting table...')
Expand Down
14 changes: 11 additions & 3 deletions metax/taxafunc_ploter/bar_plot_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,21 @@ def plot_intensity_bar_sns(self, taxon_name:str|None=None, sample_list:list|None
title:str|None =None, rename_taxa:bool=False,
show_legend:bool=True, font_size:int=10,
rename_sample:bool=True, plot_mean:bool=False,
plot_percent:bool=False, sub_meta:str="None", **kwargs):
plot_percent:bool=False, sub_meta:str="None", plt_theme:str='Auto'):

df, _ = self._get_modfied_df(df, taxon_name, sample_list, func_name, peptide_seq,
df, rename_sample = self._get_modfied_df(df, taxon_name, sample_list, func_name, peptide_seq,
rename_taxa, rename_sample, plot_mean, sub_meta, plot_percent)
if sub_meta != "None":
df, _ = self.tfa.BasicStats.get_combined_sub_meta_df(df=df, sub_meta=sub_meta, rename_sample=rename_sample, plot_mean=plot_mean)

colormap = GetDistinctColors().get_distinct_colors(len(df.index))
if plt_theme == 'Auto':
plt.style.use('default')
else:
plt.style.use(plt_theme)

fig, ax = plt.subplots(figsize=(width, height))
df.T.plot(kind='bar', stacked=True, ax=ax, color=colormap)
df.T.plot(kind='bar', stacked=True, ax=ax, color=colormap, width=0.95)

ax.set_title(title, fontsize=font_size)
ax.set_xlabel('Group' if plot_mean else 'Sample', fontsize=font_size)
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.119.10'
__version__ = '1.119.11'
API_version = '4'
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.119.10"
version = "1.119.11"
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 168bae0

Please sign in to comment.