diff --git a/R/qc_sequence_coverage.R b/R/qc_sequence_coverage.R index 2652a274..48b5b9ce 100644 --- a/R/qc_sequence_coverage.R +++ b/R/qc_sequence_coverage.R @@ -49,10 +49,10 @@ qc_sequence_coverage <- function(data, interactive = FALSE) { # Validate inputs - if (!all(c({{ protein_identifier }},{{ coverage }}) %in% colnames(data))) { + if (!all(c(rlang::as_name(rlang::enquo(protein_identifier)), rlang::as_name(rlang::enquo(coverage))) %in% colnames(data))) { stop("Column names for protein_identifier and coverage must exist in the dataset.") } - + result <- data %>% dplyr::distinct({{ protein_identifier }}, {{ coverage }}, {{ sample }}) %>% tidyr::drop_na({{ coverage }}) %>% @@ -77,7 +77,7 @@ qc_sequence_coverage <- function(data, size = 1 ) + ggplot2::geom_vline(data = result %>% dplyr::distinct(.data$median_coverage, {{ sample }}), - mapping = aes(xintercept = median_coverage), + mapping = aes(xintercept = .data$median_coverage), linewidth = 1, linetype = "dashed") + ggplot2::labs( diff --git a/man/normalise.Rd b/man/normalise.Rd index 7e1f49b8..568b446f 100644 --- a/man/normalise.Rd +++ b/man/normalise.Rd @@ -7,7 +7,8 @@ normalise(data, sample, intensity_log2, method = "median") } \arguments{ -\item{data}{a data frame containing at least sample names and intensity values.} +\item{data}{a data frame containing at least sample names and intensity values. Please note that if the +data frame is grouped, the normalisation will be computed by group.} \item{sample}{a character column in the \code{data} data frame that contains the sample names.} diff --git a/man/qc_sequence_coverage.Rd b/man/qc_sequence_coverage.Rd index 05188fba..c8f4d516 100644 --- a/man/qc_sequence_coverage.Rd +++ b/man/qc_sequence_coverage.Rd @@ -21,7 +21,7 @@ identifiers.} \item{coverage}{a numeric column in the \code{data} data frame that contains protein coverage in percent. This information can be obtained using the \code{\link{sequence_coverage}} function.} -\item{sample}{optional, a character column in the \code{data} data frame that contains sample names. +\item{sample}{optional, a character or factor column in the \code{data} data frame that contains sample names. Please only provide this argument if you want to facet the distribution plot by sample otherwise do not provide this argument.}