knitr::opts_chunk$set(fig.cap = NULL, fig.path = params$output_figure) library(knitr) library(data.table) library(ggplot2) library(ggrepel) library(GGally) library(umap) library(FactoMineR) library(factoextra) library(corrplot) library(viridis) library(ggpubr) library(Hmisc) library(plotly) library(stringr) library(bit64)
#assert that all the stuff we need is there. stopifnot(exists("expdes")) stopifnot(exists("prot")) stopifnot(exists("prot_int"))
expdes <- expdes[,c("condition", "experiment", "reporter_channel", "replicate")]
p <- ggplot(prot_int, aes(x=interaction(reporter_channel, experiment), y=log2NIntNorm, fill=condition, colour=condition)) + geom_boxplot() + theme_minimal() + theme(axis.text.x = element_text(angle = 90, vjust = 0.2), panel.grid.major.y = element_blank(), panel.border = element_blank(), axis.ticks.y = element_blank() ) + scale_x_discrete("Channel.Run") + scale_y_continuous("Normalized Log2 Reporter Intensity") + ggtitle("Proteins - Normalised measurements distributions") fig <- ggplotly(p, tooltip = c("y"))%>% config(displayModeBar = T, modeBarButtons = list(list('toImage')), displaylogo = F) fig$x$data <- lapply(fig$x$data, FUN = function(x){ x$marker$outliercolor = x$line$color # When creating plot p with ggplot if you specify fill = cut use x$fill$color instead of $line$color x$marker$color = x$line$color # When creating plot p with ggplot if you specify fill = cut use x$fill$color instead $line$color x$marker$line = x$line$color # When creating plot p with ggplot if you specify fill = cut use x$fill$color instead $line$color return(x) }) fig
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.