From f0553f7c4a144d72fe8460ce3412248551b3ab7e Mon Sep 17 00:00:00 2001 From: SergioAlias Date: Wed, 10 Jul 2024 15:00:25 +0200 Subject: [PATCH] Support for reading ANCOM-BC results (qiime composition ancombc) --- R/read_qza.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/R/read_qza.R b/R/read_qza.R index 4195108..4cb1e4c 100644 --- a/R/read_qza.R +++ b/R/read_qza.R @@ -73,6 +73,12 @@ if(grepl("BIOMV", artifact$format)){ coltitles<-strsplit(suppressWarnings(readLines(paste0(tmp, "/", artifact$uuid, "/data/differentials.tsv"))[1]), split='\t')[[1]] artifact$data<-read.table(paste0(tmp, "/", artifact$uuid, "/data/differentials.tsv"), header=F, col.names=coltitles, skip=2, sep='\t', colClasses = defline, check.names = FALSE) colnames(artifact$data)[1]<-"Feature.ID" +} else if (artifact$format=="DataLoafPackageDirFmt"){ + for (outs in list.files(paste0(tmp,"/", artifact$uuid,"/data"), full.names = TRUE, pattern = "_slice\\.csv$")){ + NewLab <- gsub("_slice\\.csv$", "", basename(outs)) + artifact$data[[NewLab]] <- read.table(outs, sep=",", header=TRUE) + colnames(artifact$data[[NewLab]]) <- gsub("X.Intercept.", "Intercept", colnames(artifact$data[[NewLab]])) + } } else { message("Format not supported, only a list of internal files and provenance is being imported.") artifact$data<-list.files(paste0(tmp,"/",artifact$uuid, "/data"))