From fb18bed6fd796335a092ceabfa9f232d8818850a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Tue, 26 Dec 2023 20:04:21 +0100 Subject: [PATCH] fix: use R-squared instead of Pearson correlation coefficient Fixes #48 --- DESCRIPTION | 2 +- NEWS.md | 7 +++++++ R/qc_positive_control.R | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) 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/qc_positive_control.R b/R/qc_positive_control.R index 9245ed3a..0f93b548 100755 --- a/R/qc_positive_control.R +++ b/R/qc_positive_control.R @@ -10,6 +10,6 @@ qc_positive_control <- function(counts) { 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)) }