Skip to content

Commit

Permalink
Fix to circumvent plotting crashing on certain low-variance datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob37 committed Nov 7, 2019
1 parent a847ed1 commit b026345
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: NormalyzerDE
Title: Evaluation of normalization methods and calculation of differential expression analysis statistics
Version: 1.3.3
Version: 1.3.4
Maintainer: Jakob Willforss <[email protected]>
Author: Jakob Willforss
Authors@R: c(
Expand Down
12 changes: 12 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
CHANGES IN VERSION 1.3.4
----------------------------------

* Certain datasets with fixed imputed values caused large difference in CV and MAD
for RLR normalization, which in turn lead to a crash in the plotting functions.
This update makes sure that the plotting can be carried out despite extreme values.

CHANGES IN VERSION 1.3.3
----------------------------------

* Extended input validation when executing NormalyzerDE using experimentObj

CHANGES IN VERSION 1.3.2
----------------------------------

* Correctly showing the number of values replaced with NA in status text

CHANGES IN VERSION 1.3.0
----------------------------------

* Sync with Bioconductor changes

CHANGES IN VERSION 1.1.16
----------------------------------

* Clearer input verification error for both incorrect fields and when values < 1 are encountered

CHANGES IN VERSION 1.1.14/15
----------------------------------

* Updating tests to avoid cyclic dependency on the NormalyzerDE package

Expand Down
21 changes: 15 additions & 6 deletions R/generatePlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ plotReplicateVariance <- function(nr, currentLayout, pageno) {
#' @keywords internal
plotReplicateVarAndStableVariables <- function(nr, currentLayout, pageno) {

# browser()

nds <- nds(nr)
methodnames <- names(normalizations(nr))
currentjob <- jobName(nds)
Expand All @@ -483,6 +485,9 @@ plotReplicateVarAndStableVariables <- function(nr, currentLayout, pageno) {
avgmadmempdiff <- avgmadmempdiff(ner)
avgvarmempdiff <- avgvarmempdiff(ner)

lowBound <- min(c(avgcvmempdiff, avgmadmempdiff, avgvarmempdiff)) - 10
highBound <- max(c(avgcvmempdiff, avgmadmempdiff, avgvarmempdiff)) + 5

tout <- rbind(c(1, 2, 3), c(4, 5, 5))
graphics::layout(tout)
graphics::par(mar=c(6, 6, 3, 1), oma=c(2, 3, 3, 2), xpd=NA)
Expand All @@ -492,8 +497,9 @@ plotReplicateVarAndStableVariables <- function(nr, currentLayout, pageno) {
main="PCV compared to log2 ",
names.arg=c(methodnames),
border="red",
ylim=c(min(avgcvmempdiff) - 10,
max(avgmadmempdiff) + 5),
ylim=c(lowBound, highBound),
# ylim=c(min(avgcvmempdiff) - 10,
# max(avgmadmempdiff) + 5),
density=20,
cex=0.9,
cex.axis=0.7,
Expand All @@ -511,8 +517,9 @@ plotReplicateVarAndStableVariables <- function(nr, currentLayout, pageno) {
main="PMAD compared to log2",
names.arg=c(methodnames),
border="red",
ylim=c(min(avgmadmempdiff) - 10,
max(avgmadmempdiff) + 5),
ylim=c(lowBound, highBound),
# ylim=c(min(avgmadmempdiff) - 10,
# max(avgmadmempdiff) + 5),
density=20,
cex=0.9,
cex.axis=0.7,
Expand All @@ -530,13 +537,15 @@ plotReplicateVarAndStableVariables <- function(nr, currentLayout, pageno) {
las=2
)

# browser()
abc <- graphics::barplot(
avgvarmempdiff,
main="%PEV - compared to log2",
names.arg=c(methodnames),
border="red",
ylim=c(min(avgvarmempdiff) - 10,
max(avgmadmempdiff) + 5),
ylim=c(lowBound, highBound),
# ylim=c(min(avgvarmempdiff) - 10,
# max(avgmadmempdiff) + 5),
density=20,
cex=0.9,
cex.axis=0.7,
Expand Down

0 comments on commit b026345

Please sign in to comment.