diff --git a/DESCRIPTION b/DESCRIPTION index 308cecf1..770c24d6 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: NACHO Title: NanoString Quality Control Dashboard -Version: 2.0.5 +Version: 2.0.6 Authors@R: c(person(given = "Mickaƫl", family = "Canouil", diff --git a/NEWS.md b/NEWS.md index 9602f6d3..eefc5747 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# NACHO 2.0.6 + +## Fixes + +- In `R/qc_positive_control.R`, + - fix: use R-squared instead of Pearson correlation coefficient. ([#48](https://github.com/mcanouil/NACHO/issues/48)) + # NACHO 2.0.5 ## Fixes diff --git a/R/autoplot.R b/R/autoplot.R index eb49e2f8..36b90351 100644 --- a/R/autoplot.R +++ b/R/autoplot.R @@ -316,14 +316,13 @@ plot_metrics <- function( list( ggplot2::geom_point( data = ~ .x[!(is_outlier)], - size = size, width = 0.25, na.rm = TRUE, + size = size, na.rm = TRUE, position = ggplot2::position_jitter(width = 0.25, height = 0) ), ggplot2::geom_point( data = ~ .x[(is_outlier)], size = size * outliers_factor, colour = "#b22222", - width = 0.25, na.rm = TRUE, position = ggplot2::position_jitter(width = 0.25, height = 0) ), @@ -338,7 +337,7 @@ plot_metrics <- function( ) } else { ggplot2::geom_point( - size = size, width = 0.25, na.rm = TRUE, + size = size, na.rm = TRUE, position = ggplot2::position_jitter(width = 0.25, height = 0) ) } @@ -449,14 +448,13 @@ plot_cg <- function( list( ggplot2::geom_point( data = ~ .x[!(is_outlier)], - size = size, width = 0.25, na.rm = TRUE, + size = size, na.rm = TRUE, position = ggplot2::position_jitter(width = 0.25, height = 0) ), ggplot2::geom_point( data = ~ .x[(is_outlier)], size = size * outliers_factor, colour = "#b22222", - width = 0.25, na.rm = TRUE, position = ggplot2::position_jitter(width = 0.25, height = 0) ), @@ -471,7 +469,7 @@ plot_cg <- function( ) } else { ggplot2::geom_point( - size = size, width = 0.25, na.rm = TRUE, + size = size, na.rm = TRUE, position = ggplot2::position_jitter(width = 0.25, height = 0) ) } @@ -1131,7 +1129,7 @@ plot_norm <- function( ) + ggplot2::geom_line( mapping = ggplot2::aes(colour = .data[["Name"]], group = .data[["Name"]]), - size = size, + linewidth = size, na.rm = TRUE ) + ggplot2::facet_grid(cols = ggplot2::vars(.data[["Status"]])) + diff --git a/R/qc_positive_control.R b/R/qc_positive_control.R index 9245ed3a..2aa7463c 100755 --- a/R/qc_positive_control.R +++ b/R/qc_positive_control.R @@ -8,8 +8,12 @@ #' #' @return [[numeric]] qc_positive_control <- function(counts) { - measured <- log2(counts[["Count"]]) + if (any(counts[["Count"]] %in% 0)) { + measured <- log2(counts[["Count"]] + 1) + } else { + measured <- log2(counts[["Count"]]) + } known <- log2(as.numeric(sub("^[^(]*\\((.*)\\)$", "\\1", counts[["Name"]]))) # plexset value: "32" - correlation <- stats::cor.test(known, measured)$estimate + correlation <- summary(stats::lm(measured ~ known))$r.squared unname(round(correlation, 5)) } diff --git a/data/GSE74821.rda b/data/GSE74821.rda index 3feee73b..abeb8f9b 100755 Binary files a/data/GSE74821.rda and b/data/GSE74821.rda differ