diff --git a/src/plotting/functions_plotting.R b/src/plotting/functions_plotting.R index 5efa954..cd6890e 100644 --- a/src/plotting/functions_plotting.R +++ b/src/plotting/functions_plotting.R @@ -294,8 +294,9 @@ f_compute_PCoA <- function(meta_df, mat, method = "bray", threshold_for_prevalen message(nrow(relAB_sel), " out of ", nrow(mat_clean), " features passed prevalence cutoff") # remove empty columns - relAB_sel <- relAB_sel[, colSums(relAB_sel) > 0] - + if (method == "bray") { + relAB_sel <- relAB_sel[, colSums(relAB_sel) > 0] + } # Compute Bray-Curtis distances dist <- vegan::vegdist(x = t(relAB_sel), method = method) pco <- labdsv::pco(dis = dist, k = 2)