diff --git a/DESCRIPTION b/DESCRIPTION index 95a097c5..2bb30c59 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -54,10 +54,10 @@ biocViews: ImmunoOncology, MassSpectrometry, Proteomics, Software, Normalization LazyData: true URL: http://msstats.org BugReports: https://groups.google.com/forum/#!forum/msstats -RoxygenNote: 7.3.3 Encoding: UTF-8 NeedsCompilation: no Packaged: 2017-10-20 02:13:12 UTC; meenachoi LinkingTo: Rcpp, RcppArmadillo +Config/roxygen2/version: 8.0.0 diff --git a/R/plot_quality_metrics.R b/R/plot_quality_metrics.R index f64368f6..c98e953f 100644 --- a/R/plot_quality_metrics.R +++ b/R/plot_quality_metrics.R @@ -24,10 +24,12 @@ #' when \code{isPlotly = TRUE}. #' #' @details -#' The x-axis order is determined by the factor levels of the \code{Run} -#' column. When \code{runOrder} is passed to the converter the \code{Run} -#' column is automatically set to an ordered factor; otherwise the runs appear -#' in alphabetical order. +#' The x-axis shows the integer order position of each run (1, 2, 3, ...) +#' rather than the run name, to avoid clutter when run names are long. +#' Positions are determined by the factor levels of the \code{Run} column. +#' When \code{runOrder} is passed to the converter the \code{Run} column is +#' automatically set to an ordered factor; otherwise the runs appear in +#' alphabetical order. #' #' Metric values are averaged across fragment ions within each #' PeptideSequence + PrecursorCharge + Run combination before plotting, so @@ -95,22 +97,25 @@ MSstatsQualityMetricsPlot <- function(input, metric = "AnomalyScores", ) colnames(plot_df)[colnames(plot_df) == "x"] <- metric - # Preserve run factor ordering from the original data - plot_df$Run <- factor(plot_df$Run, levels = levels(input_df$Run)) + # Preserve run factor ordering from the original data and map each + # Run to its integer position so the x-axis shows order numbers + # instead of run names (which can be long and clutter the axis). + run_levels <- levels(input_df$Run) + plot_df$RunOrder <- match(as.character(plot_df$Run), run_levels) p <- ggplot(plot_df, - aes(x = .data[["Run"]], + aes(x = .data[["RunOrder"]], y = .data[[metric]], color = .data[["Precursor"]], group = .data[["Precursor"]])) + geom_line(linewidth = 0.6) + geom_point(size = 1.5) + - scale_x_discrete(guide = guide_axis(angle = 45)) + + scale_x_continuous(breaks = seq(5, length(run_levels), by = 5)) + theme_bw() + theme(axis.text.x = element_text(size = 8), legend.title = element_text(size = 9), legend.text = element_text(size = 7)) + - labs(x = "Run (temporal order)", + labs(x = "Run order", y = metric, title = paste("Quality Metric:", metric), subtitle = which.Protein, diff --git a/R/utils_documentation.R b/R/utils_documentation.R index 2cc03d61..699789e7 100644 --- a/R/utils_documentation.R +++ b/R/utils_documentation.R @@ -1,8 +1,7 @@ #' A dummy function to store shared documentation items. #' #' @import data.table -#' @importFrom MSstatsConvert MSstatsImport MSstatsClean MSstatsPreprocess -#' MSstatsBalancedDesign MSstatsMakeAnnotation MSstatsLogsSettings +#' @importFrom MSstatsConvert MSstatsImport MSstatsClean MSstatsPreprocess MSstatsBalancedDesign MSstatsMakeAnnotation MSstatsLogsSettings #' #' @param removeFewMeasurements TRUE (default) will remove the features that have 1 or 2 measurements across runs. #' @param useUniquePeptide TRUE (default) removes peptides that are assigned for more than one proteins. diff --git a/man/MSstatsQualityMetricsPlot.Rd b/man/MSstatsQualityMetricsPlot.Rd index 6ef07a56..959e55d1 100644 --- a/man/MSstatsQualityMetricsPlot.Rd +++ b/man/MSstatsQualityMetricsPlot.Rd @@ -43,10 +43,12 @@ coloured line, mirroring the feature-level view in \code{\link[MSstats]{dataProcessPlots}}. } \details{ -The x-axis order is determined by the factor levels of the \code{Run} -column. When \code{runOrder} is passed to the converter the \code{Run} -column is automatically set to an ordered factor; otherwise the runs appear -in alphabetical order. +The x-axis shows the integer order position of each run (1, 2, 3, ...) +rather than the run name, to avoid clutter when run names are long. +Positions are determined by the factor levels of the \code{Run} column. +When \code{runOrder} is passed to the converter the \code{Run} column is +automatically set to an ordered factor; otherwise the runs appear in +alphabetical order. Metric values are averaged across fragment ions within each PeptideSequence + PrecursorCharge + Run combination before plotting, so diff --git a/man/reexports.Rd b/man/reexports.Rd index 22f4362c..968ebc67 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -20,6 +20,6 @@ These objects are imported from other packages. Follow the links below to see their documentation. \describe{ - \item{MSstatsConvert}{\code{\link[MSstatsConvert]{DIANNtoMSstatsFormat}}, \code{\link[MSstatsConvert]{DIAUmpiretoMSstatsFormat}}, \code{\link[MSstatsConvert]{FragPipetoMSstatsFormat}}, \code{\link[MSstatsConvert]{MaxQtoMSstatsFormat}}, \code{\link[MSstatsConvert]{OpenMStoMSstatsFormat}}, \code{\link[MSstatsConvert]{OpenSWATHtoMSstatsFormat}}, \code{\link[MSstatsConvert]{PDtoMSstatsFormat}}, \code{\link[MSstatsConvert]{ProgenesistoMSstatsFormat}}, \code{\link[MSstatsConvert]{SkylinetoMSstatsFormat}}, \code{\link[MSstatsConvert]{SpectronauttoMSstatsFormat}}} + \item{MSstatsConvert}{\code{\link[MSstatsConvert:DIANNtoMSstatsFormat]{DIANNtoMSstatsFormat()}}, \code{\link[MSstatsConvert:DIAUmpiretoMSstatsFormat]{DIAUmpiretoMSstatsFormat()}}, \code{\link[MSstatsConvert:FragPipetoMSstatsFormat]{FragPipetoMSstatsFormat()}}, \code{\link[MSstatsConvert:MaxQtoMSstatsFormat]{MaxQtoMSstatsFormat()}}, \code{\link[MSstatsConvert:OpenMStoMSstatsFormat]{OpenMStoMSstatsFormat()}}, \code{\link[MSstatsConvert:OpenSWATHtoMSstatsFormat]{OpenSWATHtoMSstatsFormat()}}, \code{\link[MSstatsConvert:PDtoMSstatsFormat]{PDtoMSstatsFormat()}}, \code{\link[MSstatsConvert:ProgenesistoMSstatsFormat]{ProgenesistoMSstatsFormat()}}, \code{\link[MSstatsConvert:SkylinetoMSstatsFormat]{SkylinetoMSstatsFormat()}}, \code{\link[MSstatsConvert:SpectronauttoMSstatsFormat]{SpectronauttoMSstatsFormat()}}} }}