Skip to content

Commit

Permalink
update cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
byemaxx committed Jul 23, 2024
1 parent a021d84 commit e2d43b1
Show file tree
Hide file tree
Showing 38 changed files with 103 additions and 91 deletions.
Binary file modified Docs/MetaX_Cookbook.assets/add_a_list.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/add_to_list.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/anova_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/basic_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 not shown.
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_focus.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/co_network_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/corss_heatmap_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/deseq2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
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/main_window.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/peptide_query.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/right_click_theme.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/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/t_test_res.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified Docs/MetaX_Cookbook.assets/taxa_func_link_page2.png
Binary file modified Docs/MetaX_Cookbook.assets/taxa_func_linked_only.png
Binary file modified Docs/MetaX_Cookbook.assets/taxa_func_sankey.png
Binary file modified Docs/MetaX_Cookbook.assets/tools_menu.png
Binary file modified Docs/MetaX_Cookbook.assets/trends_cluster_setting.png
Binary file modified Docs/MetaX_Cookbook.assets/trends_page.png
Binary file modified Docs/MetaX_Cookbook.assets/tukey_test.png
Binary file modified Docs/MetaX_Cookbook.assets/volcano.png
116 changes: 64 additions & 52 deletions Docs/MetaX_Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Then we can check tables in **Table Review** part, and export it.

### PCA, Correlation and Box Plot

<img src="./MetaX_Cookbook.assets/basic_stats_pca.png" alt="basic_stats_pca" />
<img src="./MetaX_Cookbook.assets/basic_stats_pca.png" alt="basic_stats_pca" style="zoom:;" />

We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default all) to plot **PCA**, **Correlation**, and **Box Plot** for **[Taxa, Function, Taxa-Func, Peptide table, Protein table**]

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

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

- ![basic_setting](MetaX_Cookbook.assets/basic_setting.png)
- <img src="MetaX_Cookbook.assets/sub_meta.png" alt="sub_meta" />

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

- <img src="MetaX_Cookbook.assets/basic_setting.png" alt="basic_setting" style="zoom:80%;" />


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

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

- ![image-20230728112519665](./MetaX_Cookbook.assets/right_cilck_menu.png)

- <img src="./MetaX_Cookbook.assets/pic_tools_bar.png" alt="image-20230728112747731" style="zoom:80%;" />

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

- 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" />
- <img src="MetaX_Cookbook.assets/all_cmap.png" alt="all_cmap">

- **Plot:**

Expand Down Expand Up @@ -469,8 +473,6 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a
- 3D Bar plot

- Plot 3D bar by selecting a **sub meta**.
- ![basic_stats_bar_3d_setting](MetaX_Cookbook.assets/basic_stats_bar_3d_setting.png)

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


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

- Select 2 group stats T-Test for **[Taxa, Function, Taxa-Func, Peptide table and Proteins Table**]

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

### ANOVA-TEST

- select <u>some groups</u> or <u>all groups</u> to ANOVA Test for **[Taxa, Function, Taxa-Func and Peptide table**]

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

### Significant Taxa-Func

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

- The **result** of the T-test and ANOVA Test will show in a new window

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



Expand All @@ -520,6 +522,7 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a

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

-
- Taxa-Func cross heatmap:
- The orange cells mean in the corresponding function ( X-axis) and Taxa( Y-axis) are significantly different between groups.

Expand All @@ -535,14 +538,53 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a

- The colored tiles represent the taxa which were not significantly different between groups but the related functions were.

### Group-Control TEST

- **Dunnett's Test**

Set a Group as **"Control"**, then compare all groups to Control

- **Comparing in Each Condition:** Select a meta such as individual, then compare groups to control in each individual.

- **DESeq2 Test**

Bingo! You noticed the hidden function of MetaX, click **Help -> About -> Like** 3 times to unlock the function to compare all groups to control.



- ![group_control_test](./MetaX_Cookbook.assets/group_control_test.png)
- Result of Dunnett's Test:
- T- Statistic value shown in the heatmap
- <img src="./MetaX_Cookbook.assets/dunnetts_heatmap.png" alt="dunnetts_heatmap" />



### DESeq2

- Select two groups to calculate FoldChange by [<u>PyDESeq2</u>]: https://github.com/owkin/PyDESeq2



<img src="./MetaX_Cookbook.assets/deseq2.png" alt="image-20230728123725717"/>

- Select <u>p-adjust</u>, <u>log2FC</u> to plot

(**Ultra-Up(Down):** |log2FC| > Max log2FC)

- Volcano:

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

- Sankey:

- The last node level is the functions linked to each Taxon (When plotting Taxa-Func)

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


### TUKEY_TEST

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

- **Select a function:**

Expand Down Expand Up @@ -571,50 +613,17 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a

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

### Group-Control TEST

- **Dunnett's Test**

Set a Group as **"Control"**, then compare all groups to Control

- **Comparing in Each Condition:** Select a meta such as individual, then compare groups to control in each individual.

- ![group_control_test](./MetaX_Cookbook.assets/group_control_test.png)
- Result of Dunnett's Test:
- T- Statistic value shown in the heatmap
- <img src="./MetaX_Cookbook.assets/dunnetts_heatmap.png" alt="dunnetts_heatmap" />



## 6. Differential Analysis

### Fold Change Calculation

- Select two groups to calculate FoldChange by [<u>PyDESeq2</u>]: https://github.com/owkin/PyDESeq2



<img src="./MetaX_Cookbook.assets/deseq2.png" alt="image-20230728123725717" />
## 6. Expression Analysis

- Select <u>p-adjust</u>, <u>log2FC</u> to plot

(**Ultra-Up(Down):** |log2FC| > Max log2FC)

- Volcano:

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

- Sankey:

- The last node level is the functions linked to each Taxon (When plotting Taxa-Func)

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

### Co-Expression Networks
### Co-Expression Networks & Heatmap

- select Groups or Samples to calculate the correlation and plot the network

<img src="./MetaX_Cookbook.assets/co_network_page.png" alt="image-20230728142606826" />
<img src="./MetaX_Cookbook.assets/co_network_page.png">

- Slecet table, and set the method of correlation and threshold

Expand All @@ -632,13 +641,14 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a

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


- Correlation of expression
- ![image-20240723162241316](MetaX_Cookbook.assets/expression_corelation_heatmap.png)

### Expression Trends

- Add items to the list window to plot the clusters with similar trends of intensity

<img src="./MetaX_Cookbook.assets/trends_page.png" alt="image-20230728143806833" />
<img src="./MetaX_Cookbook.assets/trends_page.png">

- Clusters plot (clustered by **k-means**)

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

### Taxa-Func Link Plot

<img src="./MetaX_Cookbook.assets/taxa_func_link_page2.png" alt="image-20230728150309898" />
<img src="./MetaX_Cookbook.assets/taxa_func_link_page2.png">

- Check all taxa in one function (or Check all functions in a taxon)

Expand Down Expand Up @@ -710,11 +720,13 @@ We can select <u>**meta**</u> <u>**groups**</u> or <u>**samples**</u> (default a
- Select some groups or samples (default all)
- add some taxa, func or taxa-func to focus the window (Optional)

<img src="./MetaX_Cookbook.assets/taxa_func_link_page.png" alt="image-20230728145518517" />
<img src="./MetaX_Cookbook.assets/taxa_func_link_page.png">

- Plot list only
- Checked the "**Plot List Only**" to show the items only in the list

- **Plot List Only:** Show the items only in the list and the items linked to them
- **Without Links:** Only show the items in the focus list
- <img src="./MetaX_Cookbook.assets/taxa_func_link_net_settings.png" >

- Network plot
- The yellow dots are taxa, and the grey dots are functions, the size of the dots presents the intensity
- The red dots are the taxa we focused on
Expand Down
4 changes: 2 additions & 2 deletions metax/gui/main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5005,15 +5005,15 @@ def plot_co_expr(self, plot_type = 'network'):
print(f'Calculate correlation with {corr_method} method...')
df = self.tfa.BasicStats.get_correlation(df_type = df_type, sample_list = sample_list, focus_list = focus_list, plot_list_only = plot_list_only, rename_taxa = rename_taxa, method=corr_method)
# save df to table_dict
self.update_table_dict(f'co-expression heatmap({df_type})', df)
self.update_table_dict(f'expression correlation heatmap({df_type})', df)

show_all_labels = (
self.checkBox_corr_hetatmap_show_all_labels_x.isChecked(),
self.checkBox_corr_hetatmap_show_all_labels_y.isChecked(),
)
cmap = self.comboBox_corr_hetatmap_cmap.currentText()
BasicPlot(self.tfa).plot_items_corr_heatmap(df=df,
title_name=f'Co-expression heatmap of {df_type}',
title_name=f'Expression Correlation Heatmap({df_type})',
cluster=True,
cmap=cmap,
width=width, height=height,
Expand Down
46 changes: 23 additions & 23 deletions metax/gui/metax_gui/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<enum>Qt::LeftToRight</enum>
</property>
<property name="currentIndex">
<number>4</number>
<number>3</number>
</property>
<property name="documentMode">
<bool>false</bool>
Expand Down Expand Up @@ -1720,8 +1720,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>888</width>
<height>376</height>
<width>660</width>
<height>232</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -2785,7 +2785,7 @@
<item row="7" column="1" rowspan="2" colspan="5">
<widget class="QListWidget" name="listWidget_list_for_ploting">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand Down Expand Up @@ -2871,25 +2871,25 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
<height>260</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>430</height>
<height>400</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="page_7">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>176</width>
<height>72</height>
<width>888</width>
<height>206</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -4283,8 +4283,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>888</width>
<height>146</height>
<width>207</width>
<height>70</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -4938,8 +4938,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>912</width>
<height>196</height>
<width>895</width>
<height>137</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -6477,8 +6477,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>888</width>
<height>153</height>
<width>490</width>
<height>81</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -6604,8 +6604,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>888</width>
<height>153</height>
<width>538</width>
<height>63</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -7568,8 +7568,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>888</width>
<height>196</height>
<width>538</width>
<height>127</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -8265,8 +8265,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>888</width>
<height>145</height>
<width>98</width>
<height>41</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -8305,8 +8305,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>888</width>
<height>145</height>
<width>383</width>
<height>68</height>
</rect>
</property>
<attribute name="label">
Expand Down
Loading

0 comments on commit e2d43b1

Please sign in to comment.