---
description: How to generated a plot on GSEACompass.
---

# Plot

GSEACompass offers a wide variety of plots, each of them customizable in terms of size or included rows.

### User interface and interactions

A plot can generated after some rows or column have been selected by clicking on the drop-down menu on the top-left part of the window.

<figure><img src="https://3282963671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtrGplZFXqa18VLHNZDSb%2Fuploads%2FzvueTXQbEIMpdFD3J1sn%2FScreenshot%20from%202024-07-08%2021-50-18.png?alt=media&#x26;token=7c3be8c8-afde-408b-888d-3ba9b9cd93c9" alt=""><figcaption><p>Drop-down menu for selecting plot</p></figcaption></figure>

The following image shows the window on screen (regardless of the plot inside it) when a plot is requested and generated.

<figure><img src="https://3282963671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtrGplZFXqa18VLHNZDSb%2Fuploads%2FtfjPt0nsa3npFdO3AJU6%2FScreenshot%20from%202024-07-08%2021-27-26.png?alt=media&#x26;token=238f19e1-1dbe-4b80-8a15-85444b0d9376" alt=""><figcaption><p>The plot window</p></figcaption></figure>

These are the action available for the user:

* `Save` button: To save the currently shown plot in your disk;
* `Zoom in` and `Zoom out` buttons: To zoom in and out the plot, this doesn't affect the image that will saved: the images is always the full one;
* `New width` and `New height` fields: Input here the new size you'd like the plot to have;
* `Update size` button: Once clicked, it requests and generates a new plot with the size found in the two fields.
* Scroll up and Scroll down with the mouse wheel: When done on the plot it has the same effect of the `Zoom in` and `Zoom out` buttons.

### Enrichment plot

<figure><img src="https://3282963671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtrGplZFXqa18VLHNZDSb%2Fuploads%2Fn1Mff2OW1hOcTKcJgN4C%2Fenrc.png?alt=media&#x26;token=da3bf37f-1361-493d-838e-d68fc8505e86" alt="" width="375"><figcaption><p>An enrichment plot</p></figcaption></figure>

This plot can be requested when **one row or more rows are selected**. If more rows are selected, the plots will be gracefully overlapped (as generated by gseapy).

The x-axis represents the genes in the ranking list, while the upper y-axis the value of the running sum for each gene in the gene set and the lower y-axis the value of the ranking matrix in each gene in the ranking list. The middle layer has black bands when the gene in the ranking list is in the gene set too.

The definition here reported is the official one, from the GSEA website.

> * The top portion of the plot shows the running ES for the gene set as the analysis walks down the ranked list. The score at the peak of the plot (the score furthest from 0.0) is the ES for the gene set. Gene sets with a distinct peak at the beginning (such as the one shown here) or end of the ranked list are generally the most interesting.
> * The middle portion of the plot shows where the members of the gene set appear in the ranked list of genes. The **leading edge subset** of a gene set is the subset of members that contribute most to the ES. For a positive ES (such as the one shown here), the leading edge subset is the set of members that appear in the ranked list prior to the peak score. For a negative ES, it is the set of members that appear subsequent to the peak score.
> * The bottom portion of the plot shows the value of the ranking metric as you move down the list of ranked genes. The ranking metric measures a gene’s correlation with a phenotype. The value of the ranking metric goes from positive to negative as you move down the ranked list. A positive value indicates correlation with the first phenotype and a negative value indicates correlation with the second phenotype. For continuous phenotypes (time series or gene of interest), a positive value indicates correlation with the phenotype profile and a negative value indicates no correlation or inverse correlation with the profile.

### Heatmap

<figure><img src="https://3282963671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtrGplZFXqa18VLHNZDSb%2Fuploads%2Fnm2boi8cGHSdSU6eHTAV%2Fheatm.png?alt=media&#x26;token=46946fcf-40c5-4e8c-87d5-425c71890f9e" alt=""><figcaption><p>A heatmap</p></figcaption></figure>

This plot can be request when the **tabular result is that one of GSEA and one and only one row has been selected**.

It has all the genes in the gene set selected as y-axis and all the samples as x-axis, a cell color means how expressed is that gene in that sample (red means highly expressed, blue poorly expressed).

### Dotplot

<figure><img src="https://3282963671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtrGplZFXqa18VLHNZDSb%2Fuploads%2FG5AIedT7o8JuVveEOI3T%2Fdot.png?alt=media&#x26;token=259a20d1-b204-4cb5-85ae-702ea1a760e3" alt="" width="563"><figcaption><p>A dotplot</p></figcaption></figure>

This plot can be requested if **one and only numerical column has been selected, if you wish even rows can be selected**: the result will be a dotplot in which just the selected rows have been considered and shown. **If no row is selected, the whole table will be considered** and an automatic cut-off will be set, so that in the end just a small and significant number of gene sets will be shown.

If a filter is set (e.g. you wrote something in the search bar), just the gene sets resulting from the filter will be considered.

The y-axis contains all the selected gene sets, the x-axis shows the value taken by that gene set in the selected column. This latter information is also measured by the color of the dot. The size of a plot has the meaning of percentage number of genes in the ranked list contained in that specific gene set (i.e. number of gene (number of genes in the gene set divided by the number of genes in the ranked list).

### Intersection over union plot

<figure><img src="https://3282963671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtrGplZFXqa18VLHNZDSb%2Fuploads%2FGkm6BnOVS5vKeVO4BSv7%2Fiou.png?alt=media&#x26;token=884810b1-69cc-4db3-865b-6149a3ea4571" alt="" width="554"><figcaption><p>An intersection over union plot</p></figcaption></figure>

This plot can be requested if **two or more rows are selected**.

It has both as x-axis and y-axis the selected gene sets, each cell has a color darker or lighter according to the number of genes overlapping in the selected gene sets (as the name suggests, the number of genes resulting from the intersection of the gene sets divided by the number of genes resulting from the union of the gene sets).

For readability reasons, full names of gene sets are substituted by labels and those labels are mapped to each gene set in the right part of the image.

The upper triangle of the matrix is not shown since the matrix is symmetrical.

### Wordcloud

<figure><img src="https://3282963671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtrGplZFXqa18VLHNZDSb%2Fuploads%2FKifYQd0oKmf596FRXBCY%2Fwc.png?alt=media&#x26;token=1a690eee-8cbf-4035-97d7-d0b85ddc6490" alt="" width="563"><figcaption><p>A wordcloud of leading genes</p></figcaption></figure>

This plot can be requested **if and only if a single textual column is selected** (either term or lead\_genes column); if you wish, **you can also select the rows** to be considered in it when being generated.

If a filter is set (e.g. you wrote something in the search bar), just the gene sets resulting from the filter will be considered.

It shows each word in the selected column, or among the selected rows if any is selected, (e.g. genes in all the leading edges) as big as the number of occurences of it in the entire collection of words selected.
