diff --git a/DESCRIPTION b/DESCRIPTION index f7120edb..38b3d75c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: volcano3D Type: Package Title: Interactive Plotting of Three-Way Differential Expression Analysis -Version: 1.1.0 +Version: 1.2.0 Authors@R: c(person("Katriona", "Goldmann", role = c("aut", "cre"), email = "k.goldmann@qmul.ac.uk", comment = c(ORCID = "0000-0002-9073-6323")), diff --git a/NEWS.md b/NEWS.md index 711ced9d..8e84b2b8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,10 @@ News ===== +# volcano3D 1.2.0 +###### 25/02/2021 +* Add argument for scene camera in volcano3D + # volcano3D 1.1.0 ###### 04/02/2021 * allow colour coding to be based on pvalue or adjusted pvalue according to cutoff_criteria diff --git a/R/volcano3D.R b/R/volcano3D.R index cd62873c..2a9c5695 100644 --- a/R/volcano3D.R +++ b/R/volcano3D.R @@ -54,6 +54,12 @@ #' @param xy_aspectratio The aspect ratio for the xy axis compared to z #' (default = 1). Decreasing this makes the grid wider in the plot window. #' @param plot_height The plot height in px. Default=700. +#' @param camera_eye The (x,y,z) components of the 'eye' camera vector. This +#' vector determines the view point about the origin of this scene. +#' @param source a character string of length 1. Match the value of this string +#' with the source argument in \code{\link[plotly]{event_data}} to retrieve the +#' event data corresponding to a specific plot (shiny apps can have multiple +#' plots). #' @param ... Optional parameters to pass to \code{\link{polar_grid}}. #' @return Returns a cylindrical 3D plotly plot featuring variables on a #' tri-axis radial graph with the -log10(multi-group test p-value) on the @@ -115,6 +121,8 @@ volcano3D <- function(polar, z_aspectratio = 1, xy_aspectratio = 1, plot_height = 700, + camera_eye = list(x=1.25, y=1.25, z=1.25), + source="volcano3D", ...){ if(! class(polar) %in% c("polar")) stop("polar must be a polar object") @@ -286,7 +294,7 @@ volcano3D <- function(polar, colors = switch(colour_scale, "discrete" = colours, "continuous" = NULL), - type = "scatter3d", mode = "markers") %>% + type = "scatter3d", mode = "markers", source = source) %>% # Add the cylindrical grid add_trace(x = polar_grid$x, y = polar_grid$y, z = polar_grid$z, @@ -335,14 +343,16 @@ volcano3D <- function(polar, plot_bgcolor = 'rgba(0, 0, 0, 0)', scene = list( - aspectratio = list(x = xy_aspectratio, - y = xy_aspectratio, + camera = list(eye = camera_eye), + aspectratio = list(x = xy_aspectratio, + y = xy_aspectratio, z = z_aspectratio), dragmode = "turntable", xaxis = axis_settings_xy, yaxis = axis_settings_xy, zaxis = axis_settings, - annotations = annot), + annotations = annot + ), xaxis = list(title = "x"), yaxis = list(title = "y") ) diff --git a/docs/404.html b/docs/404.html index 3db21332..af6876eb 100644 --- a/docs/404.html +++ b/docs/404.html @@ -89,7 +89,7 @@
diff --git a/docs/ReadMe.html b/docs/ReadMe.html index 5b33b748..3164326e 100644 --- a/docs/ReadMe.html +++ b/docs/ReadMe.html @@ -89,7 +89,7 @@ diff --git a/docs/articles/Extended_Vignette.html b/docs/articles/Extended_Vignette.html index cf2db5a0..93cfc059 100644 --- a/docs/articles/Extended_Vignette.html +++ b/docs/articles/Extended_Vignette.html @@ -44,7 +44,7 @@ @@ -1255,8 +1255,8 @@radial_plotly(polar = syn_polar,
label_rows = c("SLAMF6", "PARP16", "ITM2C"),
hover=hovertext)
-
-By hovering over certain points you can also determine genes for future interrogation.
+ +By hovering over certain points you can also determine genes for future interrogation.
Similarly we can create a static ggplot image using radial_ggplot:
radial_ggplot(polar = syn_polar,
@@ -1308,8 +1308,8 @@
plot_method='plotly')
plotly::subplot(plot1, plot2, plot3, titleY=TRUE, margin=0.05)
Or using ggplot
+ +Or using ggplot
plot1 <- boxplot_trio(syn_polar,
value = "FAM92B",
@@ -1353,8 +1353,8 @@
plot_height = 800)
p
We can alter the colour code using the colours parameter. These are assigned in order group1+, group1+group2+, group2+, group2+group3+, group3+, group1+group3+.
+ +We can alter the colour code using the colours parameter. These are assigned in order group1+, group1+group2+, group2+, group2+group3+, group3+, group1+group3+.
p <- volcano3D(syn_polar,
label_rows = c("SLAMF6", "PARP16", "ITM2C"),
@@ -1367,8 +1367,8 @@
plot_height=800)
p
p <- show_grid(four_grid)
p$cylindrical
and pass it into the plotting functions:
+ +and pass it into the plotting functions:
volcano3D(syn_polar,
grid = four_grid,
@@ -1422,8 +1422,8 @@
label_size = 10,
xy_aspectratio = 1,
z_aspectratio = 0.9)
For example to extend the radial axis and increase the number of spokes in 2D we can apply:
+ +For example to extend the radial axis and increase the number of spokes in 2D we can apply:
new_grid = polar_grid(r_vector=NULL,
z_vector=-log10(syn_polar@pvalues$LRT_pvalue),
@@ -1440,8 +1440,8 @@
label_rows = c("SLAMF6", "PARP16", "ITM2C"))
p %>% config(editable = TRUE)
radial_plotly(polar = syn_mod_polar,
label_rows = c("M156.0", "M37.2"))
Or a ggplot static image using radial_ggplot:
+ +Or a ggplot static image using radial_ggplot:
radial_ggplot(polar = syn_mod_polar,
label_rows = c("M156.0", "M37.2"),
diff --git a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-15-1.png
index f5d50b20..2fa5d633 100644
Binary files a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-15-1.png and b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-15-1.png differ
diff --git a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-16-1.png
index 2e2ad610..840340a8 100644
Binary files a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-16-1.png and b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-16-1.png differ
diff --git a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-17-1.png b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-17-1.png
index a5dd647d..5de13eaa 100644
Binary files a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-17-1.png and b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-17-1.png differ
diff --git a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-18-1.png b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-18-1.png
index c0ca682e..2b03fcd2 100644
Binary files a/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-18-1.png and b/docs/articles/Extended_Vignette_files/figure-html/unnamed-chunk-18-1.png differ
diff --git a/docs/articles/Vignette.html b/docs/articles/Vignette.html
index 5a025781..6e15838e 100644
--- a/docs/articles/Vignette.html
+++ b/docs/articles/Vignette.html
@@ -44,7 +44,7 @@
NEWS.md
+
The plot height in px. Default=700.
The (x,y,z) components of the 'eye' camera vector. This +vector determines the view point about the origin of this scene.
a character string of length 1. Match the value of this string
+with the source argument in event_data
to retrieve the
+event data corresponding to a specific plot (shiny apps can have multiple
+plots).
Optional parameters to pass to polar_grid
.