knitr::opts_chunk$set(fig.cap = NULL, fig.path = params$output_figure) 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) num_files <- expdes[, .N] run_per_condition <- expdes[, .(countRepMax = .N), by = .(experiment)] setnames(run_per_condition, "experiment", "condition") # for fractions, create file name from mqExperiment and Fraction if (!("file_name" %in% colnames(expdes))){ expdes$file_name = paste(expdes$experiment, " - ", expdes$Replicate) } prot_int_rep <- merge( run_per_condition, prot_int[Imputed == 0, .(Repcount = .N), by = .(id, condition)], by = c("condition") ) prot_int_rep[, repPC := Repcount/countRepMax] prot_id_in_a_cond <- prot_int_rep[repPC >= 0.5, unique(id)] prot_int[, Valid := 0L] prot_int[id %in% prot_id_in_a_cond, Valid := 1L] rm(prot_id_in_a_cond, prot_int_rep)
dt <- copy(prot_int[Imputed == 0]) dt[is.na(condition), condition := "Library"] # Protein groups will always have grouped over fractions dt <- dt[, .N, by = .(condition, Replicate)] dt[, Run := str_c(condition, Replicate, sep = " - ")] p <- ggplot(dt, aes(x = as.factor(Run), y = N, color = condition, label=Replicate)) + geom_segment( aes(x=as.factor(Run), xend=as.factor(Run), y=0, yend=N), color="skyblue") + geom_point(size=2, alpha=0.9) + coord_flip() + theme_minimal() + scale_x_discrete("Condition - Replicate") + scale_y_continuous("# Proteins") + 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() ) + ggtitle("Proteins - Number of identifications from proteinGroups.txt") ggplotly(p, tooltip = c("label","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.