From 6b7bd7ffa7e8e4270b0e769a4213805c16b08e8f Mon Sep 17 00:00:00 2001 From: lionncle Date: Tue, 17 Jan 2023 16:33:49 +0100 Subject: [PATCH] update replicate names To avoid weird behavior of the check_pcrs_rpl function, more precisely during the detection of barycenters, I paste "bar_" at the beginning of each name of replicates. This trick make the code more robust again side effects of row names renaming by data.frame when sample name begin by digits. --- R/pcrslayer.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/pcrslayer.R b/R/pcrslayer.R index c8b8387..52d6fbc 100644 --- a/R/pcrslayer.R +++ b/R/pcrslayer.R @@ -423,8 +423,8 @@ check_pcr_repl <- function(metabarlist, funcpcr <- ifelse(funcpcr, "0ok", "dyspcr") } - reads_stdt <- reads/rowSums(reads) + replicates <- paste0("bar_", as.character(replicates)) bar <- rowsum(reads_stdt, replicates)/as.vector(table(replicates)) all <- rbind(reads_stdt, bar) all.d <- vegdist(all, "bray")