Skip to content

Commit

Permalink
scale_edge_width_continuous was added to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
barizona committed Sep 1, 2024
1 parent 0493f28 commit 3c222a1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
14 changes: 10 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,17 @@ plot_barplot(reshaped_results = ora_reshaped_results,

This function generates a network visualisation of the enriched ontology categories (*e.g.*, transcription factors). Each node represents an eriched ontology category, coloured based on its *eFDR* value. An edge is drawn between two nodes if they share at least one common gene belonging to the target set, indicating co-regulation. The thickness of the edge reflects the number of shared genes.

```{r 'network_plot_ora', out.width = '60%'}
```{r 'network_plot_ora', out.width = '60%', warning = FALSE, message = FALSE}
plot_graph(reshaped_results = ora_reshaped_results,
# Column containing the names we wish to plot
ontology_id_colname = "ontology_id",
# Upper threshold for the value indicating the significance
p_value_max_threshold = 0.05,
# Column that indicates the significance values
p_value_type_colname = "eFDR")
p_value_type_colname = "eFDR") +
# Scaling the edge width
ggraph::scale_edge_width_continuous(range = c(0.2, 3),
breaks = c(2, 4, 6, 8, 10))
```

**Visualising the Associations: Heatmap**
Expand Down Expand Up @@ -533,14 +536,17 @@ gsea_reshaped_results <- reshape_results(model = gsea_model,

This function generates a network visualisation of the enriched ontology categories (*e.g.*, transcription factors). Each node represents a category and is coloured based on its significance level. A connection (edge) is drawn between two nodes if they share at least one common gene belonging to the **ranked list**, meaning that both transcription factors regulate the expression of the same target gene. The thickness of the edge reflects the number of shared genes.

```{r 'network_plot_gsea', out.width = '60%'}
```{r 'network_plot_gsea', out.width = '60%', warning = FALSE, message = FALSE}
plot_graph(reshaped_results = gsea_reshaped_results,
# the column containing the names we wish to plot
ontology_id_colname = "ontology_id",
# upper threshold for the value indicating the significance
p_value_max_threshold = 0.05,
# column that indicates the significance values
p_value_type_colname = "adjusted_p_value")
p_value_type_colname = "adjusted_p_value") +
# Scaling the edge width
ggraph::scale_edge_width_continuous(range = c(0.2, 3),
breaks = c(20, 40, 60, 80))
```

Other plot types such as lollipop plots, bar plots, and heatmaps can also be used to investigate the GSEA results.
Expand Down
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ plot_graph(reshaped_results = ora_reshaped_results,
# Upper threshold for the value indicating the significance
p_value_max_threshold = 0.05,
# Column that indicates the significance values
p_value_type_colname = "eFDR")
p_value_type_colname = "eFDR") +
# Scaling the edge width
ggraph::scale_edge_width_continuous(range = c(0.2, 3),
breaks = c(2, 4, 6, 8, 10))
```

<img src="man/figures/README-network_plot_ora-1.png" width="60%" />
Expand Down Expand Up @@ -690,7 +693,7 @@ gsea_results %>%
filter(adjusted_p_value < 0.05) %>%
# the number of such rows
nrow()
#> [1] 9
#> [1] 8
```

Inspect the significant results:
Expand All @@ -705,15 +708,14 @@ gsea_results %>%

| ontology_id | ontology_name | nr_common_with_tested_elements | p_value | adjusted_p_value |
|:------------|:--------------|-------------------------------:|----------:|-----------------:|
| LexA | LexA | 53 | 0.0000000 | 0.0000054 |
| FNR | FNR | 259 | 0.0001077 | 0.0082413 |
| GlaR | GlaR | 3 | 0.0002392 | 0.0122013 |
| ModE | ModE | 45 | 0.0003759 | 0.0128984 |
| SoxS | SoxS | 37 | 0.0004215 | 0.0128984 |
| DnaA | DnaA | 13 | 0.0005266 | 0.0134293 |
| ArcA | ArcA | 148 | 0.0008472 | 0.0185172 |
| PaaX | PaaX | 14 | 0.0024604 | 0.0470549 |
| PspF | PspF | 7 | 0.0029044 | 0.0493741 |
| LexA | LexA | 53 | 0.0000000 | 0.0000037 |
| FNR | FNR | 259 | 0.0000784 | 0.0059976 |
| ArcA | ArcA | 148 | 0.0002848 | 0.0087152 |
| GlaR | GlaR | 3 | 0.0002484 | 0.0087152 |
| ModE | ModE | 45 | 0.0002666 | 0.0087152 |
| SoxS | SoxS | 37 | 0.0006182 | 0.0157647 |
| DnaA | DnaA | 13 | 0.0007556 | 0.0165154 |
| PaaX | PaaX | 14 | 0.0014082 | 0.0269323 |

### Visualising the GSEA Results

Expand Down Expand Up @@ -745,7 +747,10 @@ plot_graph(reshaped_results = gsea_reshaped_results,
# upper threshold for the value indicating the significance
p_value_max_threshold = 0.05,
# column that indicates the significance values
p_value_type_colname = "adjusted_p_value")
p_value_type_colname = "adjusted_p_value") +
# Scaling the edge width
ggraph::scale_edge_width_continuous(range = c(0.2, 3),
breaks = c(20, 40, 60, 80))
```

<img src="man/figures/README-network_plot_gsea-1.png" width="60%" />
Expand Down
Binary file modified man/figures/README-network_plot_gsea-1.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 man/figures/README-network_plot_ora-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c222a1

Please sign in to comment.