From 7a0b0ead9d82087f86e29e4867b3412f88303cd7 Mon Sep 17 00:00:00 2001 From: Tuomas Borman <60338854+TuomasBorman@users.noreply.github.com> Date: Mon, 13 May 2024 14:32:31 +0300 Subject: [PATCH] agglomerateByRank: bugfix related to agglomeration non-existing tree (#542) --- DESCRIPTION | 2 +- NEWS | 1 + R/agglomerate.R | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a4ac31c39..d5ba7ee2d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: mia Type: Package -Version: 1.13.3 +Version: 1.13.4 Authors@R: c(person(given = "Felix G.M.", family = "Ernst", role = c("aut"), email = "felix.gm.ernst@outlook.com", diff --git a/NEWS b/NEWS index b72e7755f..da9ee40d2 100644 --- a/NEWS +++ b/NEWS @@ -117,3 +117,4 @@ Changes in version 1.13.x + Added new functions getMediation and addMediation + replace getExperiment* and testExperiment* functions with getCrossAssociation + Replace mergeRows and mergeCols with new function agglomerateByVariable ++ agglomerateByRank: bugfix related to agglomeration of non-existing tree diff --git a/R/agglomerate.R b/R/agglomerate.R index ac2026477..d03a30f35 100644 --- a/R/agglomerate.R +++ b/R/agglomerate.R @@ -371,10 +371,9 @@ setMethod( } # Agglomerate data x <- callNextMethod(x, ...) - # Agglomerate also tree, if the data includes only one - # rowTree --> otherwise it is not possible to agglomerate - # since all rownames are not found from individual tree. - if(agglomerate.tree){ + # Agglomerate also trees if user has specified and if there + # are trees available + if( agglomerate.tree && !is.null(x@rowTree) ){ x <- .agglomerate_trees(x) } x