From 8b78dee2d6df45b3fa8c1a10b852f794c4cef7f7 Mon Sep 17 00:00:00 2001 From: Sam Minot Date: Fri, 16 Feb 2024 11:07:30 -0800 Subject: [PATCH] Align sample order between metadata and counts --- templates/corncob.Rscript | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/corncob.Rscript b/templates/corncob.Rscript index dab1734..dcb49a7 100644 --- a/templates/corncob.Rscript +++ b/templates/corncob.Rscript @@ -23,12 +23,18 @@ numCores = ${task.cpus} print("Reading in ${metadata_csv}") metadata <- read.csv("${metadata_csv}", sep=",") metadata <- tibble::column_to_rownames(metadata, names(metadata)[1]) -print(metadata) +print(head(metadata)) +print(dim(metadata)) print("Reading in ${readcounts_csv_gz}") counts <- read.csv("${readcounts_csv_gz}", sep=",") counts <- tibble::column_to_rownames(counts, "specimen") -print(counts) +print(head(counts)) +print(dim(counts)) + +# Subset the metadata to have the same rows and order as counts +print("Aligning sample order between metadata and counts") +metadata <- metadata[rownames(counts),] #### Run the differentialAbundance analysis da <- differentialTest(