From 2e17fe7e035eeecad994615769923680417c58b8 Mon Sep 17 00:00:00 2001 From: Sebastian Gibb Date: Mon, 13 Jul 2015 19:27:01 +0200 Subject: [PATCH] .plotMsiSlice incorrectly used just the first z dimension if "combine=TRUE" --- DESCRIPTION | 4 ++-- NEWS | 4 ++++ R/plotMsiSlice-functions.R | 2 +- tests/testthat/test_plotMsiSlice-functions.R | 8 +++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4fbc501..0944bf8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: MALDIquant -Version: 1.12.5 -Date: 2015-07-12 +Version: 1.12.6 +Date: 2015-07-13 Title: Quantitative Analysis of Mass Spectrometry Data Authors@R: c(person("Sebastian", "Gibb", role=c("aut", "cre"), email="mail@sebastiangibb.de"), person("Korbinian", "Strimmer", diff --git a/NEWS b/NEWS index fbb3137..7db8cf7 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ RELEASE HISTORY OF THE "MALDIquant" PACKAGE =========================================== +Version 1.12.6 [2015-07-13 Mon]: +- BUGFIX: `.plotMsiSlice` just used the first center if "combine=TRUE"; + affected functions: `plotMsiSlice`. + Version 1.12.5 [2015-07-12 Sun]: - `calibratyIntensity`: gains a "range" argument for "median" and "PQN" as well; in 1.12 just "TIC" was supported. diff --git a/R/plotMsiSlice-functions.R b/R/plotMsiSlice-functions.R index 3e6c715..d47031d 100644 --- a/R/plotMsiSlice-functions.R +++ b/R/plotMsiSlice-functions.R @@ -39,7 +39,7 @@ col <- x for (i in seq_len(d[3L])) { - col[,, i] <- .colorMatrix(.array2matrix(x), colRamp=colRampList[[i]], + col[,, i] <- .colorMatrix(.array2matrix(x, z=i), colRamp=colRampList[[i]], scale=scale) } diff --git a/tests/testthat/test_plotMsiSlice-functions.R b/tests/testthat/test_plotMsiSlice-functions.R index 6bac28d..abe3eaf 100644 --- a/tests/testthat/test_plotMsiSlice-functions.R +++ b/tests/testthat/test_plotMsiSlice-functions.R @@ -3,11 +3,13 @@ context(".plotMsiSlice") test_that(".array2matrix", { x1 <- array(1:12, dim=c(x=2, y=3, z=2)) x2 <- array(1:12, dim=c(1, 12, 1)) - r1 <- matrix(1:12, nrow=2, ncol=3) - r2 <- matrix(1:12, nrow=1, ncol=12) + r1 <- matrix(1:6, nrow=2, ncol=3) + r2 <- matrix(7:12, nrow=2, ncol=3) + r3 <- matrix(1:12, nrow=1, ncol=12) expect_identical(MALDIquant:::.array2matrix(x1), r1) - expect_identical(MALDIquant:::.array2matrix(x2), r2) + expect_identical(MALDIquant:::.array2matrix(x1, z=2), r2) + expect_identical(MALDIquant:::.array2matrix(x2), r3) }) test_that(".colorMatrix", {