From 6caedce7826cd6d8e12cdc51eb51ed8a279b4123 Mon Sep 17 00:00:00 2001 From: Orhun Kok Date: Wed, 17 Jul 2024 22:04:04 -0400 Subject: [PATCH] 2.1.0 update --- .../10_fwhm.R | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename modules/dia-nn/{040_Chromotography => 040_Chromatography}/10_fwhm.R (72%) diff --git a/modules/dia-nn/040_Chromotography/10_fwhm.R b/modules/dia-nn/040_Chromatography/10_fwhm.R similarity index 72% rename from modules/dia-nn/040_Chromotography/10_fwhm.R rename to modules/dia-nn/040_Chromatography/10_fwhm.R index ca580fb..ac38ec8 100644 --- a/modules/dia-nn/040_Chromotography/10_fwhm.R +++ b/modules/dia-nn/040_Chromatography/10_fwhm.R @@ -15,17 +15,18 @@ init <- function() { report <- data()[['report']][,c('Raw.file', 'FWHM', 'Precursor.Id')] - # plotdata <- report[report$FWHM > 0,] - plotdata <- report + plotdata <- report[report$FWHM > 0,] + plotdata$FWHM <- plotdata$FWHM * 60 + # Thresholding data at 1 and 99th percentiles - # ceiling <- quantile(plotdata$FWHM, probs=.95, na.rm = TRUE) - # floor <- quantile(plotdata$FWHM, probs=.95, na.rm = TRUE) + ceiling <- quantile(plotdata$FWHM, probs=.99, na.rm = TRUE) + floor <- quantile(plotdata$FWHM, probs=.01, na.rm = TRUE) - # plotdata <- dplyr::filter(plotdata, is.finite(FWHM)) + plotdata <- dplyr::filter(plotdata, is.finite(FWHM)) - # plotdata[plotdata$FWHM >= ceiling, 2] <- ceiling - # plotdata[plotdata$FWHM <= floor, 2] <- floor + plotdata[plotdata$FWHM >= ceiling, 2] <- ceiling + plotdata[plotdata$FWHM <= floor, 2] <- floor return(plotdata) } @@ -38,11 +39,10 @@ init <- function() { ggplot(plotdata, aes(x=FWHM)) + facet_wrap(~Raw.file, nrow = 1, scales = "free_x") + - stat_bin(aes(y=..count..), size = 0.8, bins=100,position = "identity",geom="step")+ coord_flip() + - xlim(0, max(plotdata$FWHM) * 0.33) + - labs(x='FWHM (min)', y='Number of Precursors') + + xlim(mean(plotdata$FWHM) - (sd(plotdata$FWHM)), mean(plotdata$FWHM) + (sd(plotdata$FWHM))) + + labs(x='FWHM (secs)', y='Number of Precursors') + scale_color_manual(values=c(custom_colors[[1]], custom_colors[[6]]))+ theme_diann(input=input, show_legend=T) }