--- title: "Interactive Volcano, Fissure, and Woods Plots" author: "Maria K. Janowska" date: "`r Sys.Date()`" output: html_document: default vignette: | %\VignetteIndexEntry{Interactive Volcano, Fissure, and Woods Plots} %\VignetteEncoding{UTF-8} %\VignetteEngine{knitr::rmarkdown} \usepackage[UTF-8]{inputenc} editor_options: markdown: wrap: sentence --- ```{r, include = FALSE} has_deps <- requireNamespace("plotly", quietly = TRUE) && requireNamespace("crosstalk", quietly = TRUE) && requireNamespace("DT", quietly = TRUE) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center", eval = has_deps, message = FALSE, warning = FALSE ) ``` ```{r, echo = FALSE, eval = !has_deps, results = "asis"} cat("This vignette needs the plotly, crosstalk and DT packages. ", "Install them with install.packages(c(\"plotly\", \"crosstalk\", \"DT\")).", sep = "") ``` The interactive plots are for exploring the data. Hover over a peptide to see its sequence, uptake, difference and p-value. Plots built together are linked: a peptide selected in one is highlighted in all of them. For figures in a paper, use the static plots (`plot_fissure_vent()`, `plots_vol_tp()`). The plots need the plotly, crosstalk and DT packages. They are optional and are not installed with HDXBoxeR. | Function | Shows | |---|---| | `interactive_volcano()` | volcano plot | | `interactive_fissure_vent()` | fissure vent plot (`vignette("fissure_vent")`) | | `interactive_woods()` | Woods plot | | `significant_peptides_table()` | table of all peptides | | `interactive_fissure_explorer()` | all four together, linked | The significance test is the same as in the rest of the package. ## Example ```{r} library(HDXBoxeR) file_nm <- system.file("extdata", "All_results_table.csv", package = "HDXBoxeR") a <- output_tp(file_nm) ``` One plot: ```{r} interactive_fissure_vent(a, state1 = "Unbound", state2 = "bound", times = "1800.00s") ``` Give several `alpha` and `pvalue` values to switch between them with a dropdown (top right): ```{r} interactive_fissure_vent(a, state1 = "Unbound", state2 = "bound", times = "1800.00s", alpha = c(0.01, 0.05), pvalue = c(0.01, 0.05)) ``` `alpha` and `pvalue` are paired: the first with the first, the second with the second. All plots together. Select rows in the table, or hover over a peptide, to highlight it everywhere: ```{r fig.height = 9} interactive_fissure_explorer(a, state1 = "Unbound", state2 = "bound", times = "1800.00s") ``` ## Saving Save one plot with `htmlwidgets::saveWidget()`. The explorer is a layout of several plots, so save it with `htmltools::save_html()`: ```{r, eval = FALSE} explorer <- interactive_fissure_explorer(a, state1 = "Unbound", state2 = "bound", times = "1800.00s") htmltools::save_html(explorer, "fissure_explorer.html") ``` The saved file opens in any browser, without R. ## Good to know - One time point per call. - `p_adjust = "BH"` corrects the p-values for multiple testing. ## How this connects to the rest of the package | Interactive | Static version | Explained in | |---|---|---| | `interactive_volcano()` | `plots_vol_tp()` | `vignette("HDXBoxeR")` | | `interactive_fissure_vent()` | `plot_fissure_vent()` | `vignette("fissure_vent")` | | `interactive_woods()` | `woods_CI_plot()` | `vignette("HDXBoxeR")` | | `significant_peptides_table()` | `hdx_results_table()`, `diff_peptides_prep()` | `vignette("HDXBoxeR")` | To show results on a structure, see `vignette("hdx_structure")`.