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")]
dt <- prot_int[Imputed == 0, .(`% measured values` = .N/prot_int[, length(unique(id))]), by = .(run_id, condition, replicate)] dt[, Run := str_c(condition, replicate, sep = " - ")] dt[, `% measured values` := 100*(round(`% measured values`, 2))] p<- ggplot(dt, aes(y = `% measured values`, x = Run, color = condition, fill = condition)) + geom_bar(stat ="identity", position = "dodge")+ 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("Experiment - Channel") + ggtitle("Proteins - Data completedness by samples") ggplotly(p, tooltip = c("y")) %>% config(displayModeBar = T, modeBarButtons = list(list('toImage')), displaylogo = F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.