From 940b0bbb06b11ce7352e615b9e5801064965a0e3 Mon Sep 17 00:00:00 2001 From: Claudia Mengoni <43252093+Cengoni@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:42:43 +0100 Subject: [PATCH] transpose matrix for clr --- metaphlan/utils/calculate_diversity.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metaphlan/utils/calculate_diversity.R b/metaphlan/utils/calculate_diversity.R index 3f48b97..d929c52 100644 --- a/metaphlan/utils/calculate_diversity.R +++ b/metaphlan/utils/calculate_diversity.R @@ -224,8 +224,8 @@ if (opt$diversity == "beta"){ # CLR or Aitchison if (opt$metric == "clr" || opt$metric == "aitchison"){ # Centered Log-Ratio - ait_norm_mpa_table <- compositions::clr(mpa_table) - mat <- as.matrix(compositions::as.data.frame.rmult(ait_norm_mpa_table)) + ait_norm_mpa_table <- compositions::clr(t(mpa_table)) + mat <- t(as.matrix(compositions::as.data.frame.rmult(ait_norm_mpa_table))) if (opt$metric == "aitchison"){ # Aitchison