Skip to content

Commit

Permalink
Fixed legend p<0.05
Browse files Browse the repository at this point in the history
  • Loading branch information
zhizuio committed Mar 14, 2024
1 parent 447d5e6 commit 6e95107
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 102 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: EnrichIntersect
Type: Package
Title: Enrichment Analysis and Intersecting Sankey Diagram
Version: 0.6
Date: 2023-02-24
Version: 0.7
Date: 2024-03-14
URL: https://github.com/ocbe-uio/EnrichIntersect
BugReports: https://github.com/ocbe-uio/EnrichIntersect/issues
Authors@R: c(person("Zhi", "Zhao", email = "zhi.zhao@medisin.uio.no", role = c("aut","cre")), person("Manuela", "Zucknick", email = "manuela.zucknick@medisin.uio.no", role = c("aut")), person("Tero", "Aittokallio", email = "t.a.aittokallio@medisin.uio.no", role = c("ctb")))
Expand All @@ -17,7 +17,7 @@ Suggests: knitr
LazyData: true
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2023-02-24 22:30:53 UTC; zhiz
Packaged: 2024-03-14 15:18:31 UTC; zhiz
Author: Zhi Zhao [aut, cre],
Manuela Zucknick [aut],
Tero Aittokallio [ctb]
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# EnrichIntersect 0.7

- Fixed issue with the legend of p<0.05
- Added REAMD.md

# EnrichIntersect 0.6

- Automatically filter out non-edge data from the input object of `intersectSankey()`
Expand Down
11 changes: 7 additions & 4 deletions R/enrichment.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,18 @@ enrichment <- function(x, custom.set, alpha = 0, normalize = TRUE,
guides(colour = guide_legend(override.aes = list(size = 5))) +
scale_size(name = ES.name, range = c(1, 5), breaks = c(0, 1, 2, 3),
guide = guide_legend(keyheight = .8)) +
theme(axis.text.x = element_text(size = 8, angle = angle,
vjust = 1, hjust = 1)) +
theme(axis.text.x =
element_text(size = 8, angle = angle, vjust = 1, hjust = 1),
legend.margin = margin(-0.1,0,0,0, unit="cm")) +
xlab("") + ylab("")

if (pvalue.cutoff == 0.05) {
g <- g + scale_color_manual(name = NULL, values = c("p<0.05" = "red"))
g <- g + scale_color_manual(name = NULL,
values = c(`red` = "red"), labels = "p<0.05")
} else {
if (pvalue.cutoff == 0.1) {
g <- g + scale_color_manual(name = NULL, values = c("p<0.1" = "red"))
g <- g + scale_color_manual(name = NULL,
values = c(`red` = "red"), labels = "p<0.1")
} else {
g <- g + scale_color_manual(name = NULL, values = c("gray", "red"),
labels = paste0("p", c(">=", "<"),
Expand Down
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@

This is a flexible R package for enrichment analysis based on user-defined sets. It allows users to perform over-representation analysis of the custom sets among any specified ranked feature list, hence making enrichment analysis applicable to various types of data from different scientific fields. EnrichIntersect also enables an interactive means to visualize identified associations based on, for example, the mix-lasso model ([Zhao et al., 2022](https://doi.org/10.1016/j.isci.2022.104767)) or similar methods. A user-manual description of features, function calls and examples can be found from the [vignette](https://cran.r-project.org/web/packages/EnrichIntersect/vignettes/EnrichIntersect.html) of our package.

## Citation

> Zhi Zhao, Manuela Zucknick, Tero Aittokallio (2022).
> EnrichIntersect: an R package for custom set enrichment analysis and
> interactive visualization of intersecting sets. _Bioinformatics Advances_,
> vbac073. DOI: [10.1093/bioadv/vbac073](https://doi.org/10.1093/bioadv/vbac073).
> Zhi Zhao, Shixiong Wang, Manuela Zucknick, Tero Aittokallio (2022).
> Tissue-specific identification of multi-omics features for pan-cancer
> drug response prediction. _iScience_, 25(8): 104767. DOI:
> [10.1016/j.isci.2022.104767](https://doi.org/10.1016/j.isci.2022.104767).
## Installation

Install the latest released version from [CRAN](https://CRAN.R-project.org/package=EnrichIntersect)
Expand Down Expand Up @@ -46,7 +34,7 @@ set.seed(123)
enrich <- enrichment(x, custom.set, permute.n = 5)
```

![](https://github.com/zhizuio/EnrichIntersect/blob/main/README_plot_enrich.png)<!-- -->
<img src="man/figures/plot_enrich.png" width="90%" />

### Plot Sankey diagram for intersecting set through an array

Expand All @@ -57,4 +45,18 @@ data(cancers_genes_drugs, package = "EnrichIntersect")
intersectSankey(cancers_genes_drugs, step.names = c("Cancers","Genes","Drugs"))
```

![](https://github.com/zhizuio/EnrichIntersect/blob/main/README_plot_sankey.png)<!-- -->
<img src="man/figures/plot_sankey.png" width="90%" />



## Citation

> Zhi Zhao, Manuela Zucknick, Tero Aittokallio (2022).
> EnrichIntersect: an R package for custom set enrichment analysis and
> interactive visualization of intersecting sets. _Bioinformatics Advances_,
> vbac073. DOI: [10.1093/bioadv/vbac073](https://doi.org/10.1093/bioadv/vbac073).
> Zhi Zhao, Shixiong Wang, Manuela Zucknick, Tero Aittokallio (2022).
> Tissue-specific identification of multi-omics features for pan-cancer
> drug response prediction. _iScience_, 25(8): 104767. DOI:
> [10.1016/j.isci.2022.104767](https://doi.org/10.1016/j.isci.2022.104767).
Binary file removed README_plot_enrich.png
Binary file not shown.
Binary file removed README_plot_sankey.png
Binary file not shown.
Binary file modified build/vignette.rds
Binary file not shown.
42 changes: 4 additions & 38 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
citHeader("To cite EnrichIntersect in publications use:")

citEntry(entry = "Article",
title = "EnrichIntersect: an R package for custom set enrichment analysis and interactive visualization of intersecting sets",
bibentry(bibtype = "Article",
title = "{EnrichIntersect}: an {R} package for custom set enrichment analysis and interactive visualization of intersecting sets",
author = c(person(given = "Zhi",
family = "Zhao",
email = "zhi.zhao@medisin.uio.no"),
Expand All @@ -16,38 +14,6 @@ citEntry(entry = "Article",
volume = "2",
number = "1",
pages = "vbac073",
doi = "10.1093/bioadv/vbac073",
textVersion =
paste("Zhi Zhao, Manuela Zucknick, Tero Aittokallio (2022).",
"EnrichIntersect: an R package for custom set enrichment analysis and interactive visualization of intersecting sets.",
"Bioinformatics Advances, 2(1), vbac073.",
"doi: 10.1093/bioadv/vbac073.")
)

citEntry(entry = "Article",
title = "Tissue-specific identification of multi-omics features for pan-cancer drug response prediction",
author = c(person(given = "Zhi",
family = "Zhao",
email = "zhi.zhao@medisin.uio.no"),
person(given = "Shixiong",
family = "Wang",
email = "shixiong.wang@rr-research.no"),
person(given = "Manuela",
family = "Zucknick",
email = "manuela.zucknick@medisin.uio.no"),
person(given = "Tero",
family = "Aittokallio",
email = "t.a.aittokallio@medisin.uio.no")),
journal = "iScience",
year = "2022",
volume = "25",
number = "8",
pages = "104767",
doi = "10.1016/j.isci.2022.104767",
textVersion =
paste("Zhi Zhao and Shixiong Wang and Manuela Zucknick and Tero Aittokallio (2022).",
"Tissue-specific identification of multi-omics features for pan-cancer drug response prediction.",
"iScience, 25(8), 104767.",
"doi: 10.1016/j.isci.2022.104767."),
header = "If mix-lasso is used, please also cite:"
doi = "10.1093/bioadv/vbac073",
header = "To cite EnrichIntersect in publications use:"
)
4 changes: 2 additions & 2 deletions inst/doc/EnrichIntersect.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(echo = TRUE)

## ---- eval=TRUE---------------------------------------------------------------
## ----eval=TRUE----------------------------------------------------------------
library("EnrichIntersect")

## ----enrichment_map, results="hide", fig.width=7, fig.height=5----------------
## ----enrichment_map, results="hide", fig.width=7.2, fig.height=5--------------
x <- cancers_drug_groups$score
custom.set <- cancers_drug_groups$custom.set
set.seed(123)
Expand Down
2 changes: 1 addition & 1 deletion inst/doc/EnrichIntersect.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ library("EnrichIntersect")

An example input data object `cancers_drug_groups` is an R `list` provided in our package, which includes a `data.frame` object with 147 cancer drugs as rows and nine cancer types as columns, and another `data.frame` that groups the 147 drugs (second column) into nine user-defined drug classes (first column). The default setup of `enrichment()` uses the classic K-S test statistic to calculate the normalized enrichment score that quantifies the degree to which the features in a feature set are over-represented at the top or bottom of the entire ranked list of features (e.g. a list of drugs), using as default 100 permutations for the empirical null test statistic. In the visualization, the statistically significantly enriched feature sets are marked with red coloured circles given a pre-specified significance level. The pre-specified significance level will be adjusted automatically if argument `padj.method` is one of `c("holm","hochberg","hommel","bonferroni","BH","BY","fdr","none")`. Users can specify the argument `alpha` for calculating a weighted enrichment score, argument `normalize=FALSE` for using the standard enrichment score rather than the normalized score, argument `permute.n` for the number of permutations of the ranked feature list used for estimating the empirical null test statistic, and the argument `pvalue.cutoff` for marking enriched categories at a specific significance level. See the following code for an example.

```{r enrichment_map, results="hide", fig.width=7, fig.height=5}
```{r enrichment_map, results="hide", fig.width=7.2, fig.height=5}
x <- cancers_drug_groups$score
custom.set <- cancers_drug_groups$custom.set
set.seed(123)
Expand Down
76 changes: 37 additions & 39 deletions inst/doc/EnrichIntersect.html

Large diffs are not rendered by default.

Binary file added man/figures/plot_enrich.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 man/figures/plot_sankey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vignettes/EnrichIntersect.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ library("EnrichIntersect")

An example input data object `cancers_drug_groups` is an R `list` provided in our package, which includes a `data.frame` object with 147 cancer drugs as rows and nine cancer types as columns, and another `data.frame` that groups the 147 drugs (second column) into nine user-defined drug classes (first column). The default setup of `enrichment()` uses the classic K-S test statistic to calculate the normalized enrichment score that quantifies the degree to which the features in a feature set are over-represented at the top or bottom of the entire ranked list of features (e.g. a list of drugs), using as default 100 permutations for the empirical null test statistic. In the visualization, the statistically significantly enriched feature sets are marked with red coloured circles given a pre-specified significance level. The pre-specified significance level will be adjusted automatically if argument `padj.method` is one of `c("holm","hochberg","hommel","bonferroni","BH","BY","fdr","none")`. Users can specify the argument `alpha` for calculating a weighted enrichment score, argument `normalize=FALSE` for using the standard enrichment score rather than the normalized score, argument `permute.n` for the number of permutations of the ranked feature list used for estimating the empirical null test statistic, and the argument `pvalue.cutoff` for marking enriched categories at a specific significance level. See the following code for an example.

```{r enrichment_map, results="hide", fig.width=7, fig.height=5}
```{r enrichment_map, results="hide", fig.width=7.2, fig.height=5}
x <- cancers_drug_groups$score
custom.set <- cancers_drug_groups$custom.set
set.seed(123)
Expand Down

0 comments on commit 6e95107

Please sign in to comment.